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,207,090
6,207,147
WCF error: No end point listening
HI, I know this is a very common question in case of.Net, but a weird thing is happening. My friend has a wcf service hosted in IIS. I am able to connect to his service by http://172.16.70.129/newwebsite/eval.svc Also, when I use wcftestclient to access the service, it is able to get the metadata and download the opera...
If I understand correctly, the WCF service is running on your friend's machine. The localhost in the endpoint is trying to reference the service as if it's on your own machine. To fix this, replace localhost with 172.16.70.129 in the endpoint.
WCF error: No end point listening HI, I know this is a very common question in case of.Net, but a weird thing is happening. My friend has a wcf service hosted in IIS. I am able to connect to his service by http://172.16.70.129/newwebsite/eval.svc Also, when I use wcftestclient to access the service, it is able to get t...
TITLE: WCF error: No end point listening QUESTION: HI, I know this is a very common question in case of.Net, but a weird thing is happening. My friend has a wcf service hosted in IIS. I am able to connect to his service by http://172.16.70.129/newwebsite/eval.svc Also, when I use wcftestclient to access the service, i...
[ ".net", "wcf" ]
0
1
1,236
1
0
2011-06-01T20:14:17.190000
2011-06-01T20:20:14.827000
6,207,091
6,207,300
Dynamically hooking up a class having different possible constructors
Let's say I have two classes that look like this: public class ByteFilter { private Func readBytes; private Action writeBytes; public ByteFilter(Func readBytes, Action writeBytes) { this.readBytes = readBytes; this.writeBytes = writeBytes; } } public class PacketFilter { private Func readPacket; private Action writeP...
Can't you do something like? bool packetConstructor = typeof(PacketFilter).GetConstructors().Any(c => c.GetParameters().Any(p => p.ParameterType == typeof(Func ))); replacing typeof(PacketFilter) with appropriate instance.
Dynamically hooking up a class having different possible constructors Let's say I have two classes that look like this: public class ByteFilter { private Func readBytes; private Action writeBytes; public ByteFilter(Func readBytes, Action writeBytes) { this.readBytes = readBytes; this.writeBytes = writeBytes; } } publ...
TITLE: Dynamically hooking up a class having different possible constructors QUESTION: Let's say I have two classes that look like this: public class ByteFilter { private Func readBytes; private Action writeBytes; public ByteFilter(Func readBytes, Action writeBytes) { this.readBytes = readBytes; this.writeBytes = wri...
[ "c#", ".net", "reflection", "constructor", "instantiation" ]
0
2
261
3
0
2011-06-01T20:14:30.080000
2011-06-01T20:33:58.217000
6,207,105
6,207,171
Trouble Installing Selenium RC Java Client Driver
I'm trying to set up Selenium RC with Eclipse, but when I download the.zip from the Selenium HQ website it comes with several files included. Which is the Java Client Driver that I need to include in my project?
The client driver is selenium-java-2.0b3.jar if you are using the one that is on the SeleniumHQ site. I'd recommend downloading the release candidate here, which is a more recent version. (It probably hasn't made it to the main site yet because it was uploaded only 4 hours ago.)
Trouble Installing Selenium RC Java Client Driver I'm trying to set up Selenium RC with Eclipse, but when I download the.zip from the Selenium HQ website it comes with several files included. Which is the Java Client Driver that I need to include in my project?
TITLE: Trouble Installing Selenium RC Java Client Driver QUESTION: I'm trying to set up Selenium RC with Eclipse, but when I download the.zip from the Selenium HQ website it comes with several files included. Which is the Java Client Driver that I need to include in my project? ANSWER: The client driver is selenium-j...
[ "java", "selenium", "selenium-rc" ]
1
1
333
1
0
2011-06-01T20:15:57.487000
2011-06-01T20:22:43.133000
6,207,110
6,207,127
Convert basic array to PHP array
I have an array that I pull that looks like this: [157966745,275000353,43192565,305328212]... How do I go about taking that "string" and converting it to a PHP array which I can then manipulate.
This looks like JSON, so you can use json_decode: $str = "[157966745,275000353,43192565,305328212]"; $data = json_decode($str);
Convert basic array to PHP array I have an array that I pull that looks like this: [157966745,275000353,43192565,305328212]... How do I go about taking that "string" and converting it to a PHP array which I can then manipulate.
TITLE: Convert basic array to PHP array QUESTION: I have an array that I pull that looks like this: [157966745,275000353,43192565,305328212]... How do I go about taking that "string" and converting it to a PHP array which I can then manipulate. ANSWER: This looks like JSON, so you can use json_decode: $str = "[157966...
[ "php", "arrays" ]
1
10
92
5
0
2011-06-01T20:16:29.373000
2011-06-01T20:18:02.727000
6,207,113
6,219,824
Hibernate removes child objects after session.update(parent)
I have a very simple parent-/child relationship between objects of type "Folder", which looks like this: A folder can have 0-1 parent folders. A folder can have 0-n child folders (subfolders). So, basically, a simplified version of the Java class Folder looks like this: public class Folder{ long id; Set childFolders; F...
I added some more debug code and I finally found the solution: Directly before the session.update(folder3) call, I had a tiny hidden folder.childFolders.clear() call which obviously caused the issue, so the problem didn't have something to do with Hibernate at all. Just with my stupidness. Sorry everyone for bothering ...
Hibernate removes child objects after session.update(parent) I have a very simple parent-/child relationship between objects of type "Folder", which looks like this: A folder can have 0-1 parent folders. A folder can have 0-n child folders (subfolders). So, basically, a simplified version of the Java class Folder looks...
TITLE: Hibernate removes child objects after session.update(parent) QUESTION: I have a very simple parent-/child relationship between objects of type "Folder", which looks like this: A folder can have 0-1 parent folders. A folder can have 0-n child folders (subfolders). So, basically, a simplified version of the Java ...
[ "java", "hibernate" ]
1
0
789
3
0
2011-06-01T20:16:38.643000
2011-06-02T20:12:34.877000
6,207,114
6,207,258
how to force sleep or any other type of timer to execute at particular time in c++?
I am doing socket programming in C and I want to do the following thing: pid = fork(); if(pid == 0){ //child process for(int m=0;m<2;m++){ j=0; for(i=0;i So basically the process will send data to all the neighbors and the goto sleep. What is happening here is the process sends data to first neighbor and then sleeps fo...
I can only guess what is the problem (please add the child code creation to check), I think that when this code is executed by the first child the number of neighbors is 0, with the second the number will be 1, and so on. I would try with a sleep at the beginning so this gives enough time to the others children to fork...
how to force sleep or any other type of timer to execute at particular time in c++? I am doing socket programming in C and I want to do the following thing: pid = fork(); if(pid == 0){ //child process for(int m=0;m<2;m++){ j=0; for(i=0;i So basically the process will send data to all the neighbors and the goto sleep. W...
TITLE: how to force sleep or any other type of timer to execute at particular time in c++? QUESTION: I am doing socket programming in C and I want to do the following thing: pid = fork(); if(pid == 0){ //child process for(int m=0;m<2;m++){ j=0; for(i=0;i So basically the process will send data to all the neighbors and...
[ "c++", "sockets", "udp", "posix" ]
0
0
224
3
0
2011-06-01T20:16:53.027000
2011-06-01T20:30:06.273000
6,207,115
6,207,195
Accurate method to add months in PHP 5.1?
Yesterday I ran into an issue with PHP's strtotime not properly adding a month. On '2011-05-31' I ran: date('Y-m-d',strtotime( '+1 month', strtotime('now'))); Which returns '2011-07-01' when I am expecting '2011-06-30'. MySQL doesn't have any issue doing this. I'd rather not reinvent the wheel with this, as it is fairl...
It certainly is possible in PHP: Check the strtotime manual, especially this comment. If you have a MySQL connection available, SELECT DATE_ADD( '2011-05-31', INTERVAL 1 MONTH ) would be less redundant since the (correct) functionality is already implemented without you having to implement it yourself.
Accurate method to add months in PHP 5.1? Yesterday I ran into an issue with PHP's strtotime not properly adding a month. On '2011-05-31' I ran: date('Y-m-d',strtotime( '+1 month', strtotime('now'))); Which returns '2011-07-01' when I am expecting '2011-06-30'. MySQL doesn't have any issue doing this. I'd rather not re...
TITLE: Accurate method to add months in PHP 5.1? QUESTION: Yesterday I ran into an issue with PHP's strtotime not properly adding a month. On '2011-05-31' I ran: date('Y-m-d',strtotime( '+1 month', strtotime('now'))); Which returns '2011-07-01' when I am expecting '2011-06-30'. MySQL doesn't have any issue doing this....
[ "php", "strtotime" ]
7
5
4,765
7
0
2011-06-01T20:17:05.443000
2011-06-01T20:25:26.203000
6,207,116
6,207,706
How to distinguish between Digital/Composite AV Cable on iPad?
I am using UIApplication+ScreenMirroring as software support for mirroring display on iPad1. iPad2 now includes built-in support for mirroring when using the Digital AV Cable. Currently in my app, I am disabling the software support for mirroring when an iPad2 is detected. However, if a user is using an iPad2 but conne...
You may be able to use UIScreen's mirroredScreen property added in 4.3 to determine if mirroring is actually happening due to a supported device being connected. Since this is only in 4.3 and all ipad 2s shipped with 4.3 greater, you would just need to do an os level check to ensure the property exists, if it doesn't i...
How to distinguish between Digital/Composite AV Cable on iPad? I am using UIApplication+ScreenMirroring as software support for mirroring display on iPad1. iPad2 now includes built-in support for mirroring when using the Digital AV Cable. Currently in my app, I am disabling the software support for mirroring when an iP...
TITLE: How to distinguish between Digital/Composite AV Cable on iPad? QUESTION: I am using UIApplication+ScreenMirroring as software support for mirroring display on iPad1. iPad2 now includes built-in support for mirroring when using the Digital AV Cable. Currently in my app, I am disabling the software support for mi...
[ "iphone", "ios", "ipad" ]
0
0
302
1
0
2011-06-01T20:17:07
2011-06-01T21:07:21.863000
6,207,124
6,207,529
MVC: Best way for a hyperlink to post back to an ActionResult
I'm using a Html.BeginForm but I need a hyperlink to trigger a postback to a ActionResult (similar functionality to a LinkButton). I don't think that I can use an ActionLink because i'm not routing to a view with the same name as the ActionResult (or have I misunderstood:S). Any help would be appreciated. Thanks
I think you have two options (though the first isn't as flexible and can get messy) 1) style your submit button like a hyperlink (easy, but you'll probably end up using Html.BeginAjax or something like that) 2) Style a div, ActionLink, or some other element and serialize the form data on posting back using jQuery If yo...
MVC: Best way for a hyperlink to post back to an ActionResult I'm using a Html.BeginForm but I need a hyperlink to trigger a postback to a ActionResult (similar functionality to a LinkButton). I don't think that I can use an ActionLink because i'm not routing to a view with the same name as the ActionResult (or have I ...
TITLE: MVC: Best way for a hyperlink to post back to an ActionResult QUESTION: I'm using a Html.BeginForm but I need a hyperlink to trigger a postback to a ActionResult (similar functionality to a LinkButton). I don't think that I can use an ActionLink because i'm not routing to a view with the same name as the Action...
[ "asp.net-mvc-3" ]
1
0
1,966
1
0
2011-06-01T20:17:57.783000
2011-06-01T20:52:29.193000
6,207,132
6,229,971
Applescript Tell Application launched by specific user
I am running two Skype on the same computer: one is launched normally and the other one is launched in Terminal under a different user account B. Then, I want to use Applescript to Tell application "Skype" (which is launched by account B) to do something. How should I specific the instance of Skype that is launched by ...
I turned out to solve it by creating two copies of Skype.app and rename the new one "Skype2.app". Skpye.app is launched by user A and Skype2.app by user B (via Terminal). Then, in Applescript tell application "Skype" -- do something for user A end tell tell application "Skype2" -- do something else for user B end tell
Applescript Tell Application launched by specific user I am running two Skype on the same computer: one is launched normally and the other one is launched in Terminal under a different user account B. Then, I want to use Applescript to Tell application "Skype" (which is launched by account B) to do something. How shoul...
TITLE: Applescript Tell Application launched by specific user QUESTION: I am running two Skype on the same computer: one is launched normally and the other one is launched in Terminal under a different user account B. Then, I want to use Applescript to Tell application "Skype" (which is launched by account B) to do so...
[ "applescript" ]
2
0
1,254
3
0
2011-06-01T20:18:53.100000
2011-06-03T16:32:41.410000
6,207,135
6,207,173
How to get data out of an Arraylist
So in a previous quesiton I asked how i could merge multiple array list into one array list. This answer worked (also listed below). However, I am having issues getting the records out. How do I get the data out of this multi dimensional arraylist. For example, what if I wanted to get just address out? ArrayList Names ...
You could do something like the following... I want to make sure and I note that you might want to come up with better data structures or container classes if you can. string someAddress = ((string[])res[0])[2]; In this instance we are taking the object (string array) at the first index of res and then indexing into th...
How to get data out of an Arraylist So in a previous quesiton I asked how i could merge multiple array list into one array list. This answer worked (also listed below). However, I am having issues getting the records out. How do I get the data out of this multi dimensional arraylist. For example, what if I wanted to ge...
TITLE: How to get data out of an Arraylist QUESTION: So in a previous quesiton I asked how i could merge multiple array list into one array list. This answer worked (also listed below). However, I am having issues getting the records out. How do I get the data out of this multi dimensional arraylist. For example, what...
[ "c#", "arraylist" ]
1
6
9,222
4
0
2011-06-01T20:19:08.487000
2011-06-01T20:22:44.697000
6,207,136
6,207,207
declaring an array of pointers in a C header file and assigning value?
Is it possible to declare an array of pointers and later on initialize either of them and assign a value, in a C header file? char *i[2]; i[0] = "abc"; the following does not work. char *x = "def"; // this will, of course. How am I supposed to declare and assign values for an array of pointers?
This has nothing to do with header files. You cannot create a.c file and put in it code like this: char *i[2]; i[0] = "abc"; In C, all code except definitions and initialisations must be inside functions, and your second statement is neither of these - it is an assignment. An initialisation for your array would look li...
declaring an array of pointers in a C header file and assigning value? Is it possible to declare an array of pointers and later on initialize either of them and assign a value, in a C header file? char *i[2]; i[0] = "abc"; the following does not work. char *x = "def"; // this will, of course. How am I supposed to decla...
TITLE: declaring an array of pointers in a C header file and assigning value? QUESTION: Is it possible to declare an array of pointers and later on initialize either of them and assign a value, in a C header file? char *i[2]; i[0] = "abc"; the following does not work. char *x = "def"; // this will, of course. How am I...
[ "c", "arrays", "pointers", "header-files" ]
0
2
3,826
4
0
2011-06-01T20:19:30.933000
2011-06-01T20:26:35.207000
6,207,143
6,207,535
Bind image to datagrid using resources
I am trying to retrieve the image from resource file and tryin to bind it to the datagrid of my WPF application. The datagrid is somewhat like this: And Image is a property of type image of my MVVm class like this: public Image Icon { get { return _licenseImage; } set { _licenseImage = value; PropertChanged("Icon");} }...
You should bind to an ImageSource instead of Image. we use this helper class: public static class ImageSourceHelper { public static ImageSource GetResourceImage(string resourcePath) { return GetResourceImage(Assembly.GetCallingAssembly(), resourcePath); } public static ImageSource GetResourceImage(Assembly resourceAss...
Bind image to datagrid using resources I am trying to retrieve the image from resource file and tryin to bind it to the datagrid of my WPF application. The datagrid is somewhat like this: And Image is a property of type image of my MVVm class like this: public Image Icon { get { return _licenseImage; } set { _licenseIm...
TITLE: Bind image to datagrid using resources QUESTION: I am trying to retrieve the image from resource file and tryin to bind it to the datagrid of my WPF application. The datagrid is somewhat like this: And Image is a property of type image of my MVVm class like this: public Image Icon { get { return _licenseImage; ...
[ "c#", "wpf", "image", "datagrid" ]
0
1
4,085
2
0
2011-06-01T20:19:58.047000
2011-06-01T20:52:48.173000
6,207,146
6,207,889
Help with updating vb.net formview using storedprocedure
I have followed this tutorial for the most part to explain what I am doing. http://www.asp.net/data-access/tutorials/creating-a-business-logic-layer-vb What i need to do is figure out the best way to approach to be able to update my formview. I do not understand what the tutorial is trying to explain to me so i tried i...
Without knowing which line of code is causing that error, I can't say for sure, however, my guess is that your error is on this line of code. _applicantadapter = New applicantTableAdapter Put an open parentheses after applicantTableAdapter to see the different constructor signatures available to you for that type. I be...
Help with updating vb.net formview using storedprocedure I have followed this tutorial for the most part to explain what I am doing. http://www.asp.net/data-access/tutorials/creating-a-business-logic-layer-vb What i need to do is figure out the best way to approach to be able to update my formview. I do not understand ...
TITLE: Help with updating vb.net formview using storedprocedure QUESTION: I have followed this tutorial for the most part to explain what I am doing. http://www.asp.net/data-access/tutorials/creating-a-business-logic-layer-vb What i need to do is figure out the best way to approach to be able to update my formview. I ...
[ "asp.net", ".net", "vb.net" ]
1
0
501
1
0
2011-06-01T20:20:11.230000
2011-06-01T21:24:19.583000
6,207,154
6,207,259
2nd level view in ASP.net MVC
I have an address "http://localhost:3579/MusicStore/StoreManager" which is really showing "http://localhost:3579/MusicStore/StoreManager/Index". I want to go to another another address on the same level from the index: "http://localhost:3579/MusicStore/StoreManager/Edit". Edit is a view inside the StoreManager folder, ...
It sounds like your action is in the right place, but you will need to make sure there is a route specified to route your URL to that action. Make sure a route like this is specified in your global.asax or area registration file if your project is using areas: context.MapRoute( "MusicStore_Edit", "MusicStore/StoreManag...
2nd level view in ASP.net MVC I have an address "http://localhost:3579/MusicStore/StoreManager" which is really showing "http://localhost:3579/MusicStore/StoreManager/Index". I want to go to another another address on the same level from the index: "http://localhost:3579/MusicStore/StoreManager/Edit". Edit is a view in...
TITLE: 2nd level view in ASP.net MVC QUESTION: I have an address "http://localhost:3579/MusicStore/StoreManager" which is really showing "http://localhost:3579/MusicStore/StoreManager/Index". I want to go to another another address on the same level from the index: "http://localhost:3579/MusicStore/StoreManager/Edit"....
[ "asp.net-mvc" ]
4
2
432
1
0
2011-06-01T20:21:03.913000
2011-06-01T20:30:06.287000
6,207,167
6,207,850
What to use for animation for iPad? SVG? GIF? Other?
I am making an app for the iPad/iphone and I want to have a star that tinkles every now and then and/or a rocket that shoots up randomly. What would be the best way to do that? Someone told me to use SVG and another told me that GIFs would be just fine.
SVG isn't going to work unless you are displaying the content in a UIWebView, you can either build the views using drawing code and perform the animations with core animation or use images, the first being far more efficient. Check out Apple's Core Animation Guide for more information.
What to use for animation for iPad? SVG? GIF? Other? I am making an app for the iPad/iphone and I want to have a star that tinkles every now and then and/or a rocket that shoots up randomly. What would be the best way to do that? Someone told me to use SVG and another told me that GIFs would be just fine.
TITLE: What to use for animation for iPad? SVG? GIF? Other? QUESTION: I am making an app for the iPad/iphone and I want to have a star that tinkles every now and then and/or a rocket that shoots up randomly. What would be the best way to do that? Someone told me to use SVG and another told me that GIFs would be just f...
[ "iphone", "ios", "ipad", "animation" ]
1
3
1,387
3
0
2011-06-01T18:46:11.993000
2011-06-01T21:19:21.397000
6,207,174
6,221,927
What are the performance considerations of using Amazon SimpleDB?
I'm creating a filesystem and I think I'll be storing files in a DB (http://sietch.net/ViewNewsItem.aspx?NewsItemID=124 and http://blog.druva.com/2009/01/25/file-systems-vs-databases/ seem to indicate it's a good idea). Since it's a filesystem, I'll need A LOT of I/O and REALLY fast. If I'm hosting on EC2, will Amazon ...
SimpleDB has a maximum record size of a 1,000 BYTES so it is VERY poorly suited to storing files/blobs (unless they are tiny). It is fairly common for people to use SimpleDB to index files and then to store the files in S3 which is much better suited for storing large objects.
What are the performance considerations of using Amazon SimpleDB? I'm creating a filesystem and I think I'll be storing files in a DB (http://sietch.net/ViewNewsItem.aspx?NewsItemID=124 and http://blog.druva.com/2009/01/25/file-systems-vs-databases/ seem to indicate it's a good idea). Since it's a filesystem, I'll need...
TITLE: What are the performance considerations of using Amazon SimpleDB? QUESTION: I'm creating a filesystem and I think I'll be storing files in a DB (http://sietch.net/ViewNewsItem.aspx?NewsItemID=124 and http://blog.druva.com/2009/01/25/file-systems-vs-databases/ seem to indicate it's a good idea). Since it's a fil...
[ "amazon-simpledb" ]
0
1
242
2
0
2011-06-01T20:22:48.927000
2011-06-03T00:49:15.720000
6,207,182
6,207,297
Difference between two date strings in java
I am trying to calculate difference between two date strings both of which are taken from user through a html form in format (yyyy/MM/dd) Code: public boolean diffDate() throws ParseException { date1 = getissuedate(); date2 = getduedate(); Calendar cal1 = Calendar.getInstance(); Calendar cal2 = Calendar.getInstance(); ...
you'll never get a difference of exactly 3 milliseconds between two dates gotten from a yyyy/MM/dd formatted string (maximum accuracy will be 24 hours) if you want 3 days difference use 24*60*60*1000 for a factor to scale the values
Difference between two date strings in java I am trying to calculate difference between two date strings both of which are taken from user through a html form in format (yyyy/MM/dd) Code: public boolean diffDate() throws ParseException { date1 = getissuedate(); date2 = getduedate(); Calendar cal1 = Calendar.getInstance...
TITLE: Difference between two date strings in java QUESTION: I am trying to calculate difference between two date strings both of which are taken from user through a html form in format (yyyy/MM/dd) Code: public boolean diffDate() throws ParseException { date1 = getissuedate(); date2 = getduedate(); Calendar cal1 = Ca...
[ "java" ]
0
1
7,128
7
0
2011-06-01T20:23:49.113000
2011-06-01T20:33:33.620000
6,207,185
6,207,204
Simple addClass on mouseover problem
I'm trying to set a class for a li item, with no luck. I have tried many things (to much to post) but I can't figure it out: $("li").live("mouseover",function(){ $(this).addClass('current'); }); The li item has to change class on mouseover(/hover) and keep that class state even if the mouse hovers outside the ul. But (...
You should remove the class from all the elements that currently have it before adding it to the new element: $("li").live("mouseover", function() { $('.current').removeClass('current'); $(this).addClass('current'); }); jsFiddle For added optimisation (i.e. to save the $('.current') selection, which can be expensive in...
Simple addClass on mouseover problem I'm trying to set a class for a li item, with no luck. I have tried many things (to much to post) but I can't figure it out: $("li").live("mouseover",function(){ $(this).addClass('current'); }); The li item has to change class on mouseover(/hover) and keep that class state even if t...
TITLE: Simple addClass on mouseover problem QUESTION: I'm trying to set a class for a li item, with no luck. I have tried many things (to much to post) but I can't figure it out: $("li").live("mouseover",function(){ $(this).addClass('current'); }); The li item has to change class on mouseover(/hover) and keep that cla...
[ "jquery", "addclass" ]
0
3
766
3
0
2011-06-01T20:24:02.400000
2011-06-01T20:26:23.980000
6,207,186
6,208,892
boost::asio::streambuf -- linker error
I'm having trouble getting a boost program to compile. The example I'm trying to compile is here: http://rosettacode.org/wiki/Web_scraping#C.2B.2B This is what happens when I try to compile: % g++ -Wall test.c -lboost_regex -lboost_system -lboost_thread /tmp/ccJSxOji.o: In function `boost::exception_detail::error_info_...
I hate to answer my own question, but as it turns out, I was bitten by this: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.15' not found I did some more digging: % ldd /usr/lib/libboost_regex.so /usr/lib/libboost_regex.so: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by /usr/lib/libboost_regex....
boost::asio::streambuf -- linker error I'm having trouble getting a boost program to compile. The example I'm trying to compile is here: http://rosettacode.org/wiki/Web_scraping#C.2B.2B This is what happens when I try to compile: % g++ -Wall test.c -lboost_regex -lboost_system -lboost_thread /tmp/ccJSxOji.o: In functio...
TITLE: boost::asio::streambuf -- linker error QUESTION: I'm having trouble getting a boost program to compile. The example I'm trying to compile is here: http://rosettacode.org/wiki/Web_scraping#C.2B.2B This is what happens when I try to compile: % g++ -Wall test.c -lboost_regex -lboost_system -lboost_thread /tmp/ccJS...
[ "gcc", "c++11", "boost-asio", "linker-errors" ]
1
4
1,153
1
0
2011-06-01T20:24:09.513000
2011-06-01T23:29:29.423000
6,207,187
6,207,235
PHP DOMDocument And DOMXpath
I am trying to find the last paragraph tag in a block of HTML using DOMDocument/DOMXpath but can't seem to figure it out. # Create DOMDocument Object $dom = new DOMDocument; # Load HTML into DomDocument Object $dom->loadHTML($data['component2']); # Creat DOMXPath Object and load DOMDocument Object into XPath for magic...
Use this instead: print_r($node->parentNode->lastChild->nodeValue);
PHP DOMDocument And DOMXpath I am trying to find the last paragraph tag in a block of HTML using DOMDocument/DOMXpath but can't seem to figure it out. # Create DOMDocument Object $dom = new DOMDocument; # Load HTML into DomDocument Object $dom->loadHTML($data['component2']); # Creat DOMXPath Object and load DOMDocumen...
TITLE: PHP DOMDocument And DOMXpath QUESTION: I am trying to find the last paragraph tag in a block of HTML using DOMDocument/DOMXpath but can't seem to figure it out. # Create DOMDocument Object $dom = new DOMDocument; # Load HTML into DomDocument Object $dom->loadHTML($data['component2']); # Creat DOMXPath Object a...
[ "php", "domdocument", "domxpath" ]
2
2
1,957
1
0
2011-06-01T20:24:10.947000
2011-06-01T20:28:43.800000
6,207,211
6,207,290
Python Web Framework for Small Team
I have 4 days off and I will use this time to rewrite our RoR (Ruby on Rails) Application in a python web framework just for fun;-] (and why not make the switch, RoR is great but keep changing all the time, can be exhausting.) I don't know the python web framework very well, I've glad web.py, django, cherry.py, pylons/...
I think most of the big frameworks will fit your requirements so maybe you might look at it from the perspective of the app you are writing. How much do you want to work "out of the box". Will you need user management? Will you need an admin panel etc. I use Django and it's great when you don't want to rewrite a lot of...
Python Web Framework for Small Team I have 4 days off and I will use this time to rewrite our RoR (Ruby on Rails) Application in a python web framework just for fun;-] (and why not make the switch, RoR is great but keep changing all the time, can be exhausting.) I don't know the python web framework very well, I've gla...
TITLE: Python Web Framework for Small Team QUESTION: I have 4 days off and I will use this time to rewrite our RoR (Ruby on Rails) Application in a python web framework just for fun;-] (and why not make the switch, RoR is great but keep changing all the time, can be exhausting.) I don't know the python web framework v...
[ "python", "django", "pylons", "cherrypy" ]
3
4
1,160
5
0
2011-06-01T20:26:50.097000
2011-06-01T20:32:58.657000
6,207,215
6,207,437
Mocking classes in Rhino Mocks
Lets say there is an Interface ICreateFileStrategy. Lets say there are classes A and B that implement these two interfaces. Both these classes implement method long CreateFile(ExportFile exportFile) Now when I want to write a unit test I want to test method CreateFile of class A. How is this possible. How do I set the ...
for starters you test the class not the interface, so you just create an instance of Class A mock all of the dependencies and then test the method
Mocking classes in Rhino Mocks Lets say there is an Interface ICreateFileStrategy. Lets say there are classes A and B that implement these two interfaces. Both these classes implement method long CreateFile(ExportFile exportFile) Now when I want to write a unit test I want to test method CreateFile of class A. How is t...
TITLE: Mocking classes in Rhino Mocks QUESTION: Lets say there is an Interface ICreateFileStrategy. Lets say there are classes A and B that implement these two interfaces. Both these classes implement method long CreateFile(ExportFile exportFile) Now when I want to write a unit test I want to test method CreateFile of...
[ "unit-testing", "mocking", "rhino-mocks" ]
0
1
165
1
0
2011-06-01T20:27:10.183000
2011-06-01T20:45:18.127000
6,207,216
6,207,334
Why does linking against static runtime libraries in Visual C++ 2008 still requires MSVCR71.dll at runtime?
I'm building a dll statically linked against the c runtime libraries. Why then does it require MSVCR71.dll at runtime?
msvcr71.dll is Visual C++ 2003's C runtime. If you're building with 2008, there's no reason there should be a reference to this DLL. My guess is that you depend on another DLL which was built with 2003, and which uses the dynamically linked runtime.
Why does linking against static runtime libraries in Visual C++ 2008 still requires MSVCR71.dll at runtime? I'm building a dll statically linked against the c runtime libraries. Why then does it require MSVCR71.dll at runtime?
TITLE: Why does linking against static runtime libraries in Visual C++ 2008 still requires MSVCR71.dll at runtime? QUESTION: I'm building a dll statically linked against the c runtime libraries. Why then does it require MSVCR71.dll at runtime? ANSWER: msvcr71.dll is Visual C++ 2003's C runtime. If you're building wit...
[ "c++", "windows", "visual-c++" ]
4
5
822
2
0
2011-06-01T20:27:11.867000
2011-06-01T20:37:09.257000
6,207,218
6,208,131
Implementing my own low-pass filter in Java using fft
I'm using: http://introcs.cs.princeton.edu/java/97data/FFT.java.html to implement my own low-pass filter. How do I rearrange the output from FFT.fft() to zero out the correct values for a correct low-pass filter?
When given a waveform of N samples, this FFT implementation returns an array of size N, that you have to consider as two consecutive array of size N/2: the first goes from index 0 to index N/2-1, the second goes from index N/2 to the end of the array. Each of them contain the complex energy for each integer frequency b...
Implementing my own low-pass filter in Java using fft I'm using: http://introcs.cs.princeton.edu/java/97data/FFT.java.html to implement my own low-pass filter. How do I rearrange the output from FFT.fft() to zero out the correct values for a correct low-pass filter?
TITLE: Implementing my own low-pass filter in Java using fft QUESTION: I'm using: http://introcs.cs.princeton.edu/java/97data/FFT.java.html to implement my own low-pass filter. How do I rearrange the output from FFT.fft() to zero out the correct values for a correct low-pass filter? ANSWER: When given a waveform of N...
[ "java", "fft" ]
2
3
2,327
2
0
2011-06-01T20:27:18.177000
2011-06-01T21:47:39.713000
6,207,219
6,214,820
FLEX 4: How do you add a single horizontal line in a Chart/Graph
Here is my question: I have a hybrid chart that uses bars and lines I want to add to the right vertical axis a horizontal line that represents a break even I was trying to achieve this with so to clarify the break even line is a horisontal line located at 1.5 with respect to the right side verticalAxis. Thanks in advan...
You were almost there, you just need to specify a custom item renderer for the line in the LineSeries. Example here.
FLEX 4: How do you add a single horizontal line in a Chart/Graph Here is my question: I have a hybrid chart that uses bars and lines I want to add to the right vertical axis a horizontal line that represents a break even I was trying to achieve this with so to clarify the break even line is a horisontal line located at...
TITLE: FLEX 4: How do you add a single horizontal line in a Chart/Graph QUESTION: Here is my question: I have a hybrid chart that uses bars and lines I want to add to the right vertical axis a horizontal line that represents a break even I was trying to achieve this with so to clarify the break even line is a horisont...
[ "apache-flex", "graph", "line", "charts" ]
1
0
1,922
1
0
2011-06-01T20:27:34.457000
2011-06-02T12:59:31.793000
6,207,224
6,207,658
Calculating percentages with GROUP BY query
I have a table with 3 columns which looks like this: File User Rating (1-5) ------------------------------ 00001 1 3 00002 1 4 00003 2 2 00004 3 5 00005 4 3 00005 3 2 00006 2 3 Etc. I want to generate a query that outputs the following (for each user and rating, display the number of files as well as percentage of file...
WITH t1 AS (SELECT User, Rating, Count(*) AS n FROM your_table GROUP BY User, Rating) SELECT User, Rating, n, (0.0+n)/(COUNT(*) OVER (PARTITION BY User)) -- no integer divide! FROM t1; Or SELECT User, Rating, Count(*) OVER w_user_rating AS n, (0.0+Count(*) OVER w_user_rating)/(Count(*) OVER (PARTITION BY User)) AS pct ...
Calculating percentages with GROUP BY query I have a table with 3 columns which looks like this: File User Rating (1-5) ------------------------------ 00001 1 3 00002 1 4 00003 2 2 00004 3 5 00005 4 3 00005 3 2 00006 2 3 Etc. I want to generate a query that outputs the following (for each user and rating, display the n...
TITLE: Calculating percentages with GROUP BY query QUESTION: I have a table with 3 columns which looks like this: File User Rating (1-5) ------------------------------ 00001 1 3 00002 1 4 00003 2 2 00004 3 5 00005 4 3 00005 3 2 00006 2 3 Etc. I want to generate a query that outputs the following (for each user and rat...
[ "sql", "postgresql", "group-by" ]
53
52
129,250
7
0
2011-06-01T20:28:09.323000
2011-06-01T21:03:15.967000
6,207,240
6,207,855
UITableView SelectAll - willDeselectRowAtIndexPath alternative
I built a multi-selection table, I did that using willSelectRowAtIndexPath and willDeselectRowAtIndexPath. It is working fine. Now I want to programatically selectALL or Select None. Is there a way to call [tableView selectRowAtIndexPath: [NSIndexPath indexPathForRow:i inSection:0] animated:NO scrollPosition:UITableVie...
You'll have to change your data source to reflect the select all or select none, then refresh the rows in question to update them to their new status. I can't post any specific code because it really depends on how you've set up your multi-selection. Edit It seems that you can select all by setting selectedIndexes to f...
UITableView SelectAll - willDeselectRowAtIndexPath alternative I built a multi-selection table, I did that using willSelectRowAtIndexPath and willDeselectRowAtIndexPath. It is working fine. Now I want to programatically selectALL or Select None. Is there a way to call [tableView selectRowAtIndexPath: [NSIndexPath index...
TITLE: UITableView SelectAll - willDeselectRowAtIndexPath alternative QUESTION: I built a multi-selection table, I did that using willSelectRowAtIndexPath and willDeselectRowAtIndexPath. It is working fine. Now I want to programatically selectALL or Select None. Is there a way to call [tableView selectRowAtIndexPath: ...
[ "iphone", "objective-c", "ios", "uitableview", "uikit" ]
0
2
2,084
2
0
2011-06-01T20:29:12.230000
2011-06-01T21:19:47.823000
6,207,244
6,211,331
Mass renaming linkages in a FLA
I have an AS3 based FLA that, for various reasons, needs nearly all of the linkages in the library reworked (need to move to a different package namespace). This particular FLA is pretty big, so doing this by hand would be rather tedious. What is the best way to handle this? I have considered saving out the FLA as an X...
I don't have access to Flash IDE today but you can easily adapt my script to do what you want: Automated importing/renaming of Flash assets renaming-of-flash-assets/6031965#6031965 There is an easy way to find what Jsfl functions you have to use: Open History panel (Window > Other Panels > History) Make one linkage ren...
Mass renaming linkages in a FLA I have an AS3 based FLA that, for various reasons, needs nearly all of the linkages in the library reworked (need to move to a different package namespace). This particular FLA is pretty big, so doing this by hand would be rather tedious. What is the best way to handle this? I have consi...
TITLE: Mass renaming linkages in a FLA QUESTION: I have an AS3 based FLA that, for various reasons, needs nearly all of the linkages in the library reworked (need to move to a different package namespace). This particular FLA is pretty big, so doing this by hand would be rather tedious. What is the best way to handle ...
[ "flash", "actionscript-3" ]
0
1
460
1
0
2011-06-01T20:29:24.567000
2011-06-02T06:46:34.123000
6,207,245
6,207,313
Simple html dom parser
I use simple php dom parser. I have a link in my loaded dom which looks like this (in html): Some const tesxt How can I select this object using find function? Maybe I can pass regular expression which looks at a container text? Btw, it's static(constant) text and I want to search need link refer to that text.
Reading through the Manual it should give you all you need to know. $ret = $html->find('a'); foreach ($ret as $link) { if ($link->innertext == 'Someconst tesxt') { // do what you must. } } Not sure what else you are looking for, but I am not able to test the above, just put it together from reading the manual.
Simple html dom parser I use simple php dom parser. I have a link in my loaded dom which looks like this (in html): Some const tesxt How can I select this object using find function? Maybe I can pass regular expression which looks at a container text? Btw, it's static(constant) text and I want to search need link refer...
TITLE: Simple html dom parser QUESTION: I use simple php dom parser. I have a link in my loaded dom which looks like this (in html): Some const tesxt How can I select this object using find function? Maybe I can pass regular expression which looks at a container text? Btw, it's static(constant) text and I want to sear...
[ "php", "html", "dom" ]
1
2
744
1
0
2011-06-01T20:29:29.607000
2011-06-01T20:35:22.383000
6,207,262
6,212,333
Web Application to know database update
My web application (ASP.NET 4) connects to a database (SQL Server 2005). For every new row inserted in a certain table, I want the web app can do some process (like send an email to me with new data). How do I implement the system? My first though is having web app check the table SN column, and have a variable lastPro...
you could use SqlDependency`s see http://www.codeproject.com/KB/database/chatter.aspx & http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqldependency.aspx
Web Application to know database update My web application (ASP.NET 4) connects to a database (SQL Server 2005). For every new row inserted in a certain table, I want the web app can do some process (like send an email to me with new data). How do I implement the system? My first though is having web app check the tabl...
TITLE: Web Application to know database update QUESTION: My web application (ASP.NET 4) connects to a database (SQL Server 2005). For every new row inserted in a certain table, I want the web app can do some process (like send an email to me with new data). How do I implement the system? My first though is having web ...
[ "c#", "asp.net", "sql-server-2005" ]
5
2
1,271
5
0
2011-06-01T20:30:22.833000
2011-06-02T08:48:48.447000
6,207,267
6,207,387
Why Are My Cell's Images Being Pixelated?
I am using an iPhone 4 with retina display. I have a 60x60 png that was downsized from a 500x500 png that I am using as the cell's imageView. For some reason, the image looks a bit pixelated and blurry, basically not up to retina display standards. What am I doing wrong? I am using cell.imageView.image = [UIImage image...
Try using a a 60x60 png as a source. It will likely resolve your bluriness problems and will additionaly be cheaper on memory usage. I have also experienced resized images to be blurry and the likes. I could imagine that this has something todo with the images being shrunken down at runtime, though I'm not sure about t...
Why Are My Cell's Images Being Pixelated? I am using an iPhone 4 with retina display. I have a 60x60 png that was downsized from a 500x500 png that I am using as the cell's imageView. For some reason, the image looks a bit pixelated and blurry, basically not up to retina display standards. What am I doing wrong? I am u...
TITLE: Why Are My Cell's Images Being Pixelated? QUESTION: I am using an iPhone 4 with retina display. I have a 60x60 png that was downsized from a 500x500 png that I am using as the cell's imageView. For some reason, the image looks a bit pixelated and blurry, basically not up to retina display standards. What am I d...
[ "iphone", "objective-c", "uiimageview" ]
0
1
2,894
2
0
2011-06-01T20:30:40.967000
2011-06-01T20:41:04.210000
6,207,268
6,222,229
Weblogic DB2 data Shows up as '?????' Question Marks
I am running Weblogic 10.3.3 with DB2 z/os and Unicode database, for both my local and development servers. When I run my application locally, the query to the database returns some of the unicode data as question marks, like this '????????????'. This seems to be happening to the Japanese characters. However if I deplo...
Yea, I've been there. You need to add, -Dfile.encoding=UTF-8 to your Weblogic startup script. I found the answer at this blog http://alexrogan.com/?p=126
Weblogic DB2 data Shows up as '?????' Question Marks I am running Weblogic 10.3.3 with DB2 z/os and Unicode database, for both my local and development servers. When I run my application locally, the query to the database returns some of the unicode data as question marks, like this '????????????'. This seems to be hap...
TITLE: Weblogic DB2 data Shows up as '?????' Question Marks QUESTION: I am running Weblogic 10.3.3 with DB2 z/os and Unicode database, for both my local and development servers. When I run my application locally, the query to the database returns some of the unicode data as question marks, like this '????????????'. Th...
[ "java", "jdbc", "db2", "jax-rs", "weblogic-10.x" ]
2
2
1,271
2
0
2011-06-01T20:30:46.117000
2011-06-03T01:52:45.453000
6,207,270
6,208,707
Referencing .NET dll when compiliation(with mono)
I asked a question to install F# powerpack and use it here. error FS0078: Unable to find the file 'FSharp.PowerPack.Linq.dll' in any of /Library/Frameworks/Mono.framework/Versions/2.10.2/lib/mono/2.0 /Users/smcho/Desktop/fs/powerpack /Users/smcho/smcho/bin/FSharp-2.0.0.0/bin When I run this command fsc linq.fs /r:FShar...
Can't you just use -r:/full/path/to/the/reference/assembly? (You are right that gacutil is for runtime assemblies, whereas -r is for design-time reference assemblies, which may or may not be the same.)
Referencing .NET dll when compiliation(with mono) I asked a question to install F# powerpack and use it here. error FS0078: Unable to find the file 'FSharp.PowerPack.Linq.dll' in any of /Library/Frameworks/Mono.framework/Versions/2.10.2/lib/mono/2.0 /Users/smcho/Desktop/fs/powerpack /Users/smcho/smcho/bin/FSharp-2.0.0....
TITLE: Referencing .NET dll when compiliation(with mono) QUESTION: I asked a question to install F# powerpack and use it here. error FS0078: Unable to find the file 'FSharp.PowerPack.Linq.dll' in any of /Library/Frameworks/Mono.framework/Versions/2.10.2/lib/mono/2.0 /Users/smcho/Desktop/fs/powerpack /Users/smcho/smcho...
[ ".net", "mono", "reference" ]
3
1
556
1
0
2011-06-01T20:30:57.670000
2011-06-01T23:00:49.997000
6,207,280
6,207,664
Need help with validating a date
I have the code below and it works pretty good except if you enter something like 2/2/2011, you get the error message "The Document Date is not a valid date". I would expect that it would say "The Document Date needs to be in the format MM/DD/YYYY". Why does the line newDate = dateFormat.parse(date); not catch that? //...
As already mentioned, the SimpleDateFormat is able to parse "2/2/2011" as if it is "02/02/2011". so no ParseException is thrown. On the other hand, dateFormat.format(newDate) will return "02/02/2011" and is compared against "2/2/2011". The two strings aren't equal, so the second error message is returned. setLenient(fa...
Need help with validating a date I have the code below and it works pretty good except if you enter something like 2/2/2011, you get the error message "The Document Date is not a valid date". I would expect that it would say "The Document Date needs to be in the format MM/DD/YYYY". Why does the line newDate = dateForma...
TITLE: Need help with validating a date QUESTION: I have the code below and it works pretty good except if you enter something like 2/2/2011, you get the error message "The Document Date is not a valid date". I would expect that it would say "The Document Date needs to be in the format MM/DD/YYYY". Why does the line n...
[ "java", "date", "simpledateformat" ]
3
4
2,029
2
0
2011-06-01T20:32:08.687000
2011-06-01T21:04:20.230000
6,207,282
6,207,347
launching a Windows app on client side (triggered by click on webpage)
is that possible to launch a preinstalled application from a webpage. i can see that steam has created its own protocol steam:// by installing something into my registry and now whenever i click a steam://ip link.. it tries to launch a file. so i was wondering if its possible to launch an application from a webpage, ma...
Yes: you would need to build/register a URL handler and tie it to the right application. The simplest explanation is previously answered at How can I add a custom url handler on Windows. Like iTunes itms://. More complex URL handlers will require you to do native code of your very own: the document you linked to is com...
launching a Windows app on client side (triggered by click on webpage) is that possible to launch a preinstalled application from a webpage. i can see that steam has created its own protocol steam:// by installing something into my registry and now whenever i click a steam://ip link.. it tries to launch a file. so i wa...
TITLE: launching a Windows app on client side (triggered by click on webpage) QUESTION: is that possible to launch a preinstalled application from a webpage. i can see that steam has created its own protocol steam:// by installing something into my registry and now whenever i click a steam://ip link.. it tries to laun...
[ "url", "registry", "protocols", "launch" ]
1
0
164
1
0
2011-06-01T20:32:14.057000
2011-06-01T20:38:12.320000
6,207,299
6,208,806
Python method lookup, static vs. instance
Until like one hour ago, I was convinced that in python Foo ().bar () was nothing more than a short hand for Foo.bar (Foo () ) which passes the instance as first parameter. In this example the last two lines do (apparently) the same thing: class Foo (object): def bar (self): print "baz" qux = Foo () qux.bar () Foo.bar...
On the difference between Foo().bar(), Foo.bar(Foo()) and Foo.bar() (as an answer because I signed up yesterday and can't post comments yet) - this is because of Python(<3.0)'s concept of 'bound' and 'unbound' methods - it strictly requires that, except with @staticmethod or @classmethod, method calls have an instance ...
Python method lookup, static vs. instance Until like one hour ago, I was convinced that in python Foo ().bar () was nothing more than a short hand for Foo.bar (Foo () ) which passes the instance as first parameter. In this example the last two lines do (apparently) the same thing: class Foo (object): def bar (self): pr...
TITLE: Python method lookup, static vs. instance QUESTION: Until like one hour ago, I was convinced that in python Foo ().bar () was nothing more than a short hand for Foo.bar (Foo () ) which passes the instance as first parameter. In this example the last two lines do (apparently) the same thing: class Foo (object): ...
[ "python", "static", "monkeypatching" ]
9
2
1,302
3
0
2011-06-01T20:33:46.903000
2011-06-01T23:15:05.160000
6,207,301
6,207,390
Unknown NSDate format
I have the following string to convert to NSDate: 2011-04-27 20:50:09.000002. I have the following code for the dateformatter: [inputFormatter setDateFormat:@"YYYY-mm-dd HH:mm:ss"]; but I'm unsure of what to put after the seconds. Keep in mind, I have multiple of these strings, with different numbers at the back.
Date format strings in OS 10.6 (and, I believe, in iOS4+) are based on the Unicode spec TR35-10: have a look at their date formatting strings. What you need in this case is fractional seconds: symbol S. Something like... [inputFormatter setDateFormat:@"YYYY-mm-dd HH:mm:ss.SSSSSS"];
Unknown NSDate format I have the following string to convert to NSDate: 2011-04-27 20:50:09.000002. I have the following code for the dateformatter: [inputFormatter setDateFormat:@"YYYY-mm-dd HH:mm:ss"]; but I'm unsure of what to put after the seconds. Keep in mind, I have multiple of these strings, with different numb...
TITLE: Unknown NSDate format QUESTION: I have the following string to convert to NSDate: 2011-04-27 20:50:09.000002. I have the following code for the dateformatter: [inputFormatter setDateFormat:@"YYYY-mm-dd HH:mm:ss"]; but I'm unsure of what to put after the seconds. Keep in mind, I have multiple of these strings, w...
[ "iphone", "nsdate", "nsdateformatter" ]
0
4
104
1
0
2011-06-01T20:34:02.633000
2011-06-01T20:41:09.100000
6,207,302
6,207,435
Reading a binary file in C: ftell returns results that sometimes are off by one
I'm trying to read a binary file that is in the following format: number of images [4-byte int] width [4-byte int] height [4-byte int] grayscale data [width * height bytes] (more elements of the same type) That's the first function being called: int process_file(const char *filename) { FILE *input_file = fopen(filename...
MS-DOS end-of-line sequences are Carriage Return, New Line ( CR NL, 0x0D, 0x0A ), and Unix uses simply New Line ( NL or 0x0A ). Change the line FILE *input_file = fopen(filename, "r"); to FILE *input_file = fopen(filename, "rb"); Otherwise, the fread() function used to translate CR NL as NL, on Unix systems prior to PO...
Reading a binary file in C: ftell returns results that sometimes are off by one I'm trying to read a binary file that is in the following format: number of images [4-byte int] width [4-byte int] height [4-byte int] grayscale data [width * height bytes] (more elements of the same type) That's the first function being ca...
TITLE: Reading a binary file in C: ftell returns results that sometimes are off by one QUESTION: I'm trying to read a binary file that is in the following format: number of images [4-byte int] width [4-byte int] height [4-byte int] grayscale data [width * height bytes] (more elements of the same type) That's the first...
[ "c", "binary" ]
0
5
1,534
2
0
2011-06-01T20:34:08.610000
2011-06-01T20:44:56.617000
6,207,303
6,207,705
Split a string with multiple delimiters in Ruby
Take for instance, I have a string like this: options = "Cake or pie, ice cream, or pudding" I want to be able to split the string via or,,, and, or. The thing is, is that I have been able to do it, but only by parsing, and, or first, and then splitting each array item at or, flattening the resultant array afterwards a...
What about the following: options.gsub(/ or /i, ",").split(",").map(&:strip).reject(&:empty?) replaces all delimiters but the, splits it at, trims each characters, since stuff like ice cream with a leading space might be left removes all blank strings
Split a string with multiple delimiters in Ruby Take for instance, I have a string like this: options = "Cake or pie, ice cream, or pudding" I want to be able to split the string via or,,, and, or. The thing is, is that I have been able to do it, but only by parsing, and, or first, and then splitting each array item at...
TITLE: Split a string with multiple delimiters in Ruby QUESTION: Take for instance, I have a string like this: options = "Cake or pie, ice cream, or pudding" I want to be able to split the string via or,,, and, or. The thing is, is that I have been able to do it, but only by parsing, and, or first, and then splitting ...
[ "ruby", "string", "delimiter" ]
12
15
13,015
3
0
2011-06-01T20:34:13.463000
2011-06-01T21:07:14.967000
6,207,306
6,209,150
programmatically load image at coordinate
Hi I want to load a square image (the page curl) as seen in the lower right corner programmatically when the view controller loads. How to do this?
Just add a UIImageView as a subview and set the appropriate frame.
programmatically load image at coordinate Hi I want to load a square image (the page curl) as seen in the lower right corner programmatically when the view controller loads. How to do this?
TITLE: programmatically load image at coordinate QUESTION: Hi I want to load a square image (the page curl) as seen in the lower right corner programmatically when the view controller loads. How to do this? ANSWER: Just add a UIImageView as a subview and set the appropriate frame.
[ "ios" ]
0
0
257
1
0
2011-06-01T20:34:40.777000
2011-06-02T00:12:40.150000
6,207,307
6,207,344
Shouldn't this fail without the use of locking? Simple producer consumer
I have a queue, a list with producer threads and a list with consumer threads. My code looks like this public class Runner { List Producers; List Consumers; Queue queue; Random random; public Runner() { Producers = new List (); Consumers = new List (); for (int i = 0; i < 2; i++) { Thread thread = new Thread(Produce)...
Locking is to done to eliminate aberrant behavior of an application, most specifically in multithreading. The most common goal is the elimination of a "race condition" which causes non-deterministic program behavior. This is the behavior you saw. In one run you get an error for the queue having no items, in another run...
Shouldn't this fail without the use of locking? Simple producer consumer I have a queue, a list with producer threads and a list with consumer threads. My code looks like this public class Runner { List Producers; List Consumers; Queue queue; Random random; public Runner() { Producers = new List (); Consumers = new Li...
TITLE: Shouldn't this fail without the use of locking? Simple producer consumer QUESTION: I have a queue, a list with producer threads and a list with consumer threads. My code looks like this public class Runner { List Producers; List Consumers; Queue queue; Random random; public Runner() { Producers = new List (); ...
[ "c#", "multithreading", "concurrency", "producer-consumer" ]
3
3
302
6
0
2011-06-01T20:34:47.517000
2011-06-01T20:37:48.610000
6,207,309
6,207,343
Wicket.Ajax.Call.failure: Error while parsing response: Object required
I just spent several hours of my life debugging this problem. I'm documenting it here for others. Question: I'm getting the following error when I try to click on an AjaxLink in Internet Explorer: Wicket: ERROR: Wicket.Ajax.Call.failure: Error while parsing response: Object required It works fine in all other browsers;...
Check to make sure that your HTML is 100% syntactically correct. Ajax responses are returned to the browser inside a CDATA section, and if the payload is not well-formed, IE will sometimes choke. In my case I neglected to close a tag in the section. Simply closing that link tag made all the difference. Aside: if you ev...
Wicket.Ajax.Call.failure: Error while parsing response: Object required I just spent several hours of my life debugging this problem. I'm documenting it here for others. Question: I'm getting the following error when I try to click on an AjaxLink in Internet Explorer: Wicket: ERROR: Wicket.Ajax.Call.failure: Error whil...
TITLE: Wicket.Ajax.Call.failure: Error while parsing response: Object required QUESTION: I just spent several hours of my life debugging this problem. I'm documenting it here for others. Question: I'm getting the following error when I try to click on an AjaxLink in Internet Explorer: Wicket: ERROR: Wicket.Ajax.Call.f...
[ "ajax", "wicket" ]
3
6
8,819
2
0
2011-06-01T20:35:09.063000
2011-06-01T20:37:48.453000
6,207,318
6,208,840
C# Sorting a DataTableCollection by a common column in each table
I'm having some troubles figuring out how to sort a DataTableCollection. The scenario is that each table in the collection would have the same schema and have a column called "JobNumber" which I want to sort on. The data in these tables would need to be processed in that order. Any suggestions?
DataTableCollection col; foreach(DataTable tbl in col) { // Get the DefaultViewManager of a DataTable and sort it. DataTable1.DefaultView.Sort = "JobNumber"; } http://msdn.microsoft.com/en-us/library/system.data.dataview.sort.aspx
C# Sorting a DataTableCollection by a common column in each table I'm having some troubles figuring out how to sort a DataTableCollection. The scenario is that each table in the collection would have the same schema and have a column called "JobNumber" which I want to sort on. The data in these tables would need to be ...
TITLE: C# Sorting a DataTableCollection by a common column in each table QUESTION: I'm having some troubles figuring out how to sort a DataTableCollection. The scenario is that each table in the collection would have the same schema and have a column called "JobNumber" which I want to sort on. The data in these tables...
[ "c#", ".net", "sorting" ]
0
2
1,108
3
0
2011-06-01T20:36:00.183000
2011-06-01T23:20:31.057000
6,207,319
6,207,361
DropDownList can't bind to DbNull
I have a DropDownList trying to bind to DbNull and it's not happy about it. I've seen advice about creating a ListItem with value=" " but this isn't working. Any help would be much appreciated.
if you want to add default value to dropdwon list you can do it as below mydropdown.DataSource = getdata(); mydropdown.DataBind(); mydropdown.Items.Insert(0,new ListItem("N/A","N/A")); Edit if you know some values of the datasouce is null than y dont you filter out those value at database level and than bind soruce wit...
DropDownList can't bind to DbNull I have a DropDownList trying to bind to DbNull and it's not happy about it. I've seen advice about creating a ListItem with value=" " but this isn't working. Any help would be much appreciated.
TITLE: DropDownList can't bind to DbNull QUESTION: I have a DropDownList trying to bind to DbNull and it's not happy about it. I've seen advice about creating a ListItem with value=" " but this isn't working. Any help would be much appreciated. ANSWER: if you want to add default value to dropdwon list you can do it a...
[ "asp.net", "drop-down-menu", "dbnull" ]
1
0
771
2
0
2011-06-01T20:36:02.960000
2011-06-01T20:39:24.677000
6,207,324
6,207,469
Creating a widget
Hi i want to create a widget which can be embedded on other websites similar to the twitter profile widget, an example is here; http://twitter.com/about/resources/widgets/widget_profile The way i would approach this is to return the data in json format via my wcf, the problem is looking at the twitter example there see...
The purpose of the javascript would be to actually call your wcf service to retrieve data and write the html results to the screen. In the twitter example, many options are set inside a javascript object that is used to manage the configuration (background color, username, etc). You can return json, and then take the v...
Creating a widget Hi i want to create a widget which can be embedded on other websites similar to the twitter profile widget, an example is here; http://twitter.com/about/resources/widgets/widget_profile The way i would approach this is to return the data in json format via my wcf, the problem is looking at the twitter...
TITLE: Creating a widget QUESTION: Hi i want to create a widget which can be embedded on other websites similar to the twitter profile widget, an example is here; http://twitter.com/about/resources/widgets/widget_profile The way i would approach this is to return the data in json format via my wcf, the problem is look...
[ "c#", "jquery", "asp.net" ]
4
1
2,689
2
0
2011-06-01T20:36:20.977000
2011-06-01T20:48:27.833000
6,207,325
6,208,030
database timeout error resolution problem
Hi I am having some problems in my app for the database timeout. Due to some network glitches the query takes more than 45 sec to return the resultset which has about 10,000 rows. Most of the time its fast upto 11-12 secs. My app is runs as a scheduled job in the background. The problem is I need to try three times if ...
Change... GetPurgeList() 'it gets here after getting the correct list and I am confused why does it come back here again and then finally return nothing Into.. tempList = New DestList() tempList = GetPurgeList()
database timeout error resolution problem Hi I am having some problems in my app for the database timeout. Due to some network glitches the query takes more than 45 sec to return the resultset which has about 10,000 rows. Most of the time its fast upto 11-12 secs. My app is runs as a scheduled job in the background. Th...
TITLE: database timeout error resolution problem QUESTION: Hi I am having some problems in my app for the database timeout. Due to some network glitches the query takes more than 45 sec to return the resultset which has about 10,000 rows. Most of the time its fast upto 11-12 secs. My app is runs as a scheduled job in ...
[ ".net", "asp.net", "vb.net", "ado.net" ]
0
0
836
2
0
2011-06-01T20:36:26.567000
2011-06-01T21:37:26.210000
6,207,326
6,264,625
Where does VM derive code for $file_list?
Can someone tell me where the code for $file_list is sourced in Virtuemart? To be specific, in the flypage.tpl.php file, there is a snippet of code that looks like this: This code generates the HTML for files that have been linked to the product. Unfortunately, the formatting of that section is pretty ugly by default a...
it should be here: administrator/com_virtuemart\classes\ps_product_files.php and search for function get_file_list Right under this function (row 622 - 626) should be html template for product files. Also hate this non MVC architecture. Looking forward to VM 2.0
Where does VM derive code for $file_list? Can someone tell me where the code for $file_list is sourced in Virtuemart? To be specific, in the flypage.tpl.php file, there is a snippet of code that looks like this: This code generates the HTML for files that have been linked to the product. Unfortunately, the formatting o...
TITLE: Where does VM derive code for $file_list? QUESTION: Can someone tell me where the code for $file_list is sourced in Virtuemart? To be specific, in the flypage.tpl.php file, there is a snippet of code that looks like this: This code generates the HTML for files that have been linked to the product. Unfortunately...
[ "joomla", "joomla1.5", "joomla-extensions", "virtuemart" ]
1
1
192
1
0
2011-06-01T20:36:27.807000
2011-06-07T11:39:58.367000
6,207,329
6,207,457
how to set hex color code for background
Possible Duplicate: How can I create a UIColor from a hex string? I want to programmatically set the color of the UIView Background. It doesn't seem like I can do it through Interfacebuilder. How should I do it if I want to set it to some hex code color?
I like to use this little piece of code to use HTML web colors in my apps. Usage: [self.view setBackgroundColor: [self colorWithHexString:@"FFFFFF"]]; /* white */ The Code: -(UIColor*)colorWithHexString:(NSString*)hex { NSString *cString = [[hex stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharac...
how to set hex color code for background Possible Duplicate: How can I create a UIColor from a hex string? I want to programmatically set the color of the UIView Background. It doesn't seem like I can do it through Interfacebuilder. How should I do it if I want to set it to some hex code color?
TITLE: how to set hex color code for background QUESTION: Possible Duplicate: How can I create a UIColor from a hex string? I want to programmatically set the color of the UIView Background. It doesn't seem like I can do it through Interfacebuilder. How should I do it if I want to set it to some hex code color? ANSWE...
[ "ios", "hex", "uicolor" ]
56
198
99,241
3
0
2011-06-01T20:36:47.487000
2011-06-01T20:47:47.677000
6,207,333
6,207,382
HTML5 Canvas drawing is layering a new path over the existing path at each new point. Why?
This is hard to explain so I created a JS Fiddle to show what is going on: http://jsfiddle.net/dGdxS/ - (Webkit only) Just mouse over the canvas to draw - you may need to click around I noticed the performance of the canvas was not what I expected, and when I set the line alpha I think I see why. It looks like every ne...
Because you never call ctx.closePath();, so it will redraw the entire path from the beginning each time. So you really want something similar to this: http://jsfiddle.net/dGdxS/7/
HTML5 Canvas drawing is layering a new path over the existing path at each new point. Why? This is hard to explain so I created a JS Fiddle to show what is going on: http://jsfiddle.net/dGdxS/ - (Webkit only) Just mouse over the canvas to draw - you may need to click around I noticed the performance of the canvas was n...
TITLE: HTML5 Canvas drawing is layering a new path over the existing path at each new point. Why? QUESTION: This is hard to explain so I created a JS Fiddle to show what is going on: http://jsfiddle.net/dGdxS/ - (Webkit only) Just mouse over the canvas to draw - you may need to click around I noticed the performance o...
[ "html", "canvas", "drawing" ]
1
0
1,309
2
0
2011-06-01T20:37:03.647000
2011-06-01T20:40:49.530000
6,207,335
6,207,442
Running rake task on ubuntu startup
Hi I'm having a bit of trouble with setting up a rake task to run on startup/reboot of a ubuntu instance on Amazon EC2. I need to make my instance start a simple delayed jobs "rake jobs:work" command when a new instance is launched, without me having to login using ssh, and run the command manually. The problem is - I ...
You'll need to call something in a bash script that looks like this: su - deploy -c "cd $RAILS_ROOT && rake RAILS_ENV=development jobs:work" >> $RAILS_ROOT/log/myjob.log 2>&1 Then call it from from your /etc/init.d/mystartup_filename. The file could look something like: #! /bin/sh RAILS_ROOT="/home/deploy/rails_root" E...
Running rake task on ubuntu startup Hi I'm having a bit of trouble with setting up a rake task to run on startup/reboot of a ubuntu instance on Amazon EC2. I need to make my instance start a simple delayed jobs "rake jobs:work" command when a new instance is launched, without me having to login using ssh, and run the c...
TITLE: Running rake task on ubuntu startup QUESTION: Hi I'm having a bit of trouble with setting up a rake task to run on startup/reboot of a ubuntu instance on Amazon EC2. I need to make my instance start a simple delayed jobs "rake jobs:work" command when a new instance is launched, without me having to login using ...
[ "ruby-on-rails", "ubuntu", "amazon-ec2", "rake" ]
1
3
3,074
1
0
2011-06-01T20:37:19.417000
2011-06-01T20:45:49.247000
6,207,339
6,207,673
XMLHttpRequest setRequestHeader Error
IE 9 developer tools say "Unspecified error." at this line of code: xmlhttp.setRequestHeader ("If-Modified-Since", "Sat 1 Jan 2005 00:00:00 GMT"); I am trying to disable caching of Ajax requests and I don't have control over the server and I cannot append a unique ID to the end of each request, so this looks like my on...
I was calling this before xmlhttp.open (...);. That was the mistake. Modify the header after you open the request, but before you send it. xmlhttp.open (...); xmlhttp.setRequestHeader ("...", "..."); xmlhttp.send ();
XMLHttpRequest setRequestHeader Error IE 9 developer tools say "Unspecified error." at this line of code: xmlhttp.setRequestHeader ("If-Modified-Since", "Sat 1 Jan 2005 00:00:00 GMT"); I am trying to disable caching of Ajax requests and I don't have control over the server and I cannot append a unique ID to the end of ...
TITLE: XMLHttpRequest setRequestHeader Error QUESTION: IE 9 developer tools say "Unspecified error." at this line of code: xmlhttp.setRequestHeader ("If-Modified-Since", "Sat 1 Jan 2005 00:00:00 GMT"); I am trying to disable caching of Ajax requests and I don't have control over the server and I cannot append a unique...
[ "javascript", "ajax" ]
4
12
7,664
2
0
2011-06-01T20:37:44.460000
2011-06-01T21:05:01.010000
6,207,356
6,207,381
Why string str = new string("abc") doesn't pass compiler?
Given public String(char*) why we cannot use the following statement? string str = new string("aaa"); Error 1 The best overloaded method match for 'string.String(char*)' has some invalid arguments C:\temp\ConsoleApplication2\ConsoleApplication2\Program.cs 19 26 ConsoleApplication2 Error 2 Argument 1: cannot convert fro...
Simply use: string str = "aaa"; You do not need to new a string. "aaa" is a string. It is not a char *. char * is used with unsafe code.
Why string str = new string("abc") doesn't pass compiler? Given public String(char*) why we cannot use the following statement? string str = new string("aaa"); Error 1 The best overloaded method match for 'string.String(char*)' has some invalid arguments C:\temp\ConsoleApplication2\ConsoleApplication2\Program.cs 19 26 ...
TITLE: Why string str = new string("abc") doesn't pass compiler? QUESTION: Given public String(char*) why we cannot use the following statement? string str = new string("aaa"); Error 1 The best overloaded method match for 'string.String(char*)' has some invalid arguments C:\temp\ConsoleApplication2\ConsoleApplication2...
[ "c#", "string" ]
2
10
1,336
5
0
2011-06-01T20:38:45.033000
2011-06-01T20:40:43.757000
6,207,362
6,207,519
How to run an async task for every x mins in android?
how to run the async task at specific time? (I want to run it every 2 mins) I tried using post delayed but it's not working? tvData.postDelayed(new Runnable(){ @Override public void run() { readWebpage(); }}, 100); In the above code readwebpage is function which calls the async task for me.. Right now below is the me...
You can use handler if you want to initiate something every X seconds. Handler is good because you don't need extra thread to keep tracking when firing the event. Here is a short snippet: private final static int INTERVAL = 1000 * 60 * 2; //2 minutes Handler mHandler = new Handler(); Runnable mHandlerTask = new Runnab...
How to run an async task for every x mins in android? how to run the async task at specific time? (I want to run it every 2 mins) I tried using post delayed but it's not working? tvData.postDelayed(new Runnable(){ @Override public void run() { readWebpage(); }}, 100); In the above code readwebpage is function which c...
TITLE: How to run an async task for every x mins in android? QUESTION: how to run the async task at specific time? (I want to run it every 2 mins) I tried using post delayed but it's not working? tvData.postDelayed(new Runnable(){ @Override public void run() { readWebpage(); }}, 100); In the above code readwebpage i...
[ "android", "android-asynctask" ]
50
79
75,264
9
0
2011-06-01T20:39:25.417000
2011-06-01T20:52:03.940000
6,207,365
6,207,540
working with high precision timestamps in python
Hey I am working in python with datetime and I am wondering what the best way to parse this timestamp is. The timestamps are ISO standard, here is an example "2010-06-19T08:17:14.078685237Z" Now so far I have used time = datetime.datetime.strptime(timestamp.split(".")[0], "%Y-%m-%dT%H:%M:%S") precisetime = time + datet...
There's nothing inherently ass-like with your approach, but you may like to try pyiso8601 or dateutil
working with high precision timestamps in python Hey I am working in python with datetime and I am wondering what the best way to parse this timestamp is. The timestamps are ISO standard, here is an example "2010-06-19T08:17:14.078685237Z" Now so far I have used time = datetime.datetime.strptime(timestamp.split(".")[0]...
TITLE: working with high precision timestamps in python QUESTION: Hey I am working in python with datetime and I am wondering what the best way to parse this timestamp is. The timestamps are ISO standard, here is an example "2010-06-19T08:17:14.078685237Z" Now so far I have used time = datetime.datetime.strptime(times...
[ "python", "datetime", "time" ]
6
2
16,527
5
0
2011-06-01T20:39:31.857000
2011-06-01T20:53:12.610000
6,207,370
6,209,339
ViewFactory iphone
Has anyone successfully used this class to load custom tableViewCells. I have tried to create a singleton of the viewFactory class and load the cells using the shared instance but I get the following error... Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[ViewFactory sharedMyClassNam...
The only reason that ViewFactory class is a singleton is so that you can access it globally. It would be trivial to take the bit of code in ViewFactory that does useful work and incorporate it into your own table view controller subclass. That would eliminate the singleton, make it easier to use separate nibs for each ...
ViewFactory iphone Has anyone successfully used this class to load custom tableViewCells. I have tried to create a singleton of the viewFactory class and load the cells using the shared instance but I get the following error... Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[ViewFacto...
TITLE: ViewFactory iphone QUESTION: Has anyone successfully used this class to load custom tableViewCells. I have tried to create a singleton of the viewFactory class and load the cells using the shared instance but I get the following error... Terminating app due to uncaught exception 'NSInvalidArgumentException', re...
[ "iphone", "uitableview" ]
0
0
155
2
0
2011-06-01T20:39:53.327000
2011-06-02T00:53:30.253000
6,207,379
6,207,734
Use XmlSerializer on request and DataContractSerializer on response?
Is it possible to receive a request with attributes and use the XmlSerializer to deserialize it and send a response back with just elements using the DataContractSerializer? Also, if you receive a request with attributes, must you use the XmlSerializer to deserialize the content?
For the second question: if you have attributes, then you need to use the XmlSerializer - the DataContractSerializer doesn't support them. For the first question: yes, it's possible. No, it's not easy. The selection of the serializer is done at the operation formatter level. WCF allows you to change the serializer per ...
Use XmlSerializer on request and DataContractSerializer on response? Is it possible to receive a request with attributes and use the XmlSerializer to deserialize it and send a response back with just elements using the DataContractSerializer? Also, if you receive a request with attributes, must you use the XmlSerialize...
TITLE: Use XmlSerializer on request and DataContractSerializer on response? QUESTION: Is it possible to receive a request with attributes and use the XmlSerializer to deserialize it and send a response back with just elements using the DataContractSerializer? Also, if you receive a request with attributes, must you us...
[ "wcf", "serialization" ]
4
4
848
1
0
2011-06-01T20:40:27.873000
2011-06-01T21:10:00.683000
6,207,380
6,207,626
Deleting an extension which has no means to be uninstalled
I have an extension installed in VS 2010 but there is no option to uninstall it from extension manager or add/remove programs (if it was in an msi, can't remember). Add-in manager gives me the option to disable the extension, but it still comes up when I restart VS2010 (always running in Administrator mode btw). I also...
It has uninstall option in installer. Download it again (using your link) and click uninstall.
Deleting an extension which has no means to be uninstalled I have an extension installed in VS 2010 but there is no option to uninstall it from extension manager or add/remove programs (if it was in an msi, can't remember). Add-in manager gives me the option to disable the extension, but it still comes up when I restar...
TITLE: Deleting an extension which has no means to be uninstalled QUESTION: I have an extension installed in VS 2010 but there is no option to uninstall it from extension manager or add/remove programs (if it was in an msi, can't remember). Add-in manager gives me the option to disable the extension, but it still come...
[ "visual-studio-2010", "vsix" ]
2
1
104
1
0
2011-06-01T20:40:43.583000
2011-06-01T20:59:38.763000
6,207,384
6,207,455
What is the point of Node.js
Ok this is probably a little blunt and to the point, but what is the point/need for Node.js I've noticed it mainly through CloudFoundry but just not too sure what its supposed to be doing. However I am guessing its probably something pretty big as why else would VMWare be supporting it. Thanks in advance.
It's an... Efficient and 100% event driven IO framework, flexible enough to use the best underlying OS features it can find, presenting an API in a high-level programming language (the same language your client-side will most-likely use), implemented on top of the best available intepreting engine for that language, an...
What is the point of Node.js Ok this is probably a little blunt and to the point, but what is the point/need for Node.js I've noticed it mainly through CloudFoundry but just not too sure what its supposed to be doing. However I am guessing its probably something pretty big as why else would VMWare be supporting it. Tha...
TITLE: What is the point of Node.js QUESTION: Ok this is probably a little blunt and to the point, but what is the point/need for Node.js I've noticed it mainly through CloudFoundry but just not too sure what its supposed to be doing. However I am guessing its probably something pretty big as why else would VMWare be ...
[ "node.js", "cloud-foundry" ]
29
20
6,793
5
0
2011-06-01T20:40:52.730000
2011-06-01T20:47:32.400000
6,207,388
6,207,501
Is it possible to select and upload multiple files at one time in Internet Explorer?
I'm writing a form to select and upload multiple files at one time. This seems to be a pretty straight forward task in FF and Chrome but appears to be a limitation in IE 7. Are there any suggested workarounds? This is an internal application for my company's intranet and IE is the default browser. There is now word on ...
IE 7 currently does not (and probably never will) implement the multiple option for file upload input elements which Chrome/FF/Safari/Opera implement. Therefore there is no script/HTML support for receiving multiple files with a single HTML input. The only option you have for multiple file upload with a single input ob...
Is it possible to select and upload multiple files at one time in Internet Explorer? I'm writing a form to select and upload multiple files at one time. This seems to be a pretty straight forward task in FF and Chrome but appears to be a limitation in IE 7. Are there any suggested workarounds? This is an internal appli...
TITLE: Is it possible to select and upload multiple files at one time in Internet Explorer? QUESTION: I'm writing a form to select and upload multiple files at one time. This seems to be a pretty straight forward task in FF and Chrome but appears to be a limitation in IE 7. Are there any suggested workarounds? This is...
[ "internet-explorer-7" ]
6
5
19,525
1
0
2011-06-01T20:41:06.423000
2011-06-01T20:51:07.650000
6,207,389
6,207,733
How to dynamically load a C# dll from a C++ DLL
I have a C++ application. This supports users' C++ plugin DLL's, it will dynamically load these DLL's and then be able to create and use the user's types dynamically. These user types derive from base types and interfaces defined in the main application's core library, so I hold user's objects as pointers to the base c...
Another way of doing this would be creating a C++/CLI project that hosts your C# classes and use it as a bridge in your C++ project. A few more links to this approach: Connecting c++ and c# code with a c++/cli bridge.NET to C++ Bridge The latest link has simple source code for the bridge
How to dynamically load a C# dll from a C++ DLL I have a C++ application. This supports users' C++ plugin DLL's, it will dynamically load these DLL's and then be able to create and use the user's types dynamically. These user types derive from base types and interfaces defined in the main application's core library, so...
TITLE: How to dynamically load a C# dll from a C++ DLL QUESTION: I have a C++ application. This supports users' C++ plugin DLL's, it will dynamically load these DLL's and then be able to create and use the user's types dynamically. These user types derive from base types and interfaces defined in the main application'...
[ "c#", "c++", "interop", "virtual-functions", "dynamic-loading" ]
7
2
5,787
3
0
2011-06-01T20:41:06.453000
2011-06-01T21:09:38.717000
6,207,400
6,207,450
creating a java program to extract svn logs and store them in xml
I'd like to make a GUI that will take in a file directory and start date, and then find the svn logs associated with that directory and time frame. Once I have the information, I can then parse it and store it in an xml. The trouble is just getting the logs and reading the information off of them. I've got svn client a...
There is SVNKit which is a Java SVN Library http://svnkit.com/ Also, note that SVN log already has the --xml flag which will generate it in xml form. http://svnbook.red-bean.com/en/1.0/re15.html
creating a java program to extract svn logs and store them in xml I'd like to make a GUI that will take in a file directory and start date, and then find the svn logs associated with that directory and time frame. Once I have the information, I can then parse it and store it in an xml. The trouble is just getting the l...
TITLE: creating a java program to extract svn logs and store them in xml QUESTION: I'd like to make a GUI that will take in a file directory and start date, and then find the svn logs associated with that directory and time frame. Once I have the information, I can then parse it and store it in an xml. The trouble is ...
[ "java", "svn", "logging" ]
1
5
1,549
1
0
2011-06-01T20:41:57.513000
2011-06-01T20:46:27.897000
6,207,403
6,207,954
Facebook iFrame Vertical Scrollbar Won't Go Away
I created a custom facebook landing page using the same template I have used 3 times before. The problem is, this time, ther vertical scrollbar won't go away. This is the resizing code I have been using: and at the bottom of the page: My CSS uses body {overflow: hidden;}, inside my app "auto resize" is selected. The is...
Its this code html { overflow-Y: scroll; } in your style.css style sheet thats causing the problem. When I inspect it with Chrome and remove that value, the scroll bars disappear.
Facebook iFrame Vertical Scrollbar Won't Go Away I created a custom facebook landing page using the same template I have used 3 times before. The problem is, this time, ther vertical scrollbar won't go away. This is the resizing code I have been using: and at the bottom of the page: My CSS uses body {overflow: hidden;}...
TITLE: Facebook iFrame Vertical Scrollbar Won't Go Away QUESTION: I created a custom facebook landing page using the same template I have used 3 times before. The problem is, this time, ther vertical scrollbar won't go away. This is the resizing code I have been using: and at the bottom of the page: My CSS uses body {...
[ "facebook", "iframe", "scrollbar" ]
4
5
3,618
1
0
2011-06-01T20:42:06.780000
2011-06-01T21:30:16.603000
6,207,406
6,207,602
Jquery UI nested Selectable issue
I have requirement of creating/splitting my div elements horizontally and vertically on click of button at run time. I am able to create a div container in which splits the canvas according to the button clicked. For example: When I click horizontalSplit button it should create two new div's within the selected contain...
Sounds like you need to prevent event propagation: http://api.jquery.com/event.stopPropagation/ Similar question: jQuery UI Sortable -- How can I cancel the click event on an item that's dragged/sorted? When the element is clicked, the event bubbles up the DOM until it hits the highest level HTML node. This is referred...
Jquery UI nested Selectable issue I have requirement of creating/splitting my div elements horizontally and vertically on click of button at run time. I am able to create a div container in which splits the canvas according to the button clicked. For example: When I click horizontalSplit button it should create two new...
TITLE: Jquery UI nested Selectable issue QUESTION: I have requirement of creating/splitting my div elements horizontally and vertically on click of button at run time. I am able to create a div container in which splits the canvas according to the button clicked. For example: When I click horizontalSplit button it sho...
[ "jquery", "css", "jquery-ui" ]
1
1
2,010
2
0
2011-06-01T20:42:21.197000
2011-06-01T20:57:40.587000
6,207,411
6,275,362
Remotely change computer name for a Windows Server 2008 machine using C#?
Might someone be able to point me towards a conclusive resource to learn how to remotely change a computer name on a Windows Server 2008 machine using C# I've looked at lots of sites for help and now in day two of my task and not really any closer (other than deciding WMI is pretty much my only option) Totally out of m...
Here is a nice link that discusses it in detail and also deals with active directory membership and machine naming in addition to the local machine name. http://derricksweng.blogspot.com/2009/04/programmatically-renaming-computer.html (Btw, should you have to deal with Active Directory naming, I would consider using th...
Remotely change computer name for a Windows Server 2008 machine using C#? Might someone be able to point me towards a conclusive resource to learn how to remotely change a computer name on a Windows Server 2008 machine using C# I've looked at lots of sites for help and now in day two of my task and not really any close...
TITLE: Remotely change computer name for a Windows Server 2008 machine using C#? QUESTION: Might someone be able to point me towards a conclusive resource to learn how to remotely change a computer name on a Windows Server 2008 machine using C# I've looked at lots of sites for help and now in day two of my task and no...
[ "c#", "wmi", "windows-server-2008-r2", "remote-access" ]
2
5
3,621
1
0
2011-06-01T20:43:29.917000
2011-06-08T07:15:04.250000
6,207,414
6,207,622
Expose C# classes in .net 4 class library to Silverlight App
I have a bunch of classes in a C# class library that I bought from a 3rd party company. I want to use these classes and create my classes by inheriting them. I have it all working on a.net 4 wpf application. I want to then use these classes in my silverlight application. What options do I have and which is the best opt...
It's worth noting however that the.NET platform shipping with Silverlight is not the same as the one shipping with the full.NET Framework. It means that there is little chance that the third party assembly will be compatible with Silverlight, even if SL uses the same IL. If the third party assembly only references msco...
Expose C# classes in .net 4 class library to Silverlight App I have a bunch of classes in a C# class library that I bought from a 3rd party company. I want to use these classes and create my classes by inheriting them. I have it all working on a.net 4 wpf application. I want to then use these classes in my silverlight ...
TITLE: Expose C# classes in .net 4 class library to Silverlight App QUESTION: I have a bunch of classes in a C# class library that I bought from a 3rd party company. I want to use these classes and create my classes by inheriting them. I have it all working on a.net 4 wpf application. I want to then use these classes ...
[ "c#", "wpf", "silverlight", "wcf" ]
3
2
518
2
0
2011-06-01T20:43:43.713000
2011-06-01T20:59:03.443000
6,207,415
6,207,465
PHP/SQL problem: Data from sql wont display
I have this problem on my payroll processing system. Below the area where the data are added is a table where the data added into the pay table are shown (except for the empID since the payroll details shown on the table must be from those that are associated to the employee that was selected.) Payroll System image Ple...
Add the error checking for every mysql_query. At least make a call like: mysql_query($k) or die(mysql_error()); Was: Don't expect that PHP functions (e.g. date_format ) will work inside the SQL query. (Comments say date_format is a MySQL function too)
PHP/SQL problem: Data from sql wont display I have this problem on my payroll processing system. Below the area where the data are added is a table where the data added into the pay table are shown (except for the empID since the payroll details shown on the table must be from those that are associated to the employee ...
TITLE: PHP/SQL problem: Data from sql wont display QUESTION: I have this problem on my payroll processing system. Below the area where the data are added is a table where the data added into the pay table are shown (except for the empID since the payroll details shown on the table must be from those that are associate...
[ "php", "mysql", "sql" ]
1
0
251
4
0
2011-06-01T20:43:45.760000
2011-06-01T20:48:16.647000
6,207,417
6,207,592
How to pause process run using Java's ProcessBuilder.start()?
Alright, so I'm writing this program that essentially batch runs other java programs for me (multiple times, varying parameters, parallel executions, etc). So far the running part works great. Using ProcessBuilder's.start() method (equivalent to the Runtime.exec() I believe), it creates a separate java process and off ...
You will need to create a system for sending messages between processes. You might do this by: Sending signals, depending on OS. (As aioobe notes.) Having one process occasionally check for presence/absence of a file that another process can create/delete. (If the file is being read/written, you will need to use file l...
How to pause process run using Java's ProcessBuilder.start()? Alright, so I'm writing this program that essentially batch runs other java programs for me (multiple times, varying parameters, parallel executions, etc). So far the running part works great. Using ProcessBuilder's.start() method (equivalent to the Runtime....
TITLE: How to pause process run using Java's ProcessBuilder.start()? QUESTION: Alright, so I'm writing this program that essentially batch runs other java programs for me (multiple times, varying parameters, parallel executions, etc). So far the running part works great. Using ProcessBuilder's.start() method (equivale...
[ "java", "process", "exec", "processbuilder" ]
2
2
5,462
3
0
2011-06-01T20:43:56.530000
2011-06-01T20:57:16.407000
6,207,418
6,207,510
With rspec, can I mock an object that is inside the method I am testing?
I have defined the following method: def some_method x = x + 1 y = some_other_method(x) x + y end Now in my rspec spec, can I mock the call to some_other_method for my unit test for some_method?
You can indeed mock out other methods in a RSpec test. If the two methods you mentioned are inside a class, Foo, you would do something like this to make sure that some_other_method is called: subject{ Foo.new } it "should do whatever you're testing" do subject.should_receive(:some_other_method).and_return(5) subject.s...
With rspec, can I mock an object that is inside the method I am testing? I have defined the following method: def some_method x = x + 1 y = some_other_method(x) x + y end Now in my rspec spec, can I mock the call to some_other_method for my unit test for some_method?
TITLE: With rspec, can I mock an object that is inside the method I am testing? QUESTION: I have defined the following method: def some_method x = x + 1 y = some_other_method(x) x + y end Now in my rspec spec, can I mock the call to some_other_method for my unit test for some_method? ANSWER: You can indeed mock out...
[ "ruby-on-rails", "ruby", "rspec" ]
2
4
2,544
1
0
2011-06-01T20:43:57.830000
2011-06-01T20:51:41.553000
6,207,426
6,210,142
What is the best way to generate client code for a CXF service?
I'd like to generate a client for my CXF service so I tried the Axis 2 code generator but it doesn't quite generate straightforward-to-use code. I expected something like client.getEmployeeByName("John Doe") but I have to create request classes and set the parameters on them. What is the best way to generate client cod...
What about just using the CXF wsdl2java command to generate the code?
What is the best way to generate client code for a CXF service? I'd like to generate a client for my CXF service so I tried the Axis 2 code generator but it doesn't quite generate straightforward-to-use code. I expected something like client.getEmployeeByName("John Doe") but I have to create request classes and set the...
TITLE: What is the best way to generate client code for a CXF service? QUESTION: I'd like to generate a client for my CXF service so I tried the Axis 2 code generator but it doesn't quite generate straightforward-to-use code. I expected something like client.getEmployeeByName("John Doe") but I have to create request c...
[ "java", "web-services", "apache-axis", "cxf", "webservice-client" ]
1
2
760
2
0
2011-06-01T20:44:22.167000
2011-06-02T03:47:00.427000
6,207,432
6,207,654
WF4, Promoted Properties, and Collections
What's the recommendation when needing to query an WF4 instance store for a collection of data? For example, my workflow has a collection of Step objects that will be used to display to end users where at in the overall workflow they are. How should I expose this data? I don't think property promotion is a good fit for...
You are right, the property promotion is more geared towards simple values. There is a possibility to store more complex data in a serialized form in there but as that would make it very hard to query that is usually not very helpful. Your best bet would be to store the data in your own tables. If you want to ensure yo...
WF4, Promoted Properties, and Collections What's the recommendation when needing to query an WF4 instance store for a collection of data? For example, my workflow has a collection of Step objects that will be used to display to end users where at in the overall workflow they are. How should I expose this data? I don't ...
TITLE: WF4, Promoted Properties, and Collections QUESTION: What's the recommendation when needing to query an WF4 instance store for a collection of data? For example, my workflow has a collection of Step objects that will be used to display to end users where at in the overall workflow they are. How should I expose t...
[ ".net", "workflow-foundation", "workflow-foundation-4" ]
0
0
665
1
0
2011-06-01T20:44:40.493000
2011-06-01T21:02:44.923000
6,207,433
6,208,497
jsf navigation question
I have a JSF2 project with a "view user" page that reads the currently selected user from a session bean; userHandler.selectedUser. The page is intended to be visited by navigating with links in the app. However, if the user attempts to hit the "view user" page directly by this URL... http://localhost:8080/webapp/userV...
You'd like to hook on the preRenderView event and then send a redirect when this is the case. with public void preRenderView() throws IOException { if (userHandler.getSelectedUser() == null) { FacesContext.getCurrentInstance().getExternalContext().redirect("home.jsf"); } }
jsf navigation question I have a JSF2 project with a "view user" page that reads the currently selected user from a session bean; userHandler.selectedUser. The page is intended to be visited by navigating with links in the app. However, if the user attempts to hit the "view user" page directly by this URL... http://loc...
TITLE: jsf navigation question QUESTION: I have a JSF2 project with a "view user" page that reads the currently selected user from a session bean; userHandler.selectedUser. The page is intended to be visited by navigating with links in the app. However, if the user attempts to hit the "view user" page directly by this...
[ "jsf" ]
2
3
940
2
0
2011-06-01T20:44:44.943000
2011-06-01T22:30:39.127000
6,207,440
6,207,604
What does CG_INLINE do?
I was poking around the definitions for things like CGPoint for hints on how to create my own functions but I don't know the purpose of CG_INLINE. What is happening behind the scenes here? CG_INLINE CGPoint CGPointMake(CGFloat x, CGFloat y) { CGPoint p; p.x = x; p.y = y; return p; } CG_INLINE CGSize CGSizeMake(CGFloat...
Inline functions are compiled into the call site, rather than being compiled as a single block of function code and call instructions issued when the function is used. With care, this provides a little more speed and greater numbers of cache hits. However, the history of inline in C and C++ is rocky, so this macro effe...
What does CG_INLINE do? I was poking around the definitions for things like CGPoint for hints on how to create my own functions but I don't know the purpose of CG_INLINE. What is happening behind the scenes here? CG_INLINE CGPoint CGPointMake(CGFloat x, CGFloat y) { CGPoint p; p.x = x; p.y = y; return p; } CG_INLINE C...
TITLE: What does CG_INLINE do? QUESTION: I was poking around the definitions for things like CGPoint for hints on how to create my own functions but I don't know the purpose of CG_INLINE. What is happening behind the scenes here? CG_INLINE CGPoint CGPointMake(CGFloat x, CGFloat y) { CGPoint p; p.x = x; p.y = y; return...
[ "objective-c", "cocoa", "ios" ]
15
24
3,700
3
0
2011-06-01T20:45:37.533000
2011-06-01T20:57:43.570000
6,207,447
6,207,495
Css3 evaluatable expressions?
Are there any techniques that allow for expressions in css3 statements? Frequently it is helpful to do such things as width: 35%+20px or similar. Right now the only solutions I have to these circumstances are to either redesign the page or to use javascript to dynamically set the css.
The CSS working draft on values and units specifies a calc function, though it is only supported in the latest versions of IE and Firefox.
Css3 evaluatable expressions? Are there any techniques that allow for expressions in css3 statements? Frequently it is helpful to do such things as width: 35%+20px or similar. Right now the only solutions I have to these circumstances are to either redesign the page or to use javascript to dynamically set the css.
TITLE: Css3 evaluatable expressions? QUESTION: Are there any techniques that allow for expressions in css3 statements? Frequently it is helpful to do such things as width: 35%+20px or similar. Right now the only solutions I have to these circumstances are to either redesign the page or to use javascript to dynamically...
[ "javascript", "css" ]
2
2
2,596
5
0
2011-06-01T20:46:14.290000
2011-06-01T20:50:43.707000
6,207,451
6,207,526
Design question - template pattern with enum implementing an interface
My code is starting to look out of control so I thought I would ask for help. I have an enum class that implements an interface. The first thing the method does is get a db connection from a pool using jndi. Then based on the objects properties performs a series of calculations and returns a result. public interace MyI...
I find it really confusing that you would have an enum that implements an interface like this, especially if the enum is responsible for interacting with a database - sounds like you may be misusing enum s. As for the actual problem, I would create a base class (potentially abstract) which contains the core logic of th...
Design question - template pattern with enum implementing an interface My code is starting to look out of control so I thought I would ask for help. I have an enum class that implements an interface. The first thing the method does is get a db connection from a pool using jndi. Then based on the objects properties perf...
TITLE: Design question - template pattern with enum implementing an interface QUESTION: My code is starting to look out of control so I thought I would ask for help. I have an enum class that implements an interface. The first thing the method does is get a db connection from a pool using jndi. Then based on the objec...
[ "java", "design-patterns", "spring-mvc", "enums" ]
2
3
554
1
0
2011-06-01T20:46:35.593000
2011-06-01T20:52:23.677000
6,207,454
6,216,557
Can I tell Selenium to record in DOM mode instead of element ID mode?
I have been using Selenium in my DEV environment. When I go to try some of my recorded tests on my Test environment, I find that the elements have different IDs (they are generated by the web framework). I can change the test manually to use document.forms[2].elements[3] instead of by id, which looks like this: ellaMfo...
IDE already has locator builders for several DOM styles (e.g., dom:index, which matches your model, or dom:name, which is less position-oriented). By default, they are prioritized lower than ID locators, but you can choose which locator you want to use when you record the test.
Can I tell Selenium to record in DOM mode instead of element ID mode? I have been using Selenium in my DEV environment. When I go to try some of my recorded tests on my Test environment, I find that the elements have different IDs (they are generated by the web framework). I can change the test manually to use document...
TITLE: Can I tell Selenium to record in DOM mode instead of element ID mode? QUESTION: I have been using Selenium in my DEV environment. When I go to try some of my recorded tests on my Test environment, I find that the elements have different IDs (they are generated by the web framework). I can change the test manual...
[ "selenium", "selenium-ide" ]
1
2
668
1
0
2011-06-01T20:47:24.783000
2011-06-02T15:19:11.820000
6,207,462
6,207,678
Generate a plaintext file from list of words on a webpage
I am trying to generate a plain text file containing a list of words that is on a webpage. The problem is that the list is divided into multiple pages. http://www.whonamedit.com/eponyms/A/?start=50&maxrows=25 This is what I mean. Like for the letter A, I need all 13 pages of words and I also need every letter of the al...
Assuming this is specifically for the whonamedit website, you can do the following: List getWordsOnPage(String url) { // read words within element. } void getAllWords() { List all = new ArrayList (); for (char letter = 'A'; letter <= 'Z'; ++letter) { for (int start = 0; true; start += 25) { List page = getWordsOnPage(...
Generate a plaintext file from list of words on a webpage I am trying to generate a plain text file containing a list of words that is on a webpage. The problem is that the list is divided into multiple pages. http://www.whonamedit.com/eponyms/A/?start=50&maxrows=25 This is what I mean. Like for the letter A, I need al...
TITLE: Generate a plaintext file from list of words on a webpage QUESTION: I am trying to generate a plain text file containing a list of words that is on a webpage. The problem is that the list is divided into multiple pages. http://www.whonamedit.com/eponyms/A/?start=50&maxrows=25 This is what I mean. Like for the l...
[ "java", "web-crawler" ]
0
0
233
2
0
2011-06-01T20:48:01.680000
2011-06-01T21:05:34.720000
6,207,477
6,207,580
.Net MVC3 Custom Model Binder - Initially Loading Model
I am creating a custom model binder to initially load a model from the database before updating the model with incoming values. (Inheriting from DefaultModelBinder) Which method do I need to override to do this?
You need to override the BindModel method of the DefaultModelBinder base class: public override object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext) { if (bindingContext.ModelType == typeof(YourType)) { var instanceOfYourType =...; // load YourType from DB etc.. var newBindingConte...
.Net MVC3 Custom Model Binder - Initially Loading Model I am creating a custom model binder to initially load a model from the database before updating the model with incoming values. (Inheriting from DefaultModelBinder) Which method do I need to override to do this?
TITLE: .Net MVC3 Custom Model Binder - Initially Loading Model QUESTION: I am creating a custom model binder to initially load a model from the database before updating the model with incoming values. (Inheriting from DefaultModelBinder) Which method do I need to override to do this? ANSWER: You need to override the ...
[ "c#", ".net", "asp.net-mvc-3", "modelbinders", "defaultmodelbinder" ]
2
3
1,339
2
0
2011-06-01T20:48:53.240000
2011-06-01T20:56:35.517000
6,207,480
6,207,833
How to rotate a two-dimensional array to an arbitrary degree?
Say I have a bool[][], and I want to rotate it by 37 degrees. I am aware that the transformation wouldn't always be perfect, and that's okay. I've ready plenty of answers on here similar to my question, but the only solutions I've found only solve the problem for 90 degree increments.
The best way is to loop over the destination locations and for each of them read the correct source location. If you try the other way around (i.e. looping on source and writing on destination) you will end up with gaps. The rotation formula is simple... source_x = dest_x * c + dest_y * s + x0 source_y = dest_x * -s + ...
How to rotate a two-dimensional array to an arbitrary degree? Say I have a bool[][], and I want to rotate it by 37 degrees. I am aware that the transformation wouldn't always be perfect, and that's okay. I've ready plenty of answers on here similar to my question, but the only solutions I've found only solve the proble...
TITLE: How to rotate a two-dimensional array to an arbitrary degree? QUESTION: Say I have a bool[][], and I want to rotate it by 37 degrees. I am aware that the transformation wouldn't always be perfect, and that's okay. I've ready plenty of answers on here similar to my question, but the only solutions I've found onl...
[ "c#", "arrays", "math" ]
1
9
3,099
4
0
2011-06-01T20:49:20.973000
2011-06-01T21:17:53.410000
6,207,481
6,209,086
Using Google Maps Javascript API pinch-to-zoom on my own image
I'm trying to create a mobile-friendly web page that will allow a user to drag an around in a. I've got this working using the image.ontouchstart method. Now I want to make it so the user can pinch-to-zoom when viewing this from an iOS device (I'm currently browsing to my page locally from my iPad). From the research I...
I believe your options are fairly limited. But if you can tolerate the user being aware that the map is underneath your image (because they'll see it for a split second after every zoom) then as a starting point, take a look at the answer at any technology to preview high definition photo, can zoom in and out like goog...
Using Google Maps Javascript API pinch-to-zoom on my own image I'm trying to create a mobile-friendly web page that will allow a user to drag an around in a. I've got this working using the image.ontouchstart method. Now I want to make it so the user can pinch-to-zoom when viewing this from an iOS device (I'm currently...
TITLE: Using Google Maps Javascript API pinch-to-zoom on my own image QUESTION: I'm trying to create a mobile-friendly web page that will allow a user to drag an around in a. I've got this working using the image.ontouchstart method. Now I want to make it so the user can pinch-to-zoom when viewing this from an iOS dev...
[ "image", "google-maps", "zooming", "pinch" ]
3
2
4,658
2
0
2011-06-01T20:49:23.970000
2011-06-02T00:03:37.900000
6,207,486
6,207,503
will an in clause always return the same order in mysql
ok so i have this query select price from product where product_id in (49, 50, 51) and I want to know if the three records returned will be in the same order as my in clause. SO for example 100.0000 166.0000 55.0000 will 100.0000 belong to 49, 166.0000 to 50 and 55.0000 to 51
If you want to preserve the same order you have specified within in clause you have to use field() function. select price from product where product_id in (49, 50, 51) order by field(product_id,49,50,51)
will an in clause always return the same order in mysql ok so i have this query select price from product where product_id in (49, 50, 51) and I want to know if the three records returned will be in the same order as my in clause. SO for example 100.0000 166.0000 55.0000 will 100.0000 belong to 49, 166.0000 to 50 and 5...
TITLE: will an in clause always return the same order in mysql QUESTION: ok so i have this query select price from product where product_id in (49, 50, 51) and I want to know if the three records returned will be in the same order as my in clause. SO for example 100.0000 166.0000 55.0000 will 100.0000 belong to 49, 16...
[ "mysql" ]
1
1
599
3
0
2011-06-01T20:50:05.953000
2011-06-01T20:51:17.733000
6,207,491
6,207,858
JScript JSON Array access
I have a JSON array stored in a file data.json - I used the code that was recommended here for a similar problem, explain why when I try to access the array later in the program it tells me it is undefined. var chartData = (function () { var chartData = null; $.ajax({ 'async': false, 'global': false, 'url': "data.json"...
Perhaps because it was not successful? I found it very useful to debug using console.log (firebug, or most modern web developer panels in chrome or ie support it) you can try this piece of code to debug it. var chartData = (function () { var chartData = null; $.ajax({ 'async': false, 'global': false, 'url': "data.json"...
JScript JSON Array access I have a JSON array stored in a file data.json - I used the code that was recommended here for a similar problem, explain why when I try to access the array later in the program it tells me it is undefined. var chartData = (function () { var chartData = null; $.ajax({ 'async': false, 'global':...
TITLE: JScript JSON Array access QUESTION: I have a JSON array stored in a file data.json - I used the code that was recommended here for a similar problem, explain why when I try to access the array later in the program it tells me it is undefined. var chartData = (function () { var chartData = null; $.ajax({ 'async'...
[ "javascript", "ajax", "json" ]
0
1
260
2
0
2011-06-01T20:50:21.473000
2011-06-01T21:20:16.913000
6,207,504
6,207,544
Suppress PHP warnings for expected Oracle exceptions
I have a PHP function that calls a PL/SQL package that can throw a number of known exceptions (i.e. user exceptions) that I can catch in PHP and act on. The problem is, despite catching the exception in PHP I get a warning in the PHP log file with a stack trace from the PL/SQL exception: PHP Warning: oci_execute(): ORA...
If you only need to suppress the warning on oci_execute(), prepend it with @ @oci_execute() Using that kind of runtime error suppression is often not recommended since it covers up problems in the application, but you've handled the problem in the code by catching the exception already and understand the consequence of...
Suppress PHP warnings for expected Oracle exceptions I have a PHP function that calls a PL/SQL package that can throw a number of known exceptions (i.e. user exceptions) that I can catch in PHP and act on. The problem is, despite catching the exception in PHP I get a warning in the PHP log file with a stack trace from ...
TITLE: Suppress PHP warnings for expected Oracle exceptions QUESTION: I have a PHP function that calls a PL/SQL package that can throw a number of known exceptions (i.e. user exceptions) that I can catch in PHP and act on. The problem is, despite catching the exception in PHP I get a warning in the PHP log file with a...
[ "php", "oracle", "plsql", "suppress-warnings", "oracle-call-interface" ]
10
9
4,221
1
0
2011-06-01T20:51:20.947000
2011-06-01T20:53:20.443000
6,207,524
6,207,583
Arranging Divs to minimize spaces
Here's my problem: I have a group of divs which have varying amounts of content. They're floated left and I want them to line up so there's no vertical space between them (apart from the 10px margin I added. here's an example on jsFiddle it's a bit like this question but i couldn't quite follow the suggestions 1st, is ...
That´s not possible just with css, although I saw a sort of a solution using css3 columns but that´s not very cross-browser compatible. You´ll have to use javascript, for example the Masonry jquery plugin.
Arranging Divs to minimize spaces Here's my problem: I have a group of divs which have varying amounts of content. They're floated left and I want them to line up so there's no vertical space between them (apart from the 10px margin I added. here's an example on jsFiddle it's a bit like this question but i couldn't qui...
TITLE: Arranging Divs to minimize spaces QUESTION: Here's my problem: I have a group of divs which have varying amounts of content. They're floated left and I want them to line up so there's no vertical space between them (apart from the 10px margin I added. here's an example on jsFiddle it's a bit like this question ...
[ "css", "layout", "html", "grid", "css-float" ]
1
3
149
2
0
2011-06-01T20:52:11.380000
2011-06-01T20:56:47.500000
6,207,527
6,210,243
how do make this show/hide more concise?
There are many show/hide questions and examples but I can't find the answer. I have a simple code like this which is used in a few areas within a page. jQuery(document).ready(function () { jQuery('#mini-cart').hide(); jQuery('#mini-cart-a').click(function () { jQuery('#mini-cart').toggle(400); return false; }); }); Eac...
Specify a class such as ".tab" and the id of the div containing the content that you want to display for the particular ".tab" i.e. $(".tab").click(function(){ var clickedID = $(this).attr("class").split(" ")[1]; $("#" + clickedID).toggle(); }); This container will be displayed if you click on the div.tab container 1 T...
how do make this show/hide more concise? There are many show/hide questions and examples but I can't find the answer. I have a simple code like this which is used in a few areas within a page. jQuery(document).ready(function () { jQuery('#mini-cart').hide(); jQuery('#mini-cart-a').click(function () { jQuery('#mini-cart...
TITLE: how do make this show/hide more concise? QUESTION: There are many show/hide questions and examples but I can't find the answer. I have a simple code like this which is used in a few areas within a page. jQuery(document).ready(function () { jQuery('#mini-cart').hide(); jQuery('#mini-cart-a').click(function () { ...
[ "jquery", "show-hide" ]
3
0
841
5
0
2011-06-01T20:52:26.737000
2011-06-02T04:06:44.173000
6,207,539
6,207,670
How can I most easily do IPC/RPC between Cocoa (client) and Java (server) running on the same host?
The Java end is a Bukkit plugin, so I don't have the freedom to build on a servlet engine like Tomcat. I don't need arbitrary access to any object; I just want to expose a subset of functionality available to plugins to my wrapper application. The Cocoa application, I am building from the ground up, so the restrictions...
Java does not support UNIX sockets out-of-the box, but this question gives some alternatives. Or you can just open a tcp socket on localhost to keep in the standard library. There are a lot of solutions out there, but if you want to stay lean and mean, a simple socket is not too bad. All the boxed solutions are quite c...
How can I most easily do IPC/RPC between Cocoa (client) and Java (server) running on the same host? The Java end is a Bukkit plugin, so I don't have the freedom to build on a servlet engine like Tomcat. I don't need arbitrary access to any object; I just want to expose a subset of functionality available to plugins to ...
TITLE: How can I most easily do IPC/RPC between Cocoa (client) and Java (server) running on the same host? QUESTION: The Java end is a Bukkit plugin, so I don't have the freedom to build on a servlet engine like Tomcat. I don't need arbitrary access to any object; I just want to expose a subset of functionality availa...
[ "java", "objective-c", "cocoa", "ipc", "rpc" ]
1
0
680
2
0
2011-06-01T20:53:10.200000
2011-06-01T21:04:39.073000
6,207,542
6,207,574
MySQL DELETE query issue with Select
The following query: DELETE FROM CO05IN.ININVPRC WHERE IPPART IN (SELECT IPPART FROM CO05IN.ININVPRC left join CO05IN.ININVMST on IPPART = IMPART where IMPART is null); Creates this on the log: You can't specify target table 'ININVPRC' for update in FROM clause. What is causing this? Note using MySQL version 5.1
Try in this way. DELETE FROM CO05IN.ININVPRC WHERE IPPART IN (select * from (SELECT IPPART FROM CO05IN.ININVPRC left join CO05IN.ININVMST on IPPART = IMPART where IMPART is null) as t);
MySQL DELETE query issue with Select The following query: DELETE FROM CO05IN.ININVPRC WHERE IPPART IN (SELECT IPPART FROM CO05IN.ININVPRC left join CO05IN.ININVMST on IPPART = IMPART where IMPART is null); Creates this on the log: You can't specify target table 'ININVPRC' for update in FROM clause. What is causing this...
TITLE: MySQL DELETE query issue with Select QUESTION: The following query: DELETE FROM CO05IN.ININVPRC WHERE IPPART IN (SELECT IPPART FROM CO05IN.ININVPRC left join CO05IN.ININVMST on IPPART = IMPART where IMPART is null); Creates this on the log: You can't specify target table 'ININVPRC' for update in FROM clause. Wh...
[ "mysql", "mysql-error-1093" ]
1
2
173
1
0
2011-06-01T20:53:12.977000
2011-06-01T20:56:09.573000
6,207,543
6,237,150
Search on phone number in AD
Is it possible to search in LDAP who has their phonenumber set? (as in, everybody without a NULL value as phone will be shown?) edit: without knowing the usernames beforehand..
Figured it out myself by playing around abit, for any1 curious: $filter = '(&(objectCategory=person)(telephoneNumber=*))'; Does the trick
Search on phone number in AD Is it possible to search in LDAP who has their phonenumber set? (as in, everybody without a NULL value as phone will be shown?) edit: without knowing the usernames beforehand..
TITLE: Search on phone number in AD QUESTION: Is it possible to search in LDAP who has their phonenumber set? (as in, everybody without a NULL value as phone will be shown?) edit: without knowing the usernames beforehand.. ANSWER: Figured it out myself by playing around abit, for any1 curious: $filter = '(&(objectCat...
[ "php", "active-directory", "ldap" ]
0
0
3,328
1
0
2011-06-01T20:53:17.913000
2011-06-04T14:01:46.137000
6,207,545
6,214,698
How do I search through associations in metawhere in Rails 3?
When I was using searchlogic, I couuld use the following: 27 # @todos = Todo.contact_user_id_is(current_user). 28 # contact_campaign_id_is(@campaign). 29 # current_date_lte(Date.today). 30 # done_date_null. 31 # ascend_by_contact_id. 32 # ascend_by_current_date For example, it would allow me to search for the campaign ...
If Todo belongs_to or has_one contact, which I'm assuming is the case based on the Searchlogic query above, you would want to do something like (untested): @todos = Todo.joins(:contact). where(:contact => {:user_id => current_user.id,:campaign_id => @campaign.id },:current_date.lteq => Date.today,:done_date.not_eq => n...
How do I search through associations in metawhere in Rails 3? When I was using searchlogic, I couuld use the following: 27 # @todos = Todo.contact_user_id_is(current_user). 28 # contact_campaign_id_is(@campaign). 29 # current_date_lte(Date.today). 30 # done_date_null. 31 # ascend_by_contact_id. 32 # ascend_by_current_d...
TITLE: How do I search through associations in metawhere in Rails 3? QUESTION: When I was using searchlogic, I couuld use the following: 27 # @todos = Todo.contact_user_id_is(current_user). 28 # contact_campaign_id_is(@campaign). 29 # current_date_lte(Date.today). 30 # done_date_null. 31 # ascend_by_contact_id. 32 # a...
[ "ruby-on-rails-3", "associations", "meta-where" ]
0
0
218
1
0
2011-06-01T20:53:21.310000
2011-06-02T12:47:52.277000
6,207,547
6,212,031
amazon cloud web service - how to locate/manage it
I am thinking of implementing a service on the amazon cloud. Basic idea is: client has some files (client can be on a the user's amazon cloud, or on a regular machine) files are uploaded to a machine on the cloud, along with instructions for how to process the files cloud machine performs the file processing output fil...
Interesting.. You need the following: Auto-scaling - to spawn one or more servers + remove them when not in use. http://www.techmasala.com/2009/04/06/dynamically-scale-web-applications-in-amazon-ec2/ Amazon S3 for transferring and storing files - 99% redundancy + distributed. RequestTimeout uploading to S3 using PHP I ...
amazon cloud web service - how to locate/manage it I am thinking of implementing a service on the amazon cloud. Basic idea is: client has some files (client can be on a the user's amazon cloud, or on a regular machine) files are uploaded to a machine on the cloud, along with instructions for how to process the files cl...
TITLE: amazon cloud web service - how to locate/manage it QUESTION: I am thinking of implementing a service on the amazon cloud. Basic idea is: client has some files (client can be on a the user's amazon cloud, or on a regular machine) files are uploaded to a machine on the cloud, along with instructions for how to pr...
[ "amazon-s3", "amazon-ec2" ]
0
0
103
1
0
2011-06-01T20:53:36.297000
2011-06-02T08:12:44.460000
6,207,548
6,207,801
java.lang.NoClassDefFoundError: org/apache/axis2/AxisFault When axis2-kernel-1.5.4.jar is in the class path
I have a jar file with a main() statement that instantiates and calls an axis2 web service stub. It cannot seem to find org.apache.axis2.AxisFault despite it being on my classpath. I am running 1.6.0_25 on windows 7. My command is as follows: java -classpath "C:\Program Files\Apache Software Foundation\axis2-1.5.4\lib\...
-jar makes java ignore any -cp jars. Adjust the Class-Path in the manifest.
java.lang.NoClassDefFoundError: org/apache/axis2/AxisFault When axis2-kernel-1.5.4.jar is in the class path I have a jar file with a main() statement that instantiates and calls an axis2 web service stub. It cannot seem to find org.apache.axis2.AxisFault despite it being on my classpath. I am running 1.6.0_25 on window...
TITLE: java.lang.NoClassDefFoundError: org/apache/axis2/AxisFault When axis2-kernel-1.5.4.jar is in the class path QUESTION: I have a jar file with a main() statement that instantiates and calls an axis2 web service stub. It cannot seem to find org.apache.axis2.AxisFault despite it being on my classpath. I am running ...
[ "java", "windows", "apache-axis" ]
3
3
16,171
1
0
2011-06-01T20:53:39.390000
2011-06-01T21:15:39.567000
6,207,549
6,209,024
How do I use AppleScript to get e-mail addresses, account information from Lotus Notes?
We have a mailbox containing roughly 60,000 e-mails, and I've been challenged to pull the names, account numbers and e-mail addresses out of the body of each and export it into a spreadsheet-friendly format. I was thinking of using AppleScript and Notes 8.5, but I can't find any documentation on how to interact with in...
If you're familiar with scripting languages, I suggest going with LotusScript instead. It gives you direct access to the Notes objects rather than Applescript and the Notes C API. You can create a Notes Agent within the mailbox using the Notes Designer application. The code would roughly be this: Dim s as New NotesSess...
How do I use AppleScript to get e-mail addresses, account information from Lotus Notes? We have a mailbox containing roughly 60,000 e-mails, and I've been challenged to pull the names, account numbers and e-mail addresses out of the body of each and export it into a spreadsheet-friendly format. I was thinking of using ...
TITLE: How do I use AppleScript to get e-mail addresses, account information from Lotus Notes? QUESTION: We have a mailbox containing roughly 60,000 e-mails, and I've been challenged to pull the names, account numbers and e-mail addresses out of the body of each and export it into a spreadsheet-friendly format. I was ...
[ "applescript", "lotus-notes" ]
0
1
711
1
0
2011-06-01T20:53:39.527000
2011-06-01T23:53:09.107000
6,207,555
6,215,757
Checking for TextField changes once a form was submitted in Coldfusion
I have code that displays database entries, and allows for editing/deletion. I am trying to find some way on submission to see if a particular field has been changed, so if the old data of the field is not referenced by any database entries, I can delete it. Any ideas on how to do this? To respond to the first comment ...
A simple way to compare whether fields on a form have changed from the original is to include the original data in a hidden form field then on the action page compare the values of the form field and its hidden counterpart and see if they've changed. form: action: If you're consistent with form field names it'll be eas...
Checking for TextField changes once a form was submitted in Coldfusion I have code that displays database entries, and allows for editing/deletion. I am trying to find some way on submission to see if a particular field has been changed, so if the old data of the field is not referenced by any database entries, I can d...
TITLE: Checking for TextField changes once a form was submitted in Coldfusion QUESTION: I have code that displays database entries, and allows for editing/deletion. I am trying to find some way on submission to see if a particular field has been changed, so if the old data of the field is not referenced by any databas...
[ "coldfusion", "submit", "textfield", "onchange" ]
1
2
1,192
2
0
2011-06-01T20:54:12.143000
2011-06-02T14:17:52.147000
6,207,557
6,207,746
How to reduce queries in django model has_relation method?
Here are two example Django models. Pay special attention to the has_pet method. class Person(models.Model): name = models.CharField(max_length=255) def has_pet(self): return bool(self.pets.all().only('id')) class Pet(models.Model): name = models.CharField(max_length=255) owner = models.ForeignKey(Person, blank=True,...
If you want a list of all the people with pets you can do that in a single query: Person.objects.exclude(pets=None) Sounds like you want to iterate over a single list of people, using annotations would probably make sense: for person in Person.objects.annotate(has_pet=Count('pets')): if person.has_pet: # if has_pet is ...
How to reduce queries in django model has_relation method? Here are two example Django models. Pay special attention to the has_pet method. class Person(models.Model): name = models.CharField(max_length=255) def has_pet(self): return bool(self.pets.all().only('id')) class Pet(models.Model): name = models.CharField(ma...
TITLE: How to reduce queries in django model has_relation method? QUESTION: Here are two example Django models. Pay special attention to the has_pet method. class Person(models.Model): name = models.CharField(max_length=255) def has_pet(self): return bool(self.pets.all().only('id')) class Pet(models.Model): name = m...
[ "python", "django", "django-models", "django-queryset" ]
7
4
827
1
0
2011-06-01T20:54:28.230000
2011-06-01T21:10:41.927000
6,207,570
6,207,841
Plotting mean and 95% confidence interval with Hmisc::xYplot and adjusting x axis
I'm trying to plot the results of a regression and I need to plot the coefficients estimated plus 95% confidence interval (actually I have 95% credibility interval, since I'm fitting a Bayesian model, but the idea is the same). And in the x axis, I need to put the name of each variable. Here what I tried, but it didn't...
Sorry guys, but I found the errors on the code above. In this case, do I answer my own question? Here the code that works... xYplot(Cbind(betas1,quantiles.beta) ~ seq(0, 125, 25), varwidth = TRUE, ylab="Betas",xlab="Ano", ylim=c(-1.5, 1.5), scales=list(cex=1.2, x = list(at=seq(0,125, by=25), labels = c("PIB per cap.", ...
Plotting mean and 95% confidence interval with Hmisc::xYplot and adjusting x axis I'm trying to plot the results of a regression and I need to plot the coefficients estimated plus 95% confidence interval (actually I have 95% credibility interval, since I'm fitting a Bayesian model, but the idea is the same). And in the...
TITLE: Plotting mean and 95% confidence interval with Hmisc::xYplot and adjusting x axis QUESTION: I'm trying to plot the results of a regression and I need to plot the coefficients estimated plus 95% confidence interval (actually I have 95% credibility interval, since I'm fitting a Bayesian model, but the idea is the...
[ "r", "lattice" ]
0
2
2,031
1
0
2011-06-01T20:55:39.417000
2011-06-01T21:18:35.640000
6,207,571
6,208,893
CSS print sheet problem
What a maddening problem. I'm working on a site built on top of a CMS, so the markup is... not clean. I'm trying to write a print style sheet but it's being wildly inconsistent across browsers (I know, a shock). Link: http://www.gastongov.com/departments/county-commission/contact-info IE7 and IE9 look fine. IE8, the te...
You've got a few curly problems, but here are some easy things that will at least help diagnosing and fixing them easier, even if they don't fix the problems themselves directly. Your print style sheet loads before 'page.css' and a bunch of other CSS files which appear to come from the CMS you're using. All of which ha...
CSS print sheet problem What a maddening problem. I'm working on a site built on top of a CMS, so the markup is... not clean. I'm trying to write a print style sheet but it's being wildly inconsistent across browsers (I know, a shock). Link: http://www.gastongov.com/departments/county-commission/contact-info IE7 and IE...
TITLE: CSS print sheet problem QUESTION: What a maddening problem. I'm working on a site built on top of a CMS, so the markup is... not clean. I'm trying to write a print style sheet but it's being wildly inconsistent across browsers (I know, a shock). Link: http://www.gastongov.com/departments/county-commission/conta...
[ "css", "printing" ]
1
3
1,840
1
0
2011-06-01T20:55:10.033000
2011-06-01T23:29:31.700000
6,207,576
6,212,188
Using JQuery Sortable toArray with connectWith; how to get IDs of all items?
Given n lists of m items that are Sortable across lists, how can I get an overall list of IDs for all items in all lists from top to bottom (including both sort participants and non-participants)? My list of items looks something like this: Category 1 - (id=a) Item 1A - (id=b) Item 1B Category 2 - (id=c) Item 2A - (id=...
There doesn't seem to be a native function to do this, so I created a demo that iterates all the.sortable elements to create one array and log to the console in Chrome or Firefox with Firebug. I also changed the update to receive so it only fires once (see jQueryUI sortable documentation ).
Using JQuery Sortable toArray with connectWith; how to get IDs of all items? Given n lists of m items that are Sortable across lists, how can I get an overall list of IDs for all items in all lists from top to bottom (including both sort participants and non-participants)? My list of items looks something like this: Ca...
TITLE: Using JQuery Sortable toArray with connectWith; how to get IDs of all items? QUESTION: Given n lists of m items that are Sortable across lists, how can I get an overall list of IDs for all items in all lists from top to bottom (including both sort participants and non-participants)? My list of items looks somet...
[ "jquery", "jquery-ui", "jquery-ui-sortable" ]
1
2
4,690
2
0
2011-06-01T20:56:19.420000
2011-06-02T08:32:31.597000
6,207,585
6,207,964
JSON to C# Classes - Unknown property names
let's say I have the following JSON payload; { "pagemap": { "metatags": [ { "msapplication-task": "name\u003dAbout Tugberk Ugurlu;action-uri\u003d/about;icon-uri\u003d/content/App_Icons/icos/about.ico", "msapplication-task": "name\u003dContact;action-uri\u003d/contact;icon-uri\u003d/content/App_Icons/icos/contact.ico",...
I'd probably just want the MetaTags array to just get pushed into a Dictionary or even just List and then write a helper class that parses msapplication-task values into something you want. Edit: I believe the OP is looking for some help in how his model class would actually be public class PageMap { public Dictionary ...
JSON to C# Classes - Unknown property names let's say I have the following JSON payload; { "pagemap": { "metatags": [ { "msapplication-task": "name\u003dAbout Tugberk Ugurlu;action-uri\u003d/about;icon-uri\u003d/content/App_Icons/icos/about.ico", "msapplication-task": "name\u003dContact;action-uri\u003d/contact;icon-ur...
TITLE: JSON to C# Classes - Unknown property names QUESTION: let's say I have the following JSON payload; { "pagemap": { "metatags": [ { "msapplication-task": "name\u003dAbout Tugberk Ugurlu;action-uri\u003d/about;icon-uri\u003d/content/App_Icons/icos/about.ico", "msapplication-task": "name\u003dContact;action-uri\u00...
[ "c#", ".net", "json" ]
5
2
2,237
2
0
2011-06-01T20:56:54.033000
2011-06-01T21:31:21.507000
6,207,589
6,207,638
Is it possible to have 3 delimiters for the explode function
Option 1 (spaces) keyword keyword keyword Option 2 (line breaks) keyword keyword keyword Option 3 (commas) keyword, keyword, keyword Or would I have to use the split function instead? And if so, how?
Try using preg_split but notice that this will explode on all of your examples at once. $parts = preg_split("/[,\n]/", $string); Edit: For the third example you give you'll get empty array elements as it's being split on both the comma and the space. Pass $parts through array_filter() to strip these out.
Is it possible to have 3 delimiters for the explode function Option 1 (spaces) keyword keyword keyword Option 2 (line breaks) keyword keyword keyword Option 3 (commas) keyword, keyword, keyword Or would I have to use the split function instead? And if so, how?
TITLE: Is it possible to have 3 delimiters for the explode function QUESTION: Option 1 (spaces) keyword keyword keyword Option 2 (line breaks) keyword keyword keyword Option 3 (commas) keyword, keyword, keyword Or would I have to use the split function instead? And if so, how? ANSWER: Try using preg_split but notice ...
[ "php", "split", "explode" ]
2
4
90
3
0
2011-06-01T20:57:09.670000
2011-06-01T21:00:32.987000
6,207,598
6,207,727
what's wrong in where condition statement
SqlConnection con = new SqlConnection (@"Data Source=SAMA-PC\SQLEXPRESS;Initial Catalog=advCenter; Integrated Security=True"); SqlCommand com1 = new SqlCommand( "select visited_link from links where [user_email]=@ue and [visited_link]=@vl",con); com1.Parameters.AddWithValue("@ue",Convert.ToString(Session["mail"])); com...
Use the following: "... and CAST([visited_link] AS NVARCHAR(MAX))=@vl " Refer to the following CAST and CONVERT (Transact-SQL) HOW TO: Compare Values in NTEXT Field
what's wrong in where condition statement SqlConnection con = new SqlConnection (@"Data Source=SAMA-PC\SQLEXPRESS;Initial Catalog=advCenter; Integrated Security=True"); SqlCommand com1 = new SqlCommand( "select visited_link from links where [user_email]=@ue and [visited_link]=@vl",con); com1.Parameters.AddWithValue("@u...
TITLE: what's wrong in where condition statement QUESTION: SqlConnection con = new SqlConnection (@"Data Source=SAMA-PC\SQLEXPRESS;Initial Catalog=advCenter; Integrated Security=True"); SqlCommand com1 = new SqlCommand( "select visited_link from links where [user_email]=@ue and [visited_link]=@vl",con); com1.Parameter...
[ "asp.net" ]
0
0
90
2
0
2011-06-01T20:57:35.563000
2011-06-01T21:08:59.467000