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,287,603 | 6,287,687 | Working on a django site and wondering would it be wise to store my media on an nfs mounted partition? | First, I only have experience building small-medium sized websites with php so forgive me if this question seems asinine. I want to know if it is a common /accepted/wise practice to store media (user uploaded photos,videos,etc) in a mounted nfs share? I was just going to put all media in a /media folder like I always h... | I think you are probably getting ahead of yourself. You can always migrate the media to a separate server later. I don't think NFS would necessarily be the way to go anyways. Better to just serve the media from another box directly. If you want to design this to be scalable in advance, think about using GridFS, perhaps... | Working on a django site and wondering would it be wise to store my media on an nfs mounted partition? First, I only have experience building small-medium sized websites with php so forgive me if this question seems asinine. I want to know if it is a common /accepted/wise practice to store media (user uploaded photos,v... | TITLE:
Working on a django site and wondering would it be wise to store my media on an nfs mounted partition?
QUESTION:
First, I only have experience building small-medium sized websites with php so forgive me if this question seems asinine. I want to know if it is a common /accepted/wise practice to store media (user... | [
"django",
"scalability",
"nfs"
] | 4 | 2 | 277 | 1 | 0 | 2011-06-09T02:52:11.100000 | 2011-06-09T03:04:56.850000 |
6,287,604 | 6,289,165 | TCP/IP books for windows OS | I've heard about these TCP/IP books which apparently seem to focus on TCP/IP in UNIX TCP-Illustrated-Vol.1 TCP-Illustrated-Vol.2 Apart from the code introduced in these books, Are there any differences between TCP/IP implementation from windows? If yes, Can you suggest some other TCP/IP books for windows platform? | Network Programming for Microsoft Windows is THE book. It's quite old, but that doesn't matter. It's not a simple subject, the book can be a bit dense and it's not a hand holding 'for dummies' book, but I've yet to find a better book on the subject. Of course, you also probably want to have the two Stevens' books that ... | TCP/IP books for windows OS I've heard about these TCP/IP books which apparently seem to focus on TCP/IP in UNIX TCP-Illustrated-Vol.1 TCP-Illustrated-Vol.2 Apart from the code introduced in these books, Are there any differences between TCP/IP implementation from windows? If yes, Can you suggest some other TCP/IP book... | TITLE:
TCP/IP books for windows OS
QUESTION:
I've heard about these TCP/IP books which apparently seem to focus on TCP/IP in UNIX TCP-Illustrated-Vol.1 TCP-Illustrated-Vol.2 Apart from the code introduced in these books, Are there any differences between TCP/IP implementation from windows? If yes, Can you suggest some... | [
"c",
"winapi",
"tcp",
"winsock"
] | 2 | 1 | 429 | 2 | 0 | 2011-06-09T02:52:16.087000 | 2011-06-09T06:58:51.557000 |
6,287,610 | 6,287,726 | How to determine if the graphic or picture is damage? | I have Encrypted->Decrypted images and draw it to canvas. i got no error when assigning it to jpg(TJpegImage) DecryptJepegImage(PWordInfo(FWordList[i])^.Image, jpg); // No errors here but i got errors when im going to draw it to canvas. bmp.Canvas.StretchDraw(Rect(0, 0, bmp.Width, bmp.Height), jpg); // says Access viol... | That's not really enough information to go on. The one thing that I can be pretty sure of is that it's almost certainly not caused by damage to the encrypted image. Access Violation means invalid memory access somewhere. Either you're dereferencing a pointer that's nil, or you've got corrupted memory. Just going by my ... | How to determine if the graphic or picture is damage? I have Encrypted->Decrypted images and draw it to canvas. i got no error when assigning it to jpg(TJpegImage) DecryptJepegImage(PWordInfo(FWordList[i])^.Image, jpg); // No errors here but i got errors when im going to draw it to canvas. bmp.Canvas.StretchDraw(Rect(0... | TITLE:
How to determine if the graphic or picture is damage?
QUESTION:
I have Encrypted->Decrypted images and draw it to canvas. i got no error when assigning it to jpg(TJpegImage) DecryptJepegImage(PWordInfo(FWordList[i])^.Image, jpg); // No errors here but i got errors when im going to draw it to canvas. bmp.Canvas.... | [
"delphi",
"image"
] | 1 | 3 | 223 | 1 | 0 | 2011-06-09T02:53:20.797000 | 2011-06-09T03:13:44.913000 |
6,287,617 | 6,287,653 | Textbox/Dropdown Combination | I'm trying to "combine" the textbox and dropdown box. I can't seem to get them lined up though. My code: Item 1 Item 2 Item 3 | I've created a demo for you here: http://jsfiddle.net/aJaa6/ *note that I changed the widths so it would fit in the panel. CSS: #container { position: relative; }
#input { position: absolute; top: 0; left: 0; z-index: 999; padding: 0; margin: 0; }
#select { position: absolute; top: 0; left: 0; padding: 0; margin: 0; ... | Textbox/Dropdown Combination I'm trying to "combine" the textbox and dropdown box. I can't seem to get them lined up though. My code: Item 1 Item 2 Item 3 | TITLE:
Textbox/Dropdown Combination
QUESTION:
I'm trying to "combine" the textbox and dropdown box. I can't seem to get them lined up though. My code: Item 1 Item 2 Item 3
ANSWER:
I've created a demo for you here: http://jsfiddle.net/aJaa6/ *note that I changed the widths so it would fit in the panel. CSS: #container... | [
"html",
"css"
] | 5 | 5 | 48,572 | 4 | 0 | 2011-06-09T02:54:20.173000 | 2011-06-09T02:59:52.347000 |
6,287,619 | 6,287,779 | How to dynamically change Core Data entity column type? | How can I change the type of a Core Data entity column programmatically? For example, form String to Int 16. The entity can be assumed empty (no data row). | Firstly, it's not an SQL column, it's the attribute of an entity. Attributes have behaviors, columns in SQL do not. In answer to your question, once a data model model has been used to write data to a persistent store file (sqlite store or other formats) it cannot altered programatically. If you change an attribute, yo... | How to dynamically change Core Data entity column type? How can I change the type of a Core Data entity column programmatically? For example, form String to Int 16. The entity can be assumed empty (no data row). | TITLE:
How to dynamically change Core Data entity column type?
QUESTION:
How can I change the type of a Core Data entity column programmatically? For example, form String to Int 16. The entity can be assumed empty (no data row).
ANSWER:
Firstly, it's not an SQL column, it's the attribute of an entity. Attributes have... | [
"iphone",
"objective-c",
"core-data"
] | 0 | 3 | 789 | 2 | 0 | 2011-06-09T02:54:42.997000 | 2011-06-09T03:21:40.950000 |
6,287,626 | 6,287,657 | jquery ajax returning true but not display proper message? | I have the following code $(document).ready(function(){ // class exists if($('.delete').length) { // add click handler $('.delete').click(function(){ // ask for confirmation var result = confirm('Are you sure you want to delete this?'); var vid = $(this).attr('id'); var row = $(this).parents('tr'); // do ajax request i... | Try replacing if(response == "true") with if(response) if you are sure it is returning true/false. To check the type of data response is, try alert(typeof response) and see what it shows. Edit: Since you mention data type as JSON, make sure you return a valid response and set the content type to json in response. If yo... | jquery ajax returning true but not display proper message? I have the following code $(document).ready(function(){ // class exists if($('.delete').length) { // add click handler $('.delete').click(function(){ // ask for confirmation var result = confirm('Are you sure you want to delete this?'); var vid = $(this).attr('... | TITLE:
jquery ajax returning true but not display proper message?
QUESTION:
I have the following code $(document).ready(function(){ // class exists if($('.delete').length) { // add click handler $('.delete').click(function(){ // ask for confirmation var result = confirm('Are you sure you want to delete this?'); var vi... | [
"jquery"
] | 0 | 0 | 729 | 2 | 0 | 2011-06-09T02:55:54.623000 | 2011-06-09T03:00:43.890000 |
6,287,631 | 6,287,817 | Get all commits when pushing to server | I am making a git post-commit hook to post my commit messages to Twitter. I have set up the hook on the server, which means it only runs when I call git push. To interface with git from python, I am using GitPython. In my code, I am using repo.head.commit.message to get the latest commit message. Which means if I push ... | The githooks docs say: The hook executes once for each ref to be updated, and takes three parameters: - the name of the ref being updated, - the old object name stored in the ref, - and the new objectname to be stored in the ref. So, check the arguments your script gets, you should also get the new ref, and then you ca... | Get all commits when pushing to server I am making a git post-commit hook to post my commit messages to Twitter. I have set up the hook on the server, which means it only runs when I call git push. To interface with git from python, I am using GitPython. In my code, I am using repo.head.commit.message to get the latest... | TITLE:
Get all commits when pushing to server
QUESTION:
I am making a git post-commit hook to post my commit messages to Twitter. I have set up the hook on the server, which means it only runs when I call git push. To interface with git from python, I am using GitPython. In my code, I am using repo.head.commit.message... | [
"python",
"git",
"gitpython"
] | 1 | 3 | 418 | 1 | 0 | 2011-06-09T02:56:35.967000 | 2011-06-09T03:29:01.480000 |
6,287,632 | 6,287,766 | What is wrong with my Spring MessageSource setup? | I'm attempting to set up a ReloadableResourceBundleMessageSource to use in my JSPs and Controller. Here's the pieces I have. The message key is printing to the screen in my jsp. What am I missing? spring-servlet.xml /WEB-INF/messages/login login_en.properties login.title=Welcome to the login page. home.jsp | Yeah, this tripped me up for a long time too. The bean id has to be called messageSource. | What is wrong with my Spring MessageSource setup? I'm attempting to set up a ReloadableResourceBundleMessageSource to use in my JSPs and Controller. Here's the pieces I have. The message key is printing to the screen in my jsp. What am I missing? spring-servlet.xml /WEB-INF/messages/login login_en.properties login.titl... | TITLE:
What is wrong with my Spring MessageSource setup?
QUESTION:
I'm attempting to set up a ReloadableResourceBundleMessageSource to use in my JSPs and Controller. Here's the pieces I have. The message key is printing to the screen in my jsp. What am I missing? spring-servlet.xml /WEB-INF/messages/login login_en.pro... | [
"java",
"spring",
"jsp",
"spring-mvc"
] | 1 | 4 | 3,323 | 3 | 0 | 2011-06-09T02:57:09.870000 | 2011-06-09T03:20:26.100000 |
6,287,633 | 6,287,732 | Setting up content scripts for different sites in google-chrome | I looked at the google-chrome-extension labs page and I don't see any example where you can use different content scripts for different sites. They have a page showing how to have multiple content scripts on one site, but not the reverse. Is there any way to have different content scripts for different sites? | { "name": "My extension",... "content_scripts": [ { "matches": ["http://www.google.com/*"], "js": ["script1.js"] },{ "matches": ["http://www.yahoo.com/*"], "js": ["script2.js"] } ],... } | Setting up content scripts for different sites in google-chrome I looked at the google-chrome-extension labs page and I don't see any example where you can use different content scripts for different sites. They have a page showing how to have multiple content scripts on one site, but not the reverse. Is there any way ... | TITLE:
Setting up content scripts for different sites in google-chrome
QUESTION:
I looked at the google-chrome-extension labs page and I don't see any example where you can use different content scripts for different sites. They have a page showing how to have multiple content scripts on one site, but not the reverse.... | [
"google-chrome",
"google-chrome-extension"
] | 3 | 5 | 397 | 1 | 0 | 2011-06-09T02:57:11.163000 | 2011-06-09T03:15:09.157000 |
6,287,636 | 6,287,675 | AsyncTask only works first time | I'm trying to make a utility httpClient class My code works great the first execute. When debugging, the second execute won't step in, or execute, so something is messed up. The Activity/Listener protected String getPage(String url, List namevaluePairs, String postOrGet, Activity whichActivity, String dialogText) { try... | An AsyncTask can only be run once as stated in the documentation: http://developer.android.com/reference/android/os/AsyncTask.html So for every request you need to create a new helper object. Edit: Check this out: ThreadSafeClientConnManager | AsyncTask only works first time I'm trying to make a utility httpClient class My code works great the first execute. When debugging, the second execute won't step in, or execute, so something is messed up. The Activity/Listener protected String getPage(String url, List namevaluePairs, String postOrGet, Activity whichAc... | TITLE:
AsyncTask only works first time
QUESTION:
I'm trying to make a utility httpClient class My code works great the first execute. When debugging, the second execute won't step in, or execute, so something is messed up. The Activity/Listener protected String getPage(String url, List namevaluePairs, String postOrGet... | [
"android",
"asynchronous",
"android-asynctask"
] | 1 | 2 | 837 | 2 | 0 | 2011-06-09T02:57:29.307000 | 2011-06-09T03:02:49.327000 |
6,287,640 | 6,290,914 | How do you fix this Ruby on Rails and Gravatar gem bug? | I'm trying to use the gravatar_image_tag RoR plug-in and it is giving me this error, when I start up the rails console or the rails server. What do I do to fix it? /Library/Ruby/Gems/1.8/gems/actionpack-3.1.0.beta1/lib/action_view/helpers/asset_tag_helpers/asset_paths.rb:66: uninitialized constant ActionView::Helpers::... | It's possible your plugin isn't compatible with your version of rails. Gravatar images aren't that hard to do with out a plugin. Here is a solution by Ryan Bates for Gravatars application_helper.rb def avatar_url(user) if user.avatar_url.present? user.avatar_url else default_url = "#{root_url}images/guest.png" gravatar... | How do you fix this Ruby on Rails and Gravatar gem bug? I'm trying to use the gravatar_image_tag RoR plug-in and it is giving me this error, when I start up the rails console or the rails server. What do I do to fix it? /Library/Ruby/Gems/1.8/gems/actionpack-3.1.0.beta1/lib/action_view/helpers/asset_tag_helpers/asset_p... | TITLE:
How do you fix this Ruby on Rails and Gravatar gem bug?
QUESTION:
I'm trying to use the gravatar_image_tag RoR plug-in and it is giving me this error, when I start up the rails console or the rails server. What do I do to fix it? /Library/Ruby/Gems/1.8/gems/actionpack-3.1.0.beta1/lib/action_view/helpers/asset_t... | [
"ruby-on-rails",
"rubygems",
"gravatar"
] | 1 | 2 | 389 | 1 | 0 | 2011-06-09T02:57:45.460000 | 2011-06-09T09:45:53 |
6,287,646 | 6,287,707 | XPath: How to: select all children and grandchildren (regardless of depth) with the given attribute name of the current context? | xml: the depth is unknown. How can I select all elements with xlink:href attribute? I tried the following: *[@xlink:href] self::*[@xlink:href] Any guidance is appreciated. | For just children of grandchildren use descendant-or-self::*[@xlink:href] For all nodes just add // in front of your xpath //*[@xlink:href] Also, your xml sample is not valid but I'm guessing it is just a sample. | XPath: How to: select all children and grandchildren (regardless of depth) with the given attribute name of the current context? xml: the depth is unknown. How can I select all elements with xlink:href attribute? I tried the following: *[@xlink:href] self::*[@xlink:href] Any guidance is appreciated. | TITLE:
XPath: How to: select all children and grandchildren (regardless of depth) with the given attribute name of the current context?
QUESTION:
xml: the depth is unknown. How can I select all elements with xlink:href attribute? I tried the following: *[@xlink:href] self::*[@xlink:href] Any guidance is appreciated.
... | [
"xml",
"xpath",
"depth"
] | 5 | 5 | 13,834 | 2 | 0 | 2011-06-09T02:58:33.880000 | 2011-06-09T03:09:12.157000 |
6,287,650 | 6,290,203 | Rendering SVG with OpenGL (and OpenGL ES) | I am currently investigating the possibility of rendering vector graphics from an SVG file using OpenGL and OpenGL ES. I intend to target Windows and Android. My ideal solution would be to have a minimal C library that generates a polygon triangulation from a given SVG file. This would then generate standard OpenGL or ... | From http://shivavg.svn.sourceforge.net/viewvc/shivavg/trunk/src/shPipeline.c?revision=14&view=markup: static void shDrawVertices(SHPath *p, GLenum mode) { int start = 0; int size = 0;
/* We separate vertex arrays by contours to properly handle the fill modes */ glEnableClientState(GL_VERTEX_ARRAY); glVertexPointer(2,... | Rendering SVG with OpenGL (and OpenGL ES) I am currently investigating the possibility of rendering vector graphics from an SVG file using OpenGL and OpenGL ES. I intend to target Windows and Android. My ideal solution would be to have a minimal C library that generates a polygon triangulation from a given SVG file. Th... | TITLE:
Rendering SVG with OpenGL (and OpenGL ES)
QUESTION:
I am currently investigating the possibility of rendering vector graphics from an SVG file using OpenGL and OpenGL ES. I intend to target Windows and Android. My ideal solution would be to have a minimal C library that generates a polygon triangulation from a ... | [
"android",
"opengl",
"opengl-es",
"svg",
"vector-graphics"
] | 63 | 3 | 37,379 | 6 | 0 | 2011-06-09T02:59:19.003000 | 2011-06-09T08:45:15.453000 |
6,287,655 | 6,291,881 | Ant equivalent of cut | sort | uniq | In an Ant task I set a property which is a list of files. e.g. web/src/main/test/com/whatever/Ralph business/src/main/test/com/whatever/Alice web/src/main/test/com/whatever/Bob I would like to extract the set of subdirectories from this list. In bash I'd: $ cat filename | cut -d'/' -f1 | sort | uniq business web Is the... | You can do this using a loadresource task with a filterchain. Something like this perhaps: web/src/main/test/com/whatever/Ralph business/src/main/test/com/whatever/Alice web/src/main/test/com/whatever/Bob Result: [echo] business [echo] web
BUILD SUCCESSFUL In older versions of Ant (<1.7) you could do the same by writi... | Ant equivalent of cut | sort | uniq In an Ant task I set a property which is a list of files. e.g. web/src/main/test/com/whatever/Ralph business/src/main/test/com/whatever/Alice web/src/main/test/com/whatever/Bob I would like to extract the set of subdirectories from this list. In bash I'd: $ cat filename | cut -d'/' -... | TITLE:
Ant equivalent of cut | sort | uniq
QUESTION:
In an Ant task I set a property which is a list of files. e.g. web/src/main/test/com/whatever/Ralph business/src/main/test/com/whatever/Alice web/src/main/test/com/whatever/Bob I would like to extract the set of subdirectories from this list. In bash I'd: $ cat file... | [
"ant"
] | 2 | 2 | 1,827 | 1 | 0 | 2011-06-09T03:00:31.680000 | 2011-06-09T11:12:57.563000 |
6,287,665 | 6,287,709 | [cakephp][l10n] merge language file (.po) in cakephp | i am using cakephp 1.2, i have 2 language file, english and chinese, english is default language. i have a problem here, if the message id not exist in chinese language, it will display out the message id. Is it possible i get from default language if message id not exist in the current language po file? | The common paradigm is to use the default language as the language file keys like: __('Posts') Where the English language file may not define any translations, and the Chinese could define them all, or none. If the system doesn't find a matching key in the current language po file, it will simply use the key passed to ... | [cakephp][l10n] merge language file (.po) in cakephp i am using cakephp 1.2, i have 2 language file, english and chinese, english is default language. i have a problem here, if the message id not exist in chinese language, it will display out the message id. Is it possible i get from default language if message id not ... | TITLE:
[cakephp][l10n] merge language file (.po) in cakephp
QUESTION:
i am using cakephp 1.2, i have 2 language file, english and chinese, english is default language. i have a problem here, if the message id not exist in chinese language, it will display out the message id. Is it possible i get from default language ... | [
"cakephp",
"localization"
] | 0 | 1 | 421 | 1 | 0 | 2011-06-09T03:01:50.223000 | 2011-06-09T03:09:42.590000 |
6,287,670 | 6,290,259 | MVC 3 - How to RedirectToAction immediately after asynchronous WCF call | How do i get my MVCcontroller method to call a long running WCF task asynchronously and redirect immediately after the asynchronously call is fired? I have configured my WCF service reference to "Generate asynchronously operations" yet when the method is called i can see in the debugger that code steps through and pass... | The whole point of asynchronous methods is that they should not block. Your test method is not asynchronous. Use a true async WCF call and a async controller = nothing will block. | MVC 3 - How to RedirectToAction immediately after asynchronous WCF call How do i get my MVCcontroller method to call a long running WCF task asynchronously and redirect immediately after the asynchronously call is fired? I have configured my WCF service reference to "Generate asynchronously operations" yet when the met... | TITLE:
MVC 3 - How to RedirectToAction immediately after asynchronous WCF call
QUESTION:
How do i get my MVCcontroller method to call a long running WCF task asynchronously and redirect immediately after the asynchronously call is fired? I have configured my WCF service reference to "Generate asynchronously operations... | [
"c#",
"asp.net-mvc",
"wcf",
"asp.net-mvc-3",
"asynchronous"
] | 2 | 1 | 3,032 | 4 | 0 | 2011-06-09T03:02:25.380000 | 2011-06-09T08:49:34.887000 |
6,287,676 | 6,287,748 | how to insert a line using into a file in alphabetical order using shell script | How can i insert lines into a file using shell script such that they are inserted in alphabetical order, following would explain better. input file contains: 1 hsdfd 2 bsdfd 3 ekksdf.. i want to insert these contents into another file using shell script such that they are as below,sorted on the alphabetical order: < ro... | echo "1 hsdfd 2 bsdfd 3 ekksdf " | sort -k 2
2 bsdfd 3 ekksdf 1 hsdfd So if there is a second file, and you want the result being sorted: cat file1 file2 | sort -k 2 > sorted updated: After your edit, I would use sed for the main work, after invoking sort: echo "1 hsdfd 2 bsdfd 3 ekksdf" | sort -k 2 | sed -r 's/(.*) (... | how to insert a line using into a file in alphabetical order using shell script How can i insert lines into a file using shell script such that they are inserted in alphabetical order, following would explain better. input file contains: 1 hsdfd 2 bsdfd 3 ekksdf.. i want to insert these contents into another file using... | TITLE:
how to insert a line using into a file in alphabetical order using shell script
QUESTION:
How can i insert lines into a file using shell script such that they are inserted in alphabetical order, following would explain better. input file contains: 1 hsdfd 2 bsdfd 3 ekksdf.. i want to insert these contents into ... | [
"linux",
"shell",
"unix"
] | 2 | 2 | 2,485 | 2 | 0 | 2011-06-09T03:02:59.500000 | 2011-06-09T03:17:20.540000 |
6,287,679 | 6,288,913 | Sencha Touch List Component Inside Tabbed Toolbar | I am working with the Sencha touch framework and there list item component. I have only been working with this for about 2 weeks now and I can not figure out how to get the "onItemDisclosure" to open up the "detailPanel". I am trying to follow this example: http://vimeo.com/19245335. I have pasted my code below. Any he... | Are you getting any javascript errors? According to the docs setActiveItem either needs a component instance, a number (card index), or a config object, e.g. {xtype:'detailPanel'} If you want to make a new detail panel active try GoW3Guide.views.Guidescard.setActiveItem({xtype:'detailpanel'}); or GoW3Guide.views.Guides... | Sencha Touch List Component Inside Tabbed Toolbar I am working with the Sencha touch framework and there list item component. I have only been working with this for about 2 weeks now and I can not figure out how to get the "onItemDisclosure" to open up the "detailPanel". I am trying to follow this example: http://vimeo... | TITLE:
Sencha Touch List Component Inside Tabbed Toolbar
QUESTION:
I am working with the Sencha touch framework and there list item component. I have only been working with this for about 2 weeks now and I can not figure out how to get the "onItemDisclosure" to open up the "detailPanel". I am trying to follow this exa... | [
"javascript",
"html",
"sencha-touch"
] | 1 | 0 | 718 | 1 | 0 | 2011-06-09T03:03:13.827000 | 2011-06-09T06:30:55.137000 |
6,287,684 | 6,287,871 | Using the ASP.NET ClientServerManager method or property to get name of control | Does the ASP.NET ClientServerManager provide some method or property to return the name of an ASP.NET control in the generated html page that could be used to write the javascript (using RegisterClientScriptBlock) in the code-behind? The actual generated control names can be quite long and unknown (I am also using mast... | Control.ClientID is rendered as html tag ID, so you can use that property. | Using the ASP.NET ClientServerManager method or property to get name of control Does the ASP.NET ClientServerManager provide some method or property to return the name of an ASP.NET control in the generated html page that could be used to write the javascript (using RegisterClientScriptBlock) in the code-behind? The ac... | TITLE:
Using the ASP.NET ClientServerManager method or property to get name of control
QUESTION:
Does the ASP.NET ClientServerManager provide some method or property to return the name of an ASP.NET control in the generated html page that could be used to write the javascript (using RegisterClientScriptBlock) in the c... | [
"asp.net"
] | 0 | 1 | 87 | 2 | 0 | 2011-06-09T03:04:45.770000 | 2011-06-09T03:46:09.700000 |
6,287,694 | 6,287,822 | Is it possible to have a grails app choose between hibernate and mongodb at runtime | I'm trying to build a Grails App. I want the user who installs this grails app on their tomcat instance be able to choose whether they want to use hibernate with an rdbms or mongodb while deploying the app. Is it possible to have both plugins hibernate and mongodb and pick one based on a config file? Alternately is it ... | The second option is your best bet. If both plugins are installed you need to use the mapWith attribute to indicate which to use, and that's a static field in your domain classes. But if you don't install the Mongo plugin all domain classes will use Hibernate, and if you uninstall the Hibernate plugin and install the M... | Is it possible to have a grails app choose between hibernate and mongodb at runtime I'm trying to build a Grails App. I want the user who installs this grails app on their tomcat instance be able to choose whether they want to use hibernate with an rdbms or mongodb while deploying the app. Is it possible to have both p... | TITLE:
Is it possible to have a grails app choose between hibernate and mongodb at runtime
QUESTION:
I'm trying to build a Grails App. I want the user who installs this grails app on their tomcat instance be able to choose whether they want to use hibernate with an rdbms or mongodb while deploying the app. Is it possi... | [
"grails"
] | 1 | 2 | 303 | 1 | 0 | 2011-06-09T03:07:03.427000 | 2011-06-09T03:30:01.487000 |
6,287,703 | 6,287,704 | What's the meaning of the field strmap in the struct load_info? | I'm studying the mechanism of module loading inside the linux kernel, and I'm stuck at the meaning of the field strmap inside the struct load_info. The struct is defined in kernel/module.c and the field is filled in kernel/module.c. I know it is a bitmap, but I can't figure out the meaning of the individual bits. | (I couldn't find anything on LWN. This is a partial analysis of the code. Note that strmap existed as a separate variable before struct load_info was introduced.) strtab contains a bunch of null-terminated strings concatenated together. E.g. it might contain this, where. stands for a null character: foo.bar.quux.corge.... | What's the meaning of the field strmap in the struct load_info? I'm studying the mechanism of module loading inside the linux kernel, and I'm stuck at the meaning of the field strmap inside the struct load_info. The struct is defined in kernel/module.c and the field is filled in kernel/module.c. I know it is a bitmap, ... | TITLE:
What's the meaning of the field strmap in the struct load_info?
QUESTION:
I'm studying the mechanism of module loading inside the linux kernel, and I'm stuck at the meaning of the field strmap inside the struct load_info. The struct is defined in kernel/module.c and the field is filled in kernel/module.c. I kno... | [
"linux",
"kernel",
"dynamic-linking",
"module"
] | 1 | 1 | 161 | 1 | 0 | 2011-06-08T20:31:42.303000 | 2011-06-08T22:15:21.717000 |
6,287,714 | 6,287,844 | getResources and String Array forces close | I am new to android programming and it's been some years since I have done any Java programming. I have declared a string-array in the XML strings.xml: Question Introduction Question1 Question 2 I then start an Activity called Coastal. Then, I begin a second activity by pushing a button, starting the activity Foreshore... | You can't call getResources() before your activity class is "officially" instantiated (it's an instance method, and at that point you don't have an instance yet). Move your String array initialization to your onCreate(). | getResources and String Array forces close I am new to android programming and it's been some years since I have done any Java programming. I have declared a string-array in the XML strings.xml: Question Introduction Question1 Question 2 I then start an Activity called Coastal. Then, I begin a second activity by pushin... | TITLE:
getResources and String Array forces close
QUESTION:
I am new to android programming and it's been some years since I have done any Java programming. I have declared a string-array in the XML strings.xml: Question Introduction Question1 Question 2 I then start an Activity called Coastal. Then, I begin a second ... | [
"android",
"arrays"
] | 2 | 6 | 1,278 | 1 | 0 | 2011-06-09T03:11:31.433000 | 2011-06-09T03:36:02.870000 |
6,287,716 | 6,291,398 | Is there a way to see the final frame of a MovieClip from its parent timeline? | I work on a truckload of flash banners and have progressed more into dispatching events from the final frame of a MovieClip that would contain an object (or collection of closely related objects) animating and then listening for them from the parent timeline so that I know when to continue the main animation etc. In th... | My completely manual way of dealing with this is to put a placeholder graphic on the first frame and some code to skip that first frame when actually playing. It's not perfect but it does the job rather well. | Is there a way to see the final frame of a MovieClip from its parent timeline? I work on a truckload of flash banners and have progressed more into dispatching events from the final frame of a MovieClip that would contain an object (or collection of closely related objects) animating and then listening for them from th... | TITLE:
Is there a way to see the final frame of a MovieClip from its parent timeline?
QUESTION:
I work on a truckload of flash banners and have progressed more into dispatching events from the final frame of a MovieClip that would contain an object (or collection of closely related objects) animating and then listenin... | [
"flash",
"animation",
"adobe",
"timeline"
] | 0 | 1 | 506 | 3 | 0 | 2011-06-09T03:11:36.147000 | 2011-06-09T10:30:24.917000 |
6,287,719 | 6,289,279 | nodejs - mongodb - how to find all where a != b? | This is collection sessions { "_id": "R65i3SmvucW9imK2cxA6wdFb.GXoSHjly7obzFNslklNCBvE0UrW/qOiNmiBtPN24/1c", "session": { "channel": "all", "username": "xuka" }, "expires": NumberLong("1307692520000") } { "_id": "zJYZj2jwxa5zN0uZcCZC26zp.Tpp8fVkqwKLZEpRWgq7/3DDTcDw9VSlskBum28gox+0", "session": {
"channel": "3", "usern... | Try var k =3; db.collection('sessions', function(err, collection){ collection.find({'session.channel':{'$ne':k+''}},function(err, cursor) { }); }); Because each sessions collection's item contain an object "session" which contain an attribute "channel". | nodejs - mongodb - how to find all where a != b? This is collection sessions { "_id": "R65i3SmvucW9imK2cxA6wdFb.GXoSHjly7obzFNslklNCBvE0UrW/qOiNmiBtPN24/1c", "session": { "channel": "all", "username": "xuka" }, "expires": NumberLong("1307692520000") } { "_id": "zJYZj2jwxa5zN0uZcCZC26zp.Tpp8fVkqwKLZEpRWgq7/3DDTcDw9VSlsk... | TITLE:
nodejs - mongodb - how to find all where a != b?
QUESTION:
This is collection sessions { "_id": "R65i3SmvucW9imK2cxA6wdFb.GXoSHjly7obzFNslklNCBvE0UrW/qOiNmiBtPN24/1c", "session": { "channel": "all", "username": "xuka" }, "expires": NumberLong("1307692520000") } { "_id": "zJYZj2jwxa5zN0uZcCZC26zp.Tpp8fVkqwKLZEpR... | [
"mongodb",
"node.js"
] | 3 | 9 | 3,966 | 1 | 0 | 2011-06-09T03:12:41.900000 | 2011-06-09T07:09:08.667000 |
6,287,733 | 6,287,753 | C#: Initializing class variables | Possible Duplicate: C# member variable initialization; best practice? Which is the right way to initialize class variables. What is the difference between [1] and [2]. //[1] public class Person { private int mPersonID = 0; private string mPersonName = ""; } OR //[2] public class Person { private int mPersonID = 0; priv... | Instance variables that are assigned a default value as part of their declaration will get this value assigned right before the constructor is run, from the outside there is no perceptible difference in behavior between 1) and 2), it's mostly a matter of style. You also introduce an additional InitializePerson() method... | C#: Initializing class variables Possible Duplicate: C# member variable initialization; best practice? Which is the right way to initialize class variables. What is the difference between [1] and [2]. //[1] public class Person { private int mPersonID = 0; private string mPersonName = ""; } OR //[2] public class Person ... | TITLE:
C#: Initializing class variables
QUESTION:
Possible Duplicate: C# member variable initialization; best practice? Which is the right way to initialize class variables. What is the difference between [1] and [2]. //[1] public class Person { private int mPersonID = 0; private string mPersonName = ""; } OR //[2] pu... | [
"c#",
".net",
"constructor",
"class-design"
] | 4 | 6 | 30,454 | 3 | 0 | 2011-06-09T03:15:29.673000 | 2011-06-09T03:18:34.317000 |
6,287,734 | 6,287,792 | Special character in AJAX request | I have a problem concerning the input of special characters. Firstly, + is considered as a special character, right? I have a field in my form that needs to be able to contain a +. However, when I send it to my PHP script using AJAX and access the variable using $_POST, the + is not displayed, and therefore, not saved ... | A + is redundant on a number; change +123 to "+123". If your JavaScript library does not escape that, also do encodeURIComponent(value) instead of value. So, your fixed code should be: value = "+123"; paramPost = "name=abc&value=" + encodeURIComponent(value);
//..
ajax.doPost(paramPost); | Special character in AJAX request I have a problem concerning the input of special characters. Firstly, + is considered as a special character, right? I have a field in my form that needs to be able to contain a +. However, when I send it to my PHP script using AJAX and access the variable using $_POST, the + is not di... | TITLE:
Special character in AJAX request
QUESTION:
I have a problem concerning the input of special characters. Firstly, + is considered as a special character, right? I have a field in my form that needs to be able to contain a +. However, when I send it to my PHP script using AJAX and access the variable using $_POS... | [
"php",
"javascript",
"ajax",
"special-characters",
"http-post"
] | 0 | 3 | 1,648 | 2 | 0 | 2011-06-09T03:15:43.087000 | 2011-06-09T03:24:40.060000 |
6,287,738 | 6,287,756 | Why od is not ordering bytes correctly? | Here's the output dumped from od -cx (on linux you can reproduce with echo -ne "\r\n\n" |od -cx ): 0000000 \r \n \n \0 0a0d 000a 0000003 The correct first 2 bytes should be 0d0a but it outputs 0a0d,why? | because you're on a little-endian system? a 16-bit integer will be the high byte followed by the low byte; in this case the 2nd byte followed by the first. | Why od is not ordering bytes correctly? Here's the output dumped from od -cx (on linux you can reproduce with echo -ne "\r\n\n" |od -cx ): 0000000 \r \n \n \0 0a0d 000a 0000003 The correct first 2 bytes should be 0d0a but it outputs 0a0d,why? | TITLE:
Why od is not ordering bytes correctly?
QUESTION:
Here's the output dumped from od -cx (on linux you can reproduce with echo -ne "\r\n\n" |od -cx ): 0000000 \r \n \n \0 0a0d 000a 0000003 The correct first 2 bytes should be 0d0a but it outputs 0a0d,why?
ANSWER:
because you're on a little-endian system? a 16-bit... | [
"byte"
] | 1 | 4 | 123 | 3 | 0 | 2011-06-09T03:16:03.603000 | 2011-06-09T03:19:16.720000 |
6,287,743 | 6,289,891 | How to search the tags file and load it automatically when vim start up | Vim is my favorite editor, when I open a php or python file in vim, the first command is: set tags=../../../tags or set tags=../../tags I think vim can do this automatically: first search./tags, if it is exists, set it, if not exists search../tags,if it is exists, set it, if not exists search../../tags,if it is exists,... | There are a few comments on this particular subject on this question. Basically, this is supposed to work: set tags=./tags;/ It starts with a tags file in the current directory and goes up to the root directory. Type:help tags-option for more details. | How to search the tags file and load it automatically when vim start up Vim is my favorite editor, when I open a php or python file in vim, the first command is: set tags=../../../tags or set tags=../../tags I think vim can do this automatically: first search./tags, if it is exists, set it, if not exists search../tags,... | TITLE:
How to search the tags file and load it automatically when vim start up
QUESTION:
Vim is my favorite editor, when I open a php or python file in vim, the first command is: set tags=../../../tags or set tags=../../tags I think vim can do this automatically: first search./tags, if it is exists, set it, if not exi... | [
"vim",
"tags",
"editor",
"cscope"
] | 11 | 22 | 8,814 | 1 | 0 | 2011-06-09T03:17:02.807000 | 2011-06-09T08:12:12.350000 |
6,287,747 | 6,287,862 | Remove entire row from table with HTML::TableExtract | Is there a way to remove an entire row (html tags 'n all) from an HTML Table with HTML::TableExtract? Mucking around with the sample code from CPAN, this is what I've tried so far: use HTML::TableExtract qw(tree);
my $te = HTML::TableExtract->new( headers => [qw(name type members)] );
# get $html_string out of a file... | What you want is the parent and delete methods See the docs for HTML::Element and for HTML::Element::delete UPDATE Ok, click that checkmark and mark this one as answered....Here it is: my($p) = $table_tree->row(4)->parent(); $p->delete; Also, NOTE, you need the () parens around $p! If you don't have parens don't get ba... | Remove entire row from table with HTML::TableExtract Is there a way to remove an entire row (html tags 'n all) from an HTML Table with HTML::TableExtract? Mucking around with the sample code from CPAN, this is what I've tried so far: use HTML::TableExtract qw(tree);
my $te = HTML::TableExtract->new( headers => [qw(nam... | TITLE:
Remove entire row from table with HTML::TableExtract
QUESTION:
Is there a way to remove an entire row (html tags 'n all) from an HTML Table with HTML::TableExtract? Mucking around with the sample code from CPAN, this is what I've tried so far: use HTML::TableExtract qw(tree);
my $te = HTML::TableExtract->new( ... | [
"html",
"perl",
"html-table"
] | 1 | 3 | 976 | 1 | 0 | 2011-06-09T03:17:19.570000 | 2011-06-09T03:42:18.107000 |
6,287,755 | 6,287,940 | Using sed to delete all lines between two matching patterns | I have a file something like: # ID 1 blah blah blah blah $ description 1 blah blah # ID 2 blah $ description 2 blah blah blah blah How can I use a sed command to delete all lines between the # and $ line? So the result will become: # ID 1 $ description 1 blah blah # ID 2 $ description 2 blah blah blah blah Can you plea... | Use this sed command to achieve that: sed '/^#/,/^\$/{/^#/!{/^\$/!d}}' file.txt Mac users (to prevent extra characters at the end of d command error) need to add semicolons before the closing brackets sed '/^#/,/^\$/{/^#/!{/^\$/!d;};}' file.txt OUTPUT # ID 1 $ description 1 blah blah # ID 2 $ description 2 blah blah bl... | Using sed to delete all lines between two matching patterns I have a file something like: # ID 1 blah blah blah blah $ description 1 blah blah # ID 2 blah $ description 2 blah blah blah blah How can I use a sed command to delete all lines between the # and $ line? So the result will become: # ID 1 $ description 1 blah ... | TITLE:
Using sed to delete all lines between two matching patterns
QUESTION:
I have a file something like: # ID 1 blah blah blah blah $ description 1 blah blah # ID 2 blah $ description 2 blah blah blah blah How can I use a sed command to delete all lines between the # and $ line? So the result will become: # ID 1 $ d... | [
"regex",
"sed"
] | 110 | 110 | 95,409 | 6 | 0 | 2011-06-09T03:19:08.920000 | 2011-06-09T03:59:51.960000 |
6,287,770 | 6,301,055 | echo problems in PHP | I dont know how to repost questions so im just gonna link my old post here some item won't echo after putting some condition in php although some problems were solved there thanks to @Shinkou, there are still errors found in my program.I tried to figure out what caused this problem but i found no luck in solving them. ... | I have finally discovered what went wrong with my problem. Although my codes became longer that ever. So here's what I did, I added new query for my conditions "pending", "notapproved" and "approved" its the same query actually, i just added AND e. confirmation LIKE 'Pending' in the newupload page and AND e. confirmati... | echo problems in PHP I dont know how to repost questions so im just gonna link my old post here some item won't echo after putting some condition in php although some problems were solved there thanks to @Shinkou, there are still errors found in my program.I tried to figure out what caused this problem but i found no l... | TITLE:
echo problems in PHP
QUESTION:
I dont know how to repost questions so im just gonna link my old post here some item won't echo after putting some condition in php although some problems were solved there thanks to @Shinkou, there are still errors found in my program.I tried to figure out what caused this proble... | [
"php",
"html",
"while-loop",
"echo"
] | 2 | 1 | 1,599 | 1 | 0 | 2011-06-09T03:20:44.687000 | 2011-06-10T01:22:37.833000 |
6,287,772 | 6,298,373 | decompress a stylesheet using sed | im compressing a stylesheet into 1 line, using cat stylesheet.css | gsed "s|/\*\(\\\\\)\?\*/|/~\1~/|g" -e "s|/\*[^*]*\*\+\([^/][^*]*\*\+\)*/||g" -e "s|\([^:/]\)//.*$|\1|" -e "s|^//.*$||" | tr '\n' ' ' | sed -e "s|/\*[^*]*\*\+\([^/][^*]*\*\+\)*/||g" -e "s|/\~\(\\\\\)\?\~/|/*\1*/|g" -e "s|\s\+| |g" -e "s| \([{;:,]\)|\1|g... | I think you're looking for a CSS formatter. There are lots of them online. E.g. http://www.lonniebest.com/FormatCSS/. If you have to do it from shell, I'd spawn to another program to do the heavy lifting. http://cthedot.de/cssutils/ will do the trick. | decompress a stylesheet using sed im compressing a stylesheet into 1 line, using cat stylesheet.css | gsed "s|/\*\(\\\\\)\?\*/|/~\1~/|g" -e "s|/\*[^*]*\*\+\([^/][^*]*\*\+\)*/||g" -e "s|\([^:/]\)//.*$|\1|" -e "s|^//.*$||" | tr '\n' ' ' | sed -e "s|/\*[^*]*\*\+\([^/][^*]*\*\+\)*/||g" -e "s|/\~\(\\\\\)\?\~/|/*\1*/|g" -e "... | TITLE:
decompress a stylesheet using sed
QUESTION:
im compressing a stylesheet into 1 line, using cat stylesheet.css | gsed "s|/\*\(\\\\\)\?\*/|/~\1~/|g" -e "s|/\*[^*]*\*\+\([^/][^*]*\*\+\)*/||g" -e "s|\([^:/]\)//.*$|\1|" -e "s|^//.*$||" | tr '\n' ' ' | sed -e "s|/\*[^*]*\*\+\([^/][^*]*\*\+\)*/||g" -e "s|/\~\(\\\\\)\?... | [
"css",
"regex",
"bash",
"sed",
"compression"
] | 3 | 3 | 1,822 | 1 | 0 | 2011-06-09T03:20:56.703000 | 2011-06-09T19:46:53.513000 |
6,287,801 | 6,287,826 | Reasons behind targeting multiple frameworks? | I'm see a lot of projects which releases, for example, library for multiple.net FX-es (2.0, 3.5, 4.0). Is there any major reasons to target multiple FX if code will be the same (no questions if code is different, of course)? Also, in my opinion, the lower the FX version, the more possibilities to use library in project... | A big reason would be down to the user's machine and the version of the.NET runtime they have installed. By targetting the lowest common denominator, you can ensure you get maximum reach and compatibility. | Reasons behind targeting multiple frameworks? I'm see a lot of projects which releases, for example, library for multiple.net FX-es (2.0, 3.5, 4.0). Is there any major reasons to target multiple FX if code will be the same (no questions if code is different, of course)? Also, in my opinion, the lower the FX version, th... | TITLE:
Reasons behind targeting multiple frameworks?
QUESTION:
I'm see a lot of projects which releases, for example, library for multiple.net FX-es (2.0, 3.5, 4.0). Is there any major reasons to target multiple FX if code will be the same (no questions if code is different, of course)? Also, in my opinion, the lower ... | [
".net",
"version"
] | 1 | 1 | 62 | 1 | 0 | 2011-06-09T03:26:08.267000 | 2011-06-09T03:31:33.080000 |
6,287,808 | 6,287,830 | Input string was not in a correct format | I'm trying to make a simple application form were user can input data like 'reservationid', 'bookid', 'EmployeeID' and 'reservedate'. Its from my program Library System. 'reservationid' is an auto increment primary key while the rest are BigInt50, NVarChar50 and DateTime10 respectively. So I'm having this error: Input ... | If reservationid is auto incremented then remove it from your insert query string sql = "INSERT INTO BookReservation ( bookid, EmployeeID, reservedate) VALUES (@bookid, @EmployeeID, @reservedate)"; also try param[0].Value = Convert.ToInt64(bookid); param[1].Value = EmployeeID; param[2].Value = Convert.ToDate(reservedat... | Input string was not in a correct format I'm trying to make a simple application form were user can input data like 'reservationid', 'bookid', 'EmployeeID' and 'reservedate'. Its from my program Library System. 'reservationid' is an auto increment primary key while the rest are BigInt50, NVarChar50 and DateTime10 respe... | TITLE:
Input string was not in a correct format
QUESTION:
I'm trying to make a simple application form were user can input data like 'reservationid', 'bookid', 'EmployeeID' and 'reservedate'. Its from my program Library System. 'reservationid' is an auto increment primary key while the rest are BigInt50, NVarChar50 an... | [
"c#",
"asp.net"
] | 0 | 4 | 1,803 | 4 | 0 | 2011-06-09T03:28:11.840000 | 2011-06-09T03:33:24.233000 |
6,287,819 | 6,287,829 | parameter problem in asp.net mvc | I'm new to asp.net mvc. I have index method with parameter id: public ActionResult Index(int id) {
var dc = new ServicesDataContext(); var query = (from m in dc.Mapings where m.CustomerID == id select m); // var a = dc.Customers.First(m => m.CustomerId == id); // ViewData.Model = a; // return View(); return View(query... | Do this in the Edit action: return RedirectToAction("Index", new { id = qw }); | parameter problem in asp.net mvc I'm new to asp.net mvc. I have index method with parameter id: public ActionResult Index(int id) {
var dc = new ServicesDataContext(); var query = (from m in dc.Mapings where m.CustomerID == id select m); // var a = dc.Customers.First(m => m.CustomerId == id); // ViewData.Model = a; //... | TITLE:
parameter problem in asp.net mvc
QUESTION:
I'm new to asp.net mvc. I have index method with parameter id: public ActionResult Index(int id) {
var dc = new ServicesDataContext(); var query = (from m in dc.Mapings where m.CustomerID == id select m); // var a = dc.Customers.First(m => m.CustomerId == id); // View... | [
"asp.net-mvc",
"html.actionlink"
] | 1 | 4 | 1,726 | 1 | 0 | 2011-06-09T03:29:33.260000 | 2011-06-09T03:32:40.280000 |
6,287,842 | 6,287,870 | How to open only part of a git repository | I'm currently open sourcing a project that we've been developing on our own personal, private git server. We want to open source part of this project on GitHub as there are still features in development that need to be ironed out. In particular, suppose I have the following directories in my git repo: subdir 1 (public)... | My best guess is that you want to use submodules. You can have your top level directory simply contain those three submodules. Two will be made public, one not. The parent project only knows the desired commit SHA1 of the submodule, so it won't contain any actual information about the private project. If you don't want... | How to open only part of a git repository I'm currently open sourcing a project that we've been developing on our own personal, private git server. We want to open source part of this project on GitHub as there are still features in development that need to be ironed out. In particular, suppose I have the following dir... | TITLE:
How to open only part of a git repository
QUESTION:
I'm currently open sourcing a project that we've been developing on our own personal, private git server. We want to open source part of this project on GitHub as there are still features in development that need to be ironed out. In particular, suppose I have... | [
"git",
"open-source",
"repository"
] | 3 | 6 | 483 | 1 | 0 | 2011-06-09T03:35:40.443000 | 2011-06-09T03:46:08.243000 |
6,287,849 | 6,287,856 | Vertical Align middle | how to make link "test" stay in the middle of grey box when the grey box is resized? here is the code: http://jsfiddle.net/yuliantoadi/LXHmz/ | div.grid_1 { position: absolute; top: 50%; margin-top: -0.5em; right: 0; } http://jsfiddle.net/mattball/xUQnR/ | Vertical Align middle how to make link "test" stay in the middle of grey box when the grey box is resized? here is the code: http://jsfiddle.net/yuliantoadi/LXHmz/ | TITLE:
Vertical Align middle
QUESTION:
how to make link "test" stay in the middle of grey box when the grey box is resized? here is the code: http://jsfiddle.net/yuliantoadi/LXHmz/
ANSWER:
div.grid_1 { position: absolute; top: 50%; margin-top: -0.5em; right: 0; } http://jsfiddle.net/mattball/xUQnR/ | [
"css",
"vertical-alignment"
] | 2 | 4 | 726 | 1 | 0 | 2011-06-09T03:37:38.283000 | 2011-06-09T03:40:38.767000 |
6,287,851 | 6,287,892 | Query validation using C# | I am looking for a query validator in C#, which allows me to parse the SQL text from a textbox and verify whether it's correct or not before sending it for execution (MS SQL or DB2 queries). | If you want to validate SQL syntax without the use of a database, the TSql100Parser class will do well for this situation. Disclaimer, code borrowed from this post here Code to validate SQL Scripts Pretty straightforward to use though. If it returns null, then there were no errors in parsing it. using Microsoft.Data.Sc... | Query validation using C# I am looking for a query validator in C#, which allows me to parse the SQL text from a textbox and verify whether it's correct or not before sending it for execution (MS SQL or DB2 queries). | TITLE:
Query validation using C#
QUESTION:
I am looking for a query validator in C#, which allows me to parse the SQL text from a textbox and verify whether it's correct or not before sending it for execution (MS SQL or DB2 queries).
ANSWER:
If you want to validate SQL syntax without the use of a database, the TSql10... | [
"c#",
"sql",
"sql-server",
"db2"
] | 25 | 37 | 40,153 | 4 | 0 | 2011-06-09T03:39:09.833000 | 2011-06-09T03:50:53.430000 |
6,287,855 | 6,287,924 | Speed of indexing Perl arrays by offset | According to this question and this answer, lists are implemented as arrays: Perl implements lists with an array and first/last element offsets. The array is allocated larger than needed with the offsets originally pointing in the middle of the array so there is room to grow in both directions (unshifts and pushes/inse... | It's to do with the implementation of Perl as a series of opcodes. push, pop, shift and unshift are all opcodes themselves, so they can index into the array they're manipulating from C, where the accesses are very fast. If you do this from Perl with indices you'll make Perl perform extra opcodes to get the index from t... | Speed of indexing Perl arrays by offset According to this question and this answer, lists are implemented as arrays: Perl implements lists with an array and first/last element offsets. The array is allocated larger than needed with the offsets originally pointing in the middle of the array so there is room to grow in b... | TITLE:
Speed of indexing Perl arrays by offset
QUESTION:
According to this question and this answer, lists are implemented as arrays: Perl implements lists with an array and first/last element offsets. The array is allocated larger than needed with the offsets originally pointing in the middle of the array so there is... | [
"arrays",
"perl",
"indexing",
"performance",
"implementation"
] | 11 | 20 | 1,089 | 1 | 0 | 2011-06-09T03:40:27.243000 | 2011-06-09T03:57:02.720000 |
6,287,874 | 6,287,889 | SQLserver query rows in between specific date | how could i get row by filtering in between specific date... in my table, i have thousand of rows about Ordered Food. I want to check ordered food between June-01-2011 1:00:00PM to June-05-2011 6:00:00pm. how could i suppose to write t-sql code... | select * from MyTable where MyDate >= `2011-06-01T13:00:00` and MyDate < '2011-06-05T18:00:00' if you want to include both datetimes: select * from MyTable where MyDate between `2011-06-01T13:00:00` and '2011-06-05T18:00:00' | SQLserver query rows in between specific date how could i get row by filtering in between specific date... in my table, i have thousand of rows about Ordered Food. I want to check ordered food between June-01-2011 1:00:00PM to June-05-2011 6:00:00pm. how could i suppose to write t-sql code... | TITLE:
SQLserver query rows in between specific date
QUESTION:
how could i get row by filtering in between specific date... in my table, i have thousand of rows about Ordered Food. I want to check ordered food between June-01-2011 1:00:00PM to June-05-2011 6:00:00pm. how could i suppose to write t-sql code...
ANSWER:... | [
"sql-server-2005",
"t-sql"
] | 2 | 2 | 3,712 | 2 | 0 | 2011-06-09T03:47:06.410000 | 2011-06-09T03:50:08.250000 |
6,287,877 | 6,287,904 | problem of back history not being clear after logout in asp.net | protected void Page_Load(object sender, EventArgs e){ Session.Abandon(); FormsAuthentication.SignOut();
Page.Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.Redirect("~/Admin/adminLogin.aspx");
} I m not using any master page.so i have make one logout page and write code in it as above. But after l... | You can put this code in the page load protected void Page_Load(object sender, EventArgs e) { if (!HttpContext.Current.User.Identity.IsAuthenticated) { Response.Redirect("Login.aspx"); } } | problem of back history not being clear after logout in asp.net protected void Page_Load(object sender, EventArgs e){ Session.Abandon(); FormsAuthentication.SignOut();
Page.Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.Redirect("~/Admin/adminLogin.aspx");
} I m not using any master page.so i have... | TITLE:
problem of back history not being clear after logout in asp.net
QUESTION:
protected void Page_Load(object sender, EventArgs e){ Session.Abandon(); FormsAuthentication.SignOut();
Page.Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.Redirect("~/Admin/adminLogin.aspx");
} I m not using any mas... | [
"c#",
"asp.net"
] | 4 | 0 | 2,316 | 2 | 0 | 2011-06-09T03:47:53.227000 | 2011-06-09T03:53:48.433000 |
6,287,893 | 6,289,826 | Cakephp, modify auth class's behavior when the user is not logged in | By default the cakephp Auth class redirects the viewer to the front page if he/she is not logged in and tries to access a denied page. I wish for the server to run some code when this happens (set some variables and stuff). How would I go about modifying the Auth class's behavior when it redirects the user to the home ... | At first it is no good idea to change the Auth-Component-code itself since in an update you would loose all your changes. You should write your own component which extends the built-in component like this: // /app/controllers/components/my_auth.php App::import('Component', 'Auth'); class MyAuthComponent extends AuthCom... | Cakephp, modify auth class's behavior when the user is not logged in By default the cakephp Auth class redirects the viewer to the front page if he/she is not logged in and tries to access a denied page. I wish for the server to run some code when this happens (set some variables and stuff). How would I go about modify... | TITLE:
Cakephp, modify auth class's behavior when the user is not logged in
QUESTION:
By default the cakephp Auth class redirects the viewer to the front page if he/she is not logged in and tries to access a denied page. I wish for the server to run some code when this happens (set some variables and stuff). How would... | [
"php",
"authentication",
"cakephp"
] | 1 | 1 | 713 | 2 | 0 | 2011-06-09T03:50:55.817000 | 2011-06-09T08:04:41.273000 |
6,287,908 | 6,287,949 | nodejs express fs iterating files into array or object failing | So Im trying to use the nodejs express FS module to iterate a directory in my app, store each filename in an array, which I can pass to my express view and iterate through the list, but Im struggling to do so. When I do a console.log within the files.forEach function loop, its printing the filename just fine, but as so... | The myfiles array is empty because the callback hasn't been called before you call console.log(). You'll need to do something like: var fs = require('fs'); fs.readdir('./myfiles/',function(err,files){ if(err) throw err; files.forEach(function(file){ // do something with each file HERE! }); }); // because trying to do s... | nodejs express fs iterating files into array or object failing So Im trying to use the nodejs express FS module to iterate a directory in my app, store each filename in an array, which I can pass to my express view and iterate through the list, but Im struggling to do so. When I do a console.log within the files.forEac... | TITLE:
nodejs express fs iterating files into array or object failing
QUESTION:
So Im trying to use the nodejs express FS module to iterate a directory in my app, store each filename in an array, which I can pass to my express view and iterate through the list, but Im struggling to do so. When I do a console.log withi... | [
"node.js",
"express"
] | 8 | 32 | 24,698 | 5 | 0 | 2011-06-09T03:53:58 | 2011-06-09T04:02:27.890000 |
6,287,915 | 6,289,179 | How to bind wpf ComboBox to change the Language withougt writting into the xaml.cs? | I have wpf combobox as below. And, I have this culture class below. public class SpecificCultures { public static readonly string AR_SA = "ar-SA"; public static readonly string BG_BG = "bg-BG"; public static readonly string CA_ES = "ca-ES"; public static readonly string ZH_TW = "zh-TW"; public static readonly string CS... | I would suggest setting each ComboBoxItem's "Tag" property to the culture you want, or the string, and then setting the SelectedValuePath to point to "Tag" so that it will bind into the property you want. Here's a good example/explanation: http://johnpapa.net/binding-to-silverlight-combobox-and-using-selectedvalue-sele... | How to bind wpf ComboBox to change the Language withougt writting into the xaml.cs? I have wpf combobox as below. And, I have this culture class below. public class SpecificCultures { public static readonly string AR_SA = "ar-SA"; public static readonly string BG_BG = "bg-BG"; public static readonly string CA_ES = "ca-... | TITLE:
How to bind wpf ComboBox to change the Language withougt writting into the xaml.cs?
QUESTION:
I have wpf combobox as below. And, I have this culture class below. public class SpecificCultures { public static readonly string AR_SA = "ar-SA"; public static readonly string BG_BG = "bg-BG"; public static readonly s... | [
"c#",
"wpf",
"wpf-controls",
"binding"
] | 1 | 2 | 1,867 | 2 | 0 | 2011-06-09T03:54:56.940000 | 2011-06-09T07:00:39.670000 |
6,287,967 | 6,290,555 | How to write an Oracle trigger based on Auto incremented value? | I have an Oracle Table with the following keys: ID, Name, DoB, Dept & FileNo. The ID field is the primary Key with an Auto Incremented value. I wish to write a trigger, so that when a row is added with the Name, DoB & Dept, the FileNo field should get the value yyyy/xxxx where 'yyyy' is a predefined string & 'xxxx' is ... | You need a sequence to implement an Auto Incremented value: create sequence seq_file_id start with 1 increment by 1; and a trigger on a table CREATE TRIGGER file_trg BEFORE insert ON file_table FOR EACH ROW BEGIN SELECT seq_file_id.NEXTVAL INTO:new.id FROM dual;:NEW.fileno:= 'yyyy' ||:new.id;
END; / | How to write an Oracle trigger based on Auto incremented value? I have an Oracle Table with the following keys: ID, Name, DoB, Dept & FileNo. The ID field is the primary Key with an Auto Incremented value. I wish to write a trigger, so that when a row is added with the Name, DoB & Dept, the FileNo field should get the ... | TITLE:
How to write an Oracle trigger based on Auto incremented value?
QUESTION:
I have an Oracle Table with the following keys: ID, Name, DoB, Dept & FileNo. The ID field is the primary Key with an Auto Incremented value. I wish to write a trigger, so that when a row is added with the Name, DoB & Dept, the FileNo fie... | [
"oracle",
"triggers",
"auto-increment"
] | 2 | 1 | 856 | 2 | 0 | 2011-06-09T04:05:47.990000 | 2011-06-09T09:14:50.937000 |
6,287,969 | 6,300,978 | Problems using Tomcat JDBC Connection Pool in Tomcat 7 | In server.xml: In web.xml: Archive Database jdbc/ArchiveDB javax.sql.DataSource Container My Code: Context ic = new InitialContext(); DataSource ds = (DataSource) ic.lookup( "java:/comp/env/jdbc/ArchiveDB" ); I am getting the following exception: java.lang.ClassCastException: org.apache.tomcat.dbcp.dbcp.BasicDataSource... | Seems working now. I think this was a problem that I was debugging under Eclipse, so I wasn't using the server.xml that I thought I was using. Eclipse copies the one under the tomcat directory. Solution is to delete and the recreate under Eclipse to get changes in server.xml to be effective. | Problems using Tomcat JDBC Connection Pool in Tomcat 7 In server.xml: In web.xml: Archive Database jdbc/ArchiveDB javax.sql.DataSource Container My Code: Context ic = new InitialContext(); DataSource ds = (DataSource) ic.lookup( "java:/comp/env/jdbc/ArchiveDB" ); I am getting the following exception: java.lang.ClassCas... | TITLE:
Problems using Tomcat JDBC Connection Pool in Tomcat 7
QUESTION:
In server.xml: In web.xml: Archive Database jdbc/ArchiveDB javax.sql.DataSource Container My Code: Context ic = new InitialContext(); DataSource ds = (DataSource) ic.lookup( "java:/comp/env/jdbc/ArchiveDB" ); I am getting the following exception: ... | [
"java",
"tomcat",
"jdbc",
"connection-pooling",
"tomcat7"
] | 4 | 2 | 11,664 | 1 | 0 | 2011-06-09T04:06:13.020000 | 2011-06-10T01:09:10.050000 |
6,288,889 | 6,289,022 | How to reduce size of image display window in opencv? | I am using opencv to process very large images (some times even more than 2500x2000). When I display such an image using a normal cvNamedWindow it occupies the whole screen and even I am unable to scroll down or sideways to see other parts. Is it possible to reduce the size of image only while displaying? Note: the siz... | You have to use the flag CV_WINDOW_NORMAL to alter this behavior. This flag will make the window manually-resizable. cvNamedWindow(yourWindowName, CV_WINDOW_NORMAL); | How to reduce size of image display window in opencv? I am using opencv to process very large images (some times even more than 2500x2000). When I display such an image using a normal cvNamedWindow it occupies the whole screen and even I am unable to scroll down or sideways to see other parts. Is it possible to reduce ... | TITLE:
How to reduce size of image display window in opencv?
QUESTION:
I am using opencv to process very large images (some times even more than 2500x2000). When I display such an image using a normal cvNamedWindow it occupies the whole screen and even I am unable to scroll down or sideways to see other parts. Is it p... | [
"c",
"opencv"
] | 1 | 6 | 8,568 | 2 | 0 | 2011-06-09T06:27:32.717000 | 2011-06-09T06:43:52.600000 |
6,288,892 | 6,288,912 | Python: How to convert datetime format? | Possible Duplicate: How to convert a time to a string I have a variable as shown in the below code. a = "2011-06-09" Using python, how to convert it to the following format? "Jun 09,2011" | >>> import datetime >>> d = datetime.datetime.strptime('2011-06-09', '%Y-%m-%d') >>> d.strftime('%b %d,%Y') 'Jun 09,2011' In pre-2.5 Python, you can replace datetime.strptime with time.strptime, like so (untested): datetime.datetime(*(time.strptime('2011-06-09', '%Y-%m-%d')[0:6])) | Python: How to convert datetime format? Possible Duplicate: How to convert a time to a string I have a variable as shown in the below code. a = "2011-06-09" Using python, how to convert it to the following format? "Jun 09,2011" | TITLE:
Python: How to convert datetime format?
QUESTION:
Possible Duplicate: How to convert a time to a string I have a variable as shown in the below code. a = "2011-06-09" Using python, how to convert it to the following format? "Jun 09,2011"
ANSWER:
>>> import datetime >>> d = datetime.datetime.strptime('2011-06-0... | [
"python",
"date",
"datetime"
] | 32 | 72 | 178,674 | 2 | 0 | 2011-06-09T06:27:49.790000 | 2011-06-09T06:30:52.150000 |
6,288,895 | 6,296,958 | How to compile a cpp to a dll in visual studio 2010 express | I have a cpp which depends on couple of headers in the same folder. I need to compile this cpp to a dll. How do I do it in visual studio 2010 expresS? I found few articles on web for visual studio 2008 but I could not use it in 2010. Any pointers would be highly appreciated. Btw, I am a java programmer. CPP is all new ... | Right-click on your project in the Solution Explorer, and select Properties.... Under Configuration Properties -> General there's an option called Configuration Type. If you change it to Dynamic Library (.dll), your project will generate a DLL when it is built. | How to compile a cpp to a dll in visual studio 2010 express I have a cpp which depends on couple of headers in the same folder. I need to compile this cpp to a dll. How do I do it in visual studio 2010 expresS? I found few articles on web for visual studio 2008 but I could not use it in 2010. Any pointers would be high... | TITLE:
How to compile a cpp to a dll in visual studio 2010 express
QUESTION:
I have a cpp which depends on couple of headers in the same folder. I need to compile this cpp to a dll. How do I do it in visual studio 2010 expresS? I found few articles on web for visual studio 2008 but I could not use it in 2010. Any poin... | [
"c++",
"visual-c++",
"dll"
] | 1 | 8 | 15,745 | 2 | 0 | 2011-06-09T06:28:05.553000 | 2011-06-09T17:36:46.267000 |
6,288,898 | 6,288,941 | Make EditText accept and display HTML formatted text | Does any one know how to make an EditText control shows html formatted text, and even writes HTML formatted text, to act like an HTML Edit Box, | To show HTML code in an EditText you need to convert it to Spanned using Html.fromHtml(). Only a small HTML tag subset can be used in this method. You can set a Spanned as a text of an EditText. Then you can edit it and convert it back using Html.toHtml(). | Make EditText accept and display HTML formatted text Does any one know how to make an EditText control shows html formatted text, and even writes HTML formatted text, to act like an HTML Edit Box, | TITLE:
Make EditText accept and display HTML formatted text
QUESTION:
Does any one know how to make an EditText control shows html formatted text, and even writes HTML formatted text, to act like an HTML Edit Box,
ANSWER:
To show HTML code in an EditText you need to convert it to Spanned using Html.fromHtml(). Only a... | [
"android",
"android-edittext"
] | 17 | 18 | 18,262 | 3 | 0 | 2011-06-09T06:28:26.147000 | 2011-06-09T06:33:55.360000 |
6,288,900 | 6,289,051 | Determine whether any text follows an anchor tag (Or: ':last-child' selector that counts text nodes) | When a user posts a link in my forum, I'm going to replace it with a preview of that linked content (something like the Facebook news feed). However, I only want to replace the link if it appears at the end of a paragraph (or if it's the only element in a paragraph). For example: I do want to replace the link in this c... | You can simply check the.html() to see if it ends in: if (/<\/a>$/i.test($p.html())) { var previewMe = $p.children().last(); } You'll need a more complicated regex if it's possible that your anchors can get wrapped in other elements, e.g. (your original approach couldn't handle these cases either): content link In whic... | Determine whether any text follows an anchor tag (Or: ':last-child' selector that counts text nodes) When a user posts a link in my forum, I'm going to replace it with a preview of that linked content (something like the Facebook news feed). However, I only want to replace the link if it appears at the end of a paragra... | TITLE:
Determine whether any text follows an anchor tag (Or: ':last-child' selector that counts text nodes)
QUESTION:
When a user posts a link in my forum, I'm going to replace it with a preview of that linked content (something like the Facebook news feed). However, I only want to replace the link if it appears at th... | [
"jquery",
"html",
"jquery-selectors"
] | 2 | 2 | 215 | 1 | 0 | 2011-06-09T06:28:44.767000 | 2011-06-09T06:46:42.990000 |
6,288,916 | 6,288,929 | Why is the following JSON invalid? | The following JSON is not passing validation. The validator complains at the first string value starting at "Can an officer... It looks like the start of a valid string value for the key. What on earth could be wrong with this? { "DUI": { "Can an officer arrest me because he smelled alcohol on my breath?":" No, odor al... | Doesn't seem to like some line breaks present in your pasted JSON: Parse error on line 3:...ohol on my breath?":" No, odor alon -----------------------^ Expecting 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '[' I pasted the JSON from your question into the validator and removed unnecessary line breaks - this work... | Why is the following JSON invalid? The following JSON is not passing validation. The validator complains at the first string value starting at "Can an officer... It looks like the start of a valid string value for the key. What on earth could be wrong with this? { "DUI": { "Can an officer arrest me because he smelled a... | TITLE:
Why is the following JSON invalid?
QUESTION:
The following JSON is not passing validation. The validator complains at the first string value starting at "Can an officer... It looks like the start of a valid string value for the key. What on earth could be wrong with this? { "DUI": { "Can an officer arrest me be... | [
"json"
] | 1 | 5 | 5,338 | 1 | 0 | 2011-06-09T06:31:09.777000 | 2011-06-09T06:32:36.250000 |
6,288,927 | 6,289,040 | Django composing home pages or pages with several data sources | The site I am building includes a homepage composed of panels of summarised tabular data from applications within the Django project. What is the recommended way of building these types of pages. In other MVC style frameworks this is usually handled by each application providing a summary view, each of these views is r... | Write template tags for each section, and assemble them in the appropriate template. | Django composing home pages or pages with several data sources The site I am building includes a homepage composed of panels of summarised tabular data from applications within the Django project. What is the recommended way of building these types of pages. In other MVC style frameworks this is usually handled by each... | TITLE:
Django composing home pages or pages with several data sources
QUESTION:
The site I am building includes a homepage composed of panels of summarised tabular data from applications within the Django project. What is the recommended way of building these types of pages. In other MVC style frameworks this is usual... | [
"django",
"view"
] | 0 | 1 | 197 | 1 | 0 | 2011-06-09T06:32:02.737000 | 2011-06-09T06:45:59.510000 |
6,288,931 | 6,289,104 | How can I implement up and down voting? | If you have used Stack Overflow for a while, you surely have used the function of vote up and down of the question and answer. I notice Stack Overflow uses anchor. But I don't know how to POST the data to server. I think it's JavaScript associated with this, but I can't find it. How can I implement it? | Yes, JavaScript is involved. There are two parts: Hooking up a handler for the click events on the voting "buttons", and sending data to the server. Hooking up the events is well-covered elsewhere and I won't go into it here. (For instance, I cover it in this answer.) Sending the data to the server, you can use ajax. O... | How can I implement up and down voting? If you have used Stack Overflow for a while, you surely have used the function of vote up and down of the question and answer. I notice Stack Overflow uses anchor. But I don't know how to POST the data to server. I think it's JavaScript associated with this, but I can't find it. ... | TITLE:
How can I implement up and down voting?
QUESTION:
If you have used Stack Overflow for a while, you surely have used the function of vote up and down of the question and answer. I notice Stack Overflow uses anchor. But I don't know how to POST the data to server. I think it's JavaScript associated with this, but... | [
"javascript",
"php",
"post"
] | 10 | 12 | 3,731 | 5 | 0 | 2011-06-09T06:32:48.460000 | 2011-06-09T06:52:26.657000 |
6,288,935 | 6,288,971 | Syntax of Lists in Python | I am learning python, now, i came across a code snippet which looks like this: my_name={'sujit','amit','ajit','arijit'} for i, names in enumerate(my_name): print "%s" %(names[i]) OUTPUT s m i t But when I modify the code as: my_name=['sujit','amit','ajit','arijit'] for i, names in enumerate(my_name): print "%s" %(names... | {} creates a set, whereas [] creates a list. The key differences are: the list preserves the order, whereas the set does not; the list preserves duplicates, whereas the set does not; the list can be accessed through indexing (i.e. l[5] ), whereas the set can not. The first point holds the key to your puzzle. When you u... | Syntax of Lists in Python I am learning python, now, i came across a code snippet which looks like this: my_name={'sujit','amit','ajit','arijit'} for i, names in enumerate(my_name): print "%s" %(names[i]) OUTPUT s m i t But when I modify the code as: my_name=['sujit','amit','ajit','arijit'] for i, names in enumerate(my... | TITLE:
Syntax of Lists in Python
QUESTION:
I am learning python, now, i came across a code snippet which looks like this: my_name={'sujit','amit','ajit','arijit'} for i, names in enumerate(my_name): print "%s" %(names[i]) OUTPUT s m i t But when I modify the code as: my_name=['sujit','amit','ajit','arijit'] for i, nam... | [
"python",
"syntax"
] | 2 | 4 | 256 | 4 | 0 | 2011-06-09T06:33:22.783000 | 2011-06-09T06:36:28.623000 |
6,288,942 | 6,289,399 | cabal install glib makes error | I tried installing gtk2hs in many ways but have no luck so far installation always failed with glib issue So I tried installing glib first with cabal install glib but error arise again the error is this Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp.......... Registering glib-0.12.0... I... | This seems to be a known problem according to google and gtk2hs-trac. According to the following haskell-ticket try do do the manual install. Either download glib from hackage or look the tar file up in cabal cache. (I don't know by heart where that is on Windows but it should be somewhere near cabal.exe. After this un... | cabal install glib makes error I tried installing gtk2hs in many ways but have no luck so far installation always failed with glib issue So I tried installing glib first with cabal install glib but error arise again the error is this Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp........... | TITLE:
cabal install glib makes error
QUESTION:
I tried installing gtk2hs in many ways but have no luck so far installation always failed with glib issue So I tried installing glib first with cabal install glib but error arise again the error is this Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Micr... | [
"windows",
"haskell",
"installation",
"glib",
"cabal"
] | 3 | 4 | 1,080 | 1 | 0 | 2011-06-09T06:33:55.957000 | 2011-06-09T07:21:42.493000 |
6,288,943 | 6,288,986 | Web.config appSettings: complex values | Is Web.config's appSettings section only capable of storing simple strings like this? or I can have more complex values like CDATA or nested values? If not, is this the only place in Web.config where to store custom settings? Thanks | You can make any XmlSerializable class as a setting. I answered to the similar question here: Custom type application settings in ASP.NET Also there is a sample project attached. Here is an example of the settings from my config file: 10.40.10.9 22634 10.40.10.9 22635 Custom class for settings: public class EndPoint { ... | Web.config appSettings: complex values Is Web.config's appSettings section only capable of storing simple strings like this? or I can have more complex values like CDATA or nested values? If not, is this the only place in Web.config where to store custom settings? Thanks | TITLE:
Web.config appSettings: complex values
QUESTION:
Is Web.config's appSettings section only capable of storing simple strings like this? or I can have more complex values like CDATA or nested values? If not, is this the only place in Web.config where to store custom settings? Thanks
ANSWER:
You can make any XmlS... | [
"c#",
".net",
"asp.net",
"configuration",
"asp.net-4.0"
] | 5 | 5 | 14,271 | 3 | 0 | 2011-06-09T06:33:58.993000 | 2011-06-09T06:39:21.227000 |
6,288,945 | 6,290,252 | How to create game video while playing? | I am wondering how people are being able to record there game play? Like this video is of angry birds which shows game play. please help as my game is near to the deployment so i can also create my game video and upload. | One option would be to use iSimulate to send the simulator accelerometer data to the simulator and then to use screen recording software to capture video from the simulator. | How to create game video while playing? I am wondering how people are being able to record there game play? Like this video is of angry birds which shows game play. please help as my game is near to the deployment so i can also create my game video and upload. | TITLE:
How to create game video while playing?
QUESTION:
I am wondering how people are being able to record there game play? Like this video is of angry birds which shows game play. please help as my game is near to the deployment so i can also create my game video and upload.
ANSWER:
One option would be to use iSimu... | [
"iphone",
"ipod"
] | 0 | 0 | 841 | 2 | 0 | 2011-06-09T06:34:11.260000 | 2011-06-09T08:49:11.597000 |
6,288,965 | 6,289,625 | CakePHP - v1.3xx - prototype & jquery usage but prototype is running jquery events? | I could be missing something severely here, but this is just not adding up. I built an ajax form which is working perfectly fine with ProtoType. I am migrating to Jquery, and so I added the jquery libraries etc.. Below is my $ajax submit.. NOTE the jQuery coded loading and success options.. What I cannot figure out is ... | the AJAX-Helper is deprecated, you shouldn't use it anymore. Also, you don't need to specify that you want to use jQuery since this is the default library which will be loaded by CakePHP as you can read here. This doesn't mean it also gets included! Only the helper will be ready to use it. You still can use AJAX, but y... | CakePHP - v1.3xx - prototype & jquery usage but prototype is running jquery events? I could be missing something severely here, but this is just not adding up. I built an ajax form which is working perfectly fine with ProtoType. I am migrating to Jquery, and so I added the jquery libraries etc.. Below is my $ajax submi... | TITLE:
CakePHP - v1.3xx - prototype & jquery usage but prototype is running jquery events?
QUESTION:
I could be missing something severely here, but this is just not adding up. I built an ajax form which is working perfectly fine with ProtoType. I am migrating to Jquery, and so I added the jquery libraries etc.. Below... | [
"jquery",
"ajax",
"cakephp",
"prototypejs"
] | 0 | 0 | 428 | 1 | 0 | 2011-06-09T06:35:56.660000 | 2011-06-09T07:46:01.087000 |
6,288,969 | 6,289,846 | String to Bluetooth SPP R200 format routine for Android | I am trying to print a message to a Bluetooth connected printer via SPP R200 protocol though my Android phone. I have paired, connected with the device. But the language the printer speaks is not the regular strings. As far as I understand, the SPP R200 is a standard format but scary format as I feel it. Because it is ... | all you need is read manual and then send byte arrays not string to printer fx. Printing code bar(CODE39, text: "aa1234"): {GS, len("aa1234"), 4/* CODE39*/, (byte)'a', (byte)'a', (byte)'1', (byte)'2', (byte)'3', (byte)'4', 0/*NUL*/}
{0x1d, 0x06, 0x04, 0x61, 0x61, 0x31, 0x32, 0x33, 0x34, 0x00} for getting bytes from st... | String to Bluetooth SPP R200 format routine for Android I am trying to print a message to a Bluetooth connected printer via SPP R200 protocol though my Android phone. I have paired, connected with the device. But the language the printer speaks is not the regular strings. As far as I understand, the SPP R200 is a stand... | TITLE:
String to Bluetooth SPP R200 format routine for Android
QUESTION:
I am trying to print a message to a Bluetooth connected printer via SPP R200 protocol though my Android phone. I have paired, connected with the device. But the language the printer speaks is not the regular strings. As far as I understand, the S... | [
"android",
"printing",
"bluetooth"
] | 0 | 1 | 1,009 | 1 | 0 | 2011-06-09T06:36:24.723000 | 2011-06-09T08:07:25.733000 |
6,288,973 | 6,290,711 | How to inflate another xml on clicking a button | I have one Activity in that there are no Button s but I have coded it in such a way that another Activity comes, now in this second Activity there are three Button s, on which when I click all inflating different respective activities. In this second Activity there I have added one more Button, on clicking this 4th But... | I tried this code..hope helps to you.. 1.layout_existed.xml 2.layout_toinfliate.xml 3.LayoutInflateDemo.java public class LayoutInflateDemo extends Activity {
private LinearLayout layoutToAdd;
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.layou... | How to inflate another xml on clicking a button I have one Activity in that there are no Button s but I have coded it in such a way that another Activity comes, now in this second Activity there are three Button s, on which when I click all inflating different respective activities. In this second Activity there I have... | TITLE:
How to inflate another xml on clicking a button
QUESTION:
I have one Activity in that there are no Button s but I have coded it in such a way that another Activity comes, now in this second Activity there are three Button s, on which when I click all inflating different respective activities. In this second Act... | [
"android",
"xml",
"android-layout",
"layout",
"layout-inflater"
] | 1 | 6 | 13,256 | 2 | 0 | 2011-06-09T06:37:00.120000 | 2011-06-09T09:27:16.257000 |
6,288,974 | 6,289,079 | Best way to handle reading DB for queued items from a daemon? | Situation: A user submits a url and my php script adds that url to a "queue" table in the database. And suppose that there will be at least 1000 urls inserted to that "queue" table per minute. What I am going to do with the url is grab the contents of the url and then some quick parse work with the contents. My Solutio... | I would say you only grab 1 row at the time instead of all your rows. Here's why: Say you have 1000 entries in your table, your script comes, takes all 1000 in memory ( warning sign 1 for high memory usage ) and starts processing. Processing 1000 entries takes 5 minutes, but your script runs every 3 minutes. This means... | Best way to handle reading DB for queued items from a daemon? Situation: A user submits a url and my php script adds that url to a "queue" table in the database. And suppose that there will be at least 1000 urls inserted to that "queue" table per minute. What I am going to do with the url is grab the contents of the ur... | TITLE:
Best way to handle reading DB for queued items from a daemon?
QUESTION:
Situation: A user submits a url and my php script adds that url to a "queue" table in the database. And suppose that there will be at least 1000 urls inserted to that "queue" table per minute. What I am going to do with the url is grab the ... | [
"php",
"queue",
"daemon"
] | 0 | 0 | 146 | 2 | 0 | 2011-06-09T06:37:05.557000 | 2011-06-09T06:50:14.093000 |
6,288,977 | 6,289,311 | translate a pattern in xslt | i am using XSLT 1.0 version and got stuck in translating a pattern. I need to translate string 'nn' with 'XZ'. Translate function is not working for me. Please suggest how this can be achieved in XSLT 1.0 version without writing seprate template for it in one liner. | You can achieve this using recursive template: embedding tags in xslt | translate a pattern in xslt i am using XSLT 1.0 version and got stuck in translating a pattern. I need to translate string 'nn' with 'XZ'. Translate function is not working for me. Please suggest how this can be achieved in XSLT 1.0 version without writing seprate template for it in one liner. | TITLE:
translate a pattern in xslt
QUESTION:
i am using XSLT 1.0 version and got stuck in translating a pattern. I need to translate string 'nn' with 'XZ'. Translate function is not working for me. Please suggest how this can be achieved in XSLT 1.0 version without writing seprate template for it in one liner.
ANSWER... | [
"xml",
"xslt",
"xpath"
] | 0 | 0 | 351 | 2 | 0 | 2011-06-09T06:37:38.807000 | 2011-06-09T07:12:35.340000 |
6,288,991 | 6,289,426 | Do I ever need to explicitly flush GORM save calls in grails? | I have a strange situation which appears to indicate a GORM cacheing problem //begin with all book.status's as UNREAD Book.list().each { book.status = Status.READ; book.save() }
println (Book.findAllByStatus (Status.READ)) //will print an empty list println (Book.list().findAll (it.status == Status.READ)) // will prin... | In your case, the first statement return empty list because it reads data from the database, but the data isn't there yet. It's how Hibernate works: When you call save with (flush: true), it will flush the Hibernate session, persistent all data in session to database immediately. If not using (flush:true), the data is ... | Do I ever need to explicitly flush GORM save calls in grails? I have a strange situation which appears to indicate a GORM cacheing problem //begin with all book.status's as UNREAD Book.list().each { book.status = Status.READ; book.save() }
println (Book.findAllByStatus (Status.READ)) //will print an empty list println... | TITLE:
Do I ever need to explicitly flush GORM save calls in grails?
QUESTION:
I have a strange situation which appears to indicate a GORM cacheing problem //begin with all book.status's as UNREAD Book.list().each { book.status = Status.READ; book.save() }
println (Book.findAllByStatus (Status.READ)) //will print an ... | [
"grails",
"grails-orm",
"object-persistence"
] | 42 | 34 | 38,149 | 5 | 0 | 2011-06-09T06:40:16.573000 | 2011-06-09T07:24:56.730000 |
6,289,006 | 6,289,297 | Application forcefully closes | I've created tab view and now I am trying to swich to again tab after completion of task using intent, but the application forcefully closed. My error log is as below: 06-09 12:48:35.261: WARN/dalvikvm(439): threadid=3: thread exiting with uncaught exception (group=0x4001aa28) 06-09 12:48:35.261: ERROR/AndroidRuntime(4... | You need to initialize the button in inside activity class, otherwise it won`t work, then use that button in WebViewClient class. | Application forcefully closes I've created tab view and now I am trying to swich to again tab after completion of task using intent, but the application forcefully closed. My error log is as below: 06-09 12:48:35.261: WARN/dalvikvm(439): threadid=3: thread exiting with uncaught exception (group=0x4001aa28) 06-09 12:48:... | TITLE:
Application forcefully closes
QUESTION:
I've created tab view and now I am trying to swich to again tab after completion of task using intent, but the application forcefully closed. My error log is as below: 06-09 12:48:35.261: WARN/dalvikvm(439): threadid=3: thread exiting with uncaught exception (group=0x4001... | [
"android",
"android-activity"
] | 1 | 0 | 4,208 | 2 | 0 | 2011-06-09T06:41:52.130000 | 2011-06-09T07:11:36.940000 |
6,289,010 | 6,289,245 | How can I perform onListItemClick in a list view on android | I have a ListView with three ImageButton s and TextView s, ImageView. How can I perform onListItemClick in a ListView for individual actions for each ImageButton. public class AndroidThumbnailList extends ListActivity{.......... ib2=(ImageButton)findViewById(R.id.imageButton2); ib3=(ImageButton)findViewById(R.id.imageB... | You can set individuals onClick() event handlers for each ImageButton. You have to declare the method of your context (typically, your Activity ): public void onClickHandler(View v) See Javadocs of ImageButton and onClick() for further details. | How can I perform onListItemClick in a list view on android I have a ListView with three ImageButton s and TextView s, ImageView. How can I perform onListItemClick in a ListView for individual actions for each ImageButton. public class AndroidThumbnailList extends ListActivity{.......... ib2=(ImageButton)findViewById(R... | TITLE:
How can I perform onListItemClick in a list view on android
QUESTION:
I have a ListView with three ImageButton s and TextView s, ImageView. How can I perform onListItemClick in a ListView for individual actions for each ImageButton. public class AndroidThumbnailList extends ListActivity{.......... ib2=(ImageBut... | [
"android",
"android-layout"
] | 0 | 0 | 1,528 | 3 | 0 | 2011-06-09T06:42:19.977000 | 2011-06-09T07:05:48.793000 |
6,289,016 | 6,289,188 | SQL Server: Double data size of a table when altering column type | I altered the type of a column in to an actual smaller type: -- change type from nvarchar(100) to varchar(50) Alter Table [MyTable] Alter column [MyColumn] varchar(50) The table contains 4 Mio. records. Before it used around 1.1 GB of space, after the altering of the column, it uses 2.2 GB space. Is there any explanati... | Run ALTER INDEX ALL On MyTable REBUILD and then check space again with the "true" flag Basically, the change in type has fragmented storage somehow: for example it is now NULLable and it wasn't before which affects the on-disk structures. I chose this example because you have not specified NULL/NOT NULL in your ALTER T... | SQL Server: Double data size of a table when altering column type I altered the type of a column in to an actual smaller type: -- change type from nvarchar(100) to varchar(50) Alter Table [MyTable] Alter column [MyColumn] varchar(50) The table contains 4 Mio. records. Before it used around 1.1 GB of space, after the al... | TITLE:
SQL Server: Double data size of a table when altering column type
QUESTION:
I altered the type of a column in to an actual smaller type: -- change type from nvarchar(100) to varchar(50) Alter Table [MyTable] Alter column [MyColumn] varchar(50) The table contains 4 Mio. records. Before it used around 1.1 GB of s... | [
"sql-server-2008",
"alter-column"
] | 2 | 3 | 1,783 | 2 | 0 | 2011-06-09T06:43:05.687000 | 2011-06-09T07:01:31.757000 |
6,289,029 | 6,291,005 | flex/actionscript question | var n:Number = 0; [1,2,3].forEach(function (x):void { n+=x; }); how to do it in flash? Flash throws error "function called with 3 arguments..." i need only one argument here! | The Array.forEach() waits a function as first parameter which looks like this: function callbackFunc ( item:*, index:int, array:Array ): void You have to declare in your function all of the three parameters. So your stuff should look like this: var n: Number = 0; var arr: Array = [1,2,3];
arr.forEach(function (item:*,... | flex/actionscript question var n:Number = 0; [1,2,3].forEach(function (x):void { n+=x; }); how to do it in flash? Flash throws error "function called with 3 arguments..." i need only one argument here! | TITLE:
flex/actionscript question
QUESTION:
var n:Number = 0; [1,2,3].forEach(function (x):void { n+=x; }); how to do it in flash? Flash throws error "function called with 3 arguments..." i need only one argument here!
ANSWER:
The Array.forEach() waits a function as first parameter which looks like this: function cal... | [
"flash",
"apache-flex",
"actionscript"
] | 1 | 3 | 108 | 3 | 0 | 2011-06-09T06:44:49.477000 | 2011-06-09T09:53:38.150000 |
6,289,030 | 6,289,097 | How to properly call AsyncTask from a separate thread? | I'm developing a game, that is running in a separate thread. Now I need to download an image from Internet. I've written an AsyncTask class for that, but I can't figure out how to properly call it from my game thread? In fact, my AsyncTask is blocking, though I need to wait before the image is downloaded. If I use runO... | If your background thread will block anyway, you don't need AsyncTask and can do image loading directly in this thread. To post on UI thread afterwards you will need to have Handler with looper set up. One option is to pass a handler created in UI thread. Other option is to pass some context to your background thread a... | How to properly call AsyncTask from a separate thread? I'm developing a game, that is running in a separate thread. Now I need to download an image from Internet. I've written an AsyncTask class for that, but I can't figure out how to properly call it from my game thread? In fact, my AsyncTask is blocking, though I nee... | TITLE:
How to properly call AsyncTask from a separate thread?
QUESTION:
I'm developing a game, that is running in a separate thread. Now I need to download an image from Internet. I've written an AsyncTask class for that, but I can't figure out how to properly call it from my game thread? In fact, my AsyncTask is bloc... | [
"android",
"multithreading",
"download",
"android-asynctask",
"looper"
] | 1 | 1 | 1,748 | 2 | 0 | 2011-06-09T06:44:52.860000 | 2011-06-09T06:51:33.077000 |
6,289,033 | 6,289,363 | Rails unobtrusive ajax:failure event not firing | I have added success and failure handlers to a:remote => true link generated by rails: HAML: link_to 'Cancel', cancel_path(block),:method =>:delete,:remote => true,:id => "cancel-button" JS: $('#cancel-button').live('ajax:failure', function(){console.log('failure');}); $('#cancel-button').live('ajax:success', function(... | Whoops. Contrary to the blog post I was reading the name of the event is actually ajax:error rather than ajax:failure... | Rails unobtrusive ajax:failure event not firing I have added success and failure handlers to a:remote => true link generated by rails: HAML: link_to 'Cancel', cancel_path(block),:method =>:delete,:remote => true,:id => "cancel-button" JS: $('#cancel-button').live('ajax:failure', function(){console.log('failure');}); $(... | TITLE:
Rails unobtrusive ajax:failure event not firing
QUESTION:
I have added success and failure handlers to a:remote => true link generated by rails: HAML: link_to 'Cancel', cancel_path(block),:method =>:delete,:remote => true,:id => "cancel-button" JS: $('#cancel-button').live('ajax:failure', function(){console.log... | [
"javascript",
"jquery",
"ruby-on-rails",
"ajax"
] | 1 | 3 | 703 | 1 | 0 | 2011-06-09T06:45:10.560000 | 2011-06-09T07:17:37.180000 |
6,289,034 | 6,289,225 | DataGridViewColumnHeader Make Bold | I have one DataGridView and want to make the Header text Bold. I have tried changing the ColumnHeaderDefaultCellStyle to DataGridViewCellStyle { BackColor=Color [Control], SelectionBackColor=Color [Highlight], SelectionForeColor=Color [HighlightText], Font=[Font: Name=Tahoma, Size=9.75, Units=3, GdiCharSet=0, GdiVertic... | Suppose you want to change the style of column 0 of DataGridView myDataGrid: myDataGrid.Columns[0].HeaderCell.Style.Font = new Font("Tahoma", 9.75F, FontStyle.Bold); If you want to change the default for headers: myDataGrid.ColumnHeadersDefaultCellStyle.Font = new Font("Tahoma", 9.75F, FontStyle.Bold); EDIT: In the des... | DataGridViewColumnHeader Make Bold I have one DataGridView and want to make the Header text Bold. I have tried changing the ColumnHeaderDefaultCellStyle to DataGridViewCellStyle { BackColor=Color [Control], SelectionBackColor=Color [Highlight], SelectionForeColor=Color [HighlightText], Font=[Font: Name=Tahoma, Size=9.7... | TITLE:
DataGridViewColumnHeader Make Bold
QUESTION:
I have one DataGridView and want to make the Header text Bold. I have tried changing the ColumnHeaderDefaultCellStyle to DataGridViewCellStyle { BackColor=Color [Control], SelectionBackColor=Color [Highlight], SelectionForeColor=Color [HighlightText], Font=[Font: Nam... | [
"c#",
"winforms",
"datagridview"
] | 15 | 51 | 79,317 | 3 | 0 | 2011-06-09T06:45:34.530000 | 2011-06-09T07:04:12.863000 |
6,289,036 | 6,289,081 | Select specific child of the current element using THIS | I would like to know how can I select from the following. data in here... I would like to use something like: onmouseover="select(this)" and then be able to access that span based on that event, because I have may elements. Even a JQuery suggestion is welcome. | The HTML you have provided is invalid. When defining attributes, you have to give them a name. Let's assume you have this: data in here... With jQuery, you can simply do this without an inline event handler. In your $(document).ready() you could put: $('.feeds').mouseover(function () { var $span=$('span.data', this); }... | Select specific child of the current element using THIS I would like to know how can I select from the following. data in here... I would like to use something like: onmouseover="select(this)" and then be able to access that span based on that event, because I have may elements. Even a JQuery suggestion is welcome. | TITLE:
Select specific child of the current element using THIS
QUESTION:
I would like to know how can I select from the following. data in here... I would like to use something like: onmouseover="select(this)" and then be able to access that span based on that event, because I have may elements. Even a JQuery suggesti... | [
"javascript",
"jquery",
"this",
"dom-events"
] | 3 | 2 | 2,403 | 3 | 0 | 2011-06-09T06:45:45.967000 | 2011-06-09T06:50:22.580000 |
6,289,046 | 6,289,128 | Should Debug.Assert and Debug.Fail be used liberally, and should they be left in production code? | I am reading a book which asserts (pun intended) "You should load your code with Debug.Assert methods wherever you have a condition that will always be true or false." I haven't been using these two debug methods, but it makes some sense. However, I am loathe to have this stuff littered all throughout my production cod... | It is fine, since the compiler omits it in release build. It is not bad practice, and you do not need to remove them from source (indeed, you probably shouldn't). But you must be careful: Debug.Assert(SomethingImportantThatMustExecute()); is bad - the SomethingImportantThatMustExecute will be ignored in release; you mu... | Should Debug.Assert and Debug.Fail be used liberally, and should they be left in production code? I am reading a book which asserts (pun intended) "You should load your code with Debug.Assert methods wherever you have a condition that will always be true or false." I haven't been using these two debug methods, but it m... | TITLE:
Should Debug.Assert and Debug.Fail be used liberally, and should they be left in production code?
QUESTION:
I am reading a book which asserts (pun intended) "You should load your code with Debug.Assert methods wherever you have a condition that will always be true or false." I haven't been using these two debug... | [
"c#",
".net",
"debugging",
"assertions"
] | 21 | 44 | 4,038 | 5 | 0 | 2011-06-09T06:46:22.960000 | 2011-06-09T06:54:26.950000 |
6,289,052 | 6,289,780 | How come my execution result is correct, but watch list result is wrong? | I wrote a c++ program, and when I'm using debug mode, I put a pointer type variable (say m_pdummy ) into the watch list, but it shows "bad ptr"; If I expand this pointer(by clicking the "+" left to the name) and wants to see other variables under this pointer, all variables show " expression cannot be evaluated "; Howe... | Maybe the code you are debugging with is not exactly the one running, or the VS Compiler optimize your code so some of the code doesn't exist anymore. In the case of the former, the breakpoint and debug value cannot be watched, you should check out the code match the debugging one. I come up with this when I register C... | How come my execution result is correct, but watch list result is wrong? I wrote a c++ program, and when I'm using debug mode, I put a pointer type variable (say m_pdummy ) into the watch list, but it shows "bad ptr"; If I expand this pointer(by clicking the "+" left to the name) and wants to see other variables under ... | TITLE:
How come my execution result is correct, but watch list result is wrong?
QUESTION:
I wrote a c++ program, and when I'm using debug mode, I put a pointer type variable (say m_pdummy ) into the watch list, but it shows "bad ptr"; If I expand this pointer(by clicking the "+" left to the name) and wants to see othe... | [
"c++",
"visual-studio",
"debugging",
"watch"
] | 0 | 0 | 307 | 2 | 0 | 2011-06-09T06:46:44.203000 | 2011-06-09T07:59:54.393000 |
6,289,063 | 6,289,354 | How do I select a fixed number of elements around (before, and the remainder after) one specific element in a MySQL table? | I need a query (issued via php) to select n records (let's say 4) inserted around a given record (n/2 before + n/2 after). If the number of rows inserted before the current element is less than n/2, the remaining records (n-result1) should be those inserted AFTER the current record. A similar thing for the newest recor... | Selecting the records with and ID preceding and following some specific ID is not that complicates. The key is to order the records by their IDs and then select only those that are smaller than or greater than the specific ID: SELECT * FROM table WHERE id < x ORDER BY id DESC LIMIT 4; SELECT * FROM table WHERE id > x O... | How do I select a fixed number of elements around (before, and the remainder after) one specific element in a MySQL table? I need a query (issued via php) to select n records (let's say 4) inserted around a given record (n/2 before + n/2 after). If the number of rows inserted before the current element is less than n/2... | TITLE:
How do I select a fixed number of elements around (before, and the remainder after) one specific element in a MySQL table?
QUESTION:
I need a query (issued via php) to select n records (let's say 4) inserted around a given record (n/2 before + n/2 after). If the number of rows inserted before the current elemen... | [
"php",
"mysql",
"select"
] | 2 | 3 | 146 | 2 | 0 | 2011-06-09T06:48:19.960000 | 2011-06-09T07:17:04.833000 |
6,289,071 | 6,289,123 | Is there a PHP function that does the opposite of real_path? | In an upload script, I have $destination = $_SERVER['DOCUMENT_ROOT']. '/uploads/'. $_SESSION['username']. '/entries/'. '/'. $year. '/'; and i upload the image path to the database, and thus the string stores is the real_path(ie. S:\sites\www\mysite\uploads\username\entries\2011\file.png) is there a function that conver... | Looks like all you need to do is build your path differently. $base = '/uploads/'. $_SESSION['username']. '/entries/'. '/'. $year. '/'; $destination = $_SERVER['DOCUMENT_ROOT']. $base; $url = $_SERVER['HTTP_HOST']. $base; | Is there a PHP function that does the opposite of real_path? In an upload script, I have $destination = $_SERVER['DOCUMENT_ROOT']. '/uploads/'. $_SESSION['username']. '/entries/'. '/'. $year. '/'; and i upload the image path to the database, and thus the string stores is the real_path(ie. S:\sites\www\mysite\uploads\us... | TITLE:
Is there a PHP function that does the opposite of real_path?
QUESTION:
In an upload script, I have $destination = $_SERVER['DOCUMENT_ROOT']. '/uploads/'. $_SESSION['username']. '/entries/'. '/'. $year. '/'; and i upload the image path to the database, and thus the string stores is the real_path(ie. S:\sites\www... | [
"php"
] | 2 | 2 | 958 | 5 | 0 | 2011-06-09T06:49:28.310000 | 2011-06-09T06:54:01.827000 |
6,289,078 | 6,290,089 | Can I retrieve the user32.dll getlastinputtime from a system service | I am trying to write a system service that can detect whether the user is active and then launch a process if not. I am using a service because I want this to work if the user is logged in or not. I have been trying to hook into the user32.dll API and retrieve the time since last user input. However the integer being r... | You may like to use getlastinputinfo on user32.dll _ Shared Function GetLastInputInfo(ByRef plii As LASTINPUTINFO) As Boolean End Function _ Structure LASTINPUTINFO _ Public cbSize As Integer _ Public dwTime As Integer End Structure LASTINPUTINFO on MSDN | Can I retrieve the user32.dll getlastinputtime from a system service I am trying to write a system service that can detect whether the user is active and then launch a process if not. I am using a service because I want this to work if the user is logged in or not. I have been trying to hook into the user32.dll API and... | TITLE:
Can I retrieve the user32.dll getlastinputtime from a system service
QUESTION:
I am trying to write a system service that can detect whether the user is active and then launch a process if not. I am using a service because I want this to work if the user is logged in or not. I have been trying to hook into the ... | [
"vb.net",
"windows-services",
"user32"
] | 0 | 1 | 810 | 1 | 0 | 2011-06-09T06:50:14.067000 | 2011-06-09T08:32:41.090000 |
6,289,080 | 6,290,917 | App Engine: submitting form data to Google Spreadsheet | We'd like to duplicate the Google Spreadsheet Form Wizard functionality within our App Engine application. The rational for this is that Google forms look ugly and the form wizard apparently does not provide enough hooks to make layout better. Do you know any examples how to integrate Google Spreadsheet GData API in Ap... | Everything you write makes sense, but where's the question? You can put python gdata client library into your GAE project. You can expose the spreadsheet (make it accessible from the outer world), but leave it private, so nobody would be able to manually access it, and authenticate your GAE Django app. Trivially - with... | App Engine: submitting form data to Google Spreadsheet We'd like to duplicate the Google Spreadsheet Form Wizard functionality within our App Engine application. The rational for this is that Google forms look ugly and the form wizard apparently does not provide enough hooks to make layout better. Do you know any examp... | TITLE:
App Engine: submitting form data to Google Spreadsheet
QUESTION:
We'd like to duplicate the Google Spreadsheet Form Wizard functionality within our App Engine application. The rational for this is that Google forms look ugly and the form wizard apparently does not provide enough hooks to make layout better. Do ... | [
"python",
"django",
"google-app-engine",
"gdata",
"google-sheets-api"
] | 2 | 1 | 1,481 | 1 | 0 | 2011-06-09T06:50:15.403000 | 2011-06-09T09:46:03.443000 |
6,289,084 | 6,289,275 | Why would one use the unary operator on a property in ruby? i.e &:first | Possible Duplicate: Ruby/Ruby on Rails ampersand colon shortcut As a habit I try and read a little of someone elses source code regularly and comment on it in a gist. Right now I'm reading through sinatra's base app and came upon an interesting bit of code (this is part of their Request class) def accept @env['sinatra.... | Read the answers in the duplicate questions for the meaning and usage of &:.... In this case, entries is an array, and there are three methods map, sort_by, and map chained. sort_by(&:last) is equivalent to sort_by{|x| x.last}. map(&:first) is the same as map{|x| x.first}. The reason the first map does not use &:... is... | Why would one use the unary operator on a property in ruby? i.e &:first Possible Duplicate: Ruby/Ruby on Rails ampersand colon shortcut As a habit I try and read a little of someone elses source code regularly and comment on it in a gist. Right now I'm reading through sinatra's base app and came upon an interesting bit... | TITLE:
Why would one use the unary operator on a property in ruby? i.e &:first
QUESTION:
Possible Duplicate: Ruby/Ruby on Rails ampersand colon shortcut As a habit I try and read a little of someone elses source code regularly and comment on it in a gist. Right now I'm reading through sinatra's base app and came upon ... | [
"ruby",
"block",
"unary-operator"
] | 0 | 1 | 357 | 1 | 0 | 2011-06-09T06:50:42.830000 | 2011-06-09T07:08:41.367000 |
6,289,085 | 6,289,815 | Import script-modified .reg files with PowerShell? | I need to import a.reg file that contains standard configuration settings for a server product. However, it's possible that a single Windows box might contain multiple server instances. Each server instance has its own configuration keys in the Windows registry. The first instance will have the default registry key: HK... | As far as I know, basic PowerShell Cmdlets don't use.reg file at all. So, on one hand you can modify your reg files and apply them with REG.EXE. On the other hand you can use PowerShell registry provider an 'Item' CMdlets to modify your registry. | Import script-modified .reg files with PowerShell? I need to import a.reg file that contains standard configuration settings for a server product. However, it's possible that a single Windows box might contain multiple server instances. Each server instance has its own configuration keys in the Windows registry. The fi... | TITLE:
Import script-modified .reg files with PowerShell?
QUESTION:
I need to import a.reg file that contains standard configuration settings for a server product. However, it's possible that a single Windows box might contain multiple server instances. Each server instance has its own configuration keys in the Window... | [
"powershell",
"registry"
] | 3 | 5 | 24,908 | 3 | 0 | 2011-06-09T06:50:51.167000 | 2011-06-09T08:03:47.297000 |
6,289,090 | 6,289,131 | Creating threads that work with dialog boxes | I need to make a thread using AfxBeginThread in a MFC application that uses some dialog boxes, but because the thread function is inside a class I have to make it static, and then I can't use any controls because they are not static, and even if I make them static I get some linker errors. Can someone tell me how its t... | The thread function is supposed to receive a parameter that you pass to AfxBeginThread as pParam, and you can pass there the pointer to your class, and from the thread function call whatever class member function you want. That's how I do it. Something like this (pseudo code): CWinThread* thread = AfxBeginThread( MyCla... | Creating threads that work with dialog boxes I need to make a thread using AfxBeginThread in a MFC application that uses some dialog boxes, but because the thread function is inside a class I have to make it static, and then I can't use any controls because they are not static, and even if I make them static I get some... | TITLE:
Creating threads that work with dialog boxes
QUESTION:
I need to make a thread using AfxBeginThread in a MFC application that uses some dialog boxes, but because the thread function is inside a class I have to make it static, and then I can't use any controls because they are not static, and even if I make them... | [
"c++",
"mfc"
] | 1 | 2 | 793 | 2 | 0 | 2011-06-09T06:51:13.780000 | 2011-06-09T06:54:38.907000 |
6,289,118 | 6,289,143 | Regex and wild characters | I'd like to use the regex %[ _]play[,_]% where % is denotes allows some arbitrary string to appear. For example, I'd want to check that this regex appears in some where in some string. Is this valid? | No, it is not valid. The easiest way would be to simply remove the percentage signs, because a string doesn't need to match the specified regex exclusively. This regex: [ _]play[,_] will match this string: ABC play,DEF | Regex and wild characters I'd like to use the regex %[ _]play[,_]% where % is denotes allows some arbitrary string to appear. For example, I'd want to check that this regex appears in some where in some string. Is this valid? | TITLE:
Regex and wild characters
QUESTION:
I'd like to use the regex %[ _]play[,_]% where % is denotes allows some arbitrary string to appear. For example, I'd want to check that this regex appears in some where in some string. Is this valid?
ANSWER:
No, it is not valid. The easiest way would be to simply remove the ... | [
"regex",
"string"
] | 0 | 1 | 146 | 2 | 0 | 2011-06-09T06:53:46.690000 | 2011-06-09T06:56:53.433000 |
6,289,146 | 6,289,394 | How to make a menu link active using javascript/jQuery? | I have a static menu in a common header file. Whenever I visit any of the pages by clicking on the links in the menu, I need an image over that clicked link as an indicator of the activated link. below is the HTML of menu I am using home from Daniella material list program testimonials login How to use jQuery or javasc... | You don't need javascript/jQuery for this What you can do is to give each of your pages a unique ID or Class on the element or main container div somewhere near the top of the the HTML structure anyway.. then give each of the links in your menu a unique ID or class too (if using classes they can be the same as the firs... | How to make a menu link active using javascript/jQuery? I have a static menu in a common header file. Whenever I visit any of the pages by clicking on the links in the menu, I need an image over that clicked link as an indicator of the activated link. below is the HTML of menu I am using home from Daniella material lis... | TITLE:
How to make a menu link active using javascript/jQuery?
QUESTION:
I have a static menu in a common header file. Whenever I visit any of the pages by clicking on the links in the menu, I need an image over that clicked link as an indicator of the activated link. below is the HTML of menu I am using home from Dan... | [
"javascript",
"jquery",
"html",
"css",
"menu"
] | 1 | 4 | 4,739 | 2 | 0 | 2011-06-09T06:57:05.787000 | 2011-06-09T07:21:20.070000 |
6,289,147 | 6,289,565 | howto catch a error when i do "read" on a list of integer? | i need help, i have to read a list like this ["1", "2", "3"] and make a list of integer of it [1,2,3] so i use read. the problem is, when the list looks like ["1", "2", "a"] the programm quits because of the error that there is a char in it. how to check or throw an error to prevent this error? | You should be using reads, not read. Prelude>:m Data.Maybe Prelude Data.Maybe> (map (fmap fst. listToMaybe. reads) ["1", "2", "3"]):: [Maybe Integer] [Just 1,Just 2,Just 3] Prelude Data.Maybe> (map (fmap fst. listToMaybe. reads) ["1", "2", "a"]):: [Maybe Integer] [Just 1,Just 2,Nothing] Prelude Data.Maybe> | howto catch a error when i do "read" on a list of integer? i need help, i have to read a list like this ["1", "2", "3"] and make a list of integer of it [1,2,3] so i use read. the problem is, when the list looks like ["1", "2", "a"] the programm quits because of the error that there is a char in it. how to check or thr... | TITLE:
howto catch a error when i do "read" on a list of integer?
QUESTION:
i need help, i have to read a list like this ["1", "2", "3"] and make a list of integer of it [1,2,3] so i use read. the problem is, when the list looks like ["1", "2", "a"] the programm quits because of the error that there is a char in it. h... | [
"haskell"
] | 5 | 6 | 141 | 1 | 0 | 2011-06-09T06:57:07.903000 | 2011-06-09T07:40:04.493000 |
6,289,155 | 6,289,486 | Scroll on fixed position div | The entire popup-div is visible, and when I scroll vertically, it follows. Only half of the popup-div is visible, and when I scroll vertically it follows, but it's impossible to view the second part of the popup-div. How can this be achieved? css code:.popup { position:fixed; z-index:9002; background-color:#FFFFFF; bor... | try this code (the content of the pupup is just for testing): a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a ... | Scroll on fixed position div The entire popup-div is visible, and when I scroll vertically, it follows. Only half of the popup-div is visible, and when I scroll vertically it follows, but it's impossible to view the second part of the popup-div. How can this be achieved? css code:.popup { position:fixed; z-index:9002; ... | TITLE:
Scroll on fixed position div
QUESTION:
The entire popup-div is visible, and when I scroll vertically, it follows. Only half of the popup-div is visible, and when I scroll vertically it follows, but it's impossible to view the second part of the popup-div. How can this be achieved? css code:.popup { position:fix... | [
"javascript",
"css"
] | 0 | 1 | 4,012 | 2 | 0 | 2011-06-09T06:57:54.860000 | 2011-06-09T07:31:09.247000 |
6,289,156 | 6,289,858 | Radwindow OnClientClose firing on open | I have a radwindow which is opened using a javascript function as follows. However, when the radwindow pops up, the alert is displayed. function OpenRadWindow() { var oManager = GetRadWindowManager(); var oMailWnd; oMailWnd = window.radopen("MyModal.aspx"); oMailWnd.set_title("Modal Window"); oMailWnd.OnClientClose = H... | This line: oMailWnd.OnClientClose = HideActions(); is wrong. If you want to add a closing handler to the RadWindow object, you should use the client-side API e.g. oMailWnd.add_close(HideActions); Also, if you are going to show the window multiple times and you haven't set DestroyOnClose=true, I would suggest to clear t... | Radwindow OnClientClose firing on open I have a radwindow which is opened using a javascript function as follows. However, when the radwindow pops up, the alert is displayed. function OpenRadWindow() { var oManager = GetRadWindowManager(); var oMailWnd; oMailWnd = window.radopen("MyModal.aspx"); oMailWnd.set_title("Mod... | TITLE:
Radwindow OnClientClose firing on open
QUESTION:
I have a radwindow which is opened using a javascript function as follows. However, when the radwindow pops up, the alert is displayed. function OpenRadWindow() { var oManager = GetRadWindowManager(); var oMailWnd; oMailWnd = window.radopen("MyModal.aspx"); oMail... | [
"javascript",
"telerik",
"radwindow"
] | 1 | 3 | 6,110 | 1 | 0 | 2011-06-09T06:58:05.980000 | 2011-06-09T08:08:43.113000 |
6,289,159 | 6,289,213 | string matching function in mysql | I've to match a string with strings in a column of mysql table, i need to select the strings which has more than 80% of match. is there any function in mysql will do this? for example "quote by placing" string matches more than 80% for the string"quote by place". Like this i've filter. Thanks! | A FULLTEXT search would probably be the best approach for what you're doing. No need to pick an arbitrary % otherwise. If you're doing more intensive searching check out some of the engines like Sphinx | string matching function in mysql I've to match a string with strings in a column of mysql table, i need to select the strings which has more than 80% of match. is there any function in mysql will do this? for example "quote by placing" string matches more than 80% for the string"quote by place". Like this i've filter.... | TITLE:
string matching function in mysql
QUESTION:
I've to match a string with strings in a column of mysql table, i need to select the strings which has more than 80% of match. is there any function in mysql will do this? for example "quote by placing" string matches more than 80% for the string"quote by place". Like... | [
"php",
"mysql"
] | 2 | 3 | 533 | 4 | 0 | 2011-06-09T06:58:19.213000 | 2011-06-09T07:03:19.400000 |
6,289,170 | 6,290,120 | How to find out the near by restaurants using current location details | Thanks in advance. I want to find out the near by restaurant details using current location details like latitude,longitude details. Is there any api for that, could any one have idea, please let me know. Answer: Hi all, I am using http://maps.google.com/?q=restaurents+near+hyderabad&output=kml this url now if it is no... | Yes this is possible in a variety of ways - you can choose Facebook Checkins - https://graph.facebook.com/search?q=restaurant&type=place¢er=lat,long&distance=1000 Foursquare API - https://developer.foursquare.com/ Google Places API - Refer their doc before using this - http://code.google.com/apis/maps/documentation... | How to find out the near by restaurants using current location details Thanks in advance. I want to find out the near by restaurant details using current location details like latitude,longitude details. Is there any api for that, could any one have idea, please let me know. Answer: Hi all, I am using http://maps.googl... | TITLE:
How to find out the near by restaurants using current location details
QUESTION:
Thanks in advance. I want to find out the near by restaurant details using current location details like latitude,longitude details. Is there any api for that, could any one have idea, please let me know. Answer: Hi all, I am using... | [
"iphone"
] | 0 | 2 | 58,595 | 2 | 0 | 2011-06-09T06:59:55.257000 | 2011-06-09T08:35:58.640000 |
6,289,175 | 6,289,197 | target= out of a iframe but stays in the same browser window? | Currently, site A is embedded in a site B's iframe. For one.php page, I'd like to jump out of the parent iframe when submitting to the page: However, this will pop up a new window. Is there a way to jump out of the iframe but remind in the same browser window? | The usual approach is to use target="_parent" or target="_top". As per the HTML 4 specification: _parent - The user agent should load the document into the immediate FRAMESET parent of the current frame. This value is equivalent to _self if the current frame has no parent. _top - The user agent should load the document... | target= out of a iframe but stays in the same browser window? Currently, site A is embedded in a site B's iframe. For one.php page, I'd like to jump out of the parent iframe when submitting to the page: However, this will pop up a new window. Is there a way to jump out of the iframe but remind in the same browser windo... | TITLE:
target= out of a iframe but stays in the same browser window?
QUESTION:
Currently, site A is embedded in a site B's iframe. For one.php page, I'd like to jump out of the parent iframe when submitting to the page: However, this will pop up a new window. Is there a way to jump out of the iframe but remind in the ... | [
"php",
"html",
"forms"
] | 2 | 3 | 1,372 | 2 | 0 | 2011-06-09T07:00:30.497000 | 2011-06-09T07:02:18.183000 |
6,289,192 | 6,290,098 | Referenced class lib doesn't seem | I have a class lib and I referenced it to another windows project. I added its namespace to my Form.cs ( using SaglikNetClassLib; ). they are seem unknown when I want to access to classes. I can see their properties and methods. But the complier says "Error 7 The type or namespace name 'SaglikNetClassLib' could not be ... | Are you targeting the.net Client Framework? Visual Studio let's you add references to incompatible assemblies, but then gives exactly that error. Check your project settings to make sure you're targeting the full.net framework. Also, check that the Ilalcar class is public and not internal (which is the default if it's ... | Referenced class lib doesn't seem I have a class lib and I referenced it to another windows project. I added its namespace to my Form.cs ( using SaglikNetClassLib; ). they are seem unknown when I want to access to classes. I can see their properties and methods. But the complier says "Error 7 The type or namespace name... | TITLE:
Referenced class lib doesn't seem
QUESTION:
I have a class lib and I referenced it to another windows project. I added its namespace to my Form.cs ( using SaglikNetClassLib; ). they are seem unknown when I want to access to classes. I can see their properties and methods. But the complier says "Error 7 The type... | [
"c#",
"visual-studio-2010",
"class-library"
] | 1 | 3 | 58 | 2 | 0 | 2011-06-09T07:01:41.497000 | 2011-06-09T08:33:41.473000 |
6,289,193 | 6,289,383 | Newest price for an item in LINQ / LAMBDA | How do I formulate the following in LINQ with LAMBDA expressions. Given (for simplicity - this is actually later a join) a table with the fields: Item Price Timestamp which is mapped to a class. I use BlToolkit, but could also be LINQ or EF - makes no difference. I want the object with Item = 2 and the highest timestam... | Using fluent syntax, the item with the highest timestamp, and Item==2 is: var item= table.Where(i => i.Item == 2).OrderByDescending(i => i.Timestamp).SingleOrDefault(); | Newest price for an item in LINQ / LAMBDA How do I formulate the following in LINQ with LAMBDA expressions. Given (for simplicity - this is actually later a join) a table with the fields: Item Price Timestamp which is mapped to a class. I use BlToolkit, but could also be LINQ or EF - makes no difference. I want the obj... | TITLE:
Newest price for an item in LINQ / LAMBDA
QUESTION:
How do I formulate the following in LINQ with LAMBDA expressions. Given (for simplicity - this is actually later a join) a table with the fields: Item Price Timestamp which is mapped to a class. I use BlToolkit, but could also be LINQ or EF - makes no differen... | [
"sql",
"linq",
"lambda"
] | 1 | 3 | 90 | 1 | 0 | 2011-06-09T07:01:47.737000 | 2011-06-09T07:20:13.370000 |
6,289,196 | 6,289,255 | Window message: Different between WM_CREATE and WM_NCCREATE? | I tried to create button (child window) inside WM_NCCREATE message, and its position seemed to be created respected to screen coordinates, rather than client coordinates. At first, I thought WM_CREATE and WM_NCCREATE provide us the same handle to window, but this seem to be untrue. Therefore, can anyone explain me the ... | Per MSDN: WM_NCCREATE: Sent prior to the WM_CREATE message when a window is first created. Return Value: If an application processes this message, it should return TRUE to continue creation of the window. If the application returns FALSE, the CreateWindow or CreateWindowEx function will return a NULL handle. WM_CREATE:... | Window message: Different between WM_CREATE and WM_NCCREATE? I tried to create button (child window) inside WM_NCCREATE message, and its position seemed to be created respected to screen coordinates, rather than client coordinates. At first, I thought WM_CREATE and WM_NCCREATE provide us the same handle to window, but ... | TITLE:
Window message: Different between WM_CREATE and WM_NCCREATE?
QUESTION:
I tried to create button (child window) inside WM_NCCREATE message, and its position seemed to be created respected to screen coordinates, rather than client coordinates. At first, I thought WM_CREATE and WM_NCCREATE provide us the same hand... | [
"c++",
"windows"
] | 16 | 5 | 9,969 | 5 | 0 | 2011-06-09T07:02:15.423000 | 2011-06-09T07:07:02.837000 |
6,289,206 | 6,289,447 | Android: (webservices) How to store the data in remote server and retrieve it | I have an Android application which needs username and password to login. I need to save the username and password in a remote server by entering the details in the register page with an alert box showing Registered successfully. When the user opens the app next time, he will login. I want to use client/server mechanis... | package com.google.android.Test;
import org.ksoap2.SoapEnvelope; import org.ksoap2.serialization.SoapObject; import org.ksoap2.serialization.SoapSerializationEnvelope; import org.ksoap2.transport.HttpTransport;
import android.app.Activity; import android.os.Bundle; import android.widget.TextView;
public class myWebS... | Android: (webservices) How to store the data in remote server and retrieve it I have an Android application which needs username and password to login. I need to save the username and password in a remote server by entering the details in the register page with an alert box showing Registered successfully. When the use... | TITLE:
Android: (webservices) How to store the data in remote server and retrieve it
QUESTION:
I have an Android application which needs username and password to login. I need to save the username and password in a remote server by entering the details in the register page with an alert box showing Registered successf... | [
"android",
"web-services"
] | 1 | 1 | 4,570 | 2 | 0 | 2011-06-09T07:02:58.773000 | 2011-06-09T07:27:10.810000 |
6,289,210 | 6,289,228 | Why is time coming as 0000 when i am using the todays date in C# | I am trying to create a string to show the current date and time without wanting to use any slashes just the numbers. For example, 09 jun 2011 11AM should be 201109061100 But when i run the below code the time is always 0000 Output: ResultLog201109060000 Code: DateTime currDate = DateTime.Today; String resultlogFilenam... | DateTime.Today seems to return the Date part not the hour part. Just use DateTime.Now to get a complete time. http://msdn.microsoft.com/en-us/library/system.datetime.now.aspx Msdn DateTime.Today Because it returns the current date without the current time, the Today property is suitable for use in applications that wor... | Why is time coming as 0000 when i am using the todays date in C# I am trying to create a string to show the current date and time without wanting to use any slashes just the numbers. For example, 09 jun 2011 11AM should be 201109061100 But when i run the below code the time is always 0000 Output: ResultLog201109060000 ... | TITLE:
Why is time coming as 0000 when i am using the todays date in C#
QUESTION:
I am trying to create a string to show the current date and time without wanting to use any slashes just the numbers. For example, 09 jun 2011 11AM should be 201109061100 But when i run the below code the time is always 0000 Output: Resu... | [
"c#",
".net",
"datetime",
"string-formatting"
] | 3 | 5 | 359 | 4 | 0 | 2011-06-09T07:03:13.260000 | 2011-06-09T07:04:23.740000 |
6,289,215 | 6,289,257 | How to get the last attribute in XML with Java? | I have a XML file like this: From java code, i want to get latest phone attribute. I'm not using condition that attr.getValue() because this data always updated, so I want to get the latest value of phone attribute. | You can use the following xpath to get the last user's phone attribute: //user[last()]/account/@phone This will give you you phone ="2003". Here is a java snippet: import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.xpath.XPath; import javax.xml.xpath.XPathFactory; import org.w3c.dom.Document;
XPath xpat... | How to get the last attribute in XML with Java? I have a XML file like this: From java code, i want to get latest phone attribute. I'm not using condition that attr.getValue() because this data always updated, so I want to get the latest value of phone attribute. | TITLE:
How to get the last attribute in XML with Java?
QUESTION:
I have a XML file like this: From java code, i want to get latest phone attribute. I'm not using condition that attr.getValue() because this data always updated, so I want to get the latest value of phone attribute.
ANSWER:
You can use the following xpa... | [
"java",
"xml"
] | 0 | 4 | 1,507 | 2 | 0 | 2011-06-09T07:03:41.573000 | 2011-06-09T07:07:06.957000 |
6,289,216 | 6,289,305 | Multiple UITableViews in a Single Class | In a single UiView controller class i've added 3 UITableView. UITableView *ChaptersTableView;
UITableView *SubChaptersTableView;
UITableView *SubTopics1TableView; Now in ViewDidLoad of class i've initialized these TableView's & calling the Delegate & Datasource methods on these Table View's. ChaptersTableView = [[UIT... | The delegate methods return the tableview object. Hence while creating you can tag the tableviews like this. SubTopics1TableView.tag = 0, SubChaptersTableView.tag = 1 etc. In your delegate methods check the tag and configure the tableviews. For eg - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIn... | Multiple UITableViews in a Single Class In a single UiView controller class i've added 3 UITableView. UITableView *ChaptersTableView;
UITableView *SubChaptersTableView;
UITableView *SubTopics1TableView; Now in ViewDidLoad of class i've initialized these TableView's & calling the Delegate & Datasource methods on these... | TITLE:
Multiple UITableViews in a Single Class
QUESTION:
In a single UiView controller class i've added 3 UITableView. UITableView *ChaptersTableView;
UITableView *SubChaptersTableView;
UITableView *SubTopics1TableView; Now in ViewDidLoad of class i've initialized these TableView's & calling the Delegate & Datasourc... | [
"iphone",
"ipad",
"uitableview"
] | 1 | 2 | 457 | 4 | 0 | 2011-06-09T07:03:41.940000 | 2011-06-09T07:12:05 |
6,289,227 | 6,289,290 | How to go to a particular activity on list item click? | I am developing an application in android in which i creating a list view of few items. I want to call a class on each list item click.Here is my code import android.app.Activity; import android.content.Intent; import android.os.Bundle;
import android.view.View; import android.widget.AdapterView; import android.widget... | Did you correctly register abc.class as an Activity in your AndroidManifest.xml file? That would cause a crash. | How to go to a particular activity on list item click? I am developing an application in android in which i creating a list view of few items. I want to call a class on each list item click.Here is my code import android.app.Activity; import android.content.Intent; import android.os.Bundle;
import android.view.View; i... | TITLE:
How to go to a particular activity on list item click?
QUESTION:
I am developing an application in android in which i creating a list view of few items. I want to call a class on each list item click.Here is my code import android.app.Activity; import android.content.Intent; import android.os.Bundle;
import an... | [
"android",
"listview",
"onclick"
] | 2 | 2 | 17,321 | 4 | 0 | 2011-06-09T07:04:23.520000 | 2011-06-09T07:11:04.123000 |
6,289,236 | 6,289,400 | Tumblr API get current AVATAR URL | Everyone knows? about avatar url in tumblr api / read / json? like for example the facebook? http://graph.facebook.com/[your facebook id]/picture?type=normal ". $blogInfo['title']. " \n"; echo " ". $blogInfo['picture']. " \n \n";?> how to append my current avatar? | I guess you have to use GET http://www.tumblr.com/api/authenticate?email=user@example.com&password=12345 to get the avatar of the user. The sample response for mine is and get the avatar-url field of the corresponding tumblelog. Too bad there is no json format option, maybe use preg_match. You also need the email addre... | Tumblr API get current AVATAR URL Everyone knows? about avatar url in tumblr api / read / json? like for example the facebook? http://graph.facebook.com/[your facebook id]/picture?type=normal ". $blogInfo['title']. " \n"; echo " ". $blogInfo['picture']. " \n \n";?> how to append my current avatar? | TITLE:
Tumblr API get current AVATAR URL
QUESTION:
Everyone knows? about avatar url in tumblr api / read / json? like for example the facebook? http://graph.facebook.com/[your facebook id]/picture?type=normal ". $blogInfo['title']. " \n"; echo " ". $blogInfo['picture']. " \n \n";?> how to append my current avatar?
AN... | [
"tumblr"
] | 4 | 0 | 5,693 | 2 | 0 | 2011-06-09T07:05:04.377000 | 2011-06-09T07:21:46.880000 |
6,289,240 | 6,289,503 | C# type design Question | This might sound a little stupid but I am still curious about what the community thinks. So I have a WebService returning a UpdateInfo class. Now consider the following definitions public enum TTCFileType { API = 0, BOOKMARK, TICKMARK } public class FileUpdateInfo { public string FileName; public string FileDownLoadURI... | Ideally, you need two additional structure(s) public enum TickmarkType { TYPE1=0, TYPE2 }
public class TickMarkFileUpdateInfo: FileUpdateInfo { public TickmarkType type; } And then read about polymorphism in web services | C# type design Question This might sound a little stupid but I am still curious about what the community thinks. So I have a WebService returning a UpdateInfo class. Now consider the following definitions public enum TTCFileType { API = 0, BOOKMARK, TICKMARK } public class FileUpdateInfo { public string FileName; publi... | TITLE:
C# type design Question
QUESTION:
This might sound a little stupid but I am still curious about what the community thinks. So I have a WebService returning a UpdateInfo class. Now consider the following definitions public enum TTCFileType { API = 0, BOOKMARK, TICKMARK } public class FileUpdateInfo { public stri... | [
"c#"
] | 4 | 0 | 176 | 5 | 0 | 2011-06-09T07:05:32.307000 | 2011-06-09T07:33:27.957000 |
6,289,251 | 6,289,296 | SQL - Finding maximum date in set of rows along with all other data | I have a table with rows like below id, name, phName, startDate, endDate
1 A, Name 1-1-2011 5-1-2011
2 B, Name 5-1-2011 10-10-2011
3 C, Name 2-1-2011 11-10-2011
4 X, XXName 2-1-2011 11-10-2011 Now I need to find the max(startDate) along with all other columns for a given phName. Essentially, I want the resultset to... | SELECT (SELECT Max(StartDate) FROM myTable WHERE phName = "Name") as MaxDate, id, name, phName, startDate, endDate FROM myTable WHERE phName = "Name" | SQL - Finding maximum date in set of rows along with all other data I have a table with rows like below id, name, phName, startDate, endDate
1 A, Name 1-1-2011 5-1-2011
2 B, Name 5-1-2011 10-10-2011
3 C, Name 2-1-2011 11-10-2011
4 X, XXName 2-1-2011 11-10-2011 Now I need to find the max(startDate) along with all ot... | TITLE:
SQL - Finding maximum date in set of rows along with all other data
QUESTION:
I have a table with rows like below id, name, phName, startDate, endDate
1 A, Name 1-1-2011 5-1-2011
2 B, Name 5-1-2011 10-10-2011
3 C, Name 2-1-2011 11-10-2011
4 X, XXName 2-1-2011 11-10-2011 Now I need to find the max(startDate)... | [
"sql"
] | 1 | 2 | 9,501 | 3 | 0 | 2011-06-09T07:06:26.483000 | 2011-06-09T07:11:35.530000 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.