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,220,343
6,220,425
Can't get XPath query to return the right nodeset
I've got an xml file that looks like this: value1 value2 value3 What I need is to select all the ROW nodes, across all records, so I'm using something like this: rowiterator = Me.XMLDocument.CreateNavigator.Evaluate("//table/Row") which is working, but it returns a NodeIterator that only contains the first Row node in ...
You should use the XPathNavigator.Select method and loop through the iterator. Use the XPathNodeIterator.Current property to access the current XPathNavigator object in the loop. Dim iter = xmldoc.CreateNavigator().Select("//table/Row") While (iter.MoveNext()) Console.WriteLine(iter.Current.Value) End While
Can't get XPath query to return the right nodeset I've got an xml file that looks like this: value1 value2 value3 What I need is to select all the ROW nodes, across all records, so I'm using something like this: rowiterator = Me.XMLDocument.CreateNavigator.Evaluate("//table/Row") which is working, but it returns a Node...
TITLE: Can't get XPath query to return the right nodeset QUESTION: I've got an xml file that looks like this: value1 value2 value3 What I need is to select all the ROW nodes, across all records, so I'm using something like this: rowiterator = Me.XMLDocument.CreateNavigator.Evaluate("//table/Row") which is working, but...
[ "xml", "vb.net", "xpath" ]
1
2
336
1
0
2011-06-02T21:01:38.523000
2011-06-02T21:09:24.227000
6,220,349
6,220,555
Could not load file or assembly System
We have a customer that is using Server 2008 x86 II7 with asp.net 3.5SP1. When our asp.net application is installed we are getting the following error: Could not load file or assembly 'System, Version=2.0.50727' Has anyone ran into this issue? Any help would be greatly appreciated.
Check your applications web.config - are you binding to that version for some reason by any chance? Its possible it is referencing the wrong version. The assembly version is 2.0.0.0 but the file version is 2.0.50727. Once you open up the gac, right click on the System library for 2.0.0.0 and look at the file version th...
Could not load file or assembly System We have a customer that is using Server 2008 x86 II7 with asp.net 3.5SP1. When our asp.net application is installed we are getting the following error: Could not load file or assembly 'System, Version=2.0.50727' Has anyone ran into this issue? Any help would be greatly appreciated...
TITLE: Could not load file or assembly System QUESTION: We have a customer that is using Server 2008 x86 II7 with asp.net 3.5SP1. When our asp.net application is installed we are getting the following error: Could not load file or assembly 'System, Version=2.0.50727' Has anyone ran into this issue? Any help would be g...
[ "asp.net", "iis", "iis-7", "windows-server-2008" ]
1
3
831
1
0
2011-06-02T21:02:08.253000
2011-06-02T21:21:56.357000
6,220,354
6,220,860
Android - Two ImageViews side-by-side
I am trying to create an Activity for an Android app with two imageViews aligned side-by-side. my current layout config is as follows: The first image will be a square (lets say 100x100) and the second image will be rectangular (300x100) - and I want them to be aligned next to each other but always be scaled to fit wit...
try using layout_weight for both of the ImageView components. So something like: i added android:layout_weight="1" to each of them. Read up on layout_weight for LinearLayout definitions, it's very useful!
Android - Two ImageViews side-by-side I am trying to create an Activity for an Android app with two imageViews aligned side-by-side. my current layout config is as follows: The first image will be a square (lets say 100x100) and the second image will be rectangular (300x100) - and I want them to be aligned next to each...
TITLE: Android - Two ImageViews side-by-side QUESTION: I am trying to create an Activity for an Android app with two imageViews aligned side-by-side. my current layout config is as follows: The first image will be a square (lets say 100x100) and the second image will be rectangular (300x100) - and I want them to be al...
[ "android", "imageview" ]
5
14
19,750
2
0
2011-06-02T21:02:27.613000
2011-06-02T21:57:59.490000
6,220,355
6,232,773
Want to use categories as pages in WordPress
I have a couple of pages (home, about me,...) in my main navigation. Now I'd like to get rid of my sidebar and I have plenty of space in my main navigation. Is there any chance I could get my categories to display in there, preferably with the subcategories displaying as childs (which will work well in the dropdown men...
will list your categories. It will however list them vertically so you'll need to use css in your style sheet to create a class to list the horizontally. As for removing the side bar. If you go to your index.php and your single.php you will set something like or by removing this the page will no longer fetch your side ...
Want to use categories as pages in WordPress I have a couple of pages (home, about me,...) in my main navigation. Now I'd like to get rid of my sidebar and I have plenty of space in my main navigation. Is there any chance I could get my categories to display in there, preferably with the subcategories displaying as chi...
TITLE: Want to use categories as pages in WordPress QUESTION: I have a couple of pages (home, about me,...) in my main navigation. Now I'd like to get rid of my sidebar and I have plenty of space in my main navigation. Is there any chance I could get my categories to display in there, preferably with the subcategories...
[ "wordpress", "categories" ]
0
1
135
1
0
2011-06-02T21:02:28.053000
2011-06-03T21:16:13.217000
6,220,362
6,220,424
SQL lookup in SELECT statement
I've got and sql express database I need to extract some data from. I have three fields. ID,NAME,DATE. In the DATA column there is values like "654;654;526". Yes, semicolons includes. Now those number relate to another table(two - field ID and NAME). The numbers in the DATA column relate to the ID field in the 2nd tabl...
Redesign the database unless this is a third party database you are supporting. This will never be a good design and should never have been built this way. This is one of those times you bite the bullet and fix it before things get worse which they will. Yeu need a related table to store the values in. One of the very ...
SQL lookup in SELECT statement I've got and sql express database I need to extract some data from. I have three fields. ID,NAME,DATE. In the DATA column there is values like "654;654;526". Yes, semicolons includes. Now those number relate to another table(two - field ID and NAME). The numbers in the DATA column relate ...
TITLE: SQL lookup in SELECT statement QUESTION: I've got and sql express database I need to extract some data from. I have three fields. ID,NAME,DATE. In the DATA column there is values like "654;654;526". Yes, semicolons includes. Now those number relate to another table(two - field ID and NAME). The numbers in the D...
[ "sql" ]
2
2
640
4
0
2011-06-02T21:02:41.913000
2011-06-02T21:09:15.970000
6,220,374
6,220,411
Can I encrypt content so it doesn't appear in view-source, then show on pageload?
I've got a site where users extend their product trial with a registration code. They click a link (with a key in the URL) from an email, get to this site and a lightbox appears with their registration code. I'm currently displaying the registration code with HTML and hiding it with CSS. Once I check to make sure the U...
If the computer knows it, the user knows it. You can play obfuscation games, all of which amount to making your Javascript hard to read. But a sufficiently determined user will find it anyway, and once they do, they can easily share it with their friends. One code per user is the only way to fix this reliably.
Can I encrypt content so it doesn't appear in view-source, then show on pageload? I've got a site where users extend their product trial with a registration code. They click a link (with a key in the URL) from an email, get to this site and a lightbox appears with their registration code. I'm currently displaying the r...
TITLE: Can I encrypt content so it doesn't appear in view-source, then show on pageload? QUESTION: I've got a site where users extend their product trial with a registration code. They click a link (with a key in the URL) from an email, get to this site and a lightbox appears with their registration code. I'm currentl...
[ "javascript", "encryption", "obfuscation", "client-side-validation" ]
0
6
824
7
0
2011-06-02T21:03:46.057000
2011-06-02T21:07:17.683000
6,220,376
6,220,554
Flex Builder 4 cant run or debug
I've been working in Flash BUilder 4.0. I installed Flash Builder 4.5, and switched to the workspace I had used for 4.0. Then we were told to go back to 4.0, and now I can't run or debug. I can build, but then I have to double click on the.html file to run. Right clicking doesn't bring up run or debug, and the run and ...
Create a full backup of your workspace first so you can always go back to the previous situation! Try removing the hidden.metadata folder from your workspace, remove all your projects from your workspace (but of course not from the disk!). Restart Flash Builder, open your workspace folder and then reimport them. If the...
Flex Builder 4 cant run or debug I've been working in Flash BUilder 4.0. I installed Flash Builder 4.5, and switched to the workspace I had used for 4.0. Then we were told to go back to 4.0, and now I can't run or debug. I can build, but then I have to double click on the.html file to run. Right clicking doesn't bring ...
TITLE: Flex Builder 4 cant run or debug QUESTION: I've been working in Flash BUilder 4.0. I installed Flash Builder 4.5, and switched to the workspace I had used for 4.0. Then we were told to go back to 4.0, and now I can't run or debug. I can build, but then I have to double click on the.html file to run. Right click...
[ "flash", "debugging", "builder" ]
1
1
2,218
4
0
2011-06-02T21:03:48.740000
2011-06-02T21:21:46.943000
6,220,384
6,249,610
Moodle, PHP and using external APIs
I am new to Moodle and PHP, so I may be asking for the impossible or just the impractical. I am wondering how I might go about allowing client applications (written, perhaps, in C++, Java, AS3/Flash) to make calls to Moodle's Gradebook module, for example. Does Moodle run as a server or does it rely on Apache or some o...
Moodle is a mere web application written in PHP. It relies on Apache (or any other web server) to serve PHP pages. You might use something like Thrift to implement the communication between "C++, Java, Python, PHP, Ruby, Erlang, Perl, Haskell, C#, Cocoa, JavaScript, Node.js, Smalltalk, and OCaml". Regarding PHP, start ...
Moodle, PHP and using external APIs I am new to Moodle and PHP, so I may be asking for the impossible or just the impractical. I am wondering how I might go about allowing client applications (written, perhaps, in C++, Java, AS3/Flash) to make calls to Moodle's Gradebook module, for example. Does Moodle run as a server...
TITLE: Moodle, PHP and using external APIs QUESTION: I am new to Moodle and PHP, so I may be asking for the impossible or just the impractical. I am wondering how I might go about allowing client applications (written, perhaps, in C++, Java, AS3/Flash) to make calls to Moodle's Gradebook module, for example. Does Mood...
[ "php", "apache", "moodle" ]
1
1
807
1
0
2011-06-02T21:04:33.893000
2011-06-06T08:50:32.287000
6,220,387
6,220,412
Emails via script get set out 3 times?
I have a email script that runs every 15 minutes and is supposed to send a email once using PHP mailer. For some reason, it's sending out 3 emails a time. Here's my code: Subject = "Subject here"; $html.= "HTML Message here"; $plain = "Plain Message here"; $mail->Body = $html; $mail->AltBody = $plain; $sql = "SELEC...
Modify the code to have write to a log file every time it runs. My guess is that it's just getting called 3 times. Example: file_put_contents("log.txt", $_SERVER['REQUEST_TIME']. "\n", FILE_APPEND);
Emails via script get set out 3 times? I have a email script that runs every 15 minutes and is supposed to send a email once using PHP mailer. For some reason, it's sending out 3 emails a time. Here's my code: Subject = "Subject here"; $html.= "HTML Message here"; $plain = "Plain Message here"; $mail->Body = $html; ...
TITLE: Emails via script get set out 3 times? QUESTION: I have a email script that runs every 15 minutes and is supposed to send a email once using PHP mailer. For some reason, it's sending out 3 emails a time. Here's my code: Subject = "Subject here"; $html.= "HTML Message here"; $plain = "Plain Message here"; $ma...
[ "php", "phpmailer" ]
0
0
296
1
0
2011-06-02T21:04:58.223000
2011-06-02T21:07:24.063000
6,220,389
6,223,693
Monitor file acess of a running application
Is it possible to monitor programatically file access of some running app on OSX? Creating/releasing file handle/descriptor? I need to know when some app reads from file and stops reading.
I've not personally done what you're asking, but here are a few pointers that might get you started. Mac OS X comes with a command-line program, fs_usage, that does that, and more. You might be able to launch it as a helper app and parse its output. $ sudo fs_usage -f filesys Safari 22:43:27 stat64 ry/Safari/Bookmarks....
Monitor file acess of a running application Is it possible to monitor programatically file access of some running app on OSX? Creating/releasing file handle/descriptor? I need to know when some app reads from file and stops reading.
TITLE: Monitor file acess of a running application QUESTION: Is it possible to monitor programatically file access of some running app on OSX? Creating/releasing file handle/descriptor? I need to know when some app reads from file and stops reading. ANSWER: I've not personally done what you're asking, but here are a ...
[ "objective-c", "cocoa", "macos" ]
2
1
714
1
0
2011-06-02T21:05:26.657000
2011-06-03T06:24:44.440000
6,220,402
6,222,243
Deploying from BIDS to SSRS - Parameters Not Getting Updated
I'm noticing some strange behaviors when deploying reports from BIDS to SSRS. I have a parameter that has default values, but those default values don't seem to be getting propagated to the Report Server (they are stored in Parameters field in the Catalog table). Yet when I add new parameters I could see the field is c...
When overwriting an existing version of a report, certain aspects of the parameters are not updated. This lets you preserve different defaults on the server and helps avoid interruptions to subscriptions. Try deleting the SSRS version of the report and then re-deploy. This should update the parameters. (But at the expe...
Deploying from BIDS to SSRS - Parameters Not Getting Updated I'm noticing some strange behaviors when deploying reports from BIDS to SSRS. I have a parameter that has default values, but those default values don't seem to be getting propagated to the Report Server (they are stored in Parameters field in the Catalog tab...
TITLE: Deploying from BIDS to SSRS - Parameters Not Getting Updated QUESTION: I'm noticing some strange behaviors when deploying reports from BIDS to SSRS. I have a parameter that has default values, but those default values don't seem to be getting propagated to the Report Server (they are stored in Parameters field ...
[ "reporting-services", "bids" ]
2
6
2,631
1
0
2011-06-02T21:06:35.600000
2011-06-03T01:55:44.047000
6,220,407
6,220,530
In Python, how do i check if 2 different links actually point to the same page?
For example, these 2 links point to the same location: http://www.independent.co.uk/life-style/gadgets-and-tech/news/chinese-blamed-for-gmail-hacking-2292113.html http://www.independent.co.uk/life-style/gadgets-and-tech/news/2292113.html How do i check this in python?
Call geturl() on the result of urllib2.urlopen(). geturl() "returns the URL of the resource retrieved, commonly used to determine if a redirect was followed." For example: #!/usr/bin/env python # coding: utf-8 import urllib2 url1 = 'http://www.independent.co.uk/life-style/gadgets-and-tech/news/chinese-blamed-for-gmai...
In Python, how do i check if 2 different links actually point to the same page? For example, these 2 links point to the same location: http://www.independent.co.uk/life-style/gadgets-and-tech/news/chinese-blamed-for-gmail-hacking-2292113.html http://www.independent.co.uk/life-style/gadgets-and-tech/news/2292113.html Ho...
TITLE: In Python, how do i check if 2 different links actually point to the same page? QUESTION: For example, these 2 links point to the same location: http://www.independent.co.uk/life-style/gadgets-and-tech/news/chinese-blamed-for-gmail-hacking-2292113.html http://www.independent.co.uk/life-style/gadgets-and-tech/ne...
[ "python", "urllib2" ]
3
12
2,761
2
0
2011-06-02T21:07:03.640000
2011-06-02T21:19:39.743000
6,220,408
6,220,794
C#: Mapping a Data Type
I've got to write a horrible interface to import data into a new database from hundreds of data files from our old application that has everything hard coded (the data displayed resemble Excel spreadsheets, and it allows us to export the data to Comma Delimited Values). I can read it all in, with the header names. From...
Given some abstract CsvReader: using (var reader = new CsvReader(file)) { TableGuess table = new TableGuess { Name = file }; // given: IEnumerable CsvReader.Header { get; } table.AddColumns(reader.Header); string[] parts; while (null!= (parts = reader.ReadLine())) { table.AddRow(parts); } } Your ColumnGuess: class Co...
C#: Mapping a Data Type I've got to write a horrible interface to import data into a new database from hundreds of data files from our old application that has everything hard coded (the data displayed resemble Excel spreadsheets, and it allows us to export the data to Comma Delimited Values). I can read it all in, wit...
TITLE: C#: Mapping a Data Type QUESTION: I've got to write a horrible interface to import data into a new database from hundreds of data files from our old application that has everything hard coded (the data displayed resemble Excel spreadsheets, and it allows us to export the data to Comma Delimited Values). I can r...
[ "c#", "linq", "data-structures" ]
0
2
2,245
3
0
2011-06-02T21:07:09.100000
2011-06-02T21:49:31.890000
6,220,420
6,220,539
How do I do a multi-line string in node.js?
With the rise of node.js, multi-line strings are becoming more necessary in JavaScript. Is there a special way to do this in Node.JS, even if it does not work in browsers? Are there any plans or at least a feature request to do this that I can support? I already know that you can use \n\ at the end of every line, that ...
node v4 and current versions of node As of ES6 (and so versions of Node greater than v4), a new "template literal" intrinsic type was added to Javascript (denoted by back-ticks "`") which can also be used to construct multi-line strings, as in: `this is a single string` which evaluates to: 'this is a\nsingle string'. N...
How do I do a multi-line string in node.js? With the rise of node.js, multi-line strings are becoming more necessary in JavaScript. Is there a special way to do this in Node.JS, even if it does not work in browsers? Are there any plans or at least a feature request to do this that I can support? I already know that you...
TITLE: How do I do a multi-line string in node.js? QUESTION: With the rise of node.js, multi-line strings are becoming more necessary in JavaScript. Is there a special way to do this in Node.JS, even if it does not work in browsers? Are there any plans or at least a feature request to do this that I can support? I alr...
[ "string", "node.js", "multiline" ]
194
247
181,882
9
0
2011-06-02T21:08:21.980000
2011-06-02T21:20:46.617000
6,220,422
6,220,434
DateTime assigning/returning
public DateTime EnterDeparture() { DateTime EnterDeparture = new DateTime(); Console.WriteLine("Enter Year:"); EnterDeparture.AddYears(int.Parse(Console.ReadLine())); return EnterDeparture; } Train train = new Train(number, EnterDeparture()); //Train takes DateTime (2nd parameter) Console.WriteLine(Convert.ToString(tr...
DateTime.AddYears() returns a new DateTime rather than modify the one you call the method on. You need to return that new DateTime, not the old one: public DateTime EnterDeparture() { Console.WriteLine("Enter Year:"); return new DateTime().AddYears(int.Parse(Console.ReadLine())); }
DateTime assigning/returning public DateTime EnterDeparture() { DateTime EnterDeparture = new DateTime(); Console.WriteLine("Enter Year:"); EnterDeparture.AddYears(int.Parse(Console.ReadLine())); return EnterDeparture; } Train train = new Train(number, EnterDeparture()); //Train takes DateTime (2nd parameter) Console....
TITLE: DateTime assigning/returning QUESTION: public DateTime EnterDeparture() { DateTime EnterDeparture = new DateTime(); Console.WriteLine("Enter Year:"); EnterDeparture.AddYears(int.Parse(Console.ReadLine())); return EnterDeparture; } Train train = new Train(number, EnterDeparture()); //Train takes DateTime (2nd p...
[ "datetime" ]
0
0
72
1
0
2011-06-02T21:08:55.293000
2011-06-02T21:10:26.367000
6,220,440
6,220,459
What does if(); do, where the semi-colon is right after the parentheses?
It happens that, when writing some PHP code, I accidentally put a semicolon; right after an if statement. For example: if($a > 1); {.... } I thought that PHP should raise an error in this case, but it is not. That kind of syntax should have a meaning, I'm just wondering what it is. For what I could see the condition se...
A single; can be read as an "empty statement" and if($a > 1); {.... } is equivalent to if($a > 1); // execute an empty statement if $a > 1 // then execute the following block of code. {.... } For what I could see the condition seems to be always true when the; is added It only seems like it since the block is executed...
What does if(); do, where the semi-colon is right after the parentheses? It happens that, when writing some PHP code, I accidentally put a semicolon; right after an if statement. For example: if($a > 1); {.... } I thought that PHP should raise an error in this case, but it is not. That kind of syntax should have a mean...
TITLE: What does if(); do, where the semi-colon is right after the parentheses? QUESTION: It happens that, when writing some PHP code, I accidentally put a semicolon; right after an if statement. For example: if($a > 1); {.... } I thought that PHP should raise an error in this case, but it is not. That kind of syntax ...
[ "php", "if-statement" ]
5
13
1,299
2
0
2011-06-02T21:11:00.757000
2011-06-02T21:12:30.647000
6,220,442
6,220,469
pass form input value to action
I have a page (module-access.php). On the page I have a form with one text input field. I'd like to set whatever is typed in this field to be part of the form's action. Company Name: Thanks
Just change the input name from textfield to company and the action type to GET Company Name:
pass form input value to action I have a page (module-access.php). On the page I have a form with one text input field. I'd like to set whatever is typed in this field to be part of the form's action. Company Name: Thanks
TITLE: pass form input value to action QUESTION: I have a page (module-access.php). On the page I have a form with one text input field. I'd like to set whatever is typed in this field to be part of the form's action. Company Name: Thanks ANSWER: Just change the input name from textfield to company and the action typ...
[ "html", "forms", "variables", "action", "textinput" ]
5
8
18,179
2
0
2011-06-02T21:11:03.470000
2011-06-02T21:13:41.423000
6,220,444
6,225,736
Issues configuring scons to use posix arguments in a windows command prompt
First off I should forewarn you that I am a new grad(and EE at that), and not terribly familiar a build process more advanced than my hello world programs. My issue is: We are attempting to use SCons ton build our project at work. Our compiler is called 'i686-pc-elf-gcc' and uses posix style command line arguments. But...
Looks like the default SCons compiler detection is picking up the Microsoft compiler suite. Instead of: env = Environment(ENV = {'PATH': path,'TEMP': os.environ['TEMP']}) maybe try: env = Environment(tools = ['gcc', 'g++', 'gnulink'], ENV = {'PATH': path,'TEMP': os.environ['TEMP']}) This way it will use the gcc toolset...
Issues configuring scons to use posix arguments in a windows command prompt First off I should forewarn you that I am a new grad(and EE at that), and not terribly familiar a build process more advanced than my hello world programs. My issue is: We are attempting to use SCons ton build our project at work. Our compiler ...
TITLE: Issues configuring scons to use posix arguments in a windows command prompt QUESTION: First off I should forewarn you that I am a new grad(and EE at that), and not terribly familiar a build process more advanced than my hello world programs. My issue is: We are attempting to use SCons ton build our project at w...
[ "build", "makefile", "scons" ]
4
4
746
1
0
2011-06-02T21:11:07.187000
2011-06-03T10:13:49.017000
6,220,451
6,220,523
How to prevent access to a URL except by my own client code?
I am using ASP.NET MVC with heavy jQuery client-side interaction. I have a jQuery chat window that polls the server at regular 7 second intervals to fetch updates. All of this works great, I have two action methods for handling the two main functions of the chat; one method is used to post messages to the chat and the ...
Well, it's impossible to write code that acts in a way nobody else can simulate,... and the task is easily accomplished if your code is Javascript. What you CAN do, is try to make it more difficult. Use some kind of authentication, obfuscate the code using a good obfuscator, etc. You'll never be 100% sure, though, unle...
How to prevent access to a URL except by my own client code? I am using ASP.NET MVC with heavy jQuery client-side interaction. I have a jQuery chat window that polls the server at regular 7 second intervals to fetch updates. All of this works great, I have two action methods for handling the two main functions of the c...
TITLE: How to prevent access to a URL except by my own client code? QUESTION: I am using ASP.NET MVC with heavy jQuery client-side interaction. I have a jQuery chat window that polls the server at regular 7 second intervals to fetch updates. All of this works great, I have two action methods for handling the two main ...
[ "c#", "javascript", "jquery", "asp.net-mvc", "ajax" ]
4
4
225
3
0
2011-06-02T21:11:52.230000
2011-06-02T21:19:12.880000
6,220,453
6,255,037
How to decrypt PKCS8 DER encrypted private key using the password, in crypto++
I'm trying to sign a message using a private key that is encrypted, I of course have the password to it, so I'm trying to decrypt the key so I can the use it to sign. I'm using C++ library crypto++, this is the code I'm trying to use to read the key from file string keyString; FileSource fs(keyFileName.c_str(), true, n...
PKCS #8 uses a specific encryption format that has nothing to do with Crypto++'s DefaultDecryptorWithMAC. You can find the details in the specification here - http://www.rsa.com/rsalabs/node.asp?id=2130 Unfortunately Crypto++ does not currently support encrypted PKCS #8 keys natively. With the ASN.1 and crypto support ...
How to decrypt PKCS8 DER encrypted private key using the password, in crypto++ I'm trying to sign a message using a private key that is encrypted, I of course have the password to it, so I'm trying to decrypt the key so I can the use it to sign. I'm using C++ library crypto++, this is the code I'm trying to use to read...
TITLE: How to decrypt PKCS8 DER encrypted private key using the password, in crypto++ QUESTION: I'm trying to sign a message using a private key that is encrypted, I of course have the password to it, so I'm trying to decrypt the key so I can the use it to sign. I'm using C++ library crypto++, this is the code I'm try...
[ "openssl", "crypto++" ]
3
3
7,480
1
0
2011-06-02T21:11:54.213000
2011-06-06T16:23:41.897000
6,220,461
6,220,486
How do I throw an error for my singleton class?
This is the singleton pattern also named as the singleton class. Its goal is to allow only one object of type singleton. If there is already one and I call it, I'd like it to error out in some way. This won't happen in production but in development. Is there a better way then just saying echo echo "Error:only one conne...
Exceptions usually are better. else { throw new Exception("Error:only one connection"); } You can also use "LogicException", "RuntimeException", and a few others. Further reading: http://www.php.net/manual/en/language.exceptions.php Another approach with singleton class is just to return the object instead of creating ...
How do I throw an error for my singleton class? This is the singleton pattern also named as the singleton class. Its goal is to allow only one object of type singleton. If there is already one and I call it, I'd like it to error out in some way. This won't happen in production but in development. Is there a better way ...
TITLE: How do I throw an error for my singleton class? QUESTION: This is the singleton pattern also named as the singleton class. Its goal is to allow only one object of type singleton. If there is already one and I call it, I'd like it to error out in some way. This won't happen in production but in development. Is t...
[ "php", "error-handling" ]
0
2
648
2
0
2011-06-02T21:12:39.833000
2011-06-02T21:15:06.190000
6,220,466
6,226,668
long running process vb.net
I have a service ticket management application and users want to open several ticket details on a tab in a MDI frame. Since this application has to communicate through Web XML service with other company, it takes around 15 ~20 seconds. The users most complain is that he needs to wait until a saving process is done. Cur...
You could use a BackgroundWorker or new thread. I personally would try using built in asynchronous methods, such as BeginInvoke http://www.developer.com/net/vb/article.php/1443981/Asynchronous-Web-Services-for-Visual-Basic-NET.htm Keep in mind that asynchronous operations become complicated very quickly, good desighned...
long running process vb.net I have a service ticket management application and users want to open several ticket details on a tab in a MDI frame. Since this application has to communicate through Web XML service with other company, it takes around 15 ~20 seconds. The users most complain is that he needs to wait until a...
TITLE: long running process vb.net QUESTION: I have a service ticket management application and users want to open several ticket details on a tab in a MDI frame. Since this application has to communicate through Web XML service with other company, it takes around 15 ~20 seconds. The users most complain is that he nee...
[ "windows", "vb.net" ]
1
2
1,480
3
0
2011-06-02T21:13:13.530000
2011-06-03T11:43:02.713000
6,220,468
6,220,511
HTML email bgcolor property not working correctly
I have been trying to send out html emails through a PHP mail script recently. However every time I send the email it changes from How does this look? to How does this look? How do I prevent this because every time it causes the colors to change between a nasty black and lime green.
Try to escape the quotes, use single quotes, or just remove them (not ideal I know) as your code seems to see those quotes and escape them for you otherwise. For more information on your issue see addslashes: http://php.net/manual/en/function.addslashes.php
HTML email bgcolor property not working correctly I have been trying to send out html emails through a PHP mail script recently. However every time I send the email it changes from How does this look? to How does this look? How do I prevent this because every time it causes the colors to change between a nasty black an...
TITLE: HTML email bgcolor property not working correctly QUESTION: I have been trying to send out html emails through a PHP mail script recently. However every time I send the email it changes from How does this look? to How does this look? How do I prevent this because every time it causes the colors to change betwee...
[ "php", "html", "html-table", "html-email" ]
1
1
566
3
0
2011-06-02T21:13:35.527000
2011-06-02T21:18:02.343000
6,220,477
6,222,105
Declaring a javascript object literal in Script#
I am trying to replicate a jquery ajax call in Script# and in the data option I am passing an object literal { id: target.data("id"), name: newName} I am trying to reproduce this in Script#, but I am currently unsuccessful. The first thing that came to mind was an anonymous object: new { id = target.GetDataValue("id"),...
Try new Dictionary("id", target.GetDataValue("id"), "name", newName) or Script.Literal("{ id: target.data(\"id\"), name: newName}") Both should translate to your original code more or less.
Declaring a javascript object literal in Script# I am trying to replicate a jquery ajax call in Script# and in the data option I am passing an object literal { id: target.data("id"), name: newName} I am trying to reproduce this in Script#, but I am currently unsuccessful. The first thing that came to mind was an anonym...
TITLE: Declaring a javascript object literal in Script# QUESTION: I am trying to replicate a jquery ajax call in Script# and in the data option I am passing an object literal { id: target.data("id"), name: newName} I am trying to reproduce this in Script#, but I am currently unsuccessful. The first thing that came to ...
[ "javascript", "jquery", "script#" ]
3
4
933
1
0
2011-06-02T21:14:15.073000
2011-06-03T01:27:23.323000
6,220,491
6,220,633
NUnit Test Per Database Row?
I don't know if this is possible, but I'll go ahead and explain what I'm trying to do. I want to create a test fixture that runs a test with 5 different types of inputs that come from a database. TestFixture Test using input1 Test using input2 Test using input3 Test using input4 Test using input5 This way, I can see fr...
Inside the foreach loop you can do Assert.True( success, string.Format("Input: {0}", input )); Alternately you can try the ValueSourceAttribute with a sourceType being a helper class that has a method that returns an IEnumerable named sourceName. The implementation of this method should fetch the input values from DB.
NUnit Test Per Database Row? I don't know if this is possible, but I'll go ahead and explain what I'm trying to do. I want to create a test fixture that runs a test with 5 different types of inputs that come from a database. TestFixture Test using input1 Test using input2 Test using input3 Test using input4 Test using ...
TITLE: NUnit Test Per Database Row? QUESTION: I don't know if this is possible, but I'll go ahead and explain what I'm trying to do. I want to create a test fixture that runs a test with 5 different types of inputs that come from a database. TestFixture Test using input1 Test using input2 Test using input3 Test using ...
[ "c#", "unit-testing", "nunit" ]
3
0
465
2
0
2011-06-02T21:15:23.857000
2011-06-02T21:32:27.460000
6,220,493
6,292,002
Get at a Google Map object from a Chrome extension?
Is it possible to get the Map object(s) for a page that has one or more Google Maps on it, in Chrome at least? I want to get access, from a Google Chrome extension, to any Google Maps that are on the current page....or is there a good reason why this isn't possible?
For what it's worth, I found out a way to do this on the Google Maps JavaScript API group: https://groups.google.com/d/topic/google-maps-js-api-v3/lPydWBYe1kQ/discussion
Get at a Google Map object from a Chrome extension? Is it possible to get the Map object(s) for a page that has one or more Google Maps on it, in Chrome at least? I want to get access, from a Google Chrome extension, to any Google Maps that are on the current page....or is there a good reason why this isn't possible?
TITLE: Get at a Google Map object from a Chrome extension? QUESTION: Is it possible to get the Map object(s) for a page that has one or more Google Maps on it, in Chrome at least? I want to get access, from a Google Chrome extension, to any Google Maps that are on the current page....or is there a good reason why this...
[ "javascript", "google-maps", "google-chrome", "google-maps-api-3" ]
1
1
724
1
0
2011-06-02T21:15:42.670000
2011-06-09T11:23:27.920000
6,220,501
6,220,760
How do I display two rows from sql side-by-side using php?
My code below displays 10 entries, but it displays it in 10 rows and 1 column. I would like for it to display 10 entries, but in 2 columns and 5 rows. Can anyone help? Thanks in advance. <?php mysql_connect($dbhost, $dbuser, $dbpass) or die(mysql_error()); mysql_select_db($dbname) or die(mysql_error()); $result = mysql...
'; //Open table. while($row = mysql_fetch_array( $result )) { if ($row['Approved']=='No'){ continue; } else{ //If it's the beginning of a row... if( $i % $numofcols == 1 ){ echo ' '; //Open row } //Table Cell. echo ' '; //Open Cell echo 'ID Number: '.$row['id']; echo ' '; echo ' '; //Close Cell //If we have alread...
How do I display two rows from sql side-by-side using php? My code below displays 10 entries, but it displays it in 10 rows and 1 column. I would like for it to display 10 entries, but in 2 columns and 5 rows. Can anyone help? Thanks in advance. <?php mysql_connect($dbhost, $dbuser, $dbpass) or die(mysql_error()); mysq...
TITLE: How do I display two rows from sql side-by-side using php? QUESTION: My code below displays 10 entries, but it displays it in 10 rows and 1 column. I would like for it to display 10 entries, but in 2 columns and 5 rows. Can anyone help? Thanks in advance. <?php mysql_connect($dbhost, $dbuser, $dbpass) or die(my...
[ "php", "sql" ]
1
0
834
3
0
2011-06-02T21:17:15.987000
2011-06-02T21:46:08.597000
6,220,502
6,220,547
Accessing labels within a LoginView
I'm using the asp.net LoginView to show different data to authenticated or anonymous users. When I moved Foo and Bar into LoginView1, I was unable to access them from the code behind in this fashion: Foo.Text = "I am Foo"; Bar.Text = "I am Bar"; I was able to access them in this fashion before moving them into the Logi...
You need to use FindControl on the LoginView, and Cast appropriately as shown below: var foo = (Label)LoginView1.FindControl("Foo"); foo.Text = "I am Foo";
Accessing labels within a LoginView I'm using the asp.net LoginView to show different data to authenticated or anonymous users. When I moved Foo and Bar into LoginView1, I was unable to access them from the code behind in this fashion: Foo.Text = "I am Foo"; Bar.Text = "I am Bar"; I was able to access them in this fash...
TITLE: Accessing labels within a LoginView QUESTION: I'm using the asp.net LoginView to show different data to authenticated or anonymous users. When I moved Foo and Bar into LoginView1, I was unable to access them from the code behind in this fashion: Foo.Text = "I am Foo"; Bar.Text = "I am Bar"; I was able to access...
[ "c#", "asp.net" ]
3
4
2,595
1
0
2011-06-02T21:17:19.383000
2011-06-02T21:21:22.077000
6,220,504
6,220,534
To bypass referral check
Is there any way to bypass the referral check applied by some site in order to avoid there data from being extracted. Like if you follow this link! You will get Access Denied Error. However, if you just go this link!, it takes you to home page and on filling on any quote say ABAN, it follows exactly the same GET reques...
Set your referrer to the correct value. You can spoof the value to anything you want programatically or by visiting the correct url before visiting the target url.
To bypass referral check Is there any way to bypass the referral check applied by some site in order to avoid there data from being extracted. Like if you follow this link! You will get Access Denied Error. However, if you just go this link!, it takes you to home page and on filling on any quote say ABAN, it follows ex...
TITLE: To bypass referral check QUESTION: Is there any way to bypass the referral check applied by some site in order to avoid there data from being extracted. Like if you follow this link! You will get Access Denied Error. However, if you just go this link!, it takes you to home page and on filling on any quote say A...
[ "html-content-extraction", "referrals" ]
1
1
2,079
2
0
2011-06-02T21:17:28.693000
2011-06-02T21:20:00.033000
6,220,513
6,229,813
Can I resolve a DFS path with DirectoryInfo?
Is there a way to resolve a DFS path directly with DirectoryInfo? I found this answer: How can I get an active UNC Path in DFS programatically... is this really my only option?
Correct, DirectoryInfo provides no ability to "resolve" the active path of a DFS share. This is likely because DirectoryInfo is on a much higher level. Exposes instance methods for creating, moving, and enumerating through directories and subdirectories. The active path on a DFS share should be considered an "implement...
Can I resolve a DFS path with DirectoryInfo? Is there a way to resolve a DFS path directly with DirectoryInfo? I found this answer: How can I get an active UNC Path in DFS programatically... is this really my only option?
TITLE: Can I resolve a DFS path with DirectoryInfo? QUESTION: Is there a way to resolve a DFS path directly with DirectoryInfo? I found this answer: How can I get an active UNC Path in DFS programatically... is this really my only option? ANSWER: Correct, DirectoryInfo provides no ability to "resolve" the active path...
[ ".net-3.5", "microsoft-distributed-file-system", "directoryinfo" ]
1
1
662
1
0
2011-06-02T21:18:14.823000
2011-06-03T16:17:56.260000
6,220,517
6,220,586
Add user generated content to a database in asp.net
In page_load, I create a table and fill it with data gathered from a database. Then after allowing the user to modify it, I need to make the changes to the database. But I'm not sure how to do this. I have been looking around and now am more confused then when I started. My code to create the table looks like this: del...
It would be a lot easier if you used a control that is specific to this kind of operation. I mean a control like GridView. GridView displays the values of a data source in a table where each column represents a field and each row represents a record. The GridView control enables you to select, sort, and edit these item...
Add user generated content to a database in asp.net In page_load, I create a table and fill it with data gathered from a database. Then after allowing the user to modify it, I need to make the changes to the database. But I'm not sure how to do this. I have been looking around and now am more confused then when I start...
TITLE: Add user generated content to a database in asp.net QUESTION: In page_load, I create a table and fill it with data gathered from a database. Then after allowing the user to modify it, I need to make the changes to the database. But I'm not sure how to do this. I have been looking around and now am more confused...
[ "c#", "javascript", "asp.net", "html" ]
2
4
347
2
0
2011-06-02T21:18:54.463000
2011-06-02T21:25:56.243000
6,220,531
6,227,455
Can't find "rackup" command?
http://titusd.co.uk/2010/04/07/a-beginners-sinatra-tutorial I was trying to run rackup config.ru from the command line as instructed in the tutorial above in section 4. It ended up saying "No command 'rackup' found". Any idea what happened?
Using rackup1.8 config.ru instead of rackup config.ru solved my problem. But I am not terribly sure what happened, though.
Can't find "rackup" command? http://titusd.co.uk/2010/04/07/a-beginners-sinatra-tutorial I was trying to run rackup config.ru from the command line as instructed in the tutorial above in section 4. It ended up saying "No command 'rackup' found". Any idea what happened?
TITLE: Can't find "rackup" command? QUESTION: http://titusd.co.uk/2010/04/07/a-beginners-sinatra-tutorial I was trying to run rackup config.ru from the command line as instructed in the tutorial above in section 4. It ended up saying "No command 'rackup' found". Any idea what happened? ANSWER: Using rackup1.8 config....
[ "ruby", "sinatra", "rackup" ]
0
0
12,462
3
0
2011-06-02T21:19:41.047000
2011-06-03T13:05:29.517000
6,220,542
6,220,573
Can you show compiler warnings for error:nil?
Is there a compiler setting that can warn about these? Currently I'm reviewing code and putting in #warning don't use error:nil whenever I see them. (I know it's sometimes appropriate to do, but maybe there is a better way to have the compiler check sloppy error handling?)
No, since error:nil is completely legal and totally legit (as you even say), there is no way for the compiler to check it.
Can you show compiler warnings for error:nil? Is there a compiler setting that can warn about these? Currently I'm reviewing code and putting in #warning don't use error:nil whenever I see them. (I know it's sometimes appropriate to do, but maybe there is a better way to have the compiler check sloppy error handling?)
TITLE: Can you show compiler warnings for error:nil? QUESTION: Is there a compiler setting that can warn about these? Currently I'm reviewing code and putting in #warning don't use error:nil whenever I see them. (I know it's sometimes appropriate to do, but maybe there is a better way to have the compiler check sloppy...
[ "objective-c", "error-handling", "compiler-warnings" ]
2
1
77
1
0
2011-06-02T21:20:55.260000
2011-06-02T21:24:15.697000
6,220,546
6,220,566
Count number of iterations in a foreach loop
How to calculate how many items in a foreach? I want to count total rows. foreach ($Contents as $item) { $item[number];// if there are 15 $item[number] in this foreach, I want get the value: 15 }
If you just want to find out the number of elements in an array, use count. Now, to answer your question... How to calculate how many items in a foreach? $i = 0; foreach ($Contents as $item) { $item[number];// if there are 15 $item[number] in this foreach, I want get the value: 15 $i++; } If you only need the index ins...
Count number of iterations in a foreach loop How to calculate how many items in a foreach? I want to count total rows. foreach ($Contents as $item) { $item[number];// if there are 15 $item[number] in this foreach, I want get the value: 15 }
TITLE: Count number of iterations in a foreach loop QUESTION: How to calculate how many items in a foreach? I want to count total rows. foreach ($Contents as $item) { $item[number];// if there are 15 $item[number] in this foreach, I want get the value: 15 } ANSWER: If you just want to find out the number of elements ...
[ "php", "foreach" ]
76
151
398,392
11
0
2011-06-02T21:21:20.570000
2011-06-02T21:23:36.537000
6,220,549
6,220,850
Retrieve all data from one table, and some from another in CakePHP
In my CakePHP site, I want to make a drop-down list of all Venues, and any Restaurants that have is_venue=1. I've tried this in my events_controller: $venueOptions = array( 'fields' => array('id', 'name_address'), 'order' => array('name'), 'join' => array( array( 'table' => 'restaurants', 'alias' => 'Restaurants', 'typ...
I think you could do something along the lines of: Venue->find( 'list' ); $r = $this->Restaurant->find( 'list' ); $venues = Set::merge( $v, $r ); natcasesort( $venues ); // print_r( $venues ); $this->set( 'venues', $venues );...?> Which is quite like the code above - I just use the Set class and make sure to Controlle...
Retrieve all data from one table, and some from another in CakePHP In my CakePHP site, I want to make a drop-down list of all Venues, and any Restaurants that have is_venue=1. I've tried this in my events_controller: $venueOptions = array( 'fields' => array('id', 'name_address'), 'order' => array('name'), 'join' => arr...
TITLE: Retrieve all data from one table, and some from another in CakePHP QUESTION: In my CakePHP site, I want to make a drop-down list of all Venues, and any Restaurants that have is_venue=1. I've tried this in my events_controller: $venueOptions = array( 'fields' => array('id', 'name_address'), 'order' => array('nam...
[ "mysql", "cakephp", "join" ]
1
1
901
2
0
2011-06-02T21:21:31.313000
2011-06-02T21:57:02.170000
6,220,585
6,220,608
Why do WPF bindings need getters and setters?
If I have a WPF listbox and I bind its itemssource to a list of objects. If the object members are public but don't have a { get; set; } the binding will fail. Why?
I think what you're really asking is "Why do I have to use properties instead of just fields?" And the answer is that that's just how WPF bindings work. You have to bind to properties on objects. The binding system doesn't look for matching fields.
Why do WPF bindings need getters and setters? If I have a WPF listbox and I bind its itemssource to a list of objects. If the object members are public but don't have a { get; set; } the binding will fail. Why?
TITLE: Why do WPF bindings need getters and setters? QUESTION: If I have a WPF listbox and I bind its itemssource to a list of objects. If the object members are public but don't have a { get; set; } the binding will fail. Why? ANSWER: I think what you're really asking is "Why do I have to use properties instead of j...
[ "wpf", "data-binding", "getter-setter" ]
1
8
1,016
2
0
2011-06-02T21:25:49.353000
2011-06-02T21:28:57.210000
6,220,587
6,220,611
CSS Alternate Rows - some rows hidden
I'm trying to style a table so that each row is a different colour (odd/even). I have the following CSS: #woo tr:nth-child(even) td { background-color: #f0f9ff; } #woo tr:nth-child(odd) td { background-color: white; } However, some of my rows can be hidden and I'd still like the rows to alternate. How can I adjust the...
If you are using jQuery, you can employ one of its functions, for example.filter(), to choose only the elements that are visible. But the key here is a CSS selector:visible. For example (see jsfiddle ): jQuery('tr:visible:odd').css({'background-color': 'red'}); jQuery('tr:visible:even').css({'background-color': 'yellow...
CSS Alternate Rows - some rows hidden I'm trying to style a table so that each row is a different colour (odd/even). I have the following CSS: #woo tr:nth-child(even) td { background-color: #f0f9ff; } #woo tr:nth-child(odd) td { background-color: white; } However, some of my rows can be hidden and I'd still like the r...
TITLE: CSS Alternate Rows - some rows hidden QUESTION: I'm trying to style a table so that each row is a different colour (odd/even). I have the following CSS: #woo tr:nth-child(even) td { background-color: #f0f9ff; } #woo tr:nth-child(odd) td { background-color: white; } However, some of my rows can be hidden and I'...
[ "javascript", "jquery", "css", "css-tables" ]
24
25
12,710
6
0
2011-06-02T21:26:09.273000
2011-06-02T21:29:10.547000
6,220,600
6,220,706
How to apply JQuery selector to Wicket ModalWindow
I'm using one of the spiffy new show-your-password-single-char JQuery hacks, which I can apply to my all password fields on a page with But my change password dialog is rendered in a Wicket ModalWindow, final ModalWindow window = new ModalWindow("change-password-panel"); final PasswordChangePanel panel = new PasswordCh...
Try sending back some JS to run upon completion of the AJAX call: add(new AjaxFallbackLink ("change-password") { @Override public void onClick(AjaxRequestTarget target) { target.appendJavascript("$('input:password').dPassword();") window.show(target); } }); It's better to restrict the scope of the selector to just your...
How to apply JQuery selector to Wicket ModalWindow I'm using one of the spiffy new show-your-password-single-char JQuery hacks, which I can apply to my all password fields on a page with But my change password dialog is rendered in a Wicket ModalWindow, final ModalWindow window = new ModalWindow("change-password-panel"...
TITLE: How to apply JQuery selector to Wicket ModalWindow QUESTION: I'm using one of the spiffy new show-your-password-single-char JQuery hacks, which I can apply to my all password fields on a page with But my change password dialog is rendered in a Wicket ModalWindow, final ModalWindow window = new ModalWindow("chan...
[ "java", "jquery", "wicket" ]
2
5
773
1
0
2011-06-02T21:27:56.477000
2011-06-02T21:39:27.653000
6,220,614
6,220,859
What's the best way to generate this string? (NSMutableString...)
I have a dictionary whose keys are NSStrings and whose objects are NSArray. Here's an example: key (NSString): GroupA value (NSArray): John Alex Joe Bob There are many entries like this, this is just an example. What I need to do is generate a string like this (for example: (GroupA contains[cd] ('John' OR 'Alex' OR 'Jo...
That's not a valid predicate format string, so even if you end up generating it, you won't be able to convert it into an NSPredicate Here's what you want instead: NSDictionary *groupValuePairs =....; NSMutableArray *subpredicates = [NSMutableArray array]; for (NSString *group in groupValuePairs) { NSArray *values = [g...
What's the best way to generate this string? (NSMutableString...) I have a dictionary whose keys are NSStrings and whose objects are NSArray. Here's an example: key (NSString): GroupA value (NSArray): John Alex Joe Bob There are many entries like this, this is just an example. What I need to do is generate a string lik...
TITLE: What's the best way to generate this string? (NSMutableString...) QUESTION: I have a dictionary whose keys are NSStrings and whose objects are NSArray. Here's an example: key (NSString): GroupA value (NSArray): John Alex Joe Bob There are many entries like this, this is just an example. What I need to do is gen...
[ "objective-c", "cocoa-touch", "ios", "nspredicate", "nsmutablestring" ]
3
5
407
2
0
2011-06-02T21:29:21.877000
2011-06-02T21:57:53.290000
6,220,618
6,220,698
What does it mean to create an API on the web?
I have a site built in ASP.NET MVC and uses heavy jQuery client interaction to build a live chat room. Many users parsed the javascript and found the URLs it posted to in order to interact with the chat. They started building bots for fun to play games within the chat channels. These users keep asking for an "API" to m...
An API is, literally, an "Application Programming Interface". It is, at its most basic level, any interface designed for other software to interact or communicate with it. In a sense, your open URLs are APIs. Of course, entry points intended as user interfaces often aren't very well-factored for writing other software ...
What does it mean to create an API on the web? I have a site built in ASP.NET MVC and uses heavy jQuery client interaction to build a live chat room. Many users parsed the javascript and found the URLs it posted to in order to interact with the chat. They started building bots for fun to play games within the chat chan...
TITLE: What does it mean to create an API on the web? QUESTION: I have a site built in ASP.NET MVC and uses heavy jQuery client interaction to build a live chat room. Many users parsed the javascript and found the URLs it posted to in order to interact with the chat. They started building bots for fun to play games wi...
[ "c#", "asp.net", "asp.net-mvc", "web-services", "api" ]
6
5
9,459
5
0
2011-06-02T21:30:10.363000
2011-06-02T21:38:40.703000
6,220,635
6,220,736
C# JSON Parsing. Parse escaped JSON
Facebook has a new Batch request Graph API that I'm trying to consume. The JSON looks something like this: [ { "code": 200, "headers": [ { "name": "Cache-Control", "value": "private, no-cache, no-store, must-revalidate" }, { "name": "Connection", "value": "close" }, { "name": "Content-Type", "value": "text/javascript; ...
Use Newtonsoft.Json. The library is really good for parsing and generating JSON. http://json.codeplex.com/
C# JSON Parsing. Parse escaped JSON Facebook has a new Batch request Graph API that I'm trying to consume. The JSON looks something like this: [ { "code": 200, "headers": [ { "name": "Cache-Control", "value": "private, no-cache, no-store, must-revalidate" }, { "name": "Connection", "value": "close" }, { "name": "Conten...
TITLE: C# JSON Parsing. Parse escaped JSON QUESTION: Facebook has a new Batch request Graph API that I'm trying to consume. The JSON looks something like this: [ { "code": 200, "headers": [ { "name": "Cache-Control", "value": "private, no-cache, no-store, must-revalidate" }, { "name": "Connection", "value": "close" },...
[ "c#", "json", "escaping" ]
2
1
2,413
2
0
2011-06-02T21:32:31.713000
2011-06-02T21:43:28.977000
6,220,636
6,220,674
Rails 3 form_for Nested Routes
I`m trying to do a form_for with nested routes following the example of Blog and Comments from Ruby Guide(http://guides.rubyonrails.org/getting_started.html#adding-a-route-for-comments). I`m doing an application to create surveys with a lot of kind of questions, the questions are in a group and each question has one o ...
The order you specify the objects in the form for matters, you have the resources nested under groups then questions then finally answers. You need to use something like form_for [g,q,q.answers.build]. If that dosnt work edit your post to include the contents of rake routes and we can go from there.
Rails 3 form_for Nested Routes I`m trying to do a form_for with nested routes following the example of Blog and Comments from Ruby Guide(http://guides.rubyonrails.org/getting_started.html#adding-a-route-for-comments). I`m doing an application to create surveys with a lot of kind of questions, the questions are in a gro...
TITLE: Rails 3 form_for Nested Routes QUESTION: I`m trying to do a form_for with nested routes following the example of Blog and Comments from Ruby Guide(http://guides.rubyonrails.org/getting_started.html#adding-a-route-for-comments). I`m doing an application to create surveys with a lot of kind of questions, the ques...
[ "ruby-on-rails", "nested-forms", "form-for", "nested-form-for" ]
2
1
3,422
1
0
2011-06-02T21:32:35.773000
2011-06-02T21:36:24.837000
6,220,638
6,220,705
Rails beginner - why is this controller test case failing?
OK, so I'm working on my first solo Rails app, a URL shortener, and I've already confused myself pretty well. From my model, I store a short URL using the domain and key attributes. Here is my model: # == Schema Information # Schema version: 20110601022424 # # Table name: shorteners # # id:integer not null, primary key...
It seems that in the tests, the Shortener class has no access to the domain variable. Have you checked your Test DB?
Rails beginner - why is this controller test case failing? OK, so I'm working on my first solo Rails app, a URL shortener, and I've already confused myself pretty well. From my model, I store a short URL using the domain and key attributes. Here is my model: # == Schema Information # Schema version: 20110601022424 # # ...
TITLE: Rails beginner - why is this controller test case failing? QUESTION: OK, so I'm working on my first solo Rails app, a URL shortener, and I've already confused myself pretty well. From my model, I store a short URL using the domain and key attributes. Here is my model: # == Schema Information # Schema version: 2...
[ "ruby-on-rails", "ruby", "ruby-on-rails-3", "rspec", "rails-activerecord" ]
0
4
247
1
0
2011-06-02T21:32:55.820000
2011-06-02T21:39:22.020000
6,220,640
6,224,844
Entity Framework Select: Can I specify columns from dictionary?
I'm wondering if there's an easy method to do this. I can't really write a saple, because it doesn't exist in my work, yet. public ActionResult GetMyData(ICollection MyColumns); that I can call like so: ICollection MyCols = new List (); MyCols.Add("Column1"); MyCols.Add("Column2"); GetMyData(MyCols); Where my GetMyData...
These might help in that they indicate the principle - you could make a similar one using your JSON parser of choice instead of aggregating to CSV - JSON is just a formatted string after all. You'd be replacing the Aggregate part, with something that built JSON. In mine, the aggregate is comma-separating the property v...
Entity Framework Select: Can I specify columns from dictionary? I'm wondering if there's an easy method to do this. I can't really write a saple, because it doesn't exist in my work, yet. public ActionResult GetMyData(ICollection MyColumns); that I can call like so: ICollection MyCols = new List (); MyCols.Add("Column1...
TITLE: Entity Framework Select: Can I specify columns from dictionary? QUESTION: I'm wondering if there's an easy method to do this. I can't really write a saple, because it doesn't exist in my work, yet. public ActionResult GetMyData(ICollection MyColumns); that I can call like so: ICollection MyCols = new List (); M...
[ "asp.net", "select", "frameworks", "entity" ]
0
0
591
1
0
2011-06-02T21:33:09.923000
2011-06-03T08:40:55.967000
6,220,644
6,222,280
Redirect browser only if a web site is available
I have an HTML file stored on the local file system. I need it to redirect (or otherwise display in some fashion) a remote web site ONLY if the site is online and available. If the site is not available, I need to display a user-friendly message. Currently I have: Connecting to remote server... The problem is that if t...
A simple way will be to try to load a known small image and you detect if the loading is done or not. If the pdf.gif is loaded, we switch to the site, if not we go somewhere else.
Redirect browser only if a web site is available I have an HTML file stored on the local file system. I need it to redirect (or otherwise display in some fashion) a remote web site ONLY if the site is online and available. If the site is not available, I need to display a user-friendly message. Currently I have: Connec...
TITLE: Redirect browser only if a web site is available QUESTION: I have an HTML file stored on the local file system. I need it to redirect (or otherwise display in some fashion) a remote web site ONLY if the site is online and available. If the site is not available, I need to display a user-friendly message. Curren...
[ "javascript", "html", "internet-explorer" ]
3
7
3,045
2
0
2011-06-02T21:33:27.093000
2011-06-03T02:01:05.350000
6,220,659
6,220,720
How should I store my sha512 salted & hashed passwords in MySQL?
All, I am using the following PHP function to salt & hash user passwords for a web app: function stringHashing($password,$salt){ $hashedString=$password.$salt; for ($i=0; $i<50; $i++){ $hashedString=hash('sha512',$password.$hashedString.$salt); } return $hashedString; } What is the best way to store the resulting strin...
Well, SHA512 will always return a 512 bit hash, the two-argument hash() method returns this as hex digits, so that's 512 bits / 8 bits per byte * 2 hex digits per byte = 128 hex digits A CHAR(128) should be what you need
How should I store my sha512 salted & hashed passwords in MySQL? All, I am using the following PHP function to salt & hash user passwords for a web app: function stringHashing($password,$salt){ $hashedString=$password.$salt; for ($i=0; $i<50; $i++){ $hashedString=hash('sha512',$password.$hashedString.$salt); } return $...
TITLE: How should I store my sha512 salted & hashed passwords in MySQL? QUESTION: All, I am using the following PHP function to salt & hash user passwords for a web app: function stringHashing($password,$salt){ $hashedString=$password.$salt; for ($i=0; $i<50; $i++){ $hashedString=hash('sha512',$password.$hashedString....
[ "php", "mysql", "security" ]
15
27
19,852
3
0
2011-06-02T21:34:52.123000
2011-06-02T21:41:12.650000
6,220,660
6,241,892
Calculating the length of MP3 Frames in milliseconds
Lets say one MP3 Frame length in bytes is 104: how to get that in milliseconds? Is there any formula or something to do that?
I used different approach to calculate the time of every frame in the mp3 file.. assuming that all frames have same size in the file.. so I just get the total time of the mp3 file in milliseconds.. then calculate total frames in the file and finally divide the total time by total frames.. so the formula would look like...
Calculating the length of MP3 Frames in milliseconds Lets say one MP3 Frame length in bytes is 104: how to get that in milliseconds? Is there any formula or something to do that?
TITLE: Calculating the length of MP3 Frames in milliseconds QUESTION: Lets say one MP3 Frame length in bytes is 104: how to get that in milliseconds? Is there any formula or something to do that? ANSWER: I used different approach to calculate the time of every frame in the mp3 file.. assuming that all frames have sam...
[ "c#", ".net", "audio", "mp3" ]
12
0
28,585
6
0
2011-06-02T21:34:54.067000
2011-06-05T08:54:54.943000
6,220,664
6,220,721
How to tell the Gem File to use a specific local copy of a gem
Say I have a gem living happily at: /MyPath/MyGem.gem And I want to use the local and unique gem rather than a gem version from Github, or wherever it fetches it from. How do I specify I want to use gem "mygem" from /MyPath/MyGem.gem
Try, in your Gemfile: gem "mygem",:path => "/MyPath/MyGem.gem" Note that it's probably best to use a relative link in there, like: gem "mygem",:path => "vendor/MyPath/MyGem.gem"
How to tell the Gem File to use a specific local copy of a gem Say I have a gem living happily at: /MyPath/MyGem.gem And I want to use the local and unique gem rather than a gem version from Github, or wherever it fetches it from. How do I specify I want to use gem "mygem" from /MyPath/MyGem.gem
TITLE: How to tell the Gem File to use a specific local copy of a gem QUESTION: Say I have a gem living happily at: /MyPath/MyGem.gem And I want to use the local and unique gem rather than a gem version from Github, or wherever it fetches it from. How do I specify I want to use gem "mygem" from /MyPath/MyGem.gem ANSW...
[ "ruby-on-rails", "file", "path", "rubygems" ]
9
23
9,743
3
0
2011-06-02T21:35:03.200000
2011-06-02T21:41:12.730000
6,220,676
6,220,696
Access a PayPal unique transaction ID
How can I access PayPal unique transaction ID using IPN with PHP? Can I access this from the auto return too?
You get the transaction ID on the IPN callback. Look for PHP example code in the IPN documentation. You can set up a sandbox account so you can do your IPN testing. This is how I did it. Overall I found it infuriatingly difficult to figure out exactly what PayPal's API looks like. It's a very messy API and the document...
Access a PayPal unique transaction ID How can I access PayPal unique transaction ID using IPN with PHP? Can I access this from the auto return too?
TITLE: Access a PayPal unique transaction ID QUESTION: How can I access PayPal unique transaction ID using IPN with PHP? Can I access this from the auto return too? ANSWER: You get the transaction ID on the IPN callback. Look for PHP example code in the IPN documentation. You can set up a sandbox account so you can d...
[ "php", "paypal" ]
0
1
2,942
3
0
2011-06-02T21:36:51.430000
2011-06-02T21:38:35.237000
6,220,693
6,220,819
String.Format in Javascript?
In C# whenever I wanted to print two digit numbers I've used int digit=1; Console.Write(digit.ToString("00")); How can I do the same action in Javascript? Thanks
c# digit.toString("00") appends one zero to the left of digit (left padding). In javascript I use this functon for that: function zeroPad(nr,base){ var len = (String(base).length - String(nr).length)+1; return len > 0? new Array(len).join('0')+nr: nr; } zeroPad(1,10); //=> 01 zeroPad(1,100); //=> 001 zeroPad(1,1000); /...
String.Format in Javascript? In C# whenever I wanted to print two digit numbers I've used int digit=1; Console.Write(digit.ToString("00")); How can I do the same action in Javascript? Thanks
TITLE: String.Format in Javascript? QUESTION: In C# whenever I wanted to print two digit numbers I've used int digit=1; Console.Write(digit.ToString("00")); How can I do the same action in Javascript? Thanks ANSWER: c# digit.toString("00") appends one zero to the left of digit (left padding). In javascript I use this...
[ "javascript", "string", "formatting" ]
5
14
25,982
4
0
2011-06-02T21:38:32.177000
2011-06-02T21:52:18.667000
6,220,695
6,220,871
jquery how to unload or hide javascript?
i have a jquery script. see fiddle here, that loads some scripts depending on what option i select. there are a few problems. I cant make the js unload/hide when the other option is selected (what if i have more options?) and the script doesnt load inside #feed-1307038796890991 but next to it.. wired any help much appr...
Here's a better attempt: http://jsfiddle.net/Eric/vLzCU/7/ I really can't see what was going through your head when you wrote the code. Why are there two single element arrays? And why are you using a variable to index them?
jquery how to unload or hide javascript? i have a jquery script. see fiddle here, that loads some scripts depending on what option i select. there are a few problems. I cant make the js unload/hide when the other option is selected (what if i have more options?) and the script doesnt load inside #feed-1307038796890991 ...
TITLE: jquery how to unload or hide javascript? QUESTION: i have a jquery script. see fiddle here, that loads some scripts depending on what option i select. there are a few problems. I cant make the js unload/hide when the other option is selected (what if i have more options?) and the script doesnt load inside #feed...
[ "jquery" ]
0
1
180
1
0
2011-06-02T21:38:34.867000
2011-06-02T21:58:37.083000
6,220,704
6,220,781
Passing a large data structure over dbus
I'm using dbus to communicate two programs. One creates a large image and it later sends it other program for further processing. I'm passing the image as ByteArray. With 2000x2000 images my program works, but with 4000x4000 it crasses with: process 2283: arguments to dbus_message_iter_append_fixed_array() were incorre...
I don't think Dbus is really the best way to send large amounts of data. How about writing the data structure out to a file in /tmp, and just passing the filename between the programs via dbus instead?
Passing a large data structure over dbus I'm using dbus to communicate two programs. One creates a large image and it later sends it other program for further processing. I'm passing the image as ByteArray. With 2000x2000 images my program works, but with 4000x4000 it crasses with: process 2283: arguments to dbus_messa...
TITLE: Passing a large data structure over dbus QUESTION: I'm using dbus to communicate two programs. One creates a large image and it later sends it other program for further processing. I'm passing the image as ByteArray. With 2000x2000 images my program works, but with 4000x4000 it crasses with: process 2283: argum...
[ "python", "dbus" ]
6
8
6,762
3
0
2011-06-02T21:39:01.723000
2011-06-02T21:48:13.250000
6,220,709
6,220,770
How to manage read-only DB connections at an application level
We are using Java/Spring/Ibatis/MySql. Is there a way with these technologies to manage read-only connections at an application level. I am looking to add an extra layer of safeguarding on top of having read-only MySql users. It would be nice if BasicDataSource or SqlMapClientTemplate provided configuration for read-on...
for example Connection#CreateStatement can takes parameters statement = connection.createStatement (ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
How to manage read-only DB connections at an application level We are using Java/Spring/Ibatis/MySql. Is there a way with these technologies to manage read-only connections at an application level. I am looking to add an extra layer of safeguarding on top of having read-only MySql users. It would be nice if BasicDataSo...
TITLE: How to manage read-only DB connections at an application level QUESTION: We are using Java/Spring/Ibatis/MySql. Is there a way with these technologies to manage read-only connections at an application level. I am looking to add an extra layer of safeguarding on top of having read-only MySql users. It would be n...
[ "java", "mysql", "apache", "spring", "ibatis" ]
3
2
7,125
3
0
2011-06-02T21:39:44.463000
2011-06-02T21:46:36.440000
6,220,726
6,220,792
Where do you keep Constants used throughout your application?
Is interface an acceptable place to store my public static final Foo bar Do you extrapolate them to be read from outside of the program? Do you make up a super class for it? How do you do it, when situation presents itself?
I'd put each constant into the class or interface it's most closely related to (e.g. because it will be use by its methods). A very seductive but ultimately very foolish idea is to have one "constants class" (or interface) that contains all constants used in the application. This looks "neat" at first glance, but is no...
Where do you keep Constants used throughout your application? Is interface an acceptable place to store my public static final Foo bar Do you extrapolate them to be read from outside of the program? Do you make up a super class for it? How do you do it, when situation presents itself?
TITLE: Where do you keep Constants used throughout your application? QUESTION: Is interface an acceptable place to store my public static final Foo bar Do you extrapolate them to be read from outside of the program? Do you make up a super class for it? How do you do it, when situation presents itself? ANSWER: I'd put...
[ "java", "interface", "coding-style" ]
35
56
28,734
5
0
2011-06-02T21:42:13.890000
2011-06-02T21:49:19.463000
6,220,729
6,223,472
ROT-13 Link Decoding Failing in Internet Explorer
I'm encoding all email addresses on a website as ROT-13, then decoding the addresses using Javascript (to avoid spam). However, the decoding just flat-out doesn't work in IE 7 or 8. Works splendidly in Chrome, Safari, Firefox. Any ideas on what is going wrong? UPDATE The link "href" is being properly decoded, and the l...
Turns out the problem has nothing to do with the ROT-13 decoding. There is a "bug" in Internet Explorer regarding the 'href' attribute of email links. If you update the 'href' using javascript, IE automatically updates the text of the link to match the 'href'. So in my code, first the 'href' was correctly decoded, then...
ROT-13 Link Decoding Failing in Internet Explorer I'm encoding all email addresses on a website as ROT-13, then decoding the addresses using Javascript (to avoid spam). However, the decoding just flat-out doesn't work in IE 7 or 8. Works splendidly in Chrome, Safari, Firefox. Any ideas on what is going wrong? UPDATE Th...
TITLE: ROT-13 Link Decoding Failing in Internet Explorer QUESTION: I'm encoding all email addresses on a website as ROT-13, then decoding the addresses using Javascript (to avoid spam). However, the decoding just flat-out doesn't work in IE 7 or 8. Works splendidly in Chrome, Safari, Firefox. Any ideas on what is goin...
[ "javascript", "internet-explorer", "rot13" ]
0
1
380
2
0
2011-06-02T21:42:49.533000
2011-06-03T05:53:40.233000
6,220,737
6,224,134
which XML editor to use for speech recognition grammar specifications (SRGS)
Is it best to use a particular editor to write XML or will any editor do? In particular I will be using XML to write Speech Recognition Grammar Specifications (SRGS).
I'd definitely recommend using an XML-aware editor over a general-purpose text editor. There are many available. I use oXygen, which is very popular in the XML community, but use whatever takes your liking.
which XML editor to use for speech recognition grammar specifications (SRGS) Is it best to use a particular editor to write XML or will any editor do? In particular I will be using XML to write Speech Recognition Grammar Specifications (SRGS).
TITLE: which XML editor to use for speech recognition grammar specifications (SRGS) QUESTION: Is it best to use a particular editor to write XML or will any editor do? In particular I will be using XML to write Speech Recognition Grammar Specifications (SRGS). ANSWER: I'd definitely recommend using an XML-aware edito...
[ "xml", "speech-recognition", "xmlwriter", "xml-parsing", "vxml" ]
2
1
1,540
3
0
2011-06-02T21:43:32.730000
2011-06-03T07:18:08.540000
6,220,754
6,268,321
how to set a cookie for a rhomobile/rhodes webview
i am using a rhomobile/rhodes app to talk to a web service and display content in a WebView, when i send the login information in a Rho::AsyncHttp.post with the login details and a callback i can see a successful login on the web service and the application gets a cookie that i can puts and view. so far so good. howeve...
turns out WebView.set_cookie doesn't currently work for 3.0.1, but you can set the cookie in javascript... this is the hack i wound up with that seems to work: def login WebView.navigate("http://www.mysite.com/blank.html") Rho::AsyncHttp.post(:url => "http://www.mysite.com/login?user[username]=joeblow&user[password]=su...
how to set a cookie for a rhomobile/rhodes webview i am using a rhomobile/rhodes app to talk to a web service and display content in a WebView, when i send the login information in a Rho::AsyncHttp.post with the login details and a callback i can see a successful login on the web service and the application gets a cook...
TITLE: how to set a cookie for a rhomobile/rhodes webview QUESTION: i am using a rhomobile/rhodes app to talk to a web service and display content in a WebView, when i send the login information in a Rho::AsyncHttp.post with the login details and a callback i can see a successful login on the web service and the appli...
[ "ruby", "cookies", "webview", "rhodes" ]
1
2
825
2
0
2011-06-02T21:45:10.500000
2011-06-07T16:13:57.673000
6,220,756
6,220,816
Why hashing functions like sha1 use only up to 16 different char (hexadecimal)?
Sorry for this curiosity that I have. sha1 use [a-f0-9] chars for its hashing function. May I know why it doens't use all the chars possible [a-z0-9] by using all chars availabe it could grealty increase the number of possibile different hash, thus lowering the probabilty of possibile collision. If you don't think this...
You're confusing representation with content. sha1 is 160 bits of binary data. You can just as easily represent it with: hex: 0xf1d2d2f924e986ac86fdf7b36c94bcdf32beec15 decimal: 1380568310619656533693587816107765069100751973397 binary: 111100011101001011010010111110010010010011101001100001101010110010000110111111011111...
Why hashing functions like sha1 use only up to 16 different char (hexadecimal)? Sorry for this curiosity that I have. sha1 use [a-f0-9] chars for its hashing function. May I know why it doens't use all the chars possible [a-z0-9] by using all chars availabe it could grealty increase the number of possibile different ha...
TITLE: Why hashing functions like sha1 use only up to 16 different char (hexadecimal)? QUESTION: Sorry for this curiosity that I have. sha1 use [a-f0-9] chars for its hashing function. May I know why it doens't use all the chars possible [a-z0-9] by using all chars availabe it could grealty increase the number of poss...
[ "php", "encryption", "sha1" ]
5
14
2,411
5
0
2011-06-02T21:45:30.763000
2011-06-02T21:52:07.143000
6,220,759
6,223,461
Scroll bar in an Item Renderer
I have an item renderer with an HBox with the scroll bar showing. Because the scroll bar is in the ItemRenderer of a TileList when a user drags the slider it triggers the click event on the TiLeList. Is there anyway to maybe stopPropogation of the events on the scroll bar only?
Adding a click handler like this for the HBox should work: private function hbox_clickHandler(event:MouseEvent):void { if(event.target.parent is ScrollBar) event.stopPropagation(); }
Scroll bar in an Item Renderer I have an item renderer with an HBox with the scroll bar showing. Because the scroll bar is in the ItemRenderer of a TileList when a user drags the slider it triggers the click event on the TiLeList. Is there anyway to maybe stopPropogation of the events on the scroll bar only?
TITLE: Scroll bar in an Item Renderer QUESTION: I have an item renderer with an HBox with the scroll bar showing. Because the scroll bar is in the ItemRenderer of a TileList when a user drags the slider it triggers the click event on the TiLeList. Is there anyway to maybe stopPropogation of the events on the scroll ba...
[ "actionscript-3", "apache-flex", "flex3" ]
0
1
129
1
0
2011-06-02T21:46:03.867000
2011-06-03T05:52:26.470000
6,220,763
6,220,800
SQL Gen'd login identifier
I'm trying to do this declare @aspAccountName varchar(30); SET @aspAccountName=HOST_NAME() + '\ASPNET'; IF NOT EXISTS (SELECT * FROM sys.server_principals WHERE name = @aspAccountName) CREATE LOGIN (SELECT @aspAccountName) FROM WINDOWS WITH DEFAULT_DATABASE=[master] But it says 'Incorrect syntax near '@aspAccountName'...
You'd have to write the CREATE LOGIN portion as dynamic SQL. DECLARE @sql nvarchar(200) SET @sql = N'CREATE LOGIN ' + @aspAccountName + N' FROM WINDOWS WITH DEFAULT_DATABASE=[master]' EXEC sp_executesql @sql
SQL Gen'd login identifier I'm trying to do this declare @aspAccountName varchar(30); SET @aspAccountName=HOST_NAME() + '\ASPNET'; IF NOT EXISTS (SELECT * FROM sys.server_principals WHERE name = @aspAccountName) CREATE LOGIN (SELECT @aspAccountName) FROM WINDOWS WITH DEFAULT_DATABASE=[master] But it says 'Incorrect sy...
TITLE: SQL Gen'd login identifier QUESTION: I'm trying to do this declare @aspAccountName varchar(30); SET @aspAccountName=HOST_NAME() + '\ASPNET'; IF NOT EXISTS (SELECT * FROM sys.server_principals WHERE name = @aspAccountName) CREATE LOGIN (SELECT @aspAccountName) FROM WINDOWS WITH DEFAULT_DATABASE=[master] But it ...
[ "sql", "variables", "dynamic", "authentication" ]
1
1
60
1
0
2011-06-02T21:46:22.683000
2011-06-02T21:49:58.987000
6,220,771
6,222,363
Permission Denied Using VBScript
I have a script which will move and rename folders. It is successful when running it locally but when attempting to read or write to directories using mapped drives the process fails with a "Permission Denied" error. Does VBScript not like mapped drives? Below is the script with credentials to read and write to source ...
The code looks fine. Also if it is working locally I would guess that the user you are mapping the network drive with does not have permission to edit the folder. Try mapping the drive manually with the same username and password. Copy a folder to the same location to check the users permissions
Permission Denied Using VBScript I have a script which will move and rename folders. It is successful when running it locally but when attempting to read or write to directories using mapped drives the process fails with a "Permission Denied" error. Does VBScript not like mapped drives? Below is the script with credent...
TITLE: Permission Denied Using VBScript QUESTION: I have a script which will move and rename folders. It is successful when running it locally but when attempting to read or write to directories using mapped drives the process fails with a "Permission Denied" error. Does VBScript not like mapped drives? Below is the s...
[ "vbscript" ]
1
0
5,243
1
0
2011-06-02T21:46:40.203000
2011-06-03T02:18:49.420000
6,220,778
6,220,805
Whats the difference and how to generate these two encodings?
I am working with these two encoding type of strings: %ueb08%u8b09%u3c40%u5756%u5ebe%u3440%u408d \x26\x04\x9e\x8e\xf9\xd0 To generate the first type I found this function: function encoder(s) { $res = strtoupper(bin2hex($s)); $g = round(strlen($res)/4); if($g!= (strlen($res)/4)) $res.= "00"; $out = ""; for($i = 0; $i <...
The bottom is just standard notation for representing hex values in the ascii space. If you want the number 0, it is \x00, if you want 10, it would be \x0A, and 16 (hex's 10) is \x10 (15 would be \x0F )
Whats the difference and how to generate these two encodings? I am working with these two encoding type of strings: %ueb08%u8b09%u3c40%u5756%u5ebe%u3440%u408d \x26\x04\x9e\x8e\xf9\xd0 To generate the first type I found this function: function encoder(s) { $res = strtoupper(bin2hex($s)); $g = round(strlen($res)/4); if($...
TITLE: Whats the difference and how to generate these two encodings? QUESTION: I am working with these two encoding type of strings: %ueb08%u8b09%u3c40%u5756%u5ebe%u3440%u408d \x26\x04\x9e\x8e\xf9\xd0 To generate the first type I found this function: function encoder(s) { $res = strtoupper(bin2hex($s)); $g = round(str...
[ "php", "string", "encoding" ]
0
1
59
1
0
2011-06-02T21:47:50.640000
2011-06-02T21:50:31.337000
6,220,779
6,220,902
Text Formatting Within a .NET Label
Possible Duplicate: Make portion of a Label's Text to be styled bold What is the standard / best practices way to achieve the effect of text formatting within a label in a standard.NET Windows Forms Application? For example, I want a label I would programatically change. However, I might want a particular word in the l...
This is not possible with the built in label controls. Many third party vendors provide controls with this capability (via HTML-like markup). We have used Telerik's winform suite with success for this.
Text Formatting Within a .NET Label Possible Duplicate: Make portion of a Label's Text to be styled bold What is the standard / best practices way to achieve the effect of text formatting within a label in a standard.NET Windows Forms Application? For example, I want a label I would programatically change. However, I m...
TITLE: Text Formatting Within a .NET Label QUESTION: Possible Duplicate: Make portion of a Label's Text to be styled bold What is the standard / best practices way to achieve the effect of text formatting within a label in a standard.NET Windows Forms Application? For example, I want a label I would programatically ch...
[ "c#", ".net", "vb.net", "winforms", "visual-studio-2010" ]
2
2
3,780
1
0
2011-06-02T21:47:56.590000
2011-06-02T22:02:58.007000
6,220,795
6,259,483
split a PKCS12 into its certificate and private key bytes
I have been able to OpenSSL tools to extract the certificate and private key bytes from an existing PFX (PKCS12) file. However, I wish to do this using.NET. I am able to use the X509Certificate classes to load a PFX file and extract the certificate bytes but, I do not know how to extract the private key. The certificat...
See my answer here: extract private key bytes in C# Does this work for you?
split a PKCS12 into its certificate and private key bytes I have been able to OpenSSL tools to extract the certificate and private key bytes from an existing PFX (PKCS12) file. However, I wish to do this using.NET. I am able to use the X509Certificate classes to load a PFX file and extract the certificate bytes but, I ...
TITLE: split a PKCS12 into its certificate and private key bytes QUESTION: I have been able to OpenSSL tools to extract the certificate and private key bytes from an existing PFX (PKCS12) file. However, I wish to do this using.NET. I am able to use the X509Certificate classes to load a PFX file and extract the certifi...
[ "x509certificate" ]
4
1
1,967
1
0
2011-06-02T21:49:34.743000
2011-06-07T00:20:09.567000
6,220,796
6,220,846
Publicly accessible functions
I'm creating an httphandler. The file type is probably irrelevant. My.ashx file: <%@ webhandler class="MyHandler" %> <%@ assembly src="Functions.vb" %> <%@ assembly src="Classes.vb" %> Public Class MyHandler... End Class My Functions.vb file: Module PublicFunctions Function SayHello(greeting As String)... End Funct...
This is a fundamental idea of object oriented programming. Every function, every bit of code belongs somewhere and needs to be organized. One way to do this is through the use of objects (classes). If you have a function you would like to preform, conciser what that function is doing and what is using it, and place it ...
Publicly accessible functions I'm creating an httphandler. The file type is probably irrelevant. My.ashx file: <%@ webhandler class="MyHandler" %> <%@ assembly src="Functions.vb" %> <%@ assembly src="Classes.vb" %> Public Class MyHandler... End Class My Functions.vb file: Module PublicFunctions Function SayHello(gre...
TITLE: Publicly accessible functions QUESTION: I'm creating an httphandler. The file type is probably irrelevant. My.ashx file: <%@ webhandler class="MyHandler" %> <%@ assembly src="Functions.vb" %> <%@ assembly src="Classes.vb" %> Public Class MyHandler... End Class My Functions.vb file: Module PublicFunctions Fun...
[ ".net", "asp.net", "vb.net" ]
0
1
92
3
0
2011-06-02T21:49:35.243000
2011-06-02T21:56:43.540000
6,220,798
6,220,865
How to check for NaN value in Objective-C (iOS)
Possible Duplicates: Objective-C - float checking for nan Determine if NSNumber is NaN I have a problem with NaN values in CGFloat, how can I check if the number is valid? the only way so far that works is: if ([[NSString stringWithFormat:@"%f", output] isEqualToString:@"nan"]) { output = 0; } which is not a nice solut...
There is a define for checking if a number is nan inf etc in math.h (you can use it without import I think). isnan(myValue) if you follow the define you will end up with (x!=x) there are also some other useful defines like isinf, isnormal, isfinite,...
How to check for NaN value in Objective-C (iOS) Possible Duplicates: Objective-C - float checking for nan Determine if NSNumber is NaN I have a problem with NaN values in CGFloat, how can I check if the number is valid? the only way so far that works is: if ([[NSString stringWithFormat:@"%f", output] isEqualToString:@"...
TITLE: How to check for NaN value in Objective-C (iOS) QUESTION: Possible Duplicates: Objective-C - float checking for nan Determine if NSNumber is NaN I have a problem with NaN values in CGFloat, how can I check if the number is valid? the only way so far that works is: if ([[NSString stringWithFormat:@"%f", output] ...
[ "ios", "objective-c", "xcode", "cgfloat" ]
53
152
42,040
1
0
2011-06-02T21:49:39.563000
2011-06-02T21:58:14.373000
6,220,803
6,220,940
C++ - Single local class instance for entire program duration
I'm working on a lil' game engine in C++, and decided to do it all OOPily (heavy use of classes.) It's intended to be (theoretically) cross-platform, so I have an 'Engine' class, an instance of which is created by the 'OS Module', which is WinMain for Windows (the platform I'm developing it for first.) I have three mai...
Game engines are not prime candidates for cross-platform'ness since they usually involve efficient interaction with low-level API's (which are not cross-platofrm). The size of a class depends on the member variables it contains, not the number of functions it implements. Stack space is usually small ( http://msdn.micro...
C++ - Single local class instance for entire program duration I'm working on a lil' game engine in C++, and decided to do it all OOPily (heavy use of classes.) It's intended to be (theoretically) cross-platform, so I have an 'Engine' class, an instance of which is created by the 'OS Module', which is WinMain for Window...
TITLE: C++ - Single local class instance for entire program duration QUESTION: I'm working on a lil' game engine in C++, and decided to do it all OOPily (heavy use of classes.) It's intended to be (theoretically) cross-platform, so I have an 'Engine' class, an instance of which is created by the 'OS Module', which is ...
[ "c++", "oop", "class", "class-design" ]
5
4
577
4
0
2011-06-02T21:50:11.953000
2011-06-02T22:06:25.550000
6,220,808
6,220,864
Excluding a PHP Interface from PHPUnit code coverage
I've got a PHPUnit test that tests a class called HelpTokenizerTest. This class implements TokenizerInterface. For some weird reason I cannot exclude the TokenizerInterface from code coverage. It shows up in code coverage reports as not covered, despite using @codeCoverageIgnore or even @codeCoverageIgnoreStart/End. An...
When using a phpunit.xml you can set up filters to exclude files with particular names, in particular folders or with an particular extension. see the documentation for it Example:./application/ HERE or alternatively../library/../application/ AND HERE../application/
Excluding a PHP Interface from PHPUnit code coverage I've got a PHPUnit test that tests a class called HelpTokenizerTest. This class implements TokenizerInterface. For some weird reason I cannot exclude the TokenizerInterface from code coverage. It shows up in code coverage reports as not covered, despite using @codeCo...
TITLE: Excluding a PHP Interface from PHPUnit code coverage QUESTION: I've got a PHPUnit test that tests a class called HelpTokenizerTest. This class implements TokenizerInterface. For some weird reason I cannot exclude the TokenizerInterface from code coverage. It shows up in code coverage reports as not covered, des...
[ "php", "unit-testing", "phpunit" ]
4
3
3,220
2
0
2011-06-02T21:50:46.770000
2011-06-02T21:58:10.253000
6,220,813
6,220,945
PHP: Dynamic multidimensional array with N number of elements
I'm trying to create an array that contains a config file, but I'm having trouble when some of the keys has the same name. Let's say I have a config in this kind of format: dinner=salad dish.fruit.first.name=apple dish.fruit.first.juicy=true dish.fruit.second.name=lettuce dish.fruit.second.juicy=false dressing.name=fre...
There were various problems in it. The $config += $head; assignment would have overwritten entries. Prefer array_merge for such cases. And also $head was undefined; no idea where it came from. Another simplification is just traversing the array structure using = &$last[$key]. This implicitly defines the subarray. But y...
PHP: Dynamic multidimensional array with N number of elements I'm trying to create an array that contains a config file, but I'm having trouble when some of the keys has the same name. Let's say I have a config in this kind of format: dinner=salad dish.fruit.first.name=apple dish.fruit.first.juicy=true dish.fruit.secon...
TITLE: PHP: Dynamic multidimensional array with N number of elements QUESTION: I'm trying to create an array that contains a config file, but I'm having trouble when some of the keys has the same name. Let's say I have a config in this kind of format: dinner=salad dish.fruit.first.name=apple dish.fruit.first.juicy=tru...
[ "php", "dynamic", "random", "multidimensional-array", "element" ]
0
2
718
1
0
2011-06-02T21:51:43.603000
2011-06-02T22:07:12.913000
6,220,834
6,220,854
Order of Evaluation in javascript
I am confused regarding the order of evaluation in javascript. For ex, this is the code I have written this.getTabUrl=function() { this.logToConsole("1"+"getTabUrl is called"); var myUrl chrome.tabs.getSelected(null, function(tab) { myUrl = tab.url; console.log("2"+tab.url); console.log("3"+myUrl); //this.parent.logTo...
The function passed to chrome.tabs.getSelected() is executed asynchronously. You need to put everything that needs whatever gets passed to the callback inside the callback function. Note that this means you cannot return a value from the outer function that relies on something from the callback. You need to accept a ca...
Order of Evaluation in javascript I am confused regarding the order of evaluation in javascript. For ex, this is the code I have written this.getTabUrl=function() { this.logToConsole("1"+"getTabUrl is called"); var myUrl chrome.tabs.getSelected(null, function(tab) { myUrl = tab.url; console.log("2"+tab.url); console.l...
TITLE: Order of Evaluation in javascript QUESTION: I am confused regarding the order of evaluation in javascript. For ex, this is the code I have written this.getTabUrl=function() { this.logToConsole("1"+"getTabUrl is called"); var myUrl chrome.tabs.getSelected(null, function(tab) { myUrl = tab.url; console.log("2"+t...
[ "javascript", "google-chrome" ]
0
3
148
1
0
2011-06-02T21:54:38.410000
2011-06-02T21:57:29.270000
6,220,836
6,220,931
How to jump down X amount of lines, over and over
I'm using 10j to jump down 10 lines, but I want to easily jump 10 lines over and over. I don't want to have to perform the jump with a macro qv10jq@v@@.. I wish there was a method for repeating down keys like motion has f then; to continually jump (, to go back) to the next character(s). is there anything shorter than ...
Here's repmo.vim - a plugin to do what you want. It maps; to repeat the last motion command given with a count.
How to jump down X amount of lines, over and over I'm using 10j to jump down 10 lines, but I want to easily jump 10 lines over and over. I don't want to have to perform the jump with a macro qv10jq@v@@.. I wish there was a method for repeating down keys like motion has f then; to continually jump (, to go back) to the ...
TITLE: How to jump down X amount of lines, over and over QUESTION: I'm using 10j to jump down 10 lines, but I want to easily jump 10 lines over and over. I don't want to have to perform the jump with a macro qv10jq@v@@.. I wish there was a method for repeating down keys like motion has f then; to continually jump (, t...
[ "vim" ]
52
26
47,666
7
0
2011-06-02T21:54:59.880000
2011-06-02T22:05:24.760000
6,220,848
6,220,916
Why aren't parent constructors being called?
I added in parent::__construct(); to the constructors of table and bookmark in order to get this code to work. Why are they not called automatically? If I create an object of type bookmark $obj_ref_bo = new bookmark(); should not bookmark also create objects from each of its parent classes (besides abstract classes). T...
should not bookmark also create objects from each of its parent classes That's entirely your choice to make, there is no requirement in the language to call the parent methods. As the PHP manual concisely puts it: Note: Parent constructors are not called implicitly if the child class defines a constructor. In order to ...
Why aren't parent constructors being called? I added in parent::__construct(); to the constructors of table and bookmark in order to get this code to work. Why are they not called automatically? If I create an object of type bookmark $obj_ref_bo = new bookmark(); should not bookmark also create objects from each of its...
TITLE: Why aren't parent constructors being called? QUESTION: I added in parent::__construct(); to the constructors of table and bookmark in order to get this code to work. Why are they not called automatically? If I create an object of type bookmark $obj_ref_bo = new bookmark(); should not bookmark also create object...
[ "php", "class", "object", "hierarchy" ]
3
9
3,828
2
0
2011-06-02T21:56:49.407000
2011-06-02T22:03:46.003000
6,220,849
6,252,253
Relations in Spring Web MVC (Using Roo)
What is the correct way to specify a one-to-many relationship in Spring Web MVC (using Spring Roo)? Example: A Person has a name and an email. A Team has a name. A Person has a membership in a Team, and a Team has zero or more members. The user would like to a) Set the membership for a person, b) Set the members for a ...
What you need here is a bidirectional relationship (which is not created by default). When you generate your entities, you need to add both the Set association in Team, AND the Person association in Team. It will probably also be a good idea (depending on your naming convention to add the mappedBy attribute in the OneT...
Relations in Spring Web MVC (Using Roo) What is the correct way to specify a one-to-many relationship in Spring Web MVC (using Spring Roo)? Example: A Person has a name and an email. A Team has a name. A Person has a membership in a Team, and a Team has zero or more members. The user would like to a) Set the membership...
TITLE: Relations in Spring Web MVC (Using Roo) QUESTION: What is the correct way to specify a one-to-many relationship in Spring Web MVC (using Spring Roo)? Example: A Person has a name and an email. A Team has a name. A Person has a membership in a Team, and a Team has zero or more members. The user would like to a) ...
[ "spring-mvc", "spring-roo" ]
0
1
622
1
0
2011-06-02T21:56:55.403000
2011-06-06T12:49:26.017000
6,220,857
6,220,888
Basic Ruby on Rails AJAX Error
I'm working through Agile Web Development with Rails, Edition 4 with some tweaks (mostly just naming variations), and I've arrived at Iteration F2. In this iteration, you modify the index button with:remote => true, you add format.js to the respond_to section of the controller, and you generate a js.rjs file to execute...
It seems your rjs file has some invalid bits at the start. Maybe try to re-create the file?
Basic Ruby on Rails AJAX Error I'm working through Agile Web Development with Rails, Edition 4 with some tweaks (mostly just naming variations), and I've arrived at Iteration F2. In this iteration, you modify the index button with:remote => true, you add format.js to the respond_to section of the controller, and you ge...
TITLE: Basic Ruby on Rails AJAX Error QUESTION: I'm working through Agile Web Development with Rails, Edition 4 with some tweaks (mostly just naming variations), and I've arrived at Iteration F2. In this iteration, you modify the index button with:remote => true, you add format.js to the respond_to section of the cont...
[ "ruby-on-rails", "ajax" ]
1
2
745
3
0
2011-06-02T21:57:40.783000
2011-06-02T22:01:42.167000
6,220,874
6,220,925
Simple java calculator
I had created a basic calculator using Java Swing. The question I have is how to print each calculation on the panel. for example, I have added two numbers, my panel should look something like 2 + 4 = 6, and if I perform another operation it should append another operation in the panel. My idea: I know I can do with th...
There are two possibilities: Use a JTextArea and set it to be non-editable. The text area control will allow you to add multiple lines of text so that you can keep appending operations as you like. textArea.setEditable(false); Draw the text as graphics on a Canvas. This is a little more involved but you have more contr...
Simple java calculator I had created a basic calculator using Java Swing. The question I have is how to print each calculation on the panel. for example, I have added two numbers, my panel should look something like 2 + 4 = 6, and if I perform another operation it should append another operation in the panel. My idea: ...
TITLE: Simple java calculator QUESTION: I had created a basic calculator using Java Swing. The question I have is how to print each calculation on the panel. for example, I have added two numbers, my panel should look something like 2 + 4 = 6, and if I perform another operation it should append another operation in th...
[ "java", "swing" ]
2
4
1,007
3
0
2011-06-02T21:58:57.987000
2011-06-02T22:04:36.027000
6,220,883
6,220,933
Rake is out of synch with my Database
I have inherited a Ruby on Rails project where the programmer didn't use rake to create the db schema, so it seems very out of synch, is there a way to rectify this?
First create a schema.rb file rake db:schema:dump Then make a migration ot of it. class CreateMigration < ActiveRecord::Migration def self.up # insert schema.rb here end def self.down end end You might also need to create the schema_migrations table, and manually add the timestamp for this migration to it.
Rake is out of synch with my Database I have inherited a Ruby on Rails project where the programmer didn't use rake to create the db schema, so it seems very out of synch, is there a way to rectify this?
TITLE: Rake is out of synch with my Database QUESTION: I have inherited a Ruby on Rails project where the programmer didn't use rake to create the db schema, so it seems very out of synch, is there a way to rectify this? ANSWER: First create a schema.rb file rake db:schema:dump Then make a migration ot of it. class C...
[ "ruby-on-rails", "database", "rake" ]
1
2
182
1
0
2011-06-02T22:00:37.423000
2011-06-02T22:05:38.513000
6,220,894
6,220,952
Swapping bytes of text in PHP
I basically need to port this piece of code to php for (i = 0; i < 128/4; i++) data32[i] = bswap_32(data32[i]); But, there is no bswap function in php. Would someone be kind enough to provide me with something that could solve the problem?
This should do it (untested): function bswap_32($j) { return (($j & 255) << 24) | (($j & 0xff00) << 8) | (($j & 0xff0000) >> 8) | (($j & 0xff000000) >> 24); } Or, if there is a sign extension problem, this should resolve it: function bswap_32($j) { return (($j & 255) << 24) | (($j & 0xff00) << 8) | (($j & 0xff0000) >> ...
Swapping bytes of text in PHP I basically need to port this piece of code to php for (i = 0; i < 128/4; i++) data32[i] = bswap_32(data32[i]); But, there is no bswap function in php. Would someone be kind enough to provide me with something that could solve the problem?
TITLE: Swapping bytes of text in PHP QUESTION: I basically need to port this piece of code to php for (i = 0; i < 128/4; i++) data32[i] = bswap_32(data32[i]); But, there is no bswap function in php. Would someone be kind enough to provide me with something that could solve the problem? ANSWER: This should do it (unte...
[ "php" ]
0
1
597
2
0
2011-06-02T22:02:13.650000
2011-06-02T22:08:31.323000
6,220,899
6,244,384
How do I display Explorer with a file selected?
What's the API call to display an Explorer window with a specified file selected? Exactly as happens when you click the "Find Target..." button in the Properties dialog of a.lnk shortcut? I know there is function (or an interface method) for that, but I forgot the name, and cannot find it again. Note that I'm aware of ...
You need SHOpenFolderAndSelectItems. This question was early discussed here - Programmatically selecting file in explorer Dont forget to call CoInitialize before first use of SHOpenFolderAndSelectItems
How do I display Explorer with a file selected? What's the API call to display an Explorer window with a specified file selected? Exactly as happens when you click the "Find Target..." button in the Properties dialog of a.lnk shortcut? I know there is function (or an interface method) for that, but I forgot the name, a...
TITLE: How do I display Explorer with a file selected? QUESTION: What's the API call to display an Explorer window with a specified file selected? Exactly as happens when you click the "Find Target..." button in the Properties dialog of a.lnk shortcut? I know there is function (or an interface method) for that, but I ...
[ "windows", "delphi", "winapi", "shell" ]
9
7
3,320
4
0
2011-06-02T22:02:50.480000
2011-06-05T16:55:30.013000
6,220,910
6,222,841
How to dynamically change the color of progress bar background android
I'd like to dynamically change the background color of a progress bar in android. I followed the "bonus" part near the end of the page of this tutorial: http://colintmiller.com/2010/10/how-to-add-text-over-a-progress-bar-on-android/ It changes the color, but only once. If called more than once, the progress bar disappe...
See Android ProgressBar.setProgressDrawable only works once? for the answer, repeated below: What I found out is that the drawable doesn't know it's size when setprogressdrawable is called. When it is initially set up, it does know it's size. This means there is a new drawable set to the seekbar, but the size of the dr...
How to dynamically change the color of progress bar background android I'd like to dynamically change the background color of a progress bar in android. I followed the "bonus" part near the end of the page of this tutorial: http://colintmiller.com/2010/10/how-to-add-text-over-a-progress-bar-on-android/ It changes the c...
TITLE: How to dynamically change the color of progress bar background android QUESTION: I'd like to dynamically change the background color of a progress bar in android. I followed the "bonus" part near the end of the page of this tutorial: http://colintmiller.com/2010/10/how-to-add-text-over-a-progress-bar-on-android...
[ "android", "colors", "progress-bar" ]
10
23
17,676
2
0
2011-06-02T22:03:26.883000
2011-06-03T04:03:24.603000
6,220,927
6,271,183
RadComboBox in a RadGrid and getting the unique row
I have a radgrid with a radcombobox in each row. I want to get the row's ID after the combo box has been chosen (someone selecting a value in the drop down). I'm using the onitemcreated property of the radgrid to get my method called in code behind. However, I'm not able to read the value of the ID that belongs to the ...
The guys at Telerik provided the solution below. The solution by Telerik works. Thanks. Thank you for contacting us. If you want go get the row's ID when you change the selected index of particular combobox, my suggestion is to subscribe on the service-side OnSelectedIndexChanged event and use the following implementat...
RadComboBox in a RadGrid and getting the unique row I have a radgrid with a radcombobox in each row. I want to get the row's ID after the combo box has been chosen (someone selecting a value in the drop down). I'm using the onitemcreated property of the radgrid to get my method called in code behind. However, I'm not a...
TITLE: RadComboBox in a RadGrid and getting the unique row QUESTION: I have a radgrid with a radcombobox in each row. I want to get the row's ID after the combo box has been chosen (someone selecting a value in the drop down). I'm using the onitemcreated property of the radgrid to get my method called in code behind. ...
[ "telerik", "telerik-grid" ]
3
4
10,261
2
0
2011-06-02T22:04:44.363000
2011-06-07T20:24:16.157000
6,221,591
6,221,656
Keyboard arrow keys navigation with Easy Slider 1.7
I'm trying to edit the Easy Slider to allow the keyboard's arrow keys to navigate the slideshow. I tried editing the javascript's animate function from: default: t = dir; break;...to: default: t = parseInt(dir); break;...but that didn't work. Does anyone know how to use the keyboard's arrow keys to navigate this slides...
Assuming your next and prev links have IDs of #next and #prev: $(document).keydown(function(e){ if (e.keyCode == 39) { $('a#next').trigger('click'); } else if (e.keyCode == 37) { $('a#prev').trigger('click'); } }); I'm also not familiar with easy slider, but if they have a way to programmatically switch the slides bac...
Keyboard arrow keys navigation with Easy Slider 1.7 I'm trying to edit the Easy Slider to allow the keyboard's arrow keys to navigate the slideshow. I tried editing the javascript's animate function from: default: t = dir; break;...to: default: t = parseInt(dir); break;...but that didn't work. Does anyone know how to u...
TITLE: Keyboard arrow keys navigation with Easy Slider 1.7 QUESTION: I'm trying to edit the Easy Slider to allow the keyboard's arrow keys to navigate the slideshow. I tried editing the javascript's animate function from: default: t = dir; break;...to: default: t = parseInt(dir); break;...but that didn't work. Does an...
[ "javascript", "jquery", "keyboard", "slideshow" ]
0
4
2,117
1
0
2011-06-02T23:42:13.140000
2011-06-02T23:52:38.877000
6,221,595
6,221,692
Scroll through multiple listViews
Hello I am writing a rather large app and on the main page I would like the option to search through all of the pages. Because I need to get and display the different types of information in different ways I have made a few subclasses of ArrayAdapters and I am connecting them to different ListViews on my search results...
Generally putting multiple listviews in one Activity isn't a good thing if it requires lots of scrolling. Having said that, all UI's are different, so if that's how you want to do it then post some code and we can help you troubleshoot that exception. Personally, I would create multiple "activities" with some sort of m...
Scroll through multiple listViews Hello I am writing a rather large app and on the main page I would like the option to search through all of the pages. Because I need to get and display the different types of information in different ways I have made a few subclasses of ArrayAdapters and I am connecting them to differ...
TITLE: Scroll through multiple listViews QUESTION: Hello I am writing a rather large app and on the main page I would like the option to search through all of the pages. Because I need to get and display the different types of information in different ways I have made a few subclasses of ArrayAdapters and I am connect...
[ "android" ]
0
1
559
1
0
2011-06-02T23:42:39.503000
2011-06-02T23:59:09.237000
6,221,597
6,221,643
Javascript with php header redirect
I'm working on a project that uses a http://url.com ');?> for redirects, and I'm very pleased with it because of the speed and the fact that it doesn't flash some intermediary URL in the address bar before redirecting. However, I now need to call my tracking software via a piece of Javascript like so: Is there any way ...
You will either have to write the JavaScript code for your tracking in PHP and execute it before the redirect, or have a page with one of those 'you are being redirected' if you want to use Javascript. The problem is that you cannot modify the header information after it has been sent. i.e. you can't have anything afte...
Javascript with php header redirect I'm working on a project that uses a http://url.com ');?> for redirects, and I'm very pleased with it because of the speed and the fact that it doesn't flash some intermediary URL in the address bar before redirecting. However, I now need to call my tracking software via a piece of J...
TITLE: Javascript with php header redirect QUESTION: I'm working on a project that uses a http://url.com ');?> for redirects, and I'm very pleased with it because of the speed and the fact that it doesn't flash some intermediary URL in the address bar before redirecting. However, I now need to call my tracking softwar...
[ "php", "javascript", "redirect" ]
0
0
1,208
1
0
2011-06-02T23:43:07.710000
2011-06-02T23:50:11.163000
6,221,600
6,223,737
Graph traversal algorithm with a twist - minimum number of stops
I am stumped on this homework problem. I think I have the right answer but am unsure how to prove it. I am also unsure of how to approach the proof. Here is the problem: Professor Gekko has always dreamed of inline skating across North Dakota. He plans to cross the state on highway U.S. 2, which runs from Grand Forks, ...
Your algorithm is correct. Try to prove the following by induction on the number of stops passed. After passing each water location, no other strategy can have made fewer stops, and of those which made the same number of stops, no other strategy can leave you with more water. At 0 stops all strategies are equal, so it ...
Graph traversal algorithm with a twist - minimum number of stops I am stumped on this homework problem. I think I have the right answer but am unsure how to prove it. I am also unsure of how to approach the proof. Here is the problem: Professor Gekko has always dreamed of inline skating across North Dakota. He plans to...
TITLE: Graph traversal algorithm with a twist - minimum number of stops QUESTION: I am stumped on this homework problem. I think I have the right answer but am unsure how to prove it. I am also unsure of how to approach the proof. Here is the problem: Professor Gekko has always dreamed of inline skating across North D...
[ "algorithm", "graph" ]
6
3
6,096
3
0
2011-06-02T23:43:33.247000
2011-06-03T06:31:22.723000
6,221,607
6,221,657
Is It Overkill To Use Prepared Statements for Placeholder Binding Alone?
A know a lot of people that use prepared statements, for the placeholder binding alone. That is, they don't intend on issuing the same statement more than once, with different values. They simply feel using PS in this manner is more secure. My understanding of MySQL's PS, is the SQL is sent as a single transmission, fo...
A prepared statement is compiled and stored on the DBMS. These statements may be cached and reused. Imagine the benefits when hitting the same page multiple times. Further, some database engines (Oracle for example) may impose a hard statement limit and trust me (I know from experience), you do not want to exhaust this...
Is It Overkill To Use Prepared Statements for Placeholder Binding Alone? A know a lot of people that use prepared statements, for the placeholder binding alone. That is, they don't intend on issuing the same statement more than once, with different values. They simply feel using PS in this manner is more secure. My und...
TITLE: Is It Overkill To Use Prepared Statements for Placeholder Binding Alone? QUESTION: A know a lot of people that use prepared statements, for the placeholder binding alone. That is, they don't intend on issuing the same statement more than once, with different values. They simply feel using PS in this manner is m...
[ "mysql", "prepared-statement" ]
4
8
274
3
0
2011-06-02T23:44:29.410000
2011-06-02T23:53:13.940000
6,221,610
6,221,635
std::vector and Constructors
Which constructor does std::vector call when it is making a new instance of the object it's containing? I am under the impression it calls a default constructor but what if one is not defined or is the compiler doing that for me? Particularly in a case as such: class Foo { public: Foo(int size) { data = new double[size...
At a minimum, for std::vector to compile, T must be copy-constructible, and copy-assignable. If you want to use std::vector::vector(int) (or std::vector::resize() ), then T must have be default-constructible. If any of these requirements are not fulfilled, the code will not compile.... C++03 standard, section 23.1 (dis...
std::vector and Constructors Which constructor does std::vector call when it is making a new instance of the object it's containing? I am under the impression it calls a default constructor but what if one is not defined or is the compiler doing that for me? Particularly in a case as such: class Foo { public: Foo(int s...
TITLE: std::vector and Constructors QUESTION: Which constructor does std::vector call when it is making a new instance of the object it's containing? I am under the impression it calls a default constructor but what if one is not defined or is the compiler doing that for me? Particularly in a case as such: class Foo {...
[ "c++", "object", "vector", "constructor" ]
0
7
1,608
2
0
2011-06-02T23:45:22.373000
2011-06-02T23:48:35.090000
6,221,611
6,221,735
Dynamic Binding Flag Algorithm which uses RegExp
I've been at this for at least 3 hours now - 1.5 - 2 of which has been spent just learning regex in order to do this. I am still nowhere near comprehending it, but that's not quite the priority: I'd rather get this algorithm flushed out first. SO.. Here, I have a nice little method which accepts a string which is basic...
The error is because you're not guaranteed to be initializing binderFlag before returning it. Why not do something like this instead? This sets the binderFlag to your default return value up front, so that if your algorithm can't determine what to use, it returns NonPublic. This at least will resolve the compiler error...
Dynamic Binding Flag Algorithm which uses RegExp I've been at this for at least 3 hours now - 1.5 - 2 of which has been spent just learning regex in order to do this. I am still nowhere near comprehending it, but that's not quite the priority: I'd rather get this algorithm flushed out first. SO.. Here, I have a nice li...
TITLE: Dynamic Binding Flag Algorithm which uses RegExp QUESTION: I've been at this for at least 3 hours now - 1.5 - 2 of which has been spent just learning regex in order to do this. I am still nowhere near comprehending it, but that's not quite the priority: I'd rather get this algorithm flushed out first. SO.. Here...
[ "c#", "regex", "dynamic", "binding" ]
0
1
160
1
0
2011-06-02T23:45:29.573000
2011-06-03T00:07:23.997000
6,221,619
6,221,724
Can you override a method by including a module?
Possible Duplicate: Overriding method by another defined in module Here's some code: class Foo def bar puts "Original bar" end end module M def bar puts "Called M::bar" end end Foo.send(:include,M) Foo.new.bar # => Original bar Does ruby prevent overriding a previously defined method when a method of the same name is...
I don't quite understand your question. What, exactly, do you think is "prevented" here, and by whom? This is precisely how it is supposed to work. Module#include mixes in the module as the direct superclass of whatever class it is being mixed into. M is a superclass of Foo, so Foo#bar overrides M#bar, because that's h...
Can you override a method by including a module? Possible Duplicate: Overriding method by another defined in module Here's some code: class Foo def bar puts "Original bar" end end module M def bar puts "Called M::bar" end end Foo.send(:include,M) Foo.new.bar # => Original bar Does ruby prevent overriding a previously...
TITLE: Can you override a method by including a module? QUESTION: Possible Duplicate: Overriding method by another defined in module Here's some code: class Foo def bar puts "Original bar" end end module M def bar puts "Called M::bar" end end Foo.send(:include,M) Foo.new.bar # => Original bar Does ruby prevent overr...
[ "ruby" ]
4
8
6,211
3
0
2011-06-02T23:46:50.220000
2011-06-03T00:05:48.613000
6,221,621
6,221,929
SQL little table allocated in memory
Is there a way to make SQL Server to store a table with 10 attributes and 10 rows like this on memory? a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 ---------------------------------------- 138 498 365 345 500 473 498 125 134 800 448 498 362 348 500 463 498 625 165 700 468 498 625 329 500 435 498 625 345 600 437 701 365 326 500 453 4...
Don't try to dictate to SQL Server how to handle memory for things like this. It's a declarative language - you tell it what you want and it figures out how to do it. Keeping it in memory only would be an issue for recovery. That being said, once you create the table it will be kept in memory once it's written to disk....
SQL little table allocated in memory Is there a way to make SQL Server to store a table with 10 attributes and 10 rows like this on memory? a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 ---------------------------------------- 138 498 365 345 500 473 498 125 134 800 448 498 362 348 500 463 498 625 165 700 468 498 625 329 500 435 498 ...
TITLE: SQL little table allocated in memory QUESTION: Is there a way to make SQL Server to store a table with 10 attributes and 10 rows like this on memory? a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 ---------------------------------------- 138 498 365 345 500 473 498 125 134 800 448 498 362 348 500 463 498 625 165 700 468 498 62...
[ "c++", "sql-server", "sql-server-2008", "memory", "vector" ]
0
5
204
2
0
2011-06-02T23:47:03.373000
2011-06-03T00:49:16.877000
6,221,624
6,222,013
How to avoid git rebase killing merge commits?
Given the following git history: C-I origin/master / A-B-F-G-H master \ / D-E branch-b I want to rebase my local master branch on top of origin/master, but I want to preserve the merge commit G. When I tried simply doing a git rebase origin/master while at master it squashed D..E as G and committed that with the commit...
Add --preserve-merges to your rebase command. In case there were conflict resolutions in your merge, add 'recursive theirs' strategy as a parameter as well. EDIT: --preserve-merges is now deprecated, use --rebase-merges instead
How to avoid git rebase killing merge commits? Given the following git history: C-I origin/master / A-B-F-G-H master \ / D-E branch-b I want to rebase my local master branch on top of origin/master, but I want to preserve the merge commit G. When I tried simply doing a git rebase origin/master while at master it squash...
TITLE: How to avoid git rebase killing merge commits? QUESTION: Given the following git history: C-I origin/master / A-B-F-G-H master \ / D-E branch-b I want to rebase my local master branch on top of origin/master, but I want to preserve the merge commit G. When I tried simply doing a git rebase origin/master while a...
[ "git", "version-control", "git-merge", "git-rebase" ]
43
69
9,831
2
0
2011-06-02T23:47:08.347000
2011-06-03T01:07:08.203000
6,221,627
6,225,052
Finding framed data in a byte-array
I have a bytearray consisting of data received from a WebSocket-client. The data I have can be either 1 receive, or buffered data + the last receive. This depends on weather or not there were any data buffered. Now, there are really 3 possible things that should happen when data is received, and they are as following (...
Your close-signal is just an empty message, not really a special case. So what you have is a mismatch between segments over the line and interpreted messages. It doesn't look that hard, you have to extract sequences between 0x00 and 0xFF from a stream of bytes. You will need a buffer that is bigger than the biggest mes...
Finding framed data in a byte-array I have a bytearray consisting of data received from a WebSocket-client. The data I have can be either 1 receive, or buffered data + the last receive. This depends on weather or not there were any data buffered. Now, there are really 3 possible things that should happen when data is r...
TITLE: Finding framed data in a byte-array QUESTION: I have a bytearray consisting of data received from a WebSocket-client. The data I have can be either 1 receive, or buffered data + the last receive. This depends on weather or not there were any data buffered. Now, there are really 3 possible things that should hap...
[ "c#", "binary", "performance", "websocket" ]
0
0
507
1
0
2011-06-02T23:47:25.423000
2011-06-03T09:04:42.440000
6,221,632
6,222,139
When creating a short url service, is 302 temporary redirect the best way to go?
When creating a short URL service for URLs on the same domain, should we be using a 302 redirect? Full URL structure: example.com/gig/{id}/gig-full-name-slug Short URL structure: example.com/g/{base64id} We're using asp.net mvc3, if there's any shortcuts.
Your best bet is to return a 301 so that search engines pick it up as a proper redirect and dont try to index your short urls. This is what the others do (ie. bit.ly)
When creating a short url service, is 302 temporary redirect the best way to go? When creating a short URL service for URLs on the same domain, should we be using a 302 redirect? Full URL structure: example.com/gig/{id}/gig-full-name-slug Short URL structure: example.com/g/{base64id} We're using asp.net mvc3, if there'...
TITLE: When creating a short url service, is 302 temporary redirect the best way to go? QUESTION: When creating a short URL service for URLs on the same domain, should we be using a 302 redirect? Full URL structure: example.com/gig/{id}/gig-full-name-slug Short URL structure: example.com/g/{base64id} We're using asp.n...
[ "c#", "asp.net-mvc-3", "iis-7", "redirect", "short-url" ]
7
7
571
2
0
2011-06-02T23:47:55.993000
2011-06-03T01:36:13.067000
6,221,633
6,222,050
jQuery ajaxSubmit calls always returning a 0 response code with response.statusText = 'n/a'
Background: jquery 1.5.2, ruby on rails. The major issue seems to be that I'm getting a 0 response code regardless of what the web server tells me it is returning. I have an application that returns a 422 when validation on a model fails, but for some reason the success function is getting called every time. $("#form")...
The issue was because I was doing a file upload, which always returns 0 and n/a.
jQuery ajaxSubmit calls always returning a 0 response code with response.statusText = 'n/a' Background: jquery 1.5.2, ruby on rails. The major issue seems to be that I'm getting a 0 response code regardless of what the web server tells me it is returning. I have an application that returns a 422 when validation on a mo...
TITLE: jQuery ajaxSubmit calls always returning a 0 response code with response.statusText = 'n/a' QUESTION: Background: jquery 1.5.2, ruby on rails. The major issue seems to be that I'm getting a 0 response code regardless of what the web server tells me it is returning. I have an application that returns a 422 when ...
[ "jquery", "ruby-on-rails", "ajax" ]
1
1
1,437
1
0
2011-06-02T23:48:00.877000
2011-06-03T01:15:28.437000
6,221,638
6,221,756
why do I need this autorelease after [NSMutableArray array] to avoid a memory leak?
why do I need this autorelease after [NSMutableArray array] to avoid a memory leak? That is Instruments told me there was a leak. By putting the autorelease in it solved it, however I'm not sure why this would be required. The "array" method wasn't like an INIT or COPY etc... @interface Weekend: NSObject { NSMutableArr...
Why do you need that extra release? You don't. Not there, anyway. The problem is you're overretaining _events somewhere else. Maybe you're passing it to another class that's retaining without releasing? Leaks are always attributed by Instruments to creation of the object, not the unbalanced retain. Adding that autorele...
why do I need this autorelease after [NSMutableArray array] to avoid a memory leak? why do I need this autorelease after [NSMutableArray array] to avoid a memory leak? That is Instruments told me there was a leak. By putting the autorelease in it solved it, however I'm not sure why this would be required. The "array" m...
TITLE: why do I need this autorelease after [NSMutableArray array] to avoid a memory leak? QUESTION: why do I need this autorelease after [NSMutableArray array] to avoid a memory leak? That is Instruments told me there was a leak. By putting the autorelease in it solved it, however I'm not sure why this would be requi...
[ "iphone", "ios", "memory-management", "nsmutablearray", "autorelease" ]
1
5
3,338
3
0
2011-06-02T23:49:10.253000
2011-06-03T00:09:43.393000
6,221,640
6,231,113
Can I distribute a wineskin-wrapper of my application? Can I sell it?
Wineskin( http://wineskin.doh123.com/Information.html ) is an application for mac that makes simple wrappers for Windows-applications using wine, basically converting a Windows-application into a MacOS-application. (At least it looks so to the user). A readymade wrapper contains both the original application, some code...
As far as I know how wine works, it does not modify the programs itself, but provides a wrapper to make them more portable. So the licensing of wine and wineskin is for their own software only, but not for software wrapped by wine. For example, the windows tetris game I copied over to my linux box must not be put under...
Can I distribute a wineskin-wrapper of my application? Can I sell it? Wineskin( http://wineskin.doh123.com/Information.html ) is an application for mac that makes simple wrappers for Windows-applications using wine, basically converting a Windows-application into a MacOS-application. (At least it looks so to the user)....
TITLE: Can I distribute a wineskin-wrapper of my application? Can I sell it? QUESTION: Wineskin( http://wineskin.doh123.com/Information.html ) is an application for mac that makes simple wrappers for Windows-applications using wine, basically converting a Windows-application into a MacOS-application. (At least it look...
[ "licensing", "lgpl", "wine" ]
1
1
992
2
0
2011-06-02T23:49:48.590000
2011-06-03T18:23:33.227000
6,221,647
6,221,738
How to use my custom property as a trigger?
I have a class (Compound) binding to DataGrid. I want to change background color of a cell when a property is set to true. Here is what I tried: public class Compound: DependencyObject { public static readonly DependencyProperty RSquaredFlagProperty = DependencyProperty.Register("RSquaredFlag", typeof(bool), typeof(Com...
Change it to Property="TextBlock.Background" or specify a respective TargetType in your style. I don't think the trigger will work by the way since it will look for the property on the control itself not its DataContext, use a DataTrigger instead.
How to use my custom property as a trigger? I have a class (Compound) binding to DataGrid. I want to change background color of a cell when a property is set to true. Here is what I tried: public class Compound: DependencyObject { public static readonly DependencyProperty RSquaredFlagProperty = DependencyProperty.Regis...
TITLE: How to use my custom property as a trigger? QUESTION: I have a class (Compound) binding to DataGrid. I want to change background color of a cell when a property is set to true. Here is what I tried: public class Compound: DependencyObject { public static readonly DependencyProperty RSquaredFlagProperty = Depend...
[ "wpf", "datagrid", "triggers", "styles" ]
1
2
3,643
1
0
2011-06-02T23:51:12.770000
2011-06-03T00:07:29.337000
6,221,660
6,222,052
SQL Azure Migration Wizard - small extra step needed?
I've recently migrated a couple of SQL 2008 databases to Azure using the 3.7 Migration Wizard from CodePlex. After completing the migration, everything works well, except that I don't have all the "normal" right click menu items in Management Studio - e.g. I don't have "Design", "Select Top 1000", etc I think the reaso...
I hate to say it, but that's not a feature of a database migrated to SQL Azure, that's a feature of all SQL Azure Databases. Some options in in SQL Management Studio just aren't available. For example right click on a stored procedure -> Script Stored Procedure To -> Alter is disabled for some unknown reason.
SQL Azure Migration Wizard - small extra step needed? I've recently migrated a couple of SQL 2008 databases to Azure using the 3.7 Migration Wizard from CodePlex. After completing the migration, everything works well, except that I don't have all the "normal" right click menu items in Management Studio - e.g. I don't h...
TITLE: SQL Azure Migration Wizard - small extra step needed? QUESTION: I've recently migrated a couple of SQL 2008 databases to Azure using the 3.7 Migration Wizard from CodePlex. After completing the migration, everything works well, except that I don't have all the "normal" right click menu items in Management Studi...
[ "azure", "azure-sql-database", "ssms" ]
3
6
839
2
0
2011-06-02T23:53:47.977000
2011-06-03T01:15:51.970000
6,221,663
6,221,686
issue serializing series of checkboxes for use in JQuery $.post
basically I have 4 checkboxes their values are a number. so lets say my HTML source is like this: I want to post checks[] with jquery post, so that the checks stay in the specific locations. i.e server side the array looks like this: checks[1] is empty check[2] = 2 checks[4] = 4 this is what I am trying: var post_data ...
This works: var post_data = $('input[name*="checks"]:checked').serialize(); alert(post_data); See an example: http://jsfiddle.net/YAh3e/
issue serializing series of checkboxes for use in JQuery $.post basically I have 4 checkboxes their values are a number. so lets say my HTML source is like this: I want to post checks[] with jquery post, so that the checks stay in the specific locations. i.e server side the array looks like this: checks[1] is empty che...
TITLE: issue serializing series of checkboxes for use in JQuery $.post QUESTION: basically I have 4 checkboxes their values are a number. so lets say my HTML source is like this: I want to post checks[] with jquery post, so that the checks stay in the specific locations. i.e server side the array looks like this: chec...
[ "jquery", "ajax" ]
0
0
892
2
0
2011-06-02T23:54:14.417000
2011-06-02T23:57:14.897000
6,221,674
6,221,964
How do I fade text out, change it, and fade it back in?
I'm using a TextBlock in a datatemplate for a cell in a datagrid. I have a requirement that says when the value of the cell changes, the text should: fade out before changing value should change fade back in again At the moment I use the TargetUpdated RoutedEvent to trigger an animation to make the text fade away and t...
Wrote an interactivity behavior which should do this: xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" class AnimatedTextChangeBehavior: Behavior { public Duration AnimationDuration { get; set; } private string OldValue = null; private string NewValue = null; DoubleAnimation AnimationOut; DoubleAn...
How do I fade text out, change it, and fade it back in? I'm using a TextBlock in a datatemplate for a cell in a datagrid. I have a requirement that says when the value of the cell changes, the text should: fade out before changing value should change fade back in again At the moment I use the TargetUpdated RoutedEvent ...
TITLE: How do I fade text out, change it, and fade it back in? QUESTION: I'm using a TextBlock in a datatemplate for a cell in a datagrid. I have a requirement that says when the value of the cell changes, the text should: fade out before changing value should change fade back in again At the moment I use the TargetUp...
[ "wpf", "animation", "fade", "textblock" ]
9
12
6,179
1
0
2011-06-02T23:56:06.120000
2011-06-03T00:56:57.627000
6,221,678
6,222,556
multiple deployment repositories with maven
I have a source repository for which I use maven. Usually I want to deploy projects to an internal repository, so I have this repository in the parent POM. However, I also need to declare this repository in each project POM so that project can find the parent POM (a relative path to the parent POM only works if the ver...
You can define a repository URL property in parent pom (for example, ${repository.deploy}). Also create profiles in parent pom (like local and foriegn) which will assign different value to this property. In all child project pom files, use the parent defined property for repository URL. This way the other party can swi...
multiple deployment repositories with maven I have a source repository for which I use maven. Usually I want to deploy projects to an internal repository, so I have this repository in the parent POM. However, I also need to declare this repository in each project POM so that project can find the parent POM (a relative ...
TITLE: multiple deployment repositories with maven QUESTION: I have a source repository for which I use maven. Usually I want to deploy projects to an internal repository, so I have this repository in the parent POM. However, I also need to declare this repository in each project POM so that project can find the paren...
[ "maven" ]
1
2
451
1
0
2011-06-02T23:56:48.573000
2011-06-03T03:03:11.500000