always

Is it always the case that sizeof(T) >= alignof(T) for all object types T?

匿名 (未验证) 提交于 2019-12-03 01:27:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: For any object type T is it always the case that sizeof(T) is at least as large as alignof(T) ? Intuitively it seems so, since even when you adjust the alignment of objects like: struct small { char c; }; above what it would normally be, their "size" is also adjusted upwards so that the relationship between objects in an array makes sense while maintaining alignment (at least in my testing . For example: struct alignas(16) small16 { char c; }; Has both a size and alignment of 16. 回答1: At least in standard C++, for anything you can make an

Neural Network Always Produces Same/Similar Outputs for Any Input

匿名 (未验证) 提交于 2019-12-03 01:27:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a problem where I am trying to create a neural network for Tic-Tac-Toe. However, for some reason, training the neural network causes it to produce nearly the same output for any given input. I did take a look at Artificial neural networks benchmark , but my network implementation is built for neurons with the same activation function for each neuron, i.e. no constant neurons. To make sure the problem wasn't just due to my choice of training set (1218 board states and moves generated by a genetic algorithm), I tried to train the

Axis2 - always getting 404 errors

匿名 (未验证) 提交于 2019-12-03 01:27:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to move some Web Service stubs from Metro to Axis2, however after generating my stubs using wsdl2java I'm constently getting 404 errors whenever I try and make a service call. 16/12/2010 11:14:57 AM org.apache.axis2.deployment.ModuleDeployer deploy INFO: Deploying module: addressing-1.5.3-jar - file:/C:/Users/xxx/.m2/repository/org/apache/axis2/axis2/1.5.3/axis2-1.5.3-jar.jar 16/12/2010 11:14:57 AM org.apache.axis2.transport.http.HTTPSender sendViaPost INFO: Unable to sendViaPost to url[xxxx] org.apache.axis2.AxisFault: Transport

Warning about `$HTTP_RAW_POST_DATA` being deprecated

匿名 (未验证) 提交于 2019-12-03 01:26:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I switched to PHP 5.6.0 and now I get the following warning everywhere: Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini and use the php://input stream instead. in Unknown on line 0 Warning: Cannot modify header information - headers already sent in Unknown on line 0 Fine, I rely on some deprecated feature. Except that I don't! I haven't ever used this variable in any of my scripts. To be honest I had no

iphone - update UI always on Main Thread?

匿名 (未验证) 提交于 2019-12-03 01:26:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I know Apple said all UI-related operations should be carried out on main thread. So my question is "all UI-related operations" really mean every possible UI-related operaton? For example, I will addSubview ViewB to ViewA in a separate thread. Should I always use [ViewA performSelectorOnMaintThread:@selector(addSubview:)...... on the separate thread? thanks 回答1: Yes. It will crash otherwise. 回答2: Yes, You should deal with all about UI in the main-thread. If you are under MFC, you should be in the same manner. 回答3: Grand Central Dispatch does

SFINAE to make base template always result in error

匿名 (未验证) 提交于 2019-12-03 01:25:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: So I'm designing a sort of my_numeric_cast function to limit the types of conversions available when using a framework I'm writing. It was pretty straight forward to do something like template constexpr To my_numeric_cast(From); template constexpr float my_numeric_cast (int i) { return i; } Which works, allowing only casting from ints to floats whenever the cast is used. And producing a linkage error whenever a cast not in the white list is attempted. However, I'd really want to make this a compilation error, to catch the misuse much faster.

luaSocket HTTP requests always respond with a redirect (301 or 302)

匿名 (未验证) 提交于 2019-12-03 01:25:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I use LuaForWindows (latest version) and I have read this and this answer and everything i could find in the mailinglist of lua-users.org. What ever I try (most) sites only respond with either 301 or 302. I have created an example batch script which downloads (some) of the OpenGL 2.1 Reference from their man pages. @ECHO OFF FOR /F "SKIP=5" %%# IN ( %~fs0 ) DO lua -l socket.http -e "print(socket.http.request('https://www.opengl.org/sdk/docs/man2/xhtml/%%#.xml'))" GOTO:EOF glAccum glActiveTexture glAlphaFunc glAreTexturesResident

Downloading captions always returns a 403

匿名 (未验证) 提交于 2019-12-03 01:23:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: When I call the captions.download endpoint with an ID that we retrieve from the captions.list endpoint, it always returns a 403. For example: https://www.youtube.com/watch?v=1HRwpwOj4aA I call captions.list with: GET https://www.googleapis.com/youtube/v3/captions?part=id&videoId=1HRwpwOj4aA&key={YOUR_API_KEY} This is response: cache-control: private, max-age=0, must-revalidate, no-transform content-encoding: gzip content-length: 236 content-type: application/json; charset=UTF-8 date: Sat, 23 May 2015 17:55:57 GMT etag: "dhbhlDw5j8dK10GxeV

Division result is always zero [duplicate]

匿名 (未验证) 提交于 2019-12-03 01:23:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: This question already has an answer here: Dividing 1/n always returns 0.0 3 answers I got this C code. #include int main(void) { int n, d, i; double t=0, k; scanf("%d %d", &n, &d); t = (1/100) * d; k = n / 3; printf("%.2lf\t%.2lf\n", t, k); return 0; } I want to know why my variable 't' is always zero (in the printf function) ? 回答1: because in this expression t = (1/100) * d; 1 and 100 are integer values, integer division truncates, so this It's the same as this t = (0) * d; you need make that a float constant like this t = (1.0/100.0) * d;

Java iterator.hasNext() is always true

匿名 (未验证) 提交于 2019-12-03 01:23:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a little problem with the code as seen below. The iterator().hasNext() will never turn into false because the next() function always returns the same element. It ends in an infinite loop . I would like to set the attribute UserLock in every element in the collection (returned from GetElements() ). If the type of the element is "Package", I will lock all elements under the package with a recursive call of the lockAllElements function. private void lockAllElements(String internalGUID) { Element tempElem = null; while((repo