question_id int64 4 6.31M | answer_id int64 7 6.31M | title stringlengths 9 150 | question_body stringlengths 0 28.8k | answer_body stringlengths 60 27.2k | question_text stringlengths 40 28.9k | combined_text stringlengths 124 39.6k | tags listlengths 1 6 | question_score int64 0 26.3k | answer_score int64 0 28.8k | view_count int64 15 14M | answer_count int64 0 182 | favorite_count int64 0 32 | question_creation_date stringdate 2008-07-31 21:42:52 2011-06-10 18:12:18 | answer_creation_date stringdate 2008-07-31 22:17:57 2011-06-10 18:14:17 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6,217,101 | 6,217,754 | Android OpenGL buffering and glFlush | So I'm making an Android 2.2 app that uses GLSurfaceView. My question is, since OpenGL tends to buffer commands, does that mean it requires associated memory (e.g. the bitmap in a call to glTexSubImage2D() ) to stick around until it is done? Or does it make itself a copy of any memory needed for buffered commands? I as... | Good question. With Textures, and Vertex Buffer Objects incidentally, once you have called the methods that actually load the image data for the Texture, you do not need to hold onto the buffer/array you have in client memory. Don't mistake the rendering buffer with memory associated with Textures. The Texture graphics... | Android OpenGL buffering and glFlush So I'm making an Android 2.2 app that uses GLSurfaceView. My question is, since OpenGL tends to buffer commands, does that mean it requires associated memory (e.g. the bitmap in a call to glTexSubImage2D() ) to stick around until it is done? Or does it make itself a copy of any memo... | TITLE:
Android OpenGL buffering and glFlush
QUESTION:
So I'm making an Android 2.2 app that uses GLSurfaceView. My question is, since OpenGL tends to buffer commands, does that mean it requires associated memory (e.g. the bitmap in a call to glTexSubImage2D() ) to stick around until it is done? Or does it make itself ... | [
"android",
"opengl-es"
] | 2 | 2 | 1,737 | 1 | 0 | 2011-06-02T16:06:53.297000 | 2011-06-02T17:08:38.840000 |
6,217,103 | 6,217,481 | How to configure an Apache rewrite-rule to redirect all requests to 404 unless explicitly allowed | I'm searchin on internet since yesterday and i couldn't find the answer. At least one that works for apache2. I just want a set of rewritemod rules that will make apache redirect everything to a 404 but allows me to explicitly override it for some files/folders. I've tried an inclusive rule but i couldn't get it workin... | Just try this line in your.htaccess file: RewriteRule ^(?!(allowedFile\.html|allowedDirectory/)) - [R=404,L,NC] Above rule will throw 404 for everything except a file called allowedFile.html and a folder called allowedDirectory. | How to configure an Apache rewrite-rule to redirect all requests to 404 unless explicitly allowed I'm searchin on internet since yesterday and i couldn't find the answer. At least one that works for apache2. I just want a set of rewritemod rules that will make apache redirect everything to a 404 but allows me to explic... | TITLE:
How to configure an Apache rewrite-rule to redirect all requests to 404 unless explicitly allowed
QUESTION:
I'm searchin on internet since yesterday and i couldn't find the answer. At least one that works for apache2. I just want a set of rewritemod rules that will make apache redirect everything to a 404 but a... | [
"regex",
"apache",
"mod-rewrite",
"http-status-code-404"
] | 7 | 8 | 15,107 | 2 | 0 | 2011-06-02T16:07:05.647000 | 2011-06-02T16:41:56.440000 |
6,217,104 | 6,217,166 | JavaScript, how in most effective way get second value from string like "var1-var2" | I know about.split( "-",2), but how can i make something like this var str = "123-341235"; alert( str.split( "-",2 ). [2] )<--- to get second one (341235) value? Tnx for help All! | I see two simple solutions, which have roughly the same performance: var str = "123-341235"; str.split('-')[1]; // => "341235" (slower) str.slice(str.indexOf('-')+1); // => "341235" (faster) This jsPerf benchmark shows the "slice/indexOf" solution to be about twice as fast on Chrome and Firefox. Note that for either so... | JavaScript, how in most effective way get second value from string like "var1-var2" I know about.split( "-",2), but how can i make something like this var str = "123-341235"; alert( str.split( "-",2 ). [2] )<--- to get second one (341235) value? Tnx for help All! | TITLE:
JavaScript, how in most effective way get second value from string like "var1-var2"
QUESTION:
I know about.split( "-",2), but how can i make something like this var str = "123-341235"; alert( str.split( "-",2 ). [2] )<--- to get second one (341235) value? Tnx for help All!
ANSWER:
I see two simple solutions, w... | [
"javascript"
] | 5 | 5 | 5,773 | 9 | 0 | 2011-06-02T16:07:10.823000 | 2011-06-02T16:12:07.813000 |
6,217,113 | 6,217,326 | Resize layout after a loaded image gets resized | So I'm loading a really big pic in this mx:Image manteinAspectRatio enabled with a height constraint and as usual it doesn't work (Flex is definitely not for me): The big.jpg has more width than height so when it's resized the wrapping containers get the correct new height but they still have the old width. I've tried ... | After looking at Image, it seems that it needs explicit height/width or else it won't scale down properly. It's a bit stupid not to scale to the maxHeight, but you could always use Flex 4.5 Image class instead or just create your own to handle max height/width. | Resize layout after a loaded image gets resized So I'm loading a really big pic in this mx:Image manteinAspectRatio enabled with a height constraint and as usual it doesn't work (Flex is definitely not for me): The big.jpg has more width than height so when it's resized the wrapping containers get the correct new heigh... | TITLE:
Resize layout after a loaded image gets resized
QUESTION:
So I'm loading a really big pic in this mx:Image manteinAspectRatio enabled with a height constraint and as usual it doesn't work (Flex is definitely not for me): The big.jpg has more width than height so when it's resized the wrapping containers get the... | [
"apache-flex",
"layout",
"actionscript"
] | 0 | 0 | 1,086 | 1 | 0 | 2011-06-02T16:07:59.983000 | 2011-06-02T16:27:15.830000 |
6,217,121 | 6,217,225 | Invalid function parameter | I 'm writing a C-Code in which i use sockets. I use this on windows and on linux, so i try to write it dynamicly. I wrote two functions to get a server/client-socket. There i have an error on compiling: debian:~/cross_socket# make gcc *.c -Wall i586-mingw32msvc-gcc *.c -Wall -lws2_32 socket.c: In function 'get_client_s... | Probably calling wrong convention. On Windows most of the API functions are defined as WINAPI, which is __stdcall, a.k.a. PASCAL. i.e. parameters are passed left-to-right, and the stack is cleaned by the callee. OTOH default compilation calling convention is __cdecl. P.S. It'd be nice if mingw printed a more detailed e... | Invalid function parameter I 'm writing a C-Code in which i use sockets. I use this on windows and on linux, so i try to write it dynamicly. I wrote two functions to get a server/client-socket. There i have an error on compiling: debian:~/cross_socket# make gcc *.c -Wall i586-mingw32msvc-gcc *.c -Wall -lws2_32 socket.c... | TITLE:
Invalid function parameter
QUESTION:
I 'm writing a C-Code in which i use sockets. I use this on windows and on linux, so i try to write it dynamicly. I wrote two functions to get a server/client-socket. There i have an error on compiling: debian:~/cross_socket# make gcc *.c -Wall i586-mingw32msvc-gcc *.c -Wall... | [
"c",
"sockets",
"function-pointers"
] | 0 | 0 | 1,631 | 2 | 0 | 2011-06-02T16:08:26.707000 | 2011-06-02T16:17:08.203000 |
6,217,128 | 6,217,270 | Using A BlockingQueue With A Servlet To Persist Objects | First, this may be a stupid question, but I'm hoping someone will tell me so, and why. I also apologize if my explanation of what/why is lacking. I am using a servlet to upload a HUGE (247MB) file, which is pipe (|) delineated. I grab about 5 of 20 fields, create an object, then add it to a list. Once this is done, I p... | Servlets should respond to requests within a short amount of time. In this case, the persist of the file contents needs to be an asynchronous job, so: The servlet should respond with some text about the upload job, expected time to complete or something like that. The uploaded content should be written to some temp spa... | Using A BlockingQueue With A Servlet To Persist Objects First, this may be a stupid question, but I'm hoping someone will tell me so, and why. I also apologize if my explanation of what/why is lacking. I am using a servlet to upload a HUGE (247MB) file, which is pipe (|) delineated. I grab about 5 of 20 fields, create ... | TITLE:
Using A BlockingQueue With A Servlet To Persist Objects
QUESTION:
First, this may be a stupid question, but I'm hoping someone will tell me so, and why. I also apologize if my explanation of what/why is lacking. I am using a servlet to upload a HUGE (247MB) file, which is pipe (|) delineated. I grab about 5 of ... | [
"java",
"servlets",
"concurrency"
] | 0 | 4 | 664 | 1 | 0 | 2011-06-02T16:09:34.397000 | 2011-06-02T16:21:22.413000 |
6,217,131 | 6,217,217 | Why is my query returning null values when I have a NOT NULL clause in my where statement | I'm trying to get DISTINCT and NOT NULL values but this doesn't seem to work: SELECT DISTINCT ITEM FROM TABLE WHERE ITEM IS NOT NULL This returns DISTINCT values but it also returns NULL VALUES. sample: ITEM a a b b c c NULL output: a b c NULL | Try this. "IS NOT NULL" and "IS NULL" does not work with blank values. You can cover both, if the column allows blank. SELECT DISTINCT item FROM table WHERE ISNULL(item,'') <> '' | Why is my query returning null values when I have a NOT NULL clause in my where statement I'm trying to get DISTINCT and NOT NULL values but this doesn't seem to work: SELECT DISTINCT ITEM FROM TABLE WHERE ITEM IS NOT NULL This returns DISTINCT values but it also returns NULL VALUES. sample: ITEM a a b b c c NULL outpu... | TITLE:
Why is my query returning null values when I have a NOT NULL clause in my where statement
QUESTION:
I'm trying to get DISTINCT and NOT NULL values but this doesn't seem to work: SELECT DISTINCT ITEM FROM TABLE WHERE ITEM IS NOT NULL This returns DISTINCT values but it also returns NULL VALUES. sample: ITEM a a ... | [
"sql-server"
] | 2 | 4 | 27,134 | 3 | 0 | 2011-06-02T16:09:41.407000 | 2011-06-02T16:16:27.237000 |
6,217,132 | 6,217,230 | Ant target to check out from Visual Source safe | I need to write a ant target to checkout VSS project from a vss lable to the local machine. lets say VSS username 'bob' and password '123' and the vss project name is ANT_TEST. Lable I want check out is V.1.0 to local folder E:\ANTTEST. Can some one pls guid me to do that. | Take a look at the Microsoft Visual SourceSafe Tasks. They are optional tasks, so you might have to add libraries to your ant installation if the task is not found. In the event that they are not already installed, details about optional tasks can be found here. | Ant target to check out from Visual Source safe I need to write a ant target to checkout VSS project from a vss lable to the local machine. lets say VSS username 'bob' and password '123' and the vss project name is ANT_TEST. Lable I want check out is V.1.0 to local folder E:\ANTTEST. Can some one pls guid me to do that... | TITLE:
Ant target to check out from Visual Source safe
QUESTION:
I need to write a ant target to checkout VSS project from a vss lable to the local machine. lets say VSS username 'bob' and password '123' and the vss project name is ANT_TEST. Lable I want check out is V.1.0 to local folder E:\ANTTEST. Can some one pls ... | [
"java",
"ant",
"visual-sourcesafe"
] | 1 | 2 | 327 | 2 | 0 | 2011-06-02T16:09:43.870000 | 2011-06-02T16:17:38.530000 |
6,217,147 | 6,217,306 | How to remember a User's access token for Facebook | In order for my application to connect to Facebook, they click on a connect to Facebook button. This button with authorize the user, and when they are authorized, i am able to get their access token by calling facebook.getAccessToken(). But is there a way for the application to remember their credentials so that they d... | You can find a good example of doing that in the FB SDK examples using SharedPreferences: https://github.com/facebook/facebook-android-sdk/tree/master/examples/simple/src/com/facebook/android You can store the access token there, since it expires after an hour or what and the user needs to authenticate again. | How to remember a User's access token for Facebook In order for my application to connect to Facebook, they click on a connect to Facebook button. This button with authorize the user, and when they are authorized, i am able to get their access token by calling facebook.getAccessToken(). But is there a way for the appli... | TITLE:
How to remember a User's access token for Facebook
QUESTION:
In order for my application to connect to Facebook, they click on a connect to Facebook button. This button with authorize the user, and when they are authorized, i am able to get their access token by calling facebook.getAccessToken(). But is there a... | [
"android",
"facebook"
] | 1 | 2 | 6,176 | 2 | 0 | 2011-06-02T16:10:28.393000 | 2011-06-02T16:24:59.870000 |
6,217,148 | 6,231,086 | How do I access the toolbar item (org.eclipse.swt.widgets.ToolItem) from within the Activator? | I'm implementing a simple eclipse notification plugin that is supposed to change an icon in the toolbar if something of some nature happens. I made an extension to org.eclipse.ui.menus and the icon shows up nicely. I thought of starting a poller thread in the Activator and have it poll every couple minutes and changing... | Your handler must implement org.eclipse.ui.commands.IElementUpdater. It can call org.eclipse.ui.menus.UIElement.setIcon(ImageDescriptor). When you need to update the image, you call org.eclipse.ui.commands.ICommandService.refreshElements(String, Map) to trigger the refresh and the call to your handler. | How do I access the toolbar item (org.eclipse.swt.widgets.ToolItem) from within the Activator? I'm implementing a simple eclipse notification plugin that is supposed to change an icon in the toolbar if something of some nature happens. I made an extension to org.eclipse.ui.menus and the icon shows up nicely. I thought ... | TITLE:
How do I access the toolbar item (org.eclipse.swt.widgets.ToolItem) from within the Activator?
QUESTION:
I'm implementing a simple eclipse notification plugin that is supposed to change an icon in the toolbar if something of some nature happens. I made an extension to org.eclipse.ui.menus and the icon shows up ... | [
"eclipse"
] | 0 | 2 | 495 | 1 | 0 | 2011-06-02T16:10:32.887000 | 2011-06-03T18:21:38.270000 |
6,217,153 | 6,217,462 | aligning or prettifying code in emacs | I remember this was possible in emacs, but don't know how. If I have something like: 'abc' => 1, 'abcabc' =>2, 'abcabcabc' => 3, How can I align the keys, arrows and values to something like this? 'abc' => 1, 'abcabc' => 2, 'abcabcabc' => 3, Cheers | Select the region. Type M-x align-regexp RET Type = and hit enter. | aligning or prettifying code in emacs I remember this was possible in emacs, but don't know how. If I have something like: 'abc' => 1, 'abcabc' =>2, 'abcabcabc' => 3, How can I align the keys, arrows and values to something like this? 'abc' => 1, 'abcabc' => 2, 'abcabcabc' => 3, Cheers | TITLE:
aligning or prettifying code in emacs
QUESTION:
I remember this was possible in emacs, but don't know how. If I have something like: 'abc' => 1, 'abcabc' =>2, 'abcabcabc' => 3, How can I align the keys, arrows and values to something like this? 'abc' => 1, 'abcabc' => 2, 'abcabcabc' => 3, Cheers
ANSWER:
Select... | [
"emacs",
"alignment",
"indentation",
"prettify"
] | 20 | 37 | 8,782 | 2 | 0 | 2011-06-02T16:10:58.297000 | 2011-06-02T16:39:36.050000 |
6,217,154 | 6,217,614 | Junit returning an error on assertTrue string comparison | StringWriter result = runMethod.getOutput(); String expected = "<3>textValue " assertTrue("Should have contained the required result", result.toString().contains(expected)); Why does Junit return an error here? | I just tried this and it works fine. It gives the following error if the string does not match. java.lang.AssertionError: Should have contained the required result import static org.junit.Assert.assertTrue;
import java.io.StringWriter;
import org.junit.Test;
public class XYZ {
@Test public void test() {
StringWrit... | Junit returning an error on assertTrue string comparison StringWriter result = runMethod.getOutput(); String expected = "<3>textValue " assertTrue("Should have contained the required result", result.toString().contains(expected)); Why does Junit return an error here? | TITLE:
Junit returning an error on assertTrue string comparison
QUESTION:
StringWriter result = runMethod.getOutput(); String expected = "<3>textValue " assertTrue("Should have contained the required result", result.toString().contains(expected)); Why does Junit return an error here?
ANSWER:
I just tried this and it ... | [
"java",
"junit"
] | 1 | 3 | 5,827 | 1 | 0 | 2011-06-02T16:11:00.293000 | 2011-06-02T16:55:41.897000 |
6,217,155 | 6,217,942 | Prevent cheating on savedata in iPhone | We can use sqlite, nsuserdefaults or ordinary file system for saving gamedata on iPhone. These data are usually stored in the Documents directory, but files under the Documents directory can be easily modified without JailBreak. (Actually some cheated scores were posted to the server before) There are some ideas I cons... | One flaw in the design seems to be that you are trusting the local data. Instead I'd recommend that you treat the local data as unsafe user data. That way, a user can manipulate it all they want, but you'll never send it to your server to be published. When a user completes a game, have the game send the score to the s... | Prevent cheating on savedata in iPhone We can use sqlite, nsuserdefaults or ordinary file system for saving gamedata on iPhone. These data are usually stored in the Documents directory, but files under the Documents directory can be easily modified without JailBreak. (Actually some cheated scores were posted to the ser... | TITLE:
Prevent cheating on savedata in iPhone
QUESTION:
We can use sqlite, nsuserdefaults or ordinary file system for saving gamedata on iPhone. These data are usually stored in the Documents directory, but files under the Documents directory can be easily modified without JailBreak. (Actually some cheated scores were... | [
"iphone"
] | 2 | 3 | 452 | 3 | 0 | 2011-06-02T16:11:08.670000 | 2011-06-02T17:27:26.440000 |
6,217,156 | 6,217,314 | Break a previous commit into multiple commits | Without creating a branch and doing a bunch of funky work on a new branch, is it possible to break a single commit into a few different commits after it's been committed to the local repository? | git rebase -i will do it. First, start with a clean working directory: git status should show no pending modifications, deletions, or additions. Now, you have to decide which commit(s) you want to split. A) Splitting the most recent commit To split apart your most recent commit, first: $ git reset HEAD~ Now commit the ... | Break a previous commit into multiple commits Without creating a branch and doing a bunch of funky work on a new branch, is it possible to break a single commit into a few different commits after it's been committed to the local repository? | TITLE:
Break a previous commit into multiple commits
QUESTION:
Without creating a branch and doing a bunch of funky work on a new branch, is it possible to break a single commit into a few different commits after it's been committed to the local repository?
ANSWER:
git rebase -i will do it. First, start with a clean ... | [
"git"
] | 1,799 | 2,490 | 541,005 | 23 | 0 | 2011-06-02T16:11:12.183000 | 2011-06-02T16:26:02.943000 |
6,217,157 | 6,217,573 | How to select a MAX record based on multiple results from a unique ID in MySQL | I run a report in mysql which returns all active members and their associated plan selections. If a member is terminated, this is displayed on the report as well. The issue I am facing, however is when a member simply decides to 'change' plans. Our system effective 'terminates' the original plan and starts fresh with t... | Although I hate columns with embedded spaces and having to tick them, this should do it for you. The PreQuery will detect how many policy entries there are, preserve the first and last too, grouped by member. Once THAT is done, it can re-join the the plan enrollment on the same member but matching ONLY for the last "Or... | How to select a MAX record based on multiple results from a unique ID in MySQL I run a report in mysql which returns all active members and their associated plan selections. If a member is terminated, this is displayed on the report as well. The issue I am facing, however is when a member simply decides to 'change' pla... | TITLE:
How to select a MAX record based on multiple results from a unique ID in MySQL
QUESTION:
I run a report in mysql which returns all active members and their associated plan selections. If a member is terminated, this is displayed on the report as well. The issue I am facing, however is when a member simply decid... | [
"mysql",
"greatest-n-per-group"
] | 1 | 1 | 283 | 2 | 0 | 2011-06-02T16:11:17.850000 | 2011-06-02T16:51:28.343000 |
6,217,163 | 6,224,801 | Recursive Ackermann-Peter Function in x86 Assembly (NASM) | im trying to implement the recursive Ackermann-Peter-Function in x86 NASM-Assembly. The Function is defined as follows: *a(0;m) = m + 1 *a(n + 1; 0) = a(n; 1) *a(n + 1;m + 1)) = a(n; a(n + 1;m)) My Problem is i can't even imagine how to start properly. By now i only implemented an "power of x" Function recursively in A... | SOLUTION: Ok I found the problem: I didn't manage the ebp and esp right. So, I now used the ENTER and LEAVE Macros in every function call and now the whole thing works properly. Here is the Solution. Thank you for your time: asm_main: ENTER 0,0;setup Routine PUSHA MOV eax, prompt1;ask for n Full Code: http://pastebin.c... | Recursive Ackermann-Peter Function in x86 Assembly (NASM) im trying to implement the recursive Ackermann-Peter-Function in x86 NASM-Assembly. The Function is defined as follows: *a(0;m) = m + 1 *a(n + 1; 0) = a(n; 1) *a(n + 1;m + 1)) = a(n; a(n + 1;m)) My Problem is i can't even imagine how to start properly. By now i ... | TITLE:
Recursive Ackermann-Peter Function in x86 Assembly (NASM)
QUESTION:
im trying to implement the recursive Ackermann-Peter-Function in x86 NASM-Assembly. The Function is defined as follows: *a(0;m) = m + 1 *a(n + 1; 0) = a(n; 1) *a(n + 1;m + 1)) = a(n; a(n + 1;m)) My Problem is i can't even imagine how to start p... | [
"assembly",
"recursion",
"x86",
"nasm",
"ackermann"
] | 1 | 2 | 2,967 | 2 | 0 | 2011-06-02T16:11:53.493000 | 2011-06-03T08:37:11.257000 |
6,217,173 | 6,217,495 | Static ThreadLocal variable in a WebApp - Are there any Security/Performance issues? | I am researching and experimenting with a ThreadLocal variable in my Java Web Application. I am using the ThreadLocal variable to store a username (collected from the session) before a request, and then removing it after the request. I have done this by calling a static utility method in a ServletFilter. The reason I d... | This is actually a fairly common approach for attaching security information to the thread of execution (or any other execution related information). It is used in Java EE servers internally and by 3rd party code/utils like Spring as well. It will work just fine. | Static ThreadLocal variable in a WebApp - Are there any Security/Performance issues? I am researching and experimenting with a ThreadLocal variable in my Java Web Application. I am using the ThreadLocal variable to store a username (collected from the session) before a request, and then removing it after the request. I... | TITLE:
Static ThreadLocal variable in a WebApp - Are there any Security/Performance issues?
QUESTION:
I am researching and experimenting with a ThreadLocal variable in my Java Web Application. I am using the ThreadLocal variable to store a username (collected from the session) before a request, and then removing it af... | [
"java",
"session",
"servlet-filters",
"thread-local"
] | 12 | 7 | 7,048 | 1 | 0 | 2011-06-02T16:12:27.567000 | 2011-06-02T16:43:20.260000 |
6,217,175 | 6,217,604 | Canvas and globalCompositeOperations | Hey, I have the following code, that gives you the effect of a "mask". JSFiddle: http://jsfiddle.net/neuroflux/m5Fj2/7/ Basically, I would like a semi-opaque gradient instead of a circle... I tried to put the following code in, but to no advail. grad = ctx.createRadialGradient(0,0,0,0,0,600); grad.addColorStop(0, '#000... | First off, tmpCanvas = document.createElement('canvas'); tmpCanvas.width = c.width; tmpCanvas.height = c.height;
tmpCtx = tmpCanvas.getContext('2d'); Is the kind of stuff you never want to do in a loop. Right now you are creating a new canvas every 40 milliseconds! That's nuts! Secondly, if you want a semi-opaque grad... | Canvas and globalCompositeOperations Hey, I have the following code, that gives you the effect of a "mask". JSFiddle: http://jsfiddle.net/neuroflux/m5Fj2/7/ Basically, I would like a semi-opaque gradient instead of a circle... I tried to put the following code in, but to no advail. grad = ctx.createRadialGradient(0,0,0... | TITLE:
Canvas and globalCompositeOperations
QUESTION:
Hey, I have the following code, that gives you the effect of a "mask". JSFiddle: http://jsfiddle.net/neuroflux/m5Fj2/7/ Basically, I would like a semi-opaque gradient instead of a circle... I tried to put the following code in, but to no advail. grad = ctx.createRa... | [
"javascript",
"html",
"canvas",
"composite"
] | 0 | 1 | 174 | 1 | 0 | 2011-06-02T16:12:34.323000 | 2011-06-02T16:54:39.780000 |
6,217,187 | 6,217,216 | Keeping repositories in sync without being able to push and pull commits | As of right now, I cant use an git server, so I use one of my favourite git features which is turning any directory in my computer into a git repo ( just the git init thing). I use to do this because I was the only one coding and I could keep track of my own stuff. Now things have changed a bit and I'm working with a s... | How about sending each other pathches? git format-patch and git am might suit your needs. I've used it in the past and it works well enough for sending infrequent changes. | Keeping repositories in sync without being able to push and pull commits As of right now, I cant use an git server, so I use one of my favourite git features which is turning any directory in my computer into a git repo ( just the git init thing). I use to do this because I was the only one coding and I could keep trac... | TITLE:
Keeping repositories in sync without being able to push and pull commits
QUESTION:
As of right now, I cant use an git server, so I use one of my favourite git features which is turning any directory in my computer into a git repo ( just the git init thing). I use to do this because I was the only one coding and... | [
"git",
"workflow",
"git-merge"
] | 1 | 2 | 143 | 3 | 0 | 2011-06-02T16:13:47.957000 | 2011-06-02T16:16:27.173000 |
6,217,191 | 6,217,425 | Git checkout to branch not showing correct versions of files | I have a repo with 3 branches: master, Stable, and dev. I made a lot of changes on the dev branch and committed them. My colleague then checked out Stable branch over the top and created a tag. When I switched back to the dev branch the files have reverted to an older version. When I check git log I can see all the com... | Not really a solution here, but what I use with this kind of problems is gitk or some other git GUI. You say you can see the commits when you do git log, can you see the commit-ID? You can always use that to checkout... at least to make sure nothing is lost. | Git checkout to branch not showing correct versions of files I have a repo with 3 branches: master, Stable, and dev. I made a lot of changes on the dev branch and committed them. My colleague then checked out Stable branch over the top and created a tag. When I switched back to the dev branch the files have reverted to... | TITLE:
Git checkout to branch not showing correct versions of files
QUESTION:
I have a repo with 3 branches: master, Stable, and dev. I made a lot of changes on the dev branch and committed them. My colleague then checked out Stable branch over the top and created a tag. When I switched back to the dev branch the file... | [
"git"
] | 0 | 1 | 250 | 2 | 0 | 2011-06-02T16:14:11.120000 | 2011-06-02T16:36:13.267000 |
6,217,193 | 6,258,447 | ActiveResource Suffix | With ActiveResource, a call to MyObject.find(id) gets "[self.site]/[self.prefix]/:id.[self.format]". However, the API we're accessing is configured slightly differently. Instead of id.file_type we need to access "[self.site]/:id/[self.suffix].[self.format]". ie: get http://api_path/:id/tool.json Is there any way to con... | ActiveResource::Base.element_path is the method that creates the path: def element_path(id, prefix_options = {}, query_options = nil) prefix_options, query_options = split_options(prefix_options) if query_options.nil? "#{prefix(prefix_options)}#{collection_name}/#{URI.escape id.to_s}.#{format.extension}#{query_string(q... | ActiveResource Suffix With ActiveResource, a call to MyObject.find(id) gets "[self.site]/[self.prefix]/:id.[self.format]". However, the API we're accessing is configured slightly differently. Instead of id.file_type we need to access "[self.site]/:id/[self.suffix].[self.format]". ie: get http://api_path/:id/tool.json I... | TITLE:
ActiveResource Suffix
QUESTION:
With ActiveResource, a call to MyObject.find(id) gets "[self.site]/[self.prefix]/:id.[self.format]". However, the API we're accessing is configured slightly differently. Instead of id.file_type we need to access "[self.site]/:id/[self.suffix].[self.format]". ie: get http://api_pa... | [
"ruby-on-rails",
"api",
"rest",
"activeresource"
] | 2 | 3 | 798 | 1 | 0 | 2011-06-02T16:14:14.570000 | 2011-06-06T21:50:51.597000 |
6,217,207 | 6,217,234 | javascript - name or id of element | Is this.form.sel2 similar to document.getElementById('sel2')? My select tag is as follows: And when I am putting the name of the tag, i.e, sub[player_ids][] in my javascript code, am getting a syntax error. I am trying to find a workaround so that instead of using the name of the element, i want to use the id. However ... | The id of your element is sub_player_ids, not sel2. So document.getElementById("sub_player_ids") would work. You may also find that this.form["sub[player_ids][]"] would work. Using the quoted form lets you use things that you can't use in the literal form. Something to beware of is that IE7 and earlier have a broken ve... | javascript - name or id of element Is this.form.sel2 similar to document.getElementById('sel2')? My select tag is as follows: And when I am putting the name of the tag, i.e, sub[player_ids][] in my javascript code, am getting a syntax error. I am trying to find a workaround so that instead of using the name of the elem... | TITLE:
javascript - name or id of element
QUESTION:
Is this.form.sel2 similar to document.getElementById('sel2')? My select tag is as follows: And when I am putting the name of the tag, i.e, sub[player_ids][] in my javascript code, am getting a syntax error. I am trying to find a workaround so that instead of using th... | [
"javascript"
] | 0 | 3 | 1,208 | 5 | 0 | 2011-06-02T16:15:21.013000 | 2011-06-02T16:17:51.780000 |
6,217,213 | 6,217,298 | static and non static data in same class (object) in javascript | I understand that there are two ways of creating classes in JavaScript var MyObj = function(val) { this.vari = val; } Where val will be a non static member. Whereas, var MyObj = new Object(); MyObj.vari = ""; This is a single object so members of it here will act like static members. My question is that how do we have ... | There are no classes in JavaScript, only objects. When you create a new object you are "extending" from the function's prototype, not the function itself. In order to make a variable or function appear to be static you would have to attach it to the function used to create the object, and not its prototype. js> var Foo... | static and non static data in same class (object) in javascript I understand that there are two ways of creating classes in JavaScript var MyObj = function(val) { this.vari = val; } Where val will be a non static member. Whereas, var MyObj = new Object(); MyObj.vari = ""; This is a single object so members of it here w... | TITLE:
static and non static data in same class (object) in javascript
QUESTION:
I understand that there are two ways of creating classes in JavaScript var MyObj = function(val) { this.vari = val; } Where val will be a non static member. Whereas, var MyObj = new Object(); MyObj.vari = ""; This is a single object so me... | [
"javascript",
"object"
] | 0 | 3 | 1,836 | 3 | 0 | 2011-06-02T16:16:05.940000 | 2011-06-02T16:24:08.793000 |
6,217,214 | 6,217,267 | UITableView Accessory View not being displayed | Why is the following not displaying the proper UITableView accessory view? It is simply displaying the UIAcessoryTypeCheckmark that was selected in the nib file. - (UITableViewCell *)tableView:(UITableView *)tableView cellForManagedObject:(NSManagedObject *)managedObject withIndexPath:(NSIndexPath *)indexPath{
static ... | It doesn't look like you're adding the UIImageView to the accessory view of the cell in the first code block. You're also leaking all over the place. Make sure you adhere to the memory management guidelines set forth by Apple. | UITableView Accessory View not being displayed Why is the following not displaying the proper UITableView accessory view? It is simply displaying the UIAcessoryTypeCheckmark that was selected in the nib file. - (UITableViewCell *)tableView:(UITableView *)tableView cellForManagedObject:(NSManagedObject *)managedObject w... | TITLE:
UITableView Accessory View not being displayed
QUESTION:
Why is the following not displaying the proper UITableView accessory view? It is simply displaying the UIAcessoryTypeCheckmark that was selected in the nib file. - (UITableViewCell *)tableView:(UITableView *)tableView cellForManagedObject:(NSManagedObject... | [
"iphone",
"objective-c",
"uitableview",
"imageview"
] | 0 | 3 | 1,760 | 2 | 0 | 2011-06-02T16:16:07.390000 | 2011-06-02T16:21:14.910000 |
6,217,221 | 6,218,934 | Errors Message for Validation | I'm working on authorization system for Kohana. I'm doing it just for education... This is how looks my controller that checks submitted fields: $validation = Validation::factory( $_POST ) ->rule( 'username', 'not_empty' ) ->rule( 'username', 'max_length', array( ':value', 32 ) ) ->rule( 'username', 'alpha_dash', array... | You have: $validation =... So, first you should check if variables pass validation: if($validation->check()) { // no errors } else { $errors = $validation->errors('user'); } Then you should have user.php file in application/messages array ( 'rule' => 'your message', 'default' => 'default message' ), 'username' => array... | Errors Message for Validation I'm working on authorization system for Kohana. I'm doing it just for education... This is how looks my controller that checks submitted fields: $validation = Validation::factory( $_POST ) ->rule( 'username', 'not_empty' ) ->rule( 'username', 'max_length', array( ':value', 32 ) ) ->rule( '... | TITLE:
Errors Message for Validation
QUESTION:
I'm working on authorization system for Kohana. I'm doing it just for education... This is how looks my controller that checks submitted fields: $validation = Validation::factory( $_POST ) ->rule( 'username', 'not_empty' ) ->rule( 'username', 'max_length', array( ':value'... | [
"php",
"kohana"
] | 3 | 2 | 306 | 2 | 0 | 2011-06-02T16:16:48.097000 | 2011-06-02T18:47:39.817000 |
6,217,226 | 6,218,697 | Improve dictionary's internal linking structure | What I want to achieve: I have an online dictionary which works quite fine - but the crawling by search engines (especially Google) could be better. So I would like to improve the internal linking structure on my website so that Google can easily find (almost) all pages of the dictionary. What I know yet: The number of... | You could link to synonyms and antonyms, which would be both user-friendly and crawler-friendly. But I think the biggest thing you could do to improve crawling, particularly by Google, would be to add a sitemap: Sitemaps are an easy way for webmasters to inform search engines about pages on their sites that are availab... | Improve dictionary's internal linking structure What I want to achieve: I have an online dictionary which works quite fine - but the crawling by search engines (especially Google) could be better. So I would like to improve the internal linking structure on my website so that Google can easily find (almost) all pages o... | TITLE:
Improve dictionary's internal linking structure
QUESTION:
What I want to achieve: I have an online dictionary which works quite fine - but the crawling by search engines (especially Google) could be better. So I would like to improve the internal linking structure on my website so that Google can easily find (a... | [
"seo",
"search-engine",
"hyperlink",
"internal"
] | 0 | 1 | 72 | 1 | 0 | 2011-06-02T16:17:09.903000 | 2011-06-02T18:27:38.640000 |
6,217,231 | 6,217,276 | jQuery: is it possible to get an array of css values? | I'm looking to style the radio and checkbox form elements by replacing the form element with an image. I want to be able to style the checkbox and have jquery make an array of the values. Something like this: input[type=checkbox] { width:13px;height:13px; /*.css() can't take the shorhand background property I don't thi... | Try to use this:.css_class { width:13px;height:13px; /*.css() can't take the shorhand background property I don't think*/ background-image:url(assets/img/bg_form_checkbox.gif); background-repeat:no-repeat; background-position:50% 50%; position:relative; }
$(".css_class").after(' '); | jQuery: is it possible to get an array of css values? I'm looking to style the radio and checkbox form elements by replacing the form element with an image. I want to be able to style the checkbox and have jquery make an array of the values. Something like this: input[type=checkbox] { width:13px;height:13px; /*.css() c... | TITLE:
jQuery: is it possible to get an array of css values?
QUESTION:
I'm looking to style the radio and checkbox form elements by replacing the form element with an image. I want to be able to style the checkbox and have jquery make an array of the values. Something like this: input[type=checkbox] { width:13px;heigh... | [
"javascript",
"jquery",
"html",
"css",
"stylesheet"
] | 2 | 3 | 487 | 2 | 0 | 2011-06-02T16:17:38.640000 | 2011-06-02T16:22:19.263000 |
6,217,236 | 6,217,662 | How do I use an instance variable assigned in a helper_method from a helper? | I've been drying up one of our controllers in our rails 2.3 app, and I've run up against a problem using an instance variable assigned in a helper_method. Originally, the situation was like this: home_controller.rb: class HomeController < ActionController::Base def index end
def popular @popular_questions = PopularQue... | Pass them as parameters and local-variables: home_controller.rb: class HomeController < ActionController::Base helper_method:get_popular_questions
def index end
def popular @popular_questions = get_popular_questions end
private
def get_popular_questions # remember that the final statement of a method is also the re... | How do I use an instance variable assigned in a helper_method from a helper? I've been drying up one of our controllers in our rails 2.3 app, and I've run up against a problem using an instance variable assigned in a helper_method. Originally, the situation was like this: home_controller.rb: class HomeController < Acti... | TITLE:
How do I use an instance variable assigned in a helper_method from a helper?
QUESTION:
I've been drying up one of our controllers in our rails 2.3 app, and I've run up against a problem using an instance variable assigned in a helper_method. Originally, the situation was like this: home_controller.rb: class Hom... | [
"ruby-on-rails"
] | 1 | 1 | 1,047 | 1 | 0 | 2011-06-02T16:17:57.613000 | 2011-06-02T16:59:59.277000 |
6,217,243 | 6,217,948 | C++, Problems with Binary Files in sequence mode | I have a quite difficult problem with binary files. I have been asked to make a program that stores information in files, but in Sequential mode. As I am not allowed to modify things in sequential mode directly, I made a function that first reads the file until I found the correct registry, while copying the other regi... | For starters, you're not opening the input in binary mode, so unless you're under Unix, you won't see the byte image of the file on disk. If I understand correctly, you expect to read the files you've written with the same program; if so, reading and writing in different modes will not work. Secondly, you're reading an... | C++, Problems with Binary Files in sequence mode I have a quite difficult problem with binary files. I have been asked to make a program that stores information in files, but in Sequential mode. As I am not allowed to modify things in sequential mode directly, I made a function that first reads the file until I found t... | TITLE:
C++, Problems with Binary Files in sequence mode
QUESTION:
I have a quite difficult problem with binary files. I have been asked to make a program that stores information in files, but in Sequential mode. As I am not allowed to modify things in sequential mode directly, I made a function that first reads the fi... | [
"c++",
"ios",
"binaryfiles",
"sequential",
"truncation"
] | 0 | 2 | 365 | 1 | 0 | 2011-06-02T16:18:34.087000 | 2011-06-02T17:27:36.440000 |
6,217,246 | 6,217,488 | opengl regular polygon | i have the following code which draws nothing. If i use glBegin(GL_POINTS) it draws a circle but with polygon mode it doesn't. int WXSIZE=500,WYSIZE=500;
//Coordinate system float Xmin=-8, Xmax=8, Ymin=-8, Ymax=8;
void setupmywindow() { glClearColor(0,0,0,0); gluOrtho2D(Xmin, Xmax, Ymin, Ymax); }
void mypolygon(floa... | In every loop you are drawing a polygon, that consists of a single vertex, so nothing. Just put the glBegin/glEnd (and the glPolygonMode ) outside of the for loop and only draw glVertex in the loop. Of course it works with points, as a n times a single point is the same as n points. But n polygon consisting of one poin... | opengl regular polygon i have the following code which draws nothing. If i use glBegin(GL_POINTS) it draws a circle but with polygon mode it doesn't. int WXSIZE=500,WYSIZE=500;
//Coordinate system float Xmin=-8, Xmax=8, Ymin=-8, Ymax=8;
void setupmywindow() { glClearColor(0,0,0,0); gluOrtho2D(Xmin, Xmax, Ymin, Ymax);... | TITLE:
opengl regular polygon
QUESTION:
i have the following code which draws nothing. If i use glBegin(GL_POINTS) it draws a circle but with polygon mode it doesn't. int WXSIZE=500,WYSIZE=500;
//Coordinate system float Xmin=-8, Xmax=8, Ymin=-8, Ymax=8;
void setupmywindow() { glClearColor(0,0,0,0); gluOrtho2D(Xmin, ... | [
"opengl",
"polygon"
] | 0 | 4 | 2,495 | 3 | 0 | 2011-06-02T16:18:47.987000 | 2011-06-02T16:42:26.413000 |
6,217,254 | 6,217,444 | Guardfile's spork block expects a cucumber environment to exist... should it? | I've got guard, spork, cucumber and rspec working away on my system. All my specs and features run nicely but one thing puzzles me. When I run guard init spork, the Guardfile that is created contains the following: guard 'spork',:cucumber_env => { 'RAILS_ENV' => 'cucumber' },:rspec_env => { 'RAILS_ENV' => 'test' } do B... | The reason is that in earlier versions of cucumber, the cucumber:install generator actually created its own cucumber environment. This is no longer the case in the later versions of the gem, but the guard-spork gem still assumes the RAILS_ENV is cucumber instead of test. I use the same gem and made the same configurati... | Guardfile's spork block expects a cucumber environment to exist... should it? I've got guard, spork, cucumber and rspec working away on my system. All my specs and features run nicely but one thing puzzles me. When I run guard init spork, the Guardfile that is created contains the following: guard 'spork',:cucumber_env... | TITLE:
Guardfile's spork block expects a cucumber environment to exist... should it?
QUESTION:
I've got guard, spork, cucumber and rspec working away on my system. All my specs and features run nicely but one thing puzzles me. When I run guard init spork, the Guardfile that is created contains the following: guard 'sp... | [
"ruby-on-rails",
"ruby-on-rails-3",
"cucumber",
"spork"
] | 2 | 2 | 393 | 1 | 0 | 2011-06-02T16:19:26.453000 | 2011-06-02T16:37:44.940000 |
6,217,257 | 6,217,402 | Find song files on the device? | Is there a way to discover all song files on the device? I basically want to make a list of them to show to the user (don't need to play them or anything). I'm searching for "android sdk + song file discovery" and the like but not seeing anything related to programatically finding song files on the device. Thanks | There is a ContentProvider named MediaStore. This might be what you want. See this tutorial. | Find song files on the device? Is there a way to discover all song files on the device? I basically want to make a list of them to show to the user (don't need to play them or anything). I'm searching for "android sdk + song file discovery" and the like but not seeing anything related to programatically finding song fi... | TITLE:
Find song files on the device?
QUESTION:
Is there a way to discover all song files on the device? I basically want to make a list of them to show to the user (don't need to play them or anything). I'm searching for "android sdk + song file discovery" and the like but not seeing anything related to programatical... | [
"android"
] | 1 | 1 | 1,024 | 2 | 0 | 2011-06-02T16:19:55.223000 | 2011-06-02T16:34:45.583000 |
6,217,269 | 6,218,573 | Can you help me to do this algorithm "Shifting a String to right or left" | I'm working on a project implementing a clock using PIC18, LCD,... etc and I am using mikroC to implement this project. However, I am not good at C and I am stuck at certain point. The clock has a menu with several options that will enable the user to set time, alarms, alarm sound, etc. The menu has the following: 1. S... | Here a variation avoiding all the memcpy, str*cpy orgy. #define STRSZ 14
char str[STRZ*2+1] = " set Time Add Alarm "; /* The buffer must be writable */
for (i = 0; i <= STR_SZ; i++) { // Loop char save_ch = str[i + STRZ]; // Save the character at the end str[i + STRZ] = 0; // Terminate the string Lcd_Out (2, 2, str +... | Can you help me to do this algorithm "Shifting a String to right or left" I'm working on a project implementing a clock using PIC18, LCD,... etc and I am using mikroC to implement this project. However, I am not good at C and I am stuck at certain point. The clock has a menu with several options that will enable the us... | TITLE:
Can you help me to do this algorithm "Shifting a String to right or left"
QUESTION:
I'm working on a project implementing a clock using PIC18, LCD,... etc and I am using mikroC to implement this project. However, I am not good at C and I am stuck at certain point. The clock has a menu with several options that ... | [
"c",
"algorithm",
"embedded",
"mikroc"
] | 0 | 3 | 2,614 | 3 | 0 | 2011-06-02T16:21:18.597000 | 2011-06-02T18:17:44.157000 |
6,217,278 | 6,217,778 | Override a CSS style on one page | I have a page ( http://www.gardensandhomesdirect.co.uk/newhomepage ) I want to make the center column (#content-column) 930px for this page only, which will eventually become the homepage. The CMS used is NetSuite, and is notoriously difficult to work with. What is the best way to do this? Is it possible with just CSS/... | Since it's a CMS you probably cannot add markup easily so I'm thinking some jQuery would be a simple solution here... $(function () { var path = location.pathname.substring(1); if (path) { var regex = new RegExp('newhomepage$', 'gi'); if (regex.test(path)) $('#content-column').addClass('yourClass'); } }); This should a... | Override a CSS style on one page I have a page ( http://www.gardensandhomesdirect.co.uk/newhomepage ) I want to make the center column (#content-column) 930px for this page only, which will eventually become the homepage. The CMS used is NetSuite, and is notoriously difficult to work with. What is the best way to do th... | TITLE:
Override a CSS style on one page
QUESTION:
I have a page ( http://www.gardensandhomesdirect.co.uk/newhomepage ) I want to make the center column (#content-column) 930px for this page only, which will eventually become the homepage. The CMS used is NetSuite, and is notoriously difficult to work with. What is the... | [
"html",
"xhtml",
"css",
"netsuite"
] | 1 | 1 | 7,022 | 4 | 0 | 2011-06-02T16:22:25.860000 | 2011-06-02T17:12:36.290000 |
6,217,280 | 6,218,301 | Axis2 and Hibernate integration (without Spring) | We developing web services with Axis2 framework (legacy system). With jdbc it working fine, but I need to use it with hibernate. I tried 2 approaches: (Outside aar) I put hibernate*.jars to EARContent/lib and hibernate.cfg.xml to WEB-ING/classes (inside aar) I put hibernate.cfg.xml to aar/META-INF/ and added to service... | Actually, I fixed this issue with following code from my hibernate SessionFactoryUtils // Create the initial SessionFactory from the default configuration files log.debug("Initializing Hibernate");
AxisService axisService = MessageContext.getCurrentMessageContext().getAxisService(); ClassLoader serviceClassLoader = ax... | Axis2 and Hibernate integration (without Spring) We developing web services with Axis2 framework (legacy system). With jdbc it working fine, but I need to use it with hibernate. I tried 2 approaches: (Outside aar) I put hibernate*.jars to EARContent/lib and hibernate.cfg.xml to WEB-ING/classes (inside aar) I put hibern... | TITLE:
Axis2 and Hibernate integration (without Spring)
QUESTION:
We developing web services with Axis2 framework (legacy system). With jdbc it working fine, but I need to use it with hibernate. I tried 2 approaches: (Outside aar) I put hibernate*.jars to EARContent/lib and hibernate.cfg.xml to WEB-ING/classes (inside... | [
"hibernate",
"apache-axis"
] | 0 | 0 | 1,986 | 1 | 0 | 2011-06-02T16:22:27.733000 | 2011-06-02T17:56:23.997000 |
6,217,284 | 6,217,612 | GROUP_CONCAT With Nested Set Model | I have an application that uses a nested set model class to organise my data, however I'm trying to write a query that will group_concat my results. I know I need to put some sub select statements somewhere but I can't figure it out! Here's my structure at the moment: table: person -----------+------------+----------- ... | Here's how I'd write the query: SELECT p.Name, GROUP_CONCAT( g.Group_Name ) AS Group_List, GROUP_CONCAT( CAST( gg.Group_ID AS CHAR ) SEPARATOR ' ' ) AS Group_ID_List FROM person AS p INNER JOIN person_to_group AS pg ON p.Person_ID = pg.Person_ID INNER JOIN groups AS g ON pg.Group_ID = g.Group_ID INNER JOIN groups AS gg... | GROUP_CONCAT With Nested Set Model I have an application that uses a nested set model class to organise my data, however I'm trying to write a query that will group_concat my results. I know I need to put some sub select statements somewhere but I can't figure it out! Here's my structure at the moment: table: person --... | TITLE:
GROUP_CONCAT With Nested Set Model
QUESTION:
I have an application that uses a nested set model class to organise my data, however I'm trying to write a query that will group_concat my results. I know I need to put some sub select statements somewhere but I can't figure it out! Here's my structure at the moment... | [
"php",
"mysql",
"group-by",
"nested",
"group-concat"
] | 1 | 1 | 801 | 2 | 0 | 2011-06-02T16:22:39.577000 | 2011-06-02T16:55:38.497000 |
6,217,286 | 6,217,658 | Uninstalling pocket PC program programmatically | I want to write a program (create an exe file) to uninstall a program in WM 5.0. I was searching in Google but nothing really show a step by step how to do this. I had a step by step instruction on how to install a cab file programmatically, but I can't find something similar to unistall the program. I have seen some s... | Try to read this article. If I understood correctly what you need is to pass configuration xml to ProcessConfiguration method. I hope it helps. | Uninstalling pocket PC program programmatically I want to write a program (create an exe file) to uninstall a program in WM 5.0. I was searching in Google but nothing really show a step by step how to do this. I had a step by step instruction on how to install a cab file programmatically, but I can't find something sim... | TITLE:
Uninstalling pocket PC program programmatically
QUESTION:
I want to write a program (create an exe file) to uninstall a program in WM 5.0. I was searching in Google but nothing really show a step by step how to do this. I had a step by step instruction on how to install a cab file programmatically, but I can't ... | [
"c#",
"c++",
"c",
"pocketpc"
] | 1 | 0 | 335 | 1 | 0 | 2011-06-02T16:22:51.200000 | 2011-06-02T16:59:26.670000 |
6,217,289 | 6,217,318 | Where do you put an object call that is needed before your application loads? | I have an object call that is basically initiating a singleton that is needed all over my application. I thought the best place to put this was the environment.rb file, right after the Application.initialize! call. And it had worked with all my tests. But now that I'm running my code in the development environment, I'm... | Try putting it in an initializer file. See this link for configuring rails. | Where do you put an object call that is needed before your application loads? I have an object call that is basically initiating a singleton that is needed all over my application. I thought the best place to put this was the environment.rb file, right after the Application.initialize! call. And it had worked with all ... | TITLE:
Where do you put an object call that is needed before your application loads?
QUESTION:
I have an object call that is basically initiating a singleton that is needed all over my application. I thought the best place to put this was the environment.rb file, right after the Application.initialize! call. And it ha... | [
"ruby-on-rails",
"ruby"
] | 0 | 3 | 67 | 2 | 0 | 2011-06-02T16:23:02.587000 | 2011-06-02T16:26:35.830000 |
6,217,290 | 6,217,861 | Can I store a page with the NOINDEX metatag? | I'm doing a webcreawler and now I'm trying to follow the robots.txt and the metatags NOINDEX and NOFOLLOW. NOFOLLOW says me to not follow the links in the page, but and the NOINDEX? I understand that it's to not index the page on the searches, but I won't do any search, only store the page in the database. I will disre... | No particular reason not to store it. As long as you're not indexing it and returning it in a search result. You're not disrespecting the meaning of NOINDEX unless you return it as a search result. | Can I store a page with the NOINDEX metatag? I'm doing a webcreawler and now I'm trying to follow the robots.txt and the metatags NOINDEX and NOFOLLOW. NOFOLLOW says me to not follow the links in the page, but and the NOINDEX? I understand that it's to not index the page on the searches, but I won't do any search, only... | TITLE:
Can I store a page with the NOINDEX metatag?
QUESTION:
I'm doing a webcreawler and now I'm trying to follow the robots.txt and the metatags NOINDEX and NOFOLLOW. NOFOLLOW says me to not follow the links in the page, but and the NOINDEX? I understand that it's to not index the page on the searches, but I won't d... | [
"web-crawler",
"robots.txt",
"meta-tags",
"noindex"
] | 0 | 0 | 66 | 1 | 0 | 2011-06-02T16:23:05.913000 | 2011-06-02T17:19:55.497000 |
6,217,297 | 6,217,395 | Forcing the use of english in JDK7 tools | I just installed JDK7 on a german Windows machine and the first thing I noticed is that unlike JDK6 it takes after the OS and some messages (e.g., the help messages from the tools but not error messages from the compiler) are in german. How can I force it to use english everywhere? AFAIK the installer isn't language-sp... | You mean javac? Try setting -J-Duser.language=en argument. See this post: Passing "-J-Duser.language" into javac through ant to ensure compilation errors are reported in the correct language | Forcing the use of english in JDK7 tools I just installed JDK7 on a german Windows machine and the first thing I noticed is that unlike JDK6 it takes after the OS and some messages (e.g., the help messages from the tools but not error messages from the compiler) are in german. How can I force it to use english everywhe... | TITLE:
Forcing the use of english in JDK7 tools
QUESTION:
I just installed JDK7 on a german Windows machine and the first thing I noticed is that unlike JDK6 it takes after the OS and some messages (e.g., the help messages from the tools but not error messages from the compiler) are in german. How can I force it to us... | [
"java",
"java-7"
] | 10 | 3 | 3,858 | 2 | 0 | 2011-06-02T16:24:05.533000 | 2011-06-02T16:34:27.433000 |
6,217,299 | 6,225,827 | Is there a name for this partial-application--like functional programming technique? | I have a function f: (a, b, c = 5, d = 0) -> {...} that takes between 2 and 4 arguments. I want to pass a "bound" version of this function that always uses the defaults for the last arguments, but uses specific values (say 1 and 2) for the first two arguments. That is, I want g: () -> f(1, 2). If I were to do partial a... | Posting my comment as an answer: it seems that this question has little to do with functional programming or currying or partial application, but is instead precisely about taking a function that takes optional arguments that have defaults, and making a new function with no optional arguments in which the default argum... | Is there a name for this partial-application--like functional programming technique? I have a function f: (a, b, c = 5, d = 0) -> {...} that takes between 2 and 4 arguments. I want to pass a "bound" version of this function that always uses the defaults for the last arguments, but uses specific values (say 1 and 2) for... | TITLE:
Is there a name for this partial-application--like functional programming technique?
QUESTION:
I have a function f: (a, b, c = 5, d = 0) -> {...} that takes between 2 and 4 arguments. I want to pass a "bound" version of this function that always uses the defaults for the last arguments, but uses specific values... | [
"functional-programming",
"partial-application"
] | 2 | 2 | 143 | 1 | 0 | 2011-06-02T16:24:10.433000 | 2011-06-03T10:22:24.063000 |
6,217,312 | 6,221,667 | Is it possible to use Twisted with IPv6? | I'm trying to add IPv6 support to an application written with Twisted, which unfortunately does not support IPv6. There's a three-year-old ticket for this in Twisted's trac, but it seems to be stuck in debate with no indication of progress any time soon. Ideally I'd like existing reactor methods like listenTCP and conn... | Yes. Use HostnameEndpoint to connect to a remote host regardless of its address family. | Is it possible to use Twisted with IPv6? I'm trying to add IPv6 support to an application written with Twisted, which unfortunately does not support IPv6. There's a three-year-old ticket for this in Twisted's trac, but it seems to be stuck in debate with no indication of progress any time soon. Ideally I'd like existin... | TITLE:
Is it possible to use Twisted with IPv6?
QUESTION:
I'm trying to add IPv6 support to an application written with Twisted, which unfortunately does not support IPv6. There's a three-year-old ticket for this in Twisted's trac, but it seems to be stuck in debate with no indication of progress any time soon. Ideall... | [
"python",
"twisted",
"ipv6"
] | 9 | 6 | 1,776 | 1 | 0 | 2011-06-02T16:25:32.633000 | 2011-06-02T23:54:54.270000 |
6,217,317 | 6,218,427 | Bizarre copy of UNKNOWN in subroutine entry | I'm hitting a bug in the SVN perl module when using git: Bizarre copy of UNKNOWN in subroutine entry at /usr/lib/perl5/vendor_perl/SVN/Base.pm line 80. And I'm not quite sure if this is a perl bug or a subversion bug. This is the relevant part: # insert the accessor if (m/(.*)_get$/) { my $member = $1; *{"${caller}::$1... | That perldoc gives you the short answer, but a brief STFW session yields a little more detail. This is basically evidence of a smashed stack in Perl. Trivial example: #!/usr/bin/perl my @A = 1..5; sub blowUp { undef @A; my $throwAway = {}; print for @_; # <== line 6 } blowUp(@A); __END__ bash$./blowitup Bizarre copy of... | Bizarre copy of UNKNOWN in subroutine entry I'm hitting a bug in the SVN perl module when using git: Bizarre copy of UNKNOWN in subroutine entry at /usr/lib/perl5/vendor_perl/SVN/Base.pm line 80. And I'm not quite sure if this is a perl bug or a subversion bug. This is the relevant part: # insert the accessor if (m/(.*... | TITLE:
Bizarre copy of UNKNOWN in subroutine entry
QUESTION:
I'm hitting a bug in the SVN perl module when using git: Bizarre copy of UNKNOWN in subroutine entry at /usr/lib/perl5/vendor_perl/SVN/Base.pm line 80. And I'm not quite sure if this is a perl bug or a subversion bug. This is the relevant part: # insert the ... | [
"perl",
"svn"
] | 7 | 10 | 2,537 | 3 | 0 | 2011-06-02T16:26:24.240000 | 2011-06-02T18:05:53.283000 |
6,217,319 | 6,218,446 | number of reducers for 1 task in MapReduce | In a typical MapReduce setup(like Hadoop), how many reducer is used for 1 task, for example, counting words? My understanding of that MapReduce from Google means only 1 reducer is involved. Is that correct? For example, the word count will divide the input into N chunks, and N Map will be running, producing the (word,#... | The simple answer is that the number of reducers does not have to be 1 and yes, reducers can run in parallel. As I mentioned above this is user defined or derived. To keep things in context I will refer to Hadoop in this case so you have an idea of how things work. If you are using the streaming API in Hadoop (0.20.2) ... | number of reducers for 1 task in MapReduce In a typical MapReduce setup(like Hadoop), how many reducer is used for 1 task, for example, counting words? My understanding of that MapReduce from Google means only 1 reducer is involved. Is that correct? For example, the word count will divide the input into N chunks, and N... | TITLE:
number of reducers for 1 task in MapReduce
QUESTION:
In a typical MapReduce setup(like Hadoop), how many reducer is used for 1 task, for example, counting words? My understanding of that MapReduce from Google means only 1 reducer is involved. Is that correct? For example, the word count will divide the input in... | [
"hadoop",
"mapreduce"
] | 9 | 14 | 22,263 | 5 | 0 | 2011-06-02T16:26:37.950000 | 2011-06-02T18:07:40.867000 |
6,217,320 | 6,217,345 | declaring css properties in a css file for jquery .animate() | While implementing jquery.animate(), I've to write like $('#clickme').click(function() { $('#book').animate({ width: '200px', height: '500px' }) }) Isn't there some way to write the css properties in a css file and just do the 'animate' by including the css property?? Something like.move{ width: '200px', height: '500px... | The jQuery UI project extends the addClass method to allow exactly what you're looking for. jQuery UI - addClass. | declaring css properties in a css file for jquery .animate() While implementing jquery.animate(), I've to write like $('#clickme').click(function() { $('#book').animate({ width: '200px', height: '500px' }) }) Isn't there some way to write the css properties in a css file and just do the 'animate' by including the css p... | TITLE:
declaring css properties in a css file for jquery .animate()
QUESTION:
While implementing jquery.animate(), I've to write like $('#clickme').click(function() { $('#book').animate({ width: '200px', height: '500px' }) }) Isn't there some way to write the css properties in a css file and just do the 'animate' by i... | [
"jquery"
] | 2 | 4 | 190 | 2 | 0 | 2011-06-02T16:26:41.930000 | 2011-06-02T16:29:11.370000 |
6,217,322 | 6,217,360 | Button border colors in non-IE6 browsers | I am updating an IE6-era website so that cosmetic differences in modern (IE8, Firefox 4 in this scenario) browsers are eliminated, or at least reduced. We've ran into an issue with buttons, which are styled using background-color: #EFEFEF; and border: 1px. In IE6 this border setting neatly reduces the border on buttons... | Try setting border-style: outset;. Or use the shorthand version with the other styles you're already using:.mybutton { border: outset #EFEFEF 1px; } | Button border colors in non-IE6 browsers I am updating an IE6-era website so that cosmetic differences in modern (IE8, Firefox 4 in this scenario) browsers are eliminated, or at least reduced. We've ran into an issue with buttons, which are styled using background-color: #EFEFEF; and border: 1px. In IE6 this border set... | TITLE:
Button border colors in non-IE6 browsers
QUESTION:
I am updating an IE6-era website so that cosmetic differences in modern (IE8, Firefox 4 in this scenario) browsers are eliminated, or at least reduced. We've ran into an issue with buttons, which are styled using background-color: #EFEFEF; and border: 1px. In I... | [
"html",
"css",
"button",
"border"
] | 2 | 1 | 193 | 1 | 0 | 2011-06-02T16:26:57.497000 | 2011-06-02T16:30:33.767000 |
6,217,331 | 6,225,186 | Why does calling Google Analytics event tracking from Flash and calling getURL (_blank) stop __utm.gif being returned? | I have set up a way to track events in google analytics from my Flash AS2 swfs. I use the external interface to call _global.ga_track_event = function(_category:String, _action:String, _label:String, _value:Number) { if(ExternalInterface.available) { ExternalInterface.call("_gaq.push",['_trackEvent', _category, _action... | Sometimes, you need to figure if the debugging tools you use aren't giving wrong indications, either because they are not appropriate, either buggy, or either too smart to give you the raw data for example. Here, I would bet the following: Firebug is a page oriented tool (like web browsers), while you are looking at an... | Why does calling Google Analytics event tracking from Flash and calling getURL (_blank) stop __utm.gif being returned? I have set up a way to track events in google analytics from my Flash AS2 swfs. I use the external interface to call _global.ga_track_event = function(_category:String, _action:String, _label:String, _... | TITLE:
Why does calling Google Analytics event tracking from Flash and calling getURL (_blank) stop __utm.gif being returned?
QUESTION:
I have set up a way to track events in google analytics from my Flash AS2 swfs. I use the external interface to call _global.ga_track_event = function(_category:String, _action:String... | [
"flash",
"google-analytics",
"actionscript-2"
] | 0 | 2 | 405 | 1 | 0 | 2011-06-02T16:27:57.220000 | 2011-06-03T09:18:16.823000 |
6,217,335 | 6,217,596 | Is there a way I can force code to run AFTER a button's styling has updated post-click? | I am currently using jQuery Mobile on a project and have run into a funny little quirk. We have a screen where multiple buttons are used to toggle what information is displayed (basically, buttons are being used as radio buttons). We have added click handlers to the buttons that look something like this: // This is all... | Simply use your own class and override any styles jQuery applies. Something like http://jsfiddle.net/morrison/cj8ra/. | Is there a way I can force code to run AFTER a button's styling has updated post-click? I am currently using jQuery Mobile on a project and have run into a funny little quirk. We have a screen where multiple buttons are used to toggle what information is displayed (basically, buttons are being used as radio buttons). W... | TITLE:
Is there a way I can force code to run AFTER a button's styling has updated post-click?
QUESTION:
I am currently using jQuery Mobile on a project and have run into a funny little quirk. We have a screen where multiple buttons are used to toggle what information is displayed (basically, buttons are being used as... | [
"jquery",
"click",
"jquery-mobile"
] | 2 | 2 | 120 | 2 | 0 | 2011-06-02T16:28:10.933000 | 2011-06-02T16:53:48.267000 |
6,217,351 | 6,217,668 | Redefining Pythons builtin datatypes | Is it possible to redefine which object the brackets [] use? I can subclass the list object, but how to I make the interpreter use my subclass in place of the buildin list object? Is it possible? (I'm pretty sure I'm using the wrong terms for the question- feel free to edit) >>> class mlist(list):... def __init__(self)... | Try running the code after you've run the code you posted >>> testlist = list() Traceback (most recent call last): File " ", line 1, in TypeError: 'mlist' object is not callable Now, determine the type using the code I've posted >>> type([]) >>> type(list) >>> type(testlist) it seems that [] creates list, instead of ml... | Redefining Pythons builtin datatypes Is it possible to redefine which object the brackets [] use? I can subclass the list object, but how to I make the interpreter use my subclass in place of the buildin list object? Is it possible? (I'm pretty sure I'm using the wrong terms for the question- feel free to edit) >>> cla... | TITLE:
Redefining Pythons builtin datatypes
QUESTION:
Is it possible to redefine which object the brackets [] use? I can subclass the list object, but how to I make the interpreter use my subclass in place of the buildin list object? Is it possible? (I'm pretty sure I'm using the wrong terms for the question- feel fre... | [
"python",
"list",
"object",
"subclass",
"built-in-types"
] | 3 | 2 | 2,167 | 4 | 0 | 2011-06-02T16:29:28.997000 | 2011-06-02T17:00:27.827000 |
6,217,357 | 6,217,397 | JQUERY: Hide Dropdownlist1 when Dropdownlist2 = "certain value" | Basically I'm trying to hide dropdownlist1 when dropdownlist2's selected value is "example". Is this possible with jquery? | Yes its possible, just bind a function to the change event and look at the value. Live Demo $('#dp1').change(function(){ if(this.value === 'example'){ $('#dp2').hide(); }else{ // If you want it to show on other values $('#dp2').show(); } }); Reference | JQUERY: Hide Dropdownlist1 when Dropdownlist2 = "certain value" Basically I'm trying to hide dropdownlist1 when dropdownlist2's selected value is "example". Is this possible with jquery? | TITLE:
JQUERY: Hide Dropdownlist1 when Dropdownlist2 = "certain value"
QUESTION:
Basically I'm trying to hide dropdownlist1 when dropdownlist2's selected value is "example". Is this possible with jquery?
ANSWER:
Yes its possible, just bind a function to the change event and look at the value. Live Demo $('#dp1').chan... | [
"javascript",
"jquery",
"asp.net"
] | 2 | 5 | 55 | 1 | 0 | 2011-06-02T16:30:29.297000 | 2011-06-02T16:34:32.580000 |
6,217,363 | 6,218,044 | Rotated rectangle Collision | What is the most efficient way to find out if one axis aligned rectangle is colliding with one rotated rectangle? Each class has a position vector and a size vector and the rotated class has an angle value. | You want to use the Separating Axis Theorem (SAT). Normally it's used in 3d, but it collapses to 2d quite well. Since you've got a special case, the only axis you need to consider are 4 main axis of your rectangles: [ 1,0 ] [ 0,1 ] [ sin(theta), cos(theta) ] [ -cos(theta), sin(theta) ] To check an axis, compute the dot... | Rotated rectangle Collision What is the most efficient way to find out if one axis aligned rectangle is colliding with one rotated rectangle? Each class has a position vector and a size vector and the rotated class has an angle value. | TITLE:
Rotated rectangle Collision
QUESTION:
What is the most efficient way to find out if one axis aligned rectangle is colliding with one rotated rectangle? Each class has a position vector and a size vector and the rotated class has an angle value.
ANSWER:
You want to use the Separating Axis Theorem (SAT). Normall... | [
"java",
"geometry",
"rotation",
"collision-detection"
] | 3 | 5 | 1,973 | 2 | 0 | 2011-06-02T16:30:47.910000 | 2011-06-02T17:34:05.653000 |
6,217,364 | 6,217,408 | DB connections, how many! | Well, I understand this is quite vague to ask how many db write connections should I make. Still, I'm putting this question here, but in a different way. Lets say I've 10 tables which are independent of each other. I mean writing into one table does not mandate writing into other. The can be written into any of the tab... | Typically it shouldn't matter much as long as you keep your database operations batched together. Personally I have a DBRead function that creates a connection, executes the SQL statement(s), gets a DataTable (C#) and closes the connection. It is typically called 3-8 times per page render, which isn't that much conside... | DB connections, how many! Well, I understand this is quite vague to ask how many db write connections should I make. Still, I'm putting this question here, but in a different way. Lets say I've 10 tables which are independent of each other. I mean writing into one table does not mandate writing into other. The can be w... | TITLE:
DB connections, how many!
QUESTION:
Well, I understand this is quite vague to ask how many db write connections should I make. Still, I'm putting this question here, but in a different way. Lets say I've 10 tables which are independent of each other. I mean writing into one table does not mandate writing into o... | [
"database",
"database-connection"
] | 1 | 2 | 3,793 | 1 | 0 | 2011-06-02T16:30:55.923000 | 2011-06-02T16:35:16.047000 |
6,217,369 | 6,217,421 | Navigation controller push nil view controller error | I'm having some problems with a Navigation controller in my app. Moving from the RootViewController to a UITableViewController works fine. I now want to have one more level of drilldown, so users pick an item from the list and a new screen appears, like this: RootViewController --> TableViewController --> ItemViewContr... | This most common cause of this error is failing to connect itemDetailViewController to the actual object in IB. Note that you should generally place the IBOutlet designator on the property rather than on the ivar. | Navigation controller push nil view controller error I'm having some problems with a Navigation controller in my app. Moving from the RootViewController to a UITableViewController works fine. I now want to have one more level of drilldown, so users pick an item from the list and a new screen appears, like this: RootVie... | TITLE:
Navigation controller push nil view controller error
QUESTION:
I'm having some problems with a Navigation controller in my app. Moving from the RootViewController to a UITableViewController works fine. I now want to have one more level of drilldown, so users pick an item from the list and a new screen appears, ... | [
"iphone",
"objective-c",
"uinavigationcontroller"
] | 1 | 1 | 1,861 | 1 | 0 | 2011-06-02T16:31:35.410000 | 2011-06-02T16:35:57.530000 |
6,217,371 | 6,218,444 | draw a graph in android | I'm using a chart taken from here http://writerbay.wordpress.com/2011/03/12/android-tutorial-displaying-chart-on-android/#comment-54 to draw a graph in android. The data used for drawing the graph is taken from a DB. On x axis I put the data and on the y-axis I put some numbers meaning the speed. The data from DB is re... | You have two options that I can see. The first would be easier to implement but harder on performance and that is to wife the display and draw the graph all over again reading in as many as you want. The second option would be to read in 4 points and draw those and then read in the next 4 and draw those in a new line a... | draw a graph in android I'm using a chart taken from here http://writerbay.wordpress.com/2011/03/12/android-tutorial-displaying-chart-on-android/#comment-54 to draw a graph in android. The data used for drawing the graph is taken from a DB. On x axis I put the data and on the y-axis I put some numbers meaning the speed... | TITLE:
draw a graph in android
QUESTION:
I'm using a chart taken from here http://writerbay.wordpress.com/2011/03/12/android-tutorial-displaying-chart-on-android/#comment-54 to draw a graph in android. The data used for drawing the graph is taken from a DB. On x axis I put the data and on the y-axis I put some numbers... | [
"android",
"database",
"charts",
"android-asynctask"
] | 2 | 2 | 2,333 | 1 | 0 | 2011-06-02T16:31:43.970000 | 2011-06-02T18:07:35.900000 |
6,217,377 | 6,217,550 | Android Location Manager? | All I'm trying to do is return the long/lat values from the last know location and if that is null then pull new coords. I'm very new to this, This is what I have: import android.app.Activity; import android.content.Context; import android.location.Location; import android.location.LocationManager; import android.os.Bu... | And don't forget to add ACCESS_COARSE_LOCATION or ACCESS_FINE_LOCATION permissions to your AndoidManifest.xml. | Android Location Manager? All I'm trying to do is return the long/lat values from the last know location and if that is null then pull new coords. I'm very new to this, This is what I have: import android.app.Activity; import android.content.Context; import android.location.Location; import android.location.LocationMan... | TITLE:
Android Location Manager?
QUESTION:
All I'm trying to do is return the long/lat values from the last know location and if that is null then pull new coords. I'm very new to this, This is what I have: import android.app.Activity; import android.content.Context; import android.location.Location; import android.lo... | [
"android",
"locationmanager"
] | 0 | 2 | 2,456 | 2 | 0 | 2011-06-02T16:32:31.897000 | 2011-06-02T16:49:12.573000 |
6,217,381 | 6,217,535 | extending a class AND comparable in a generic java data structure | For homework I was assigned to make an AVL Tree data structure. I am trying to make my "add" method to add a piece of generic data to the tree. My problem is that in the assignment we must extend a class that was given to us called "BinaryTree". Within my add method I need to use the compareTo method, which I believe m... | You can use Generics to specify the type and require that it implements Comparable. That way you have access to both the type and compareTo() within the AVL Tree. public class AVL > extends BinaryTree {
public void add(T object) {... object.compareTo(some other object)... } } Then you would create it as AVL avl = new ... | extending a class AND comparable in a generic java data structure For homework I was assigned to make an AVL Tree data structure. I am trying to make my "add" method to add a piece of generic data to the tree. My problem is that in the assignment we must extend a class that was given to us called "BinaryTree". Within m... | TITLE:
extending a class AND comparable in a generic java data structure
QUESTION:
For homework I was assigned to make an AVL Tree data structure. I am trying to make my "add" method to add a piece of generic data to the tree. My problem is that in the assignment we must extend a class that was given to us called "Bin... | [
"java",
"tree",
"extends",
"comparable"
] | 0 | 3 | 2,421 | 4 | 0 | 2011-06-02T16:33:09.870000 | 2011-06-02T16:47:13.880000 |
6,217,394 | 6,217,431 | Which language was used to create Windows 8? | I was seeing a video of Windows 8 demonstration. So I was wandering which language was used to produce this new appearance: C++ or C#? Is there a WPF running on that UI? | Windows is written in C, C++, and some hand-tuned Assembly. For reasons why it is not written in.NET, see this question. It is not clear which of those languages was used to develop the latest eye candy in Windows 8. | Which language was used to create Windows 8? I was seeing a video of Windows 8 demonstration. So I was wandering which language was used to produce this new appearance: C++ or C#? Is there a WPF running on that UI? | TITLE:
Which language was used to create Windows 8?
QUESTION:
I was seeing a video of Windows 8 demonstration. So I was wandering which language was used to produce this new appearance: C++ or C#? Is there a WPF running on that UI?
ANSWER:
Windows is written in C, C++, and some hand-tuned Assembly. For reasons why it... | [
"windows",
"user-interface"
] | 2 | 10 | 22,046 | 2 | 0 | 2011-06-02T16:34:26.593000 | 2011-06-02T16:36:50.957000 |
6,217,398 | 6,217,497 | php while loop inside of while loop - need joins? | Ok, so i am working on some software where users can submit tickets for bugs found on a website. I am using multiple checkboxes so users can check all browsers that are affected by the bug. The bug bugId, title, type, etc are stored in one table called bugs and the affected browsers are stored in another table called a... | You want to get the browsers for the current bug, so you should have $bugID = $rowBug['bugId']; instead of $bugID = $_POST['bugId']; | php while loop inside of while loop - need joins? Ok, so i am working on some software where users can submit tickets for bugs found on a website. I am using multiple checkboxes so users can check all browsers that are affected by the bug. The bug bugId, title, type, etc are stored in one table called bugs and the affe... | TITLE:
php while loop inside of while loop - need joins?
QUESTION:
Ok, so i am working on some software where users can submit tickets for bugs found on a website. I am using multiple checkboxes so users can check all browsers that are affected by the bug. The bug bugId, title, type, etc are stored in one table called... | [
"php",
"mysql",
"join",
"while-loop"
] | 1 | 3 | 2,144 | 3 | 0 | 2011-06-02T16:34:37.667000 | 2011-06-02T16:43:36.147000 |
6,217,399 | 6,218,888 | Twitter authentication/PHP Oauth: user is asked to reallow the application every time he tries to authenticate | The code itself is pretty basic. I am trying to allow user to connect to Twitter and later to use Twitter as a mean of authentication (afaik, this is called OpenId). However, the problem is that every time when user executes the code he is asked to reallow the application – instead I expect it to return some sort of va... | Take a look at this document regarding the "Sign in with Twitter" flow, which it looks like you are trying to implement. The one thing I notice in your code is that you are calling oauth/authorize where you should be calling oauth/authenticate. Here's a relevant excerpt: The normal [OAuth] flow dictates that applicatio... | Twitter authentication/PHP Oauth: user is asked to reallow the application every time he tries to authenticate The code itself is pretty basic. I am trying to allow user to connect to Twitter and later to use Twitter as a mean of authentication (afaik, this is called OpenId). However, the problem is that every time whe... | TITLE:
Twitter authentication/PHP Oauth: user is asked to reallow the application every time he tries to authenticate
QUESTION:
The code itself is pretty basic. I am trying to allow user to connect to Twitter and later to use Twitter as a mean of authentication (afaik, this is called OpenId). However, the problem is t... | [
"php",
"openid",
"twitter"
] | 1 | 1 | 765 | 1 | 0 | 2011-06-02T16:34:39.647000 | 2011-06-02T18:43:40.877000 |
6,217,406 | 6,222,370 | How can I detect if GHC is set to generate 32bit or 64bit code by default? | I have the following bits in my makefile: GLFW_FLAG:= -m32 -O2 -Iglfw/include -Iglfw/lib -Iglfw/lib/cocoa $(CFLAGS)... $(BUILD_DIR)/%.o: %.c $(CC) -c $(GLFW_FLAG) $< -o $@ $(BUILD_DIR)/%.o: %.m $(CC) -c $(GLFW_FLAG) $< -o $@ The -m32 instructs GCC to generate 32bit code. It's there because on some configurations GHC is... | Thanks to Ed'ka I know the correct answer now. The Makefile now has a rule like this: GCCFLAGS:= $(shell ghc --info | ghc -e "fmap read getContents >>= putStrLn. unwords. read. Data.Maybe.fromJust. lookup \"Gcc Linker flags\"") It's a bit long, but all it does is extract the "Gcc Linker flags" from ghc's output. Note: ... | How can I detect if GHC is set to generate 32bit or 64bit code by default? I have the following bits in my makefile: GLFW_FLAG:= -m32 -O2 -Iglfw/include -Iglfw/lib -Iglfw/lib/cocoa $(CFLAGS)... $(BUILD_DIR)/%.o: %.c $(CC) -c $(GLFW_FLAG) $< -o $@ $(BUILD_DIR)/%.o: %.m $(CC) -c $(GLFW_FLAG) $< -o $@ The -m32 instructs G... | TITLE:
How can I detect if GHC is set to generate 32bit or 64bit code by default?
QUESTION:
I have the following bits in my makefile: GLFW_FLAG:= -m32 -O2 -Iglfw/include -Iglfw/lib -Iglfw/lib/cocoa $(CFLAGS)... $(BUILD_DIR)/%.o: %.c $(CC) -c $(GLFW_FLAG) $< -o $@ $(BUILD_DIR)/%.o: %.m $(CC) -c $(GLFW_FLAG) $< -o $@ Th... | [
"haskell",
"makefile",
"32bit-64bit",
"ghc"
] | 7 | 2 | 1,620 | 3 | 0 | 2011-06-02T16:35:09.333000 | 2011-06-03T02:20:04.660000 |
6,217,414 | 6,218,962 | And suddenly, all my controls aren't declared! (VB.NET) | This is strange. Everything worked great this morning on my ASP project. Suddenly, I have 48 errors. Similar to the following: Name 'pnlVars' is not declared 'txtPolicyNo' is not a member of 'LetterWriterASP.UW' Seems every control I reference is now no longer declared or not a member of my project. I checked the page,... | Of course it also helps to make sure, when you add a copied aspx page to your solution, to double-check the CodeBehind page tag and make sure it's not pointing to any other pages in your solution! | And suddenly, all my controls aren't declared! (VB.NET) This is strange. Everything worked great this morning on my ASP project. Suddenly, I have 48 errors. Similar to the following: Name 'pnlVars' is not declared 'txtPolicyNo' is not a member of 'LetterWriterASP.UW' Seems every control I reference is now no longer dec... | TITLE:
And suddenly, all my controls aren't declared! (VB.NET)
QUESTION:
This is strange. Everything worked great this morning on my ASP project. Suddenly, I have 48 errors. Similar to the following: Name 'pnlVars' is not declared 'txtPolicyNo' is not a member of 'LetterWriterASP.UW' Seems every control I reference is... | [
"asp.net",
"vb.net",
"visual-studio",
"controls"
] | 2 | 1 | 2,512 | 5 | 0 | 2011-06-02T16:35:35.953000 | 2011-06-02T18:50:34.257000 |
6,217,434 | 6,217,492 | Google +1 Button not W3C compliant | So I've been playing with Google's +1 button trying to get it on my website, but it's not W3C compliant. Here's the code: Does anyone know why this happens and how to make this compliant? Thanks EDIT: To get this to pass through the validation, I wrote an article on my website. | Does anyone know why this happens? Because Google designed it to use tag soup instead of HTML How to make this compliant? The documentation has alternative markup that is valid under the draft HTML 5 specification: If you want it to work with HTML 4.x or XHTML 1.x then you might be out of luck (although you might be ab... | Google +1 Button not W3C compliant So I've been playing with Google's +1 button trying to get it on my website, but it's not W3C compliant. Here's the code: Does anyone know why this happens and how to make this compliant? Thanks EDIT: To get this to pass through the validation, I wrote an article on my website. | TITLE:
Google +1 Button not W3C compliant
QUESTION:
So I've been playing with Google's +1 button trying to get it on my website, but it's not W3C compliant. Here's the code: Does anyone know why this happens and how to make this compliant? Thanks EDIT: To get this to pass through the validation, I wrote an article on ... | [
"javascript",
"w3c",
"w3c-validation",
"google-plus-one"
] | 41 | 24 | 23,756 | 12 | 0 | 2011-06-02T16:37:02.820000 | 2011-06-02T16:42:51.540000 |
6,217,435 | 6,217,877 | Why is my unit test of my Silverlight XAML bindings is failing? | I've got the following combobox defined: Where IsoCurrenciesList is an IEnumerable - the type being defined by us and declared in the view model as: private IEnumerable isoCurrenciesList; public IEnumerable IsoCurrenciesList { get { return isoCurrenciesList; } set { isoCurrenciesList = value; RaisePropertyChangedEvent(... | You've included the XAML for your ComboBox, but not the rest of your page. In your test you have GetUIElement ("LayoutRoot").DataContext = _viewModel;. In the example you're following, he defines: and then the controls on which he's testing the bindings are nested directly inside that grid. Is your page setup the same ... | Why is my unit test of my Silverlight XAML bindings is failing? I've got the following combobox defined: Where IsoCurrenciesList is an IEnumerable - the type being defined by us and declared in the view model as: private IEnumerable isoCurrenciesList; public IEnumerable IsoCurrenciesList { get { return isoCurrenciesLis... | TITLE:
Why is my unit test of my Silverlight XAML bindings is failing?
QUESTION:
I've got the following combobox defined: Where IsoCurrenciesList is an IEnumerable - the type being defined by us and declared in the view model as: private IEnumerable isoCurrenciesList; public IEnumerable IsoCurrenciesList { get { retur... | [
"c#",
"silverlight",
"unit-testing",
"xaml",
"mvvm"
] | 3 | 1 | 722 | 3 | 0 | 2011-06-02T16:37:09.600000 | 2011-06-02T17:20:59.637000 |
6,217,442 | 6,217,470 | Nested master pages using Razor syntax | I'm trying to get nested master pages working with the new razor syntax. Any help appreciated: The error I'm getting is Execute() no suitable method found to override Delving further I have my _Site.cshtml, which is the main master page and inherits ViewMasterPage. My nested master page is _layout.cshtml, which uses _s... | ViewMasterPage is used for WebForms views. Razor layout pages do not inherit a special class; instead, they inherit the same ViewPage class. You should use the @model directive instead of @inherits in all three pages. | Nested master pages using Razor syntax I'm trying to get nested master pages working with the new razor syntax. Any help appreciated: The error I'm getting is Execute() no suitable method found to override Delving further I have my _Site.cshtml, which is the main master page and inherits ViewMasterPage. My nested maste... | TITLE:
Nested master pages using Razor syntax
QUESTION:
I'm trying to get nested master pages working with the new razor syntax. Any help appreciated: The error I'm getting is Execute() no suitable method found to override Delving further I have my _Site.cshtml, which is the main master page and inherits ViewMasterPag... | [
"asp.net-mvc-3",
"razor",
"master-pages"
] | 3 | 2 | 2,394 | 1 | 0 | 2011-06-02T16:37:41.883000 | 2011-06-02T16:40:13.827000 |
6,217,450 | 6,218,968 | jquery .next *?* issue | basically got this bit of code that doesn't work in ie8 & lower. The automatic change fades out the current block of text, but doesnt fade in the new one which makes me think its the.next() that's playing up, as clicking the numbers (the.click function) works fine. jQuery: function doSlideshow() { if ($('.image_links a... | Try replacing (2 places) thistimeout = setTimeout('doSlideshow()', 6000); with: thistimeout = setInterval(function() {doSlideshow();}, 6000); Remove from doSlideshow: thistimeout = setTimeout('doSlideshow()', 6000); And change: clearTimeout(thistimeout); To: clearInterval(thistimeout); Let me know if that helps. | jquery .next *?* issue basically got this bit of code that doesn't work in ie8 & lower. The automatic change fades out the current block of text, but doesnt fade in the new one which makes me think its the.next() that's playing up, as clicking the numbers (the.click function) works fine. jQuery: function doSlideshow() ... | TITLE:
jquery .next *?* issue
QUESTION:
basically got this bit of code that doesn't work in ie8 & lower. The automatic change fades out the current block of text, but doesnt fade in the new one which makes me think its the.next() that's playing up, as clicking the numbers (the.click function) works fine. jQuery: funct... | [
"jquery",
"internet-explorer-8",
"internet-explorer-7"
] | 0 | 1 | 602 | 2 | 0 | 2011-06-02T16:38:50.877000 | 2011-06-02T18:51:29.787000 |
6,217,453 | 6,217,633 | Why does boost::is_same<int const&, boost::add_const<int &>::value equal false? | I'm working through "C++ Template Metaprogramming" by Abrahams & Gurtovoy " This isn't actually in chapter two but is something I tried whilst working on the first exercise (2.10, 2.0) which is confusing me: #include #include std::string display(bool b) { return (b? "true": "false"); }
int main() { using namespace std... | If you tried the same thing with pointers, as in boost::is_same::type>::value you'd discover that it is also false, since boost::add_const::type generates int *const type, which is obviously not the same as int const *. Essentially the same thing happens with references, i.e. boost::add_const::type is an attempt to gen... | Why does boost::is_same<int const&, boost::add_const<int &>::value equal false? I'm working through "C++ Template Metaprogramming" by Abrahams & Gurtovoy " This isn't actually in chapter two but is something I tried whilst working on the first exercise (2.10, 2.0) which is confusing me: #include #include std::string di... | TITLE:
Why does boost::is_same<int const&, boost::add_const<int &>::value equal false?
QUESTION:
I'm working through "C++ Template Metaprogramming" by Abrahams & Gurtovoy " This isn't actually in chapter two but is something I tried whilst working on the first exercise (2.10, 2.0) which is confusing me: #include #incl... | [
"c++",
"boost",
"metaprogramming"
] | 8 | 11 | 2,207 | 2 | 0 | 2011-06-02T16:39:03.067000 | 2011-06-02T16:57:17.030000 |
6,217,455 | 6,217,471 | Application locks up after i remove a function not in use | I comment out a function and the application compiles(no errors or warnings) but when I run it, it freezes up and crashes out. I uncomment the function, not in use, and then the application works fine. What is the best approach to deal with this problem? Thanks | Stick a breakpoint on the function and see what's calling it. | Application locks up after i remove a function not in use I comment out a function and the application compiles(no errors or warnings) but when I run it, it freezes up and crashes out. I uncomment the function, not in use, and then the application works fine. What is the best approach to deal with this problem? Thanks | TITLE:
Application locks up after i remove a function not in use
QUESTION:
I comment out a function and the application compiles(no errors or warnings) but when I run it, it freezes up and crashes out. I uncomment the function, not in use, and then the application works fine. What is the best approach to deal with thi... | [
"xcode"
] | 0 | 1 | 41 | 2 | 0 | 2011-06-02T16:39:09.300000 | 2011-06-02T16:40:21.073000 |
6,217,464 | 6,217,789 | In which version of iOS did the 'high speed scrubbing' *prompt* appear? | iOS has had high speed scrubbing in the media player since iOS3. However, the prompt which appears below the scrubbing control ("Slide your finger down to adjust the scrubbing rate") appeared at some later point. For example, an iPhone I have running iOS3.1.3 doesn't show the scrubbing prompt while you scrub. So when d... | The string "Slide your finger down to adjust the scrubbing rate" first appeared in the source of iOS 3.2. | In which version of iOS did the 'high speed scrubbing' *prompt* appear? iOS has had high speed scrubbing in the media player since iOS3. However, the prompt which appears below the scrubbing control ("Slide your finger down to adjust the scrubbing rate") appeared at some later point. For example, an iPhone I have runni... | TITLE:
In which version of iOS did the 'high speed scrubbing' *prompt* appear?
QUESTION:
iOS has had high speed scrubbing in the media player since iOS3. However, the prompt which appears below the scrubbing control ("Slide your finger down to adjust the scrubbing rate") appeared at some later point. For example, an i... | [
"iphone",
"ios",
"user-interface",
"media-player"
] | 1 | 1 | 971 | 1 | 0 | 2011-06-02T16:39:41.337000 | 2011-06-02T17:13:47.467000 |
6,217,484 | 6,217,761 | SQL Server trigger on insert,delete & update on table | I have a table Product and another table ProductLog. The log table needs to track two columns in the Product table. Each time there is an insert, update or delete on those columns I need to update the log table. Do I need to write three separate triggers, or can one trigger handle these operations? I also need to know ... | You need just one trigger CREATE TRIGGER [ProductAfter] ON [Product] AFTER INSERT, UPDATE, DELETE You can determine which DML statement fires the trigger based on number of records in inserted and deleted tables available within trigger body. For INSERT, deleted is empty, for DELETE, inserted is empty, for UPDATE both ... | SQL Server trigger on insert,delete & update on table I have a table Product and another table ProductLog. The log table needs to track two columns in the Product table. Each time there is an insert, update or delete on those columns I need to update the log table. Do I need to write three separate triggers, or can one... | TITLE:
SQL Server trigger on insert,delete & update on table
QUESTION:
I have a table Product and another table ProductLog. The log table needs to track two columns in the Product table. Each time there is an insert, update or delete on those columns I need to update the log table. Do I need to write three separate tr... | [
"sql-server",
"datatrigger"
] | 9 | 24 | 21,283 | 2 | 0 | 2011-06-02T16:42:13.100000 | 2011-06-02T17:09:44.047000 |
6,217,487 | 6,218,400 | Serializing a container of RSS feeds? | I am working on a project for an RSS Client. Right now I'm retrieving a feed using SyndicationFeed and an XmlReader and adding it to a list: SyndicationFeed feed = SyndicationFeed.Load( XmlReader.Create("SOME URL TO A FEED")); List feeds = new List (); feeds.Add(feed); SyndicationFeed and most of its properties are not... | The SyndicationFeed class has a SaveAsAtom10 method and a SaveAsRss20 method, both of which take a XmlWriter instance which you can use anything as the underlying store for. Personally, I'd go with the SaveAsAtom10 method, as I believe Atom is the richer format. That said, you can easily persist this into a larger sing... | Serializing a container of RSS feeds? I am working on a project for an RSS Client. Right now I'm retrieving a feed using SyndicationFeed and an XmlReader and adding it to a list: SyndicationFeed feed = SyndicationFeed.Load( XmlReader.Create("SOME URL TO A FEED")); List feeds = new List (); feeds.Add(feed); SyndicationF... | TITLE:
Serializing a container of RSS feeds?
QUESTION:
I am working on a project for an RSS Client. Right now I'm retrieving a feed using SyndicationFeed and an XmlReader and adding it to a list: SyndicationFeed feed = SyndicationFeed.Load( XmlReader.Create("SOME URL TO A FEED")); List feeds = new List (); feeds.Add(f... | [
"c#",
".net",
"serialization",
"rss",
"feed"
] | 2 | 3 | 765 | 1 | 0 | 2011-06-02T16:42:21.527000 | 2011-06-02T18:04:08.443000 |
6,217,489 | 6,217,542 | sortedArrayUsingSelector on custom Classes? | I have a NSMutableArray that has custom objects in it. Each object does have a name attribute. Is there a way to use [myArray sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)] on the name somehow? Like [myArray.name sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)] Or am I better off writing a sor... | In this case you need to use a NSSortDescriptor. NSSortDescriptor* sortDescriptor = [NSSortDescriptor sortDescriptorWithKey:@"name" ascending:YES selector:@selector(caseInsensitiveCompare:)]; NSArray* sortedArray = [myArray sortedArrayUsingDescriptors:[NSArray arrayWithObject:sortDescriptor]]; | sortedArrayUsingSelector on custom Classes? I have a NSMutableArray that has custom objects in it. Each object does have a name attribute. Is there a way to use [myArray sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)] on the name somehow? Like [myArray.name sortedArrayUsingSelector:@selector(caseInsensitiv... | TITLE:
sortedArrayUsingSelector on custom Classes?
QUESTION:
I have a NSMutableArray that has custom objects in it. Each object does have a name attribute. Is there a way to use [myArray sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)] on the name somehow? Like [myArray.name sortedArrayUsingSelector:@selec... | [
"iphone",
"nsmutablearray"
] | 2 | 11 | 4,981 | 3 | 0 | 2011-06-02T16:42:35.680000 | 2011-06-02T16:48:19.033000 |
6,217,491 | 6,217,716 | C# .NET Web Service Asynchronously | I'm trying to implement an API that performs some really lengthy tasks using a Web Service. I basically want the Web Service to kick off a thread that performs the lengthy task and leaves it running until it completes. The issue is because its an API I want it to be cross-platform. So my questions are the following: Is... | This is a good place to start: http://msdn.microsoft.com/en-us/library/aa480516.aspx If you implement this pattern, from the client perspective, nothing changes. You can implement a second web method to check the status of any running jobs you queue up in your async method. From the sample code, modified somewhat to gi... | C# .NET Web Service Asynchronously I'm trying to implement an API that performs some really lengthy tasks using a Web Service. I basically want the Web Service to kick off a thread that performs the lengthy task and leaves it running until it completes. The issue is because its an API I want it to be cross-platform. So... | TITLE:
C# .NET Web Service Asynchronously
QUESTION:
I'm trying to implement an API that performs some really lengthy tasks using a Web Service. I basically want the Web Service to kick off a thread that performs the lengthy task and leaves it running until it completes. The issue is because its an API I want it to be ... | [
"c#",
"asp.net",
"multithreading",
"web-services",
"asynchronous"
] | 4 | 2 | 6,632 | 4 | 0 | 2011-06-02T16:42:41.897000 | 2011-06-02T17:05:21.130000 |
6,217,501 | 6,218,018 | Column names with space breaks filtering | I have a colmodel similar to this: [ {"name":"ID","index":"ID"}, {"name":"Customer Name","index":"Customer_Name","width":275}, {"name":"State","index":"State","width":125}, ] When I try to filter on the "Customer Name" column, the url the grid uses to call back to the server is the orginal url ie something like this?_s... | Blank is not allowed character. You can not use it inside of name property of the column definition. You should use only the characters allowed for valid CSS selectors. Read more about jQuery restrictions here. | Column names with space breaks filtering I have a colmodel similar to this: [ {"name":"ID","index":"ID"}, {"name":"Customer Name","index":"Customer_Name","width":275}, {"name":"State","index":"State","width":125}, ] When I try to filter on the "Customer Name" column, the url the grid uses to call back to the server is ... | TITLE:
Column names with space breaks filtering
QUESTION:
I have a colmodel similar to this: [ {"name":"ID","index":"ID"}, {"name":"Customer Name","index":"Customer_Name","width":275}, {"name":"State","index":"State","width":125}, ] When I try to filter on the "Customer Name" column, the url the grid uses to call back... | [
"jqgrid"
] | 1 | 2 | 908 | 1 | 0 | 2011-06-02T16:43:52.757000 | 2011-06-02T17:32:13.910000 |
6,217,503 | 6,217,564 | Switching language on ASP.NET app using master page | I am using Visual Studio 2008 and ASP.NET to build a web app. Most of my web pages are based on a single master page. This master page contains three button links that act as language switches; the Click event handlers look like this: protected void lbuLangEN_Click(object sender, EventArgs e) { this.SwitchLanguage(stri... | You could use OnAcquireRequestState in Global.asax to change the culture. It is called right after the session is loaded, but before any master page event. So in the button event handler, you set a session variable to the desired current culture. Then you redirect to the current page. The Global.asax event can then pic... | Switching language on ASP.NET app using master page I am using Visual Studio 2008 and ASP.NET to build a web app. Most of my web pages are based on a single master page. This master page contains three button links that act as language switches; the Click event handlers look like this: protected void lbuLangEN_Click(ob... | TITLE:
Switching language on ASP.NET app using master page
QUESTION:
I am using Visual Studio 2008 and ASP.NET to build a web app. Most of my web pages are based on a single master page. This master page contains three button links that act as language switches; the Click event handlers look like this: protected void ... | [
"asp.net",
"localization",
"master-pages",
"cultureinfo"
] | 4 | 10 | 13,148 | 3 | 0 | 2011-06-02T16:44:02.840000 | 2011-06-02T16:50:26.873000 |
6,217,505 | 6,220,255 | Terminate importation of module non-fatally? | I'd like use if __name__!= '__main__': and then end the execution of a script at that point when it's being imported, rather than doing the usual if __name__ == '__main__': and indentation of all the rest of the code in the file. However I have been unable to determine what would cause only this to happen and not have ... | Another Hack: # code
if __name__ == "__main__": exec("""
# main code
#""") So... you've lost the indentation, but also the syntax highlighting and any other features of the editor you were using, unless you comment out the if line every time you edit. | Terminate importation of module non-fatally? I'd like use if __name__!= '__main__': and then end the execution of a script at that point when it's being imported, rather than doing the usual if __name__ == '__main__': and indentation of all the rest of the code in the file. However I have been unable to determine what ... | TITLE:
Terminate importation of module non-fatally?
QUESTION:
I'd like use if __name__!= '__main__': and then end the execution of a script at that point when it's being imported, rather than doing the usual if __name__ == '__main__': and indentation of all the rest of the code in the file. However I have been unable ... | [
"python",
"import"
] | 4 | 2 | 283 | 4 | 0 | 2011-06-02T16:44:17.173000 | 2011-06-02T20:52:18.750000 |
6,217,507 | 6,217,624 | Powershell - grab a word and emit it (or something) | I need to read from a file and find a word in it. The file is generated new each time my script is run. The file has many lines in it, but there is always one unique line which has the following: INSTANCE i-cbea4fa5 ami-c3e4dda ec2-........ The values "INSTANCE" and "ami-c3e4dda" will always be the same in the file. Th... | ((select-string -pattern "^INSTANCE \S+ ami-c3e4dda" -list).line).substring(9,10) | Powershell - grab a word and emit it (or something) I need to read from a file and find a word in it. The file is generated new each time my script is run. The file has many lines in it, but there is always one unique line which has the following: INSTANCE i-cbea4fa5 ami-c3e4dda ec2-........ The values "INSTANCE" and "... | TITLE:
Powershell - grab a word and emit it (or something)
QUESTION:
I need to read from a file and find a word in it. The file is generated new each time my script is run. The file has many lines in it, but there is always one unique line which has the following: INSTANCE i-cbea4fa5 ami-c3e4dda ec2-........ The value... | [
"powershell",
"amazon-ec2"
] | 2 | 0 | 103 | 2 | 0 | 2011-06-02T16:44:25.923000 | 2011-06-02T16:56:21.633000 |
6,217,513 | 6,217,742 | t-sql query to concatenate corresponding rows | I have a table Managers. Columns: ManagerId, ManagerName. I have a table Clients. Columns: ClientId, ManagerId, ClientName, ClientAddress, Details. Each (every?) manager have clients in clients table. I need a query that returns next table. Columns: Column1, Column2. Column1: ManagerName Column2: ClientName1 ',' Client... | Here is a working example using XML AUTO With Managers AS ( Select 1 as ManagerId, 'Tom' as ManagerName UNION Select 2 as ManagerId, 'Jane' as ManagerName ), Clients as ( Select 1 as ClientId, 1 as ManagerId, 'TaXon Pro' as ClientName, '112 Acme St Cityville DD 56' as ClientAddress, 'ABC' as Details UNION Select 2 as C... | t-sql query to concatenate corresponding rows I have a table Managers. Columns: ManagerId, ManagerName. I have a table Clients. Columns: ClientId, ManagerId, ClientName, ClientAddress, Details. Each (every?) manager have clients in clients table. I need a query that returns next table. Columns: Column1, Column2. Column... | TITLE:
t-sql query to concatenate corresponding rows
QUESTION:
I have a table Managers. Columns: ManagerId, ManagerName. I have a table Clients. Columns: ClientId, ManagerId, ClientName, ClientAddress, Details. Each (every?) manager have clients in clients table. I need a query that returns next table. Columns: Column... | [
"sql-server",
"t-sql",
"sql-server-2008-r2"
] | 4 | 1 | 112 | 3 | 0 | 2011-06-02T16:45:07.877000 | 2011-06-02T17:07:41.803000 |
6,217,528 | 6,222,848 | J2EE: How can I better structure my servlets? | The web-app I'm currently building follows MVC. I've structured the servlets in a way such that they each handle related actions (so, one servlet may be responsible for all actions relating to setting up a user's account, while another may be used for user correspondance). Currently I have an "action" parameter attache... | If you're just looking to avoid code-smell with the the large if statements and be a bit more OO, you can try using reflection-style instantiation if you can get your utility classes to implement the same interface. Basically, the value of the action parameter would be a representation of an actual classname (or a port... | J2EE: How can I better structure my servlets? The web-app I'm currently building follows MVC. I've structured the servlets in a way such that they each handle related actions (so, one servlet may be responsible for all actions relating to setting up a user's account, while another may be used for user correspondance). ... | TITLE:
J2EE: How can I better structure my servlets?
QUESTION:
The web-app I'm currently building follows MVC. I've structured the servlets in a way such that they each handle related actions (so, one servlet may be responsible for all actions relating to setting up a user's account, while another may be used for user... | [
"java",
"servlets",
"jakarta-ee",
"if-statement"
] | 1 | 1 | 247 | 3 | 0 | 2011-06-02T16:46:35.833000 | 2011-06-03T04:04:41.587000 |
6,217,529 | 6,217,875 | DataRowVersion not working when using DataSet.ReadXML(...) to load data | So I've spent all day finding where the problem lies. If I don't use XML to load data into my DataSet (i.e. just grab it straight from a database or somesuch) then I have no problems at all. However, I have to read it from an XML file and I am currently using DataSet.ReadXML(...) to achieve this. The XML has been writt... | Have you tried setting the XmlWriteMode to XmlWriteMode.DiffGram? | DataRowVersion not working when using DataSet.ReadXML(...) to load data So I've spent all day finding where the problem lies. If I don't use XML to load data into my DataSet (i.e. just grab it straight from a database or somesuch) then I have no problems at all. However, I have to read it from an XML file and I am curr... | TITLE:
DataRowVersion not working when using DataSet.ReadXML(...) to load data
QUESTION:
So I've spent all day finding where the problem lies. If I don't use XML to load data into my DataSet (i.e. just grab it straight from a database or somesuch) then I have no problems at all. However, I have to read it from an XML ... | [
"c#",
"xml",
"dataset",
"dataview",
"datarowview"
] | 1 | 1 | 696 | 1 | 0 | 2011-06-02T16:46:39.027000 | 2011-06-02T17:20:54 |
6,217,530 | 6,217,603 | How to Query One to Many in Linq | --I have a Table named CLASS with the Following Records in it (PK) ClassID | Name ----------|---------- 1 | CSE 2 | ECE I have an another Table Named ALLOCATIONS which has the ForeighnKey Class_ID from CLASS table (PK) (FK) ID | Class_ID | EffectiveFrom | Allocation -----|--------------|------------------|-------------... | try: from allocation in CurrentClasses.Allocations group allocation by allocation.Class_ID into allocationGroups from allocationGroup in allocationGroups from allocationRow in allocationGroup where allocationRow.Date == allocationGroup.Max(x => x.Date) select allocationRow; Hope that helps, sorry for the query syntax, ... | How to Query One to Many in Linq --I have a Table named CLASS with the Following Records in it (PK) ClassID | Name ----------|---------- 1 | CSE 2 | ECE I have an another Table Named ALLOCATIONS which has the ForeighnKey Class_ID from CLASS table (PK) (FK) ID | Class_ID | EffectiveFrom | Allocation -----|--------------... | TITLE:
How to Query One to Many in Linq
QUESTION:
--I have a Table named CLASS with the Following Records in it (PK) ClassID | Name ----------|---------- 1 | CSE 2 | ECE I have an another Table Named ALLOCATIONS which has the ForeighnKey Class_ID from CLASS table (PK) (FK) ID | Class_ID | EffectiveFrom | Allocation --... | [
"linq-to-entities"
] | 1 | 1 | 155 | 1 | 0 | 2011-06-02T16:46:42.933000 | 2011-06-02T16:54:29.823000 |
6,217,534 | 6,220,761 | Linq To Sql ComboBox (DropDownList) Setting Default Binding | We regularly setup simple winforms using Linq To Sql. I recently discovered that the ComboBox control when used as a DropDownList only updates the underlying databinding when it's clicked. So, if you tab into the control, hit the first letter to select your entry, then tab out. The underlying databinding never gets the... | So, as per above, I believe you've resolved it by binding instead to SelectedItem and ensuring that DataSourceUpdateMode is set to OnPropertyChanged. However, with the rephrased question, you'll find you can't change the VS behaviour. You'll have to make choices to what you bind to. There is a DefaultPropertyAttribute ... | Linq To Sql ComboBox (DropDownList) Setting Default Binding We regularly setup simple winforms using Linq To Sql. I recently discovered that the ComboBox control when used as a DropDownList only updates the underlying databinding when it's clicked. So, if you tab into the control, hit the first letter to select your en... | TITLE:
Linq To Sql ComboBox (DropDownList) Setting Default Binding
QUESTION:
We regularly setup simple winforms using Linq To Sql. I recently discovered that the ComboBox control when used as a DropDownList only updates the underlying databinding when it's clicked. So, if you tab into the control, hit the first letter... | [
"winforms",
"visual-studio-2010",
"linq-to-sql",
"combobox"
] | 2 | 1 | 1,122 | 1 | 0 | 2011-06-02T16:47:01.663000 | 2011-06-02T21:46:15.240000 |
6,217,537 | 6,217,751 | How to draw Button class in libgdx | I know that libgdx has this Button class that seems so easy to use, but I wonder why the draw method is set protected? In that case, how should I draw the button? Scene2d Button | Button is also an Actor. So you would put it on the Stage and the framework would draw it. Here is some more documentation on how this fits together. | How to draw Button class in libgdx I know that libgdx has this Button class that seems so easy to use, but I wonder why the draw method is set protected? In that case, how should I draw the button? Scene2d Button | TITLE:
How to draw Button class in libgdx
QUESTION:
I know that libgdx has this Button class that seems so easy to use, but I wonder why the draw method is set protected? In that case, how should I draw the button? Scene2d Button
ANSWER:
Button is also an Actor. So you would put it on the Stage and the framework woul... | [
"android",
"libgdx",
"scene2d"
] | 11 | 14 | 12,743 | 3 | 0 | 2011-06-02T16:47:18.153000 | 2011-06-02T17:08:17.967000 |
6,217,545 | 6,218,295 | How to detect in Iron Python what the script is being called from? | I have a ipy script that can be called either from an embedded console in a larger application or directly from the command line and I'm looking for a quick way to determine at run time which has occurred without having to pass an argument to differentiate the events. Additionally the script has to run on both mono/lin... | You could use System.AppDomain.CurrentDomain.GetAssemblies() (assuming you don't use AppDomain isolation, of course) and see if that contains an assembly that would only be preset when your application is running. | How to detect in Iron Python what the script is being called from? I have a ipy script that can be called either from an embedded console in a larger application or directly from the command line and I'm looking for a quick way to determine at run time which has occurred without having to pass an argument to differenti... | TITLE:
How to detect in Iron Python what the script is being called from?
QUESTION:
I have a ipy script that can be called either from an embedded console in a larger application or directly from the command line and I'm looking for a quick way to determine at run time which has occurred without having to pass an argu... | [
".net",
"mono",
"ironpython"
] | 0 | 1 | 131 | 2 | 0 | 2011-06-02T16:49:00.747000 | 2011-06-02T17:55:49.797000 |
6,217,549 | 6,217,752 | MySQL Query to Find the Root Element | NOTE: This is actually a database of a forum. I am stuck in an Interesting problem. I created a database with the following fields ID (primary), Data, ParentID ParentID is the ID of some other row in the same table. However, this parent child relationship can extend upto few levels. The topmost elements has 0 as parent... | I'll assume that root elements have ID = RootID. Since adding the root IDs is a one-off thing, I'd just start out with UPDATE `table` SET RootID = ID (after creating the new column, of course) and then run something like UPDATE `table` t1 JOIN `table` t2 ON t1.RootID = t2.ID SET t1.RootID = t2.ParentID WHERE t2.ParentI... | MySQL Query to Find the Root Element NOTE: This is actually a database of a forum. I am stuck in an Interesting problem. I created a database with the following fields ID (primary), Data, ParentID ParentID is the ID of some other row in the same table. However, this parent child relationship can extend upto few levels.... | TITLE:
MySQL Query to Find the Root Element
QUESTION:
NOTE: This is actually a database of a forum. I am stuck in an Interesting problem. I created a database with the following fields ID (primary), Data, ParentID ParentID is the ID of some other row in the same table. However, this parent child relationship can exten... | [
"mysql"
] | 0 | 2 | 532 | 2 | 0 | 2011-06-02T16:49:11.403000 | 2011-06-02T17:08:20.367000 |
6,217,559 | 6,224,722 | How do I stop getNodeName() also printing the node type | I'm stumped, hopefully I've just done a dumb thing that I can fix easily. I'm passing in a String full of XML, being 'XMLstring'. I want to get one of the elements and print the child nodes in a "name = value" on the console. The problem is that the console keeps printing garbage along with the element name that I cann... | OK I managed to resolve this issue, for anyone else who cares. The problem with the code is that the Node needs to be cast to an Element before you can get the tag name out of it in this manner. Therefore: try { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuild... | How do I stop getNodeName() also printing the node type I'm stumped, hopefully I've just done a dumb thing that I can fix easily. I'm passing in a String full of XML, being 'XMLstring'. I want to get one of the elements and print the child nodes in a "name = value" on the console. The problem is that the console keeps ... | TITLE:
How do I stop getNodeName() also printing the node type
QUESTION:
I'm stumped, hopefully I've just done a dumb thing that I can fix easily. I'm passing in a String full of XML, being 'XMLstring'. I want to get one of the elements and print the child nodes in a "name = value" on the console. The problem is that ... | [
"java",
"xml",
"netbeans"
] | 3 | 1 | 3,619 | 3 | 0 | 2011-06-02T16:49:59.110000 | 2011-06-03T08:27:54.583000 |
6,217,595 | 6,218,635 | Json parse result from virustotal api | I was playing around with the virustotal api today while becoming back the result in this form: { "permalink": "http://www.virustotal.com/file-scan/report.html?id=7b6b268cbca9d421aabba5f08533d3dcaba50e0f7887b07ef2bd66bf218b35ff-1304089592", "report": [ "2011-04-29 15:06:32", { "AVG": "Exploit_c.TVH", "AhnLab-V3": "PDF/... | Parsing Json string is not difficult, you can use the DBXJSON unit included since delphi 2010. check this sample code Uses DBXJSON;
procedure TForm1.ParseString(const AString: string); var json: TJSONObject; jPair: TJSONPair; jValue: TJSONValue; jcValue: TJSONValue; l,i: Integer; begin json:= TJSONObject.ParseJSONValu... | Json parse result from virustotal api I was playing around with the virustotal api today while becoming back the result in this form: { "permalink": "http://www.virustotal.com/file-scan/report.html?id=7b6b268cbca9d421aabba5f08533d3dcaba50e0f7887b07ef2bd66bf218b35ff-1304089592", "report": [ "2011-04-29 15:06:32", { "AVG... | TITLE:
Json parse result from virustotal api
QUESTION:
I was playing around with the virustotal api today while becoming back the result in this form: { "permalink": "http://www.virustotal.com/file-scan/report.html?id=7b6b268cbca9d421aabba5f08533d3dcaba50e0f7887b07ef2bd66bf218b35ff-1304089592", "report": [ "2011-04-29... | [
"json",
"delphi",
"delphi-2010",
"antivirus"
] | 5 | 5 | 2,581 | 2 | 0 | 2011-06-02T16:53:47.700000 | 2011-06-02T18:23:12.077000 |
6,217,601 | 6,217,859 | jQuery UI overlay not showing? | all. I am trying to get an overlay to work on my Modal box. How can I create a working overlay? I am using jQuery UI and have got it to work apart from the overlay. Here is the code to call the module: function showDialog(){ $("#example").dialog(); return false; }
$(window).resize(function() { $("#example").dialog("ce... | To make a dialog modal, all you have to do is specify true for the modal option: function showDialog(){ $("#example").dialog({ modal: true // Make the dialog "modal" (show an overlay beneath the dialog) }); return false; } Here 's an example on jQueryUI's website. | jQuery UI overlay not showing? all. I am trying to get an overlay to work on my Modal box. How can I create a working overlay? I am using jQuery UI and have got it to work apart from the overlay. Here is the code to call the module: function showDialog(){ $("#example").dialog(); return false; }
$(window).resize(functi... | TITLE:
jQuery UI overlay not showing?
QUESTION:
all. I am trying to get an overlay to work on my Modal box. How can I create a working overlay? I am using jQuery UI and have got it to work apart from the overlay. Here is the code to call the module: function showDialog(){ $("#example").dialog(); return false; }
$(win... | [
"jquery",
"jquery-ui"
] | 2 | 7 | 2,911 | 1 | 0 | 2011-06-02T16:54:07.620000 | 2011-06-02T17:19:46.257000 |
6,217,602 | 6,265,213 | Trouble Getting the Rails Server Started | When I run 'rails server' I get the following error: Could not find gem 'sqlite3 (>= 0, runtime)' in any of the gem sources listed in your Gemfile. My GemFile looks like this: gem 'sqlite3' Also when I run the port command it says it does not recognize that command: Mohammad-Azams-MacBook-Pro:blog azamsharp$ port insta... | If you have problems talking about /usr/local/bin/ruby extconf.rb checking for sqlite3.h then it's probably something to do with macports. First, make sure you have xcode installed. Run: gcc and you should get: i686-apple-darwin10-gcc-4.2.1: no input files If you do, then let's install homebrew Then, a list of commands... | Trouble Getting the Rails Server Started When I run 'rails server' I get the following error: Could not find gem 'sqlite3 (>= 0, runtime)' in any of the gem sources listed in your Gemfile. My GemFile looks like this: gem 'sqlite3' Also when I run the port command it says it does not recognize that command: Mohammad-Aza... | TITLE:
Trouble Getting the Rails Server Started
QUESTION:
When I run 'rails server' I get the following error: Could not find gem 'sqlite3 (>= 0, runtime)' in any of the gem sources listed in your Gemfile. My GemFile looks like this: gem 'sqlite3' Also when I run the port command it says it does not recognize that com... | [
"ruby-on-rails",
"ruby-on-rails-3",
"sqlite"
] | 0 | 3 | 1,038 | 6 | 0 | 2011-06-02T16:54:25.677000 | 2011-06-07T12:35:20.210000 |
6,217,616 | 6,218,226 | Debugging in SWI-prolog - unbound variables | Consider the following Prolog code. It edits lines of a particular type in its input and prints out the remaining lines w/o any change. It uses a DCG called rule which isn't included below, since it's not important to the question. go:- prompt(_, ''), processInput.
processInput:- read_line_to_codes(current_input, Code... | In Prolog the following is not the same:..., ( Cond -> Then; Else ),... and..., ( \+ Cond -> Else; Then ),... In general, a goal \+ Cond will never instantiate its variables. So you have to stick to the original formulation. In case you are interested to process entire files with DCGs, consider SWI's library(pio). | Debugging in SWI-prolog - unbound variables Consider the following Prolog code. It edits lines of a particular type in its input and prints out the remaining lines w/o any change. It uses a DCG called rule which isn't included below, since it's not important to the question. go:- prompt(_, ''), processInput.
processIn... | TITLE:
Debugging in SWI-prolog - unbound variables
QUESTION:
Consider the following Prolog code. It edits lines of a particular type in its input and prints out the remaining lines w/o any change. It uses a DCG called rule which isn't included below, since it's not important to the question. go:- prompt(_, ''), proces... | [
"debugging",
"prolog",
"dcg"
] | 3 | 4 | 788 | 1 | 0 | 2011-06-02T16:55:51.023000 | 2011-06-02T17:49:58.627000 |
6,217,621 | 6,217,812 | Is it possible to interact between ASP.Net page and Silverlight? | Say I have a Silverlight Child Windows that uses as a web browser to open access ASPX page. The ASP page will contains a close button, when user click the close button, it should close the Silverlight Child Window. I don't know if there is any way to do that? I wonder if I can use javascript to do it? | You can. Silverlight can communicate with the DOM and Javascript can communicate with the DOM. So, in since they both have a communication medium they can both communicate. Are you using the Browser control in silverlight to open the aspx page? or are you poping up a child browser window? Either way, it should be possi... | Is it possible to interact between ASP.Net page and Silverlight? Say I have a Silverlight Child Windows that uses as a web browser to open access ASPX page. The ASP page will contains a close button, when user click the close button, it should close the Silverlight Child Window. I don't know if there is any way to do t... | TITLE:
Is it possible to interact between ASP.Net page and Silverlight?
QUESTION:
Say I have a Silverlight Child Windows that uses as a web browser to open access ASPX page. The ASP page will contains a close button, when user click the close button, it should close the Silverlight Child Window. I don't know if there ... | [
"javascript",
"asp.net",
"silverlight-4.0",
"integration"
] | 1 | 3 | 856 | 1 | 0 | 2011-06-02T16:56:10.197000 | 2011-06-02T17:15:56.890000 |
6,217,622 | 6,217,727 | jQuery infinite loop on multiple animations on load | I have a range of animations (see code) that load on document load, i would like this to loop once it has played i have tried a few techniques but cant seem to get it right, could you please help me out! $(function(){
//hide all elements $('#ochreWrapper img').hide(); $('#ochreTextOne, #ochreTextTwo, #ochreTextThree')... | I don't know what you've tried, but using what you've got, put everything in a function, and call that function on load. On the last step of your animation, use a callback to call your animation again. $( function() {
// Make a function for your animation stuff function doAnimation() { //All of your animation stuff
/... | jQuery infinite loop on multiple animations on load I have a range of animations (see code) that load on document load, i would like this to loop once it has played i have tried a few techniques but cant seem to get it right, could you please help me out! $(function(){
//hide all elements $('#ochreWrapper img').hide()... | TITLE:
jQuery infinite loop on multiple animations on load
QUESTION:
I have a range of animations (see code) that load on document load, i would like this to loop once it has played i have tried a few techniques but cant seem to get it right, could you please help me out! $(function(){
//hide all elements $('#ochreWr... | [
"jquery",
"css",
"animation",
"jquery-animate"
] | 0 | 2 | 1,898 | 1 | 0 | 2011-06-02T16:56:10.667000 | 2011-06-02T17:06:16.153000 |
6,217,626 | 6,217,650 | How to keep PHP session intact when another server is making the request? | I have a secure site with private information that uses https. We have a partnership with another site that provides functionality for our users. We want the header and footer to be the same, but the body functionality to come from their site. I thought I'd create a template file that they can request from our server, ... | What you are trying to do in that way is a completely mess. You should avoid outtputting a page built from different website putted all togheter. That would become: Hard to maintain; Prone to security hole. | How to keep PHP session intact when another server is making the request? I have a secure site with private information that uses https. We have a partnership with another site that provides functionality for our users. We want the header and footer to be the same, but the body functionality to come from their site. I ... | TITLE:
How to keep PHP session intact when another server is making the request?
QUESTION:
I have a secure site with private information that uses https. We have a partnership with another site that provides functionality for our users. We want the header and footer to be the same, but the body functionality to come f... | [
"php",
"session",
"https"
] | 0 | 2 | 162 | 3 | 0 | 2011-06-02T16:56:23.533000 | 2011-06-02T16:58:45.920000 |
6,217,627 | 6,217,725 | Do not allow '&*' pair Textarea in Java Script | While adding text in a textarea, I dont want to allow '*' after '&'. I want to check on Asterisk keypress, whether previous symbol added is '&', if yes, user cannot add '*'. Kindly help, how to proceed. | You might be better off having a general function that runs after every "keyup" event which cleans up the textarea by removing any asterisks ( * ) immediately after an ampersand ( & ). This way, even if the user pastes some content which contains the invalid sequence ( &* ) it will still be cleaned up. So something lik... | Do not allow '&*' pair Textarea in Java Script While adding text in a textarea, I dont want to allow '*' after '&'. I want to check on Asterisk keypress, whether previous symbol added is '&', if yes, user cannot add '*'. Kindly help, how to proceed. | TITLE:
Do not allow '&*' pair Textarea in Java Script
QUESTION:
While adding text in a textarea, I dont want to allow '*' after '&'. I want to check on Asterisk keypress, whether previous symbol added is '&', if yes, user cannot add '*'. Kindly help, how to proceed.
ANSWER:
You might be better off having a general fu... | [
"javascript",
"textarea"
] | 2 | 3 | 268 | 3 | 0 | 2011-06-02T16:56:37.530000 | 2011-06-02T17:06:07.883000 |
6,217,628 | 6,217,722 | diff to output only the file names | I'm looking to run a Linux command that will recursively compare two directories and output only the file names of what is different. This includes anything that is present in one directory and not the other or vice versa, and text differences. | From the diff man page: -q Report only whether the files differ, not the details of the differences. -r When comparing directories, recursively compare any subdirectories found. Example command: diff -qr dir1 dir2 Example output (depends on locale): $ ls dir1 dir2 dir1: same-file different only-1
dir2: same-file diffe... | diff to output only the file names I'm looking to run a Linux command that will recursively compare two directories and output only the file names of what is different. This includes anything that is present in one directory and not the other or vice versa, and text differences. | TITLE:
diff to output only the file names
QUESTION:
I'm looking to run a Linux command that will recursively compare two directories and output only the file names of what is different. This includes anything that is present in one directory and not the other or vice versa, and text differences.
ANSWER:
From the diff... | [
"linux",
"command-line",
"diff"
] | 324 | 478 | 261,208 | 7 | 0 | 2011-06-02T16:56:50.617000 | 2011-06-02T17:06:04.077000 |
6,217,630 | 6,218,257 | jqGrid inline edit: how to save again if post returns error | jQgrid row is edited using inline editing mode. Pressing Enter sends data to server using http POST. POST method returns status 400 Bad reguest if there was some error. errorofunc in code below show error in this case. User corrects data in row and presses enter again. Pressing enter is ignored, nothing happens. It loo... | You use variable grid inside of errorfunc implementation ( grid.restoreAfterErorr ). The grid is undefined and you have exception in the line. UPDATED: ou should replace alert(response.responseText); to $.jgrid.info_dialog($.jgrid.errors.errcap,' '+ response.responseText +' ', $.jgrid.edit.bClose,{buttonalign:'right'})... | jqGrid inline edit: how to save again if post returns error jQgrid row is edited using inline editing mode. Pressing Enter sends data to server using http POST. POST method returns status 400 Bad reguest if there was some error. errorofunc in code below show error in this case. User corrects data in row and presses ent... | TITLE:
jqGrid inline edit: how to save again if post returns error
QUESTION:
jQgrid row is edited using inline editing mode. Pressing Enter sends data to server using http POST. POST method returns status 400 Bad reguest if there was some error. errorofunc in code below show error in this case. User corrects data in r... | [
"jquery",
"jqgrid"
] | 0 | 1 | 5,734 | 1 | 0 | 2011-06-02T16:57:03.893000 | 2011-06-02T17:52:08.690000 |
6,217,637 | 6,217,683 | Sending push notification from device to all contacts | I have an app where I would like to select a user in my contacts. If that person has my app installed, then I would like to send some data that is relevant for this app using a notification. The other user gets the notification, and acts on it within this app. Is that possible? I am thinking that if I can identify that... | No, you cannot. You have to have the Apple Push Token for a device and the user has to have notifications turned on to be able to receive notifications from Apple Push. You would need to maintain a server side database linking the APNS Token to a specific user account. There are a lot of dots to connect with this kind ... | Sending push notification from device to all contacts I have an app where I would like to select a user in my contacts. If that person has my app installed, then I would like to send some data that is relevant for this app using a notification. The other user gets the notification, and acts on it within this app. Is th... | TITLE:
Sending push notification from device to all contacts
QUESTION:
I have an app where I would like to select a user in my contacts. If that person has my app installed, then I would like to send some data that is relevant for this app using a notification. The other user gets the notification, and acts on it with... | [
"iphone",
"push-notification",
"apple-push-notifications"
] | 0 | 2 | 459 | 1 | 0 | 2011-06-02T16:57:33.303000 | 2011-06-02T17:02:27.390000 |
6,217,638 | 6,217,975 | Access ForeignKey set directly in template in Django | I have this simplified model: class Item(models.Model): name = models.CharField(max_length=120)
class ItemImage(models.Model): image = models.ImageField(upload_to='upload_dir') item = models.ForeignKey(Item) An Item can have many ItemImages. I also have a template rendering the following data set from the view: items ... | {% with item.itemimage_set.all|first as image %} {% endwith %} | Access ForeignKey set directly in template in Django I have this simplified model: class Item(models.Model): name = models.CharField(max_length=120)
class ItemImage(models.Model): image = models.ImageField(upload_to='upload_dir') item = models.ForeignKey(Item) An Item can have many ItemImages. I also have a template r... | TITLE:
Access ForeignKey set directly in template in Django
QUESTION:
I have this simplified model: class Item(models.Model): name = models.CharField(max_length=120)
class ItemImage(models.Model): image = models.ImageField(upload_to='upload_dir') item = models.ForeignKey(Item) An Item can have many ItemImages. I also... | [
"django",
"django-models"
] | 40 | 76 | 33,885 | 5 | 0 | 2011-06-02T16:57:43.300000 | 2011-06-02T17:29:34.410000 |
6,217,643 | 6,237,366 | is there a way to get postgres show actual i/o for query | I know that with EXPLAIN ANALYZE I can get the predicted cost and actual execution times (which are in different units, argh!), but is there a way to get Postgres to tell me how much I/O (logical or physical) that it has to do to satisfy a query? (I'm looking for the equivalent of "set statistics io on" for Sybase or M... | Starting in PostgreSQL 9.0, you can execute: EXPLAIN (ANALYZE ON, BUFFERS ON) SELECT... And it will show you how the statement interacted with PostgreSQL's cache. In cases where this reports a cache miss, that's going to be an OS call to read something. You can't be sure that's a physical I/O, because it may be in the ... | is there a way to get postgres show actual i/o for query I know that with EXPLAIN ANALYZE I can get the predicted cost and actual execution times (which are in different units, argh!), but is there a way to get Postgres to tell me how much I/O (logical or physical) that it has to do to satisfy a query? (I'm looking for... | TITLE:
is there a way to get postgres show actual i/o for query
QUESTION:
I know that with EXPLAIN ANALYZE I can get the predicted cost and actual execution times (which are in different units, argh!), but is there a way to get Postgres to tell me how much I/O (logical or physical) that it has to do to satisfy a query... | [
"postgresql"
] | 15 | 18 | 17,719 | 4 | 0 | 2011-06-02T16:58:07.217000 | 2011-06-04T14:43:54.510000 |
6,217,646 | 6,218,196 | setting variables in MXML while avoiding data binding? | I love MXML but am starting to notice some of its drawbacks. The main one I'm struggling with is its larger memory usage due to the need for binding. In the super simple code snippet below, which I've tested on Flex 4.0 import mx.events.FlexEvent; [Bindable] private var xPos:Number = 20; [Bindable] private var yPos:Num... | Well, it's kind of a loaded question. No matter what you do, if you add code, you're going to use memory. Now, 'eat up memory' is relative to what you're doing and I would love to see more information on the memory allocation of each use case. As for why one uses more memory than the other is a fairly simple (I think).... | setting variables in MXML while avoiding data binding? I love MXML but am starting to notice some of its drawbacks. The main one I'm struggling with is its larger memory usage due to the need for binding. In the super simple code snippet below, which I've tested on Flex 4.0 import mx.events.FlexEvent; [Bindable] privat... | TITLE:
setting variables in MXML while avoiding data binding?
QUESTION:
I love MXML but am starting to notice some of its drawbacks. The main one I'm struggling with is its larger memory usage due to the need for binding. In the super simple code snippet below, which I've tested on Flex 4.0 import mx.events.FlexEvent;... | [
"apache-flex",
"memory-management",
"mxml",
"flash"
] | 3 | 2 | 1,238 | 1 | 0 | 2011-06-02T16:58:28.263000 | 2011-06-02T17:46:41.920000 |
6,217,660 | 6,218,133 | Dynamic ObjectQuery<T> against EF 4 using parsed Entity SQL | I am trying to create a completely dynamic way to query entity framework using entity sql, where the type T in ObjectQuery (the table name, or entity name) is not known at compile time, and is passed into a method as a string, public class EntityQuery { public ObjectContext Context { get; private set; } public string T... | If you have Entity SQL as a string and you don't mind doing things the old-school ADO.NET way, you can always use EntityConnection, EntityCommand, and EntityDataReader directly. | Dynamic ObjectQuery<T> against EF 4 using parsed Entity SQL I am trying to create a completely dynamic way to query entity framework using entity sql, where the type T in ObjectQuery (the table name, or entity name) is not known at compile time, and is passed into a method as a string, public class EntityQuery { public... | TITLE:
Dynamic ObjectQuery<T> against EF 4 using parsed Entity SQL
QUESTION:
I am trying to create a completely dynamic way to query entity framework using entity sql, where the type T in ObjectQuery (the table name, or entity name) is not known at compile time, and is passed into a method as a string, public class En... | [
"c#",
"linq",
"entity-framework",
"dynamic",
"entity-sql"
] | 1 | 1 | 1,754 | 1 | 0 | 2011-06-02T16:59:54.237000 | 2011-06-02T17:41:28.913000 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.