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,276,636 | 6,276,659 | How to make a combination of strings in C#? | I need to make a combinaion of Stings "a" "b" "c" "d". I've tried putting them in a list then parsing a foreach methord through them, but to no avail. What else can I do? | I will give you the logic. Create a List and then go on adding each string to it. List s = new List ();
s.add("a"); s.add("b"); s.add("c"); s.add("d"); Once you added all the strings, then generate a random number between minimum and maximum index like this: private int RandomNumber(int min, int max) { Random random =... | How to make a combination of strings in C#? I need to make a combinaion of Stings "a" "b" "c" "d". I've tried putting them in a list then parsing a foreach methord through them, but to no avail. What else can I do? | TITLE:
How to make a combination of strings in C#?
QUESTION:
I need to make a combinaion of Stings "a" "b" "c" "d". I've tried putting them in a list then parsing a foreach methord through them, but to no avail. What else can I do?
ANSWER:
I will give you the logic. Create a List and then go on adding each string to ... | [
"c#",
".net",
"string",
"combinations"
] | 0 | 0 | 3,795 | 6 | 0 | 2011-06-08T09:22:19.220000 | 2011-06-08T09:25:25.430000 |
6,276,640 | 6,276,814 | jQuery UI: when using multiple buttonsets (radio-buttons) they forget their state | I'm coding a form with two different button sets. Once one of them is clicked, the other one doesn't display that it is checked any longer: deutsch englisch Mail-Output Mail-Sourcecode Once clicked the other one isn't checked any longer.. Or at least it isnt displayed as checked. Has someone else stumpled upon this pro... | you used name="mode" for both of button set. thats cause a problem. Change the name attribute of any set and then test. for example: deutsch englisch Mail-Output Mail-Sourcecode | jQuery UI: when using multiple buttonsets (radio-buttons) they forget their state I'm coding a form with two different button sets. Once one of them is clicked, the other one doesn't display that it is checked any longer: deutsch englisch Mail-Output Mail-Sourcecode Once clicked the other one isn't checked any longer..... | TITLE:
jQuery UI: when using multiple buttonsets (radio-buttons) they forget their state
QUESTION:
I'm coding a form with two different button sets. Once one of them is clicked, the other one doesn't display that it is checked any longer: deutsch englisch Mail-Output Mail-Sourcecode Once clicked the other one isn't ch... | [
"jquery",
"html",
"forms",
"user-interface"
] | 8 | 10 | 4,357 | 1 | 0 | 2011-06-08T09:22:48.917000 | 2011-06-08T09:40:58.910000 |
6,276,644 | 6,276,656 | Are regex check constraints possible in SQL Server | I am trying to find a way to validate data in my columns using regex CHECK constraints but have so far only come across the LIKE keyword that has an extremely limited subset of regex syntax. I'd like to know if there is a way to use regex in check constraints? I am using SQL Server 2005 and 2008. | I think you can create a CLR scalar UDF which can use the.Net framework RegEx classes, and then call that from your check constraint. In fact, this article discusses this scenario (search for "Check Constraint", then move backwards through the article to find implementation details). | Are regex check constraints possible in SQL Server I am trying to find a way to validate data in my columns using regex CHECK constraints but have so far only come across the LIKE keyword that has an extremely limited subset of regex syntax. I'd like to know if there is a way to use regex in check constraints? I am usi... | TITLE:
Are regex check constraints possible in SQL Server
QUESTION:
I am trying to find a way to validate data in my columns using regex CHECK constraints but have so far only come across the LIKE keyword that has an extremely limited subset of regex syntax. I'd like to know if there is a way to use regex in check con... | [
"sql-server",
"regex",
"check-constraints"
] | 3 | 4 | 2,450 | 2 | 0 | 2011-06-08T09:23:14.620000 | 2011-06-08T09:24:57.780000 |
6,276,649 | 6,276,675 | Why is this fairly simple join not working? | I'm using this query to fetch all tasks with a specific tag in a HABTM relationship. However for some reason it is failing to attach relevant tags to the tags_tasks and thus returning 0 because it can't pick up anything from the tags table. SELECT `Task`. *, `Task`.`id` FROM `tasks` AS `Task` LEFT JOIN `tags_tasks` AS ... | SELECT * FROM `tasks` LEFT JOIN `tags_tasks` ON ( `tags_tasks`.`task_id` = `tasks`.`id` ) LEFT JOIN `tags` ON ( `tags`.`id` = `tags_tasks`.`tag_id` ) WHERE `tags`.`name` = 'Problem' You were using a string at line 3, which couldn't possibly work. | Why is this fairly simple join not working? I'm using this query to fetch all tasks with a specific tag in a HABTM relationship. However for some reason it is failing to attach relevant tags to the tags_tasks and thus returning 0 because it can't pick up anything from the tags table. SELECT `Task`. *, `Task`.`id` FROM ... | TITLE:
Why is this fairly simple join not working?
QUESTION:
I'm using this query to fetch all tasks with a specific tag in a HABTM relationship. However for some reason it is failing to attach relevant tags to the tags_tasks and thus returning 0 because it can't pick up anything from the tags table. SELECT `Task`. *,... | [
"mysql",
"database",
"join",
"left-join"
] | 1 | 2 | 53 | 3 | 0 | 2011-06-08T09:23:49.300000 | 2011-06-08T09:27:08.053000 |
6,276,660 | 6,276,786 | listview in windows application | am working in windows application with c#.Am creating the listview items dynamically..i want to add columns and items for the listview and i did it too..i can create items but i cant add the columns name...my code is; private void list_Load(object sender, EventArgs e) { listView1.Columns.Add("id",40, HorizontalAlignmen... | On the ListView property window you have to set up "Details" | listview in windows application am working in windows application with c#.Am creating the listview items dynamically..i want to add columns and items for the listview and i did it too..i can create items but i cant add the columns name...my code is; private void list_Load(object sender, EventArgs e) { listView1.Columns... | TITLE:
listview in windows application
QUESTION:
am working in windows application with c#.Am creating the listview items dynamically..i want to add columns and items for the listview and i did it too..i can create items but i cant add the columns name...my code is; private void list_Load(object sender, EventArgs e) {... | [
"c#",
"winforms"
] | 0 | 1 | 3,069 | 2 | 0 | 2011-06-08T09:25:37.057000 | 2011-06-08T09:38:18.343000 |
6,276,683 | 6,276,724 | How to do : "Between TODAY AND TODAY-7"? | I need to find the account created for the current day, et for the last 7 days. To find my results for today, it works, and I do this: SELECT * FROM `account` where DATE(created_at) = DATE(NOW()) But I don't know how to do to get the last 7days account. I tried something like this, but without success: SELECT * FROM `a... | in mysql: SELECT * FROM `account` WHERE DATE(created_at) > (NOW() - INTERVAL 7 DAY) | How to do : "Between TODAY AND TODAY-7"? I need to find the account created for the current day, et for the last 7 days. To find my results for today, it works, and I do this: SELECT * FROM `account` where DATE(created_at) = DATE(NOW()) But I don't know how to do to get the last 7days account. I tried something like th... | TITLE:
How to do : "Between TODAY AND TODAY-7"?
QUESTION:
I need to find the account created for the current day, et for the last 7 days. To find my results for today, it works, and I do this: SELECT * FROM `account` where DATE(created_at) = DATE(NOW()) But I don't know how to do to get the last 7days account. I tried... | [
"mysql",
"sql"
] | 10 | 36 | 43,518 | 4 | 0 | 2011-06-08T09:27:46.170000 | 2011-06-08T09:31:53.137000 |
6,276,692 | 6,276,751 | How to emulate constructor or static block in C | I am enhancing a tool. Please note that this tool will be linked to test program, which will have main( ) function, so my tool can't have main. What this tool has is a number of functions which the test program will use. Now additionally, i want to add a timer to this tool. The idea is: when the test program is linked ... | This looks like your case also: How do I get the GCC __attribute__ ((constructor)) to work under OSX? From GCC docs: constructor destructor constructor (priority) destructor (priority) The constructor attribute causes the function to be called automatically before execution enters main (). Similarly, the destructor att... | How to emulate constructor or static block in C I am enhancing a tool. Please note that this tool will be linked to test program, which will have main( ) function, so my tool can't have main. What this tool has is a number of functions which the test program will use. Now additionally, i want to add a timer to this too... | TITLE:
How to emulate constructor or static block in C
QUESTION:
I am enhancing a tool. Please note that this tool will be linked to test program, which will have main( ) function, so my tool can't have main. What this tool has is a number of functions which the test program will use. Now additionally, i want to add a... | [
"c",
"linux",
"unix",
"static",
"constructor"
] | 3 | 4 | 303 | 2 | 0 | 2011-06-08T09:28:25.913000 | 2011-06-08T09:34:17.427000 |
6,276,698 | 6,286,805 | Dealing with large shapefiles on R | Good afternoon: I have been studying R for a while, however now I'm working with large shapefiles, the size of these files is bigger than 600 Mb. I have a computer with 200GB free and 12 GB in RAM, I want to ask if somebody knows how to deal with these files?. I really appreciate your kind help. | With the latest version of 64-bit R, and the latest version of rgdal just try reading it in: library(rgdal) shpdata <- readOGR("/path/to/shpfolder/", "shpfilename") Where "shpfilename" is the filename without the extension. If that fails update your question with details of what you did, what you saw, details of the fi... | Dealing with large shapefiles on R Good afternoon: I have been studying R for a while, however now I'm working with large shapefiles, the size of these files is bigger than 600 Mb. I have a computer with 200GB free and 12 GB in RAM, I want to ask if somebody knows how to deal with these files?. I really appreciate your... | TITLE:
Dealing with large shapefiles on R
QUESTION:
Good afternoon: I have been studying R for a while, however now I'm working with large shapefiles, the size of these files is bigger than 600 Mb. I have a computer with 200GB free and 12 GB in RAM, I want to ask if somebody knows how to deal with these files?. I real... | [
"r",
"large-files",
"shapefile"
] | 0 | 2 | 3,723 | 2 | 0 | 2011-06-08T09:29:09.317000 | 2011-06-09T00:26:17.153000 |
6,276,701 | 6,276,725 | How to include every option of CHOICE command in BAT file in a new line? | I want to put every option of CHOICE command in a new line. e.g CHOICE /N /C:123 /M "1 - one \n 2 - two \n 3 - three" but this gives me the prompt: 1 - one \n 2 - two \n 3 - three How can I put these options shown on the prompt in different lines? Like this: 1 - one 2 - two 3 - three | echo 1 - one echo 2 - two echo 3 - three choice /n /c:123 Quite simple, isn't it?:-) | How to include every option of CHOICE command in BAT file in a new line? I want to put every option of CHOICE command in a new line. e.g CHOICE /N /C:123 /M "1 - one \n 2 - two \n 3 - three" but this gives me the prompt: 1 - one \n 2 - two \n 3 - three How can I put these options shown on the prompt in different lines?... | TITLE:
How to include every option of CHOICE command in BAT file in a new line?
QUESTION:
I want to put every option of CHOICE command in a new line. e.g CHOICE /N /C:123 /M "1 - one \n 2 - two \n 3 - three" but this gives me the prompt: 1 - one \n 2 - two \n 3 - three How can I put these options shown on the prompt i... | [
"batch-file"
] | 1 | 6 | 2,164 | 1 | 0 | 2011-06-08T09:29:26.823000 | 2011-06-08T09:31:54.900000 |
6,276,703 | 6,287,754 | nodejs - mongodb - Cannot call method 'collection' of null | I'm trying to query database everytime users input messages, nodejs complains "Cannot call method 'collection' of null" Below is the code I think the problem comes from. var mongo = require('mongodb');
var db = new mongo.Db('chat', new mongo.Server('127.0.0.1', '27017', {native_parser:true})); //testting querying mong... | db.open(function(err, db){ socket.on('connection', function(client) { }); }); }); As Raynos suggested putting db.open in outer of closure will solve the problem. | nodejs - mongodb - Cannot call method 'collection' of null I'm trying to query database everytime users input messages, nodejs complains "Cannot call method 'collection' of null" Below is the code I think the problem comes from. var mongo = require('mongodb');
var db = new mongo.Db('chat', new mongo.Server('127.0.0.1'... | TITLE:
nodejs - mongodb - Cannot call method 'collection' of null
QUESTION:
I'm trying to query database everytime users input messages, nodejs complains "Cannot call method 'collection' of null" Below is the code I think the problem comes from. var mongo = require('mongodb');
var db = new mongo.Db('chat', new mongo.... | [
"mongodb",
"node.js"
] | 4 | 2 | 6,371 | 2 | 0 | 2011-06-08T09:29:29.050000 | 2011-06-09T03:18:53.460000 |
6,276,705 | 6,276,721 | update time in mysql database | I am newbie to php and I am doing an application in php using class and objects.Now I have a database where I have the fields for Created_at and updated_at. So can someone tell me how to get the created time and insert created and updated time in the database? | NOW() will help you out =) You can also try out CURDATE and CURTIME SELECT NOW(),CURDATE(),CURTIME() | update time in mysql database I am newbie to php and I am doing an application in php using class and objects.Now I have a database where I have the fields for Created_at and updated_at. So can someone tell me how to get the created time and insert created and updated time in the database? | TITLE:
update time in mysql database
QUESTION:
I am newbie to php and I am doing an application in php using class and objects.Now I have a database where I have the fields for Created_at and updated_at. So can someone tell me how to get the created time and insert created and updated time in the database?
ANSWER:
NO... | [
"php",
"mysql"
] | 0 | 2 | 1,488 | 2 | 0 | 2011-06-08T09:29:41.630000 | 2011-06-08T09:31:20.683000 |
6,276,714 | 6,276,797 | Mimic a slow internet connection (mac) | Anyone have a good technique for checking sites over a slower connection on osx? Looking at posts on here, some people have recommended sloppy, which doesn't appear to do anything, just loads sites at normal speed. Any other techniques out there? I have 50mb broadband and it's difficult to judge page speeds at the mome... | Video demo of Dummynet used to throttle IP video streaming on OSX. According to the website, it is already installed in a standard OSX. As Jeff Foster mentioned, the same question is on SuperUser. There I also found ThrottledCLI suggested by Robbie. | Mimic a slow internet connection (mac) Anyone have a good technique for checking sites over a slower connection on osx? Looking at posts on here, some people have recommended sloppy, which doesn't appear to do anything, just loads sites at normal speed. Any other techniques out there? I have 50mb broadband and it's dif... | TITLE:
Mimic a slow internet connection (mac)
QUESTION:
Anyone have a good technique for checking sites over a slower connection on osx? Looking at posts on here, some people have recommended sloppy, which doesn't appear to do anything, just loads sites at normal speed. Any other techniques out there? I have 50mb broa... | [
"performance",
"macos",
"broadband"
] | 5 | 1 | 829 | 2 | 0 | 2011-06-08T09:30:42.953000 | 2011-06-08T09:39:30.127000 |
6,276,718 | 6,276,839 | Modify datasource row values during databind in gridview | I have a grid view which I am binding with data table. My problem is data table has integer values as 1,2,3,4,5. For all these values I want to bind A,B,C,D,E respectively in grid view. I am using bound fields. I dont know where to modify data coming from data table?? | Make that column to Template column and put label and then you do it in RowDataBound event of Gridview protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { DataRow dr = ((DataRowView)e.Row.DataItem).Row; if(dr["ColumnName"].ToString() == "1" )... | Modify datasource row values during databind in gridview I have a grid view which I am binding with data table. My problem is data table has integer values as 1,2,3,4,5. For all these values I want to bind A,B,C,D,E respectively in grid view. I am using bound fields. I dont know where to modify data coming from data ta... | TITLE:
Modify datasource row values during databind in gridview
QUESTION:
I have a grid view which I am binding with data table. My problem is data table has integer values as 1,2,3,4,5. For all these values I want to bind A,B,C,D,E respectively in grid view. I am using bound fields. I dont know where to modify data c... | [
"c#",
".net",
"asp.net",
"gridview"
] | 2 | 5 | 8,762 | 1 | 0 | 2011-06-08T09:30:55.293000 | 2011-06-08T09:43:02.960000 |
6,276,730 | 6,277,591 | Getting UDP traffic statistic between particular hosts on Linux | I need to gather some network statistic to test my server application. I've tried many linux tools, but nothing I've found suits my needs. Basically I want to gather some UDP statistics (bytes/time_interval, packets/time_interval, packets_loss), but regarding only two particular hosts - for example I want to get UDP st... | Here's a tutorial for the libpcap library: http://www.systhread.net/texts/200805lpcap1.php To determine packets lost, your program will probably want to work on a pair of logs, and make sure UDP messages on the source are found on the destination. A good method for doing this is to maintain a window of packets equal to... | Getting UDP traffic statistic between particular hosts on Linux I need to gather some network statistic to test my server application. I've tried many linux tools, but nothing I've found suits my needs. Basically I want to gather some UDP statistics (bytes/time_interval, packets/time_interval, packets_loss), but regard... | TITLE:
Getting UDP traffic statistic between particular hosts on Linux
QUESTION:
I need to gather some network statistic to test my server application. I've tried many linux tools, but nothing I've found suits my needs. Basically I want to gather some UDP statistics (bytes/time_interval, packets/time_interval, packets... | [
"linux",
"networking",
"statistics",
"udp"
] | 1 | 0 | 770 | 1 | 0 | 2011-06-08T09:32:10.307000 | 2011-06-08T10:53:01 |
6,276,746 | 6,276,923 | Handling exceptions in .NET (GUI) event functions without excessive boilerplate? | Note: I don't do.NET programming regularly. Normally I do native/MFC, so I'm a bit lost as how to do this properly in the context of C#. We're displaying.NET control in the context of a native MFC application. That means the GUI thread is a native thread calling into the WndProc of the.NET control. (Well, at least as f... | You can reduce boilerplate code by using a functional approach. Write a function like this: public class Util { public static void SafeCall(Action handler) { try { handler(); } catch(Exception ex) { // process ex here } } And reuse it in every of your GUI event handlers: void MyEvent(object sender, EventArgs e) { Util.... | Handling exceptions in .NET (GUI) event functions without excessive boilerplate? Note: I don't do.NET programming regularly. Normally I do native/MFC, so I'm a bit lost as how to do this properly in the context of C#. We're displaying.NET control in the context of a native MFC application. That means the GUI thread is ... | TITLE:
Handling exceptions in .NET (GUI) event functions without excessive boilerplate?
QUESTION:
Note: I don't do.NET programming regularly. Normally I do native/MFC, so I'm a bit lost as how to do this properly in the context of C#. We're displaying.NET control in the context of a native MFC application. That means ... | [
".net",
"user-interface",
"exception",
"mfc"
] | 2 | 2 | 252 | 1 | 0 | 2011-06-08T09:33:38.300000 | 2011-06-08T09:48:13.023000 |
6,276,752 | 6,290,646 | Can I split an already split hunk with git? | I've recently discovered git's patch option to the add command, and I must say it really is a fantastic feature. I also discovered that a large hunk could be split into smaller hunks by hitting the s key, which adds to the precision of the commit. But what if I want even more precision, if the split hunk is not small e... | If you're using git add -p and even after splitting with s, you don't have a small enough change, you can use e to edit the patch directly. This can be a little confusing, but if you carefully follow the instructions in the editor window that will be opened up after pressing e then you'll be fine. In the case you've qu... | Can I split an already split hunk with git? I've recently discovered git's patch option to the add command, and I must say it really is a fantastic feature. I also discovered that a large hunk could be split into smaller hunks by hitting the s key, which adds to the precision of the commit. But what if I want even more... | TITLE:
Can I split an already split hunk with git?
QUESTION:
I've recently discovered git's patch option to the add command, and I must say it really is a fantastic feature. I also discovered that a large hunk could be split into smaller hunks by hitting the s key, which adds to the precision of the commit. But what i... | [
"git",
"split",
"addition",
"patch"
] | 256 | 319 | 56,302 | 4 | 0 | 2011-06-08T09:34:18.990000 | 2011-06-09T09:22:06.820000 |
6,276,753 | 6,276,787 | LINQ To XML Query using descendatns | I want to query the following xml file using LINQ To XML x y x Im trying to get all cell nodes that have a descendant with the value 'x'. In this example two cell nodes should be returned | You can use the Any extension method to see if any of the descendents of cell have the correct value. XDocument doc = XDocument.Load("somefile.xml"); var cells = from cell in doc.Descendants("cell") where cell.Descendants().Any(v => v.Value == "x") select cell; | LINQ To XML Query using descendatns I want to query the following xml file using LINQ To XML x y x Im trying to get all cell nodes that have a descendant with the value 'x'. In this example two cell nodes should be returned | TITLE:
LINQ To XML Query using descendatns
QUESTION:
I want to query the following xml file using LINQ To XML x y x Im trying to get all cell nodes that have a descendant with the value 'x'. In this example two cell nodes should be returned
ANSWER:
You can use the Any extension method to see if any of the descendents... | [
"c#",
"linq-to-xml"
] | 0 | 1 | 82 | 1 | 0 | 2011-06-08T09:34:26.757000 | 2011-06-08T09:38:25.767000 |
6,276,755 | 6,277,960 | Improve S3 image uploads | I have thousands of image upload to s3. I want to know the best way to do. I use the ruby gem "aws/s3", but it seems not to upload asynchronously. Should i use threads to do? Any suggestions? | I use transmit for ftp and they have a connector to s3. You might try that for uploading large numbers of files. | Improve S3 image uploads I have thousands of image upload to s3. I want to know the best way to do. I use the ruby gem "aws/s3", but it seems not to upload asynchronously. Should i use threads to do? Any suggestions? | TITLE:
Improve S3 image uploads
QUESTION:
I have thousands of image upload to s3. I want to know the best way to do. I use the ruby gem "aws/s3", but it seems not to upload asynchronously. Should i use threads to do? Any suggestions?
ANSWER:
I use transmit for ftp and they have a connector to s3. You might try that f... | [
"ruby",
"amazon-s3",
"amazon-web-services"
] | 1 | 0 | 348 | 2 | 0 | 2011-06-08T09:34:35.633000 | 2011-06-08T11:22:39.683000 |
6,276,758 | 6,276,891 | Using Tiny MCE, but emails are not sending formatted? | I am using tiny mce in a text box and trying to send emails. but the email which is sent is not formatted.. hello > it shouldnt say all that? just hello with a red background? Sub SendEmail(ByVal sEmailAddressFrom As String, ByVal sEmailAddressTo As String, ByVal sSubject As String, ByVal sBody As String) Dim msg As Ne... | ok, as I suspected.... Add the following to your code, and it should work... Sub SendEmail(ByVal sEmailAddressFrom As String, ByVal sEmailAddressTo As String, ByVal sSubject As String, ByVal sBody As String) Dim msg As New MailMessage msg.To = sEmailAddressTo msg.From = sEmailAddressFrom msg.Body = sBody msg.IsBodyHtml... | Using Tiny MCE, but emails are not sending formatted? I am using tiny mce in a text box and trying to send emails. but the email which is sent is not formatted.. hello > it shouldnt say all that? just hello with a red background? Sub SendEmail(ByVal sEmailAddressFrom As String, ByVal sEmailAddressTo As String, ByVal sS... | TITLE:
Using Tiny MCE, but emails are not sending formatted?
QUESTION:
I am using tiny mce in a text box and trying to send emails. but the email which is sent is not formatted.. hello > it shouldnt say all that? just hello with a red background? Sub SendEmail(ByVal sEmailAddressFrom As String, ByVal sEmailAddressTo A... | [
"asp.net",
"vb.net",
"tinymce"
] | 1 | 3 | 155 | 1 | 0 | 2011-06-08T09:35:11.700000 | 2011-06-08T09:46:14.707000 |
6,276,761 | 6,276,848 | vb6: redimensioning of 2D dynamic array | I am using arrays to store properties of steam according to it's pressure. Right now I have properties of exactly 9 pressures so I'm using static array. I'd like to be more flexible so I'd like to switch to dynamic arrays. When I use ReDim foo(1 to i, 1 to 10) in loop I completely loose all data except last line. When ... | You may only Redim Preserve the final dimension in a VB6 multidimensional array. Here's the info from MSDN: If you include the Preserve keyword, Visual Basic copies the elements from the existing array to the new array. When you use Preserve, you can resize only the last dimension of the array, and for every other dime... | vb6: redimensioning of 2D dynamic array I am using arrays to store properties of steam according to it's pressure. Right now I have properties of exactly 9 pressures so I'm using static array. I'd like to be more flexible so I'd like to switch to dynamic arrays. When I use ReDim foo(1 to i, 1 to 10) in loop I completel... | TITLE:
vb6: redimensioning of 2D dynamic array
QUESTION:
I am using arrays to store properties of steam according to it's pressure. Right now I have properties of exactly 9 pressures so I'm using static array. I'd like to be more flexible so I'd like to switch to dynamic arrays. When I use ReDim foo(1 to i, 1 to 10) i... | [
"arrays",
"multidimensional-array",
"vb6",
"dynamic-arrays"
] | 3 | 7 | 6,909 | 1 | 0 | 2011-06-08T09:35:33.363000 | 2011-06-08T09:43:20.603000 |
6,276,772 | 6,276,788 | LWP::UserAgent post method not return value | Just copy this code from perl cook book 2nd ed pp. 796 it returns: 400 URL must be absolute. What's wrong with this code? #!"c:\strawberry\perl\bin\perl.exe" -w
use 5.006; use strict; use LWP::Simple; use LWP::UserAgent;
my $ua = LWP::UserAgent->new(); my $resp = $ua->post("www.amazon.com/exec/obidos/search-handle-fo... | You forgot the http:// on the front of the URL Well, presumably http://, it might be https://, ftp://, etc, etc. | LWP::UserAgent post method not return value Just copy this code from perl cook book 2nd ed pp. 796 it returns: 400 URL must be absolute. What's wrong with this code? #!"c:\strawberry\perl\bin\perl.exe" -w
use 5.006; use strict; use LWP::Simple; use LWP::UserAgent;
my $ua = LWP::UserAgent->new(); my $resp = $ua->post(... | TITLE:
LWP::UserAgent post method not return value
QUESTION:
Just copy this code from perl cook book 2nd ed pp. 796 it returns: 400 URL must be absolute. What's wrong with this code? #!"c:\strawberry\perl\bin\perl.exe" -w
use 5.006; use strict; use LWP::Simple; use LWP::UserAgent;
my $ua = LWP::UserAgent->new(); my ... | [
"perl",
"lwp-useragent"
] | 1 | 7 | 2,815 | 1 | 0 | 2011-06-08T09:36:34.867000 | 2011-06-08T09:38:30.030000 |
6,276,775 | 6,276,803 | Why does android emulator restore after installing an apk file? | After I installed an apk with the command: "adb install something.apk", I closed emulator and opened it again. I didn't see my app "something" anymore. What's wrong with it? | You could have wiped the user data from your emulator. Make sure you uncheck "Wipe user data" when your start the emulator. | Why does android emulator restore after installing an apk file? After I installed an apk with the command: "adb install something.apk", I closed emulator and opened it again. I didn't see my app "something" anymore. What's wrong with it? | TITLE:
Why does android emulator restore after installing an apk file?
QUESTION:
After I installed an apk with the command: "adb install something.apk", I closed emulator and opened it again. I didn't see my app "something" anymore. What's wrong with it?
ANSWER:
You could have wiped the user data from your emulator. ... | [
"android",
"android-emulator"
] | 0 | 1 | 123 | 2 | 0 | 2011-06-08T09:37:07.317000 | 2011-06-08T09:39:57.053000 |
6,276,776 | 6,276,998 | Best practices for navigations in landscape and portrait mode in UINavigationController | I am developing an iPad application which supports both landscape as well as portrait orientation.I am having two different nib files for my rootviewController. Here is the scenario of the issue - 1.Select an item from root view in portait mode, pushes the next view in portrait. 2.Rotate the device 3.Press back button ... | Use notifications in following methods and set the coordinates in receivedRotate method. -(void)viewWillAppear:(BOOL)animated { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receivedRotate:) name:UIDeviceOrientationDidChangeNotification object:nil]; [[UIDevice currentDevice] beginGeneratingD... | Best practices for navigations in landscape and portrait mode in UINavigationController I am developing an iPad application which supports both landscape as well as portrait orientation.I am having two different nib files for my rootviewController. Here is the scenario of the issue - 1.Select an item from root view in ... | TITLE:
Best practices for navigations in landscape and portrait mode in UINavigationController
QUESTION:
I am developing an iPad application which supports both landscape as well as portrait orientation.I am having two different nib files for my rootviewController. Here is the scenario of the issue - 1.Select an item ... | [
"iphone",
"ios",
"uinavigationcontroller",
"rotation"
] | 1 | 1 | 433 | 3 | 0 | 2011-06-08T09:37:15.350000 | 2011-06-08T09:54:21.827000 |
6,276,783 | 6,276,875 | Get the intent object in an activity | Following is the scenario. 1. My application has 2 activities. 2. Activity-1 creates an intent object and pass this intent to startActivity method to launch Activity-2 3. After startActivity method Activity-1 gets onPause. My question here is that can i get the same intent object in my onPause method without making int... | The onPause method has no arguments. Therefore all objects that it will operate on must either be class members or belong to a global/static object. Is there a reason that you don't want this to be a part of your class? This will be the easiest and proper way to handle the situation. | Get the intent object in an activity Following is the scenario. 1. My application has 2 activities. 2. Activity-1 creates an intent object and pass this intent to startActivity method to launch Activity-2 3. After startActivity method Activity-1 gets onPause. My question here is that can i get the same intent object in... | TITLE:
Get the intent object in an activity
QUESTION:
Following is the scenario. 1. My application has 2 activities. 2. Activity-1 creates an intent object and pass this intent to startActivity method to launch Activity-2 3. After startActivity method Activity-1 gets onPause. My question here is that can i get the sam... | [
"android"
] | 0 | 0 | 567 | 2 | 0 | 2011-06-08T09:37:55.617000 | 2011-06-08T09:45:10.403000 |
6,276,796 | 6,276,917 | python regexp for a few thousand words | I'm trying to find certain keywords in a string with python. The string is something like this: A was changed from B to C all I'm trying to find is the "to C" part, where C is one of many thousand words. This code builds the regexp string: pre_pad = 'to ' regex_string = None for i in words: if regex_string == None: reg... | This is not supposed to be a task you can solve with a huge regexp and expect better performances than this: pre_pad = 'to ' matches = []
for i in words: regex_string = '\\b%s%s(?!-)(?!_)\\b' % (pre_pad, i) for match in re.finditer(r"%s" % regex_string, text): matches.append([match, MATCH_TYPE]) Also if, after profili... | python regexp for a few thousand words I'm trying to find certain keywords in a string with python. The string is something like this: A was changed from B to C all I'm trying to find is the "to C" part, where C is one of many thousand words. This code builds the regexp string: pre_pad = 'to ' regex_string = None for i... | TITLE:
python regexp for a few thousand words
QUESTION:
I'm trying to find certain keywords in a string with python. The string is something like this: A was changed from B to C all I'm trying to find is the "to C" part, where C is one of many thousand words. This code builds the regexp string: pre_pad = 'to ' regex_s... | [
"python",
"regex",
"pattern-matching"
] | 3 | 4 | 1,409 | 5 | 0 | 2011-06-08T09:39:25.820000 | 2011-06-08T09:48:05.750000 |
6,276,805 | 6,277,175 | Installed Tornado and Python but Apache is still handling .py files | How do I get Tornado (or in general another server) to handle the.py files on my host, while Apache still handles the php files? | I've always configured my python scripts inside apache with mod_wsgi. I believe there's no way to relegate to a different server the execution of some domain/filetype. Still, you can make a script to execute whenever an url is called. You can do it in python an call it with mod_wsgi -> wsgi docs | Installed Tornado and Python but Apache is still handling .py files How do I get Tornado (or in general another server) to handle the.py files on my host, while Apache still handles the php files? | TITLE:
Installed Tornado and Python but Apache is still handling .py files
QUESTION:
How do I get Tornado (or in general another server) to handle the.py files on my host, while Apache still handles the php files?
ANSWER:
I've always configured my python scripts inside apache with mod_wsgi. I believe there's no way t... | [
"python",
"apache",
"webserver",
"tornado"
] | 0 | 0 | 855 | 3 | 0 | 2011-06-08T09:39:58.503000 | 2011-06-08T10:09:42.343000 |
6,276,808 | 6,276,854 | mysql_affected_rows() in php | Possible Duplicate: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result I have next class: databaseURL = $dbURL; $this->databaseUName = $dbUserName; $this->databasePWord = $dbPword; $this->databaseName = $dbName; $this->nameOfDbWithWorkers = $nameOfDbWithWorkers; }
function setConnectionToDb(){... | first, use mysql_num_rows for row count, mysql_affected_rows returns number of changed rows, as is written in manual on php.net Get the number of affected rows by the last INSERT, UPDATE, REPLACE or DELETE query associated with link_identifier. second - evry time you are using mysql function, put there link identifier ... | mysql_affected_rows() in php Possible Duplicate: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result I have next class: databaseURL = $dbURL; $this->databaseUName = $dbUserName; $this->databasePWord = $dbPword; $this->databaseName = $dbName; $this->nameOfDbWithWorkers = $nameOfDbWithWorkers; }
... | TITLE:
mysql_affected_rows() in php
QUESTION:
Possible Duplicate: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result I have next class: databaseURL = $dbURL; $this->databaseUName = $dbUserName; $this->databasePWord = $dbPword; $this->databaseName = $dbName; $this->nameOfDbWithWorkers = $nameOf... | [
"php",
"mysql"
] | 1 | 1 | 2,644 | 4 | 0 | 2011-06-08T09:40:11.803000 | 2011-06-08T09:43:37.683000 |
6,276,810 | 6,277,015 | How do I apply an 'advanced' query-based constraint? | I can't find a way to apply an 'advanced' query-based constraint. For example, with the following fictitious schema, how can I enforce that the total percentage of Bob's daily activities does not exceed 100%? I've already looked into trigger constraints but I don't think they're going to do what I want (abort the INSER... | A pl/pgsql-based constraint trigger is what you want. sum() the thing, and check if it is within the defined bounds. If not, raise an exception and the statement will be cancelled. Alternatively, have a normal trigger store/update the total activity in the employee table, and place a constraint on the latter. | How do I apply an 'advanced' query-based constraint? I can't find a way to apply an 'advanced' query-based constraint. For example, with the following fictitious schema, how can I enforce that the total percentage of Bob's daily activities does not exceed 100%? I've already looked into trigger constraints but I don't t... | TITLE:
How do I apply an 'advanced' query-based constraint?
QUESTION:
I can't find a way to apply an 'advanced' query-based constraint. For example, with the following fictitious schema, how can I enforce that the total percentage of Bob's daily activities does not exceed 100%? I've already looked into trigger constra... | [
"postgresql"
] | 3 | 0 | 782 | 2 | 0 | 2011-06-08T09:40:32.633000 | 2011-06-08T09:56:40.717000 |
6,276,819 | 6,276,980 | IOS: two UIAlert with two different delegate methods | I have an UIAlert UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"ok" message:@"Canc?" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:@"Annul", nil]; [alertView show]; [alertView release]; and its delegate method: - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIn... | Simply set a tag to each Alert view and check which one sent the messeg. alertView.tag=0; And then - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { if(alertView.tag==0){
if(buttonIndex == 0)//OK button pressed { //do something } else if(buttonIndex == 1)//Annul button pressed. {... | IOS: two UIAlert with two different delegate methods I have an UIAlert UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"ok" message:@"Canc?" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:@"Annul", nil]; [alertView show]; [alertView release]; and its delegate method: - (void)alertView:(UIAlertView... | TITLE:
IOS: two UIAlert with two different delegate methods
QUESTION:
I have an UIAlert UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"ok" message:@"Canc?" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:@"Annul", nil]; [alertView show]; [alertView release]; and its delegate method: - (void)aler... | [
"objective-c",
"xcode",
"ios",
"uialertview"
] | 8 | 21 | 9,600 | 1 | 0 | 2011-06-08T09:41:26.723000 | 2011-06-08T09:52:39.543000 |
6,276,826 | 6,276,895 | Fetching Remote Images Asynchrounously for an ImageAdapter | I have an Android Gallery ImageAdapter implementation for getView() that looks as follows: public View getView(int arg0, View arg1, ViewGroup arg2) { String strURL = "http://app1.exactdev.co.za/android/celebs/celeb" + (arg0+1) + ".jpg"; Bitmap bm = RemoteBitMapHelper.getRemoteBitMap(strURL); //synchronous request
Imag... | The simple answer is you could put it inside an AsyncTask. Something like the following (untested) public View getView(int arg0, View arg1, ViewGroup arg2) {
final ImageView i = new ImageView(ctx); String url = "http://app1.exactdev.co.za/android/celebs/celeb" + (arg0 + 1) + ".jpg";
new AsyncTask () {
@Override prot... | Fetching Remote Images Asynchrounously for an ImageAdapter I have an Android Gallery ImageAdapter implementation for getView() that looks as follows: public View getView(int arg0, View arg1, ViewGroup arg2) { String strURL = "http://app1.exactdev.co.za/android/celebs/celeb" + (arg0+1) + ".jpg"; Bitmap bm = RemoteBitMap... | TITLE:
Fetching Remote Images Asynchrounously for an ImageAdapter
QUESTION:
I have an Android Gallery ImageAdapter implementation for getView() that looks as follows: public View getView(int arg0, View arg1, ViewGroup arg2) { String strURL = "http://app1.exactdev.co.za/android/celebs/celeb" + (arg0+1) + ".jpg"; Bitmap... | [
"android",
"multithreading",
"asynchronous",
"galleryview"
] | 1 | 1 | 993 | 1 | 0 | 2011-06-08T09:41:59.133000 | 2011-06-08T09:46:39.710000 |
6,276,829 | 6,276,882 | How to access to a NSArray, after extract values from a json file | I'm working with json file and I have saved my response in a NSArray. NSArray *result = [response JSONValue]; NSLog(@"value = %@", result); When I print my array, in console I obtain this: ( { user = { "created_at" = "2011-06-07T16:20:16Z"; id = 1; name = "john"; "updated_at" = "2011-06-07T16:20:16Z"; }; }, { user = { ... | Using Key-Value Coding: NSArray *names = [result valueForKeyPath:@"user.name"]; | How to access to a NSArray, after extract values from a json file I'm working with json file and I have saved my response in a NSArray. NSArray *result = [response JSONValue]; NSLog(@"value = %@", result); When I print my array, in console I obtain this: ( { user = { "created_at" = "2011-06-07T16:20:16Z"; id = 1; name ... | TITLE:
How to access to a NSArray, after extract values from a json file
QUESTION:
I'm working with json file and I have saved my response in a NSArray. NSArray *result = [response JSONValue]; NSLog(@"value = %@", result); When I print my array, in console I obtain this: ( { user = { "created_at" = "2011-06-07T16:20:1... | [
"iphone",
"objective-c",
"json"
] | 1 | 1 | 602 | 4 | 0 | 2011-06-08T09:42:07.417000 | 2011-06-08T09:45:37.857000 |
6,276,835 | 6,276,903 | onclick event pass <li> id or value | I want to pass id or value in onclick event. here is my exiting code. 1 2 here is the javascript code function getPaging(str) { $("#loading-content").load("dataSearch.php?"+str, hideLoader); } | Try like this... 1 2 or unobtrusively $(function() { $("li").on("click",function() { showLoader(); $("#loading-content").load("dataSearch.php?"+this.id, hideLoader); }); }); using just 1 2 | onclick event pass <li> id or value I want to pass id or value in onclick event. here is my exiting code. 1 2 here is the javascript code function getPaging(str) { $("#loading-content").load("dataSearch.php?"+str, hideLoader); } | TITLE:
onclick event pass <li> id or value
QUESTION:
I want to pass id or value in onclick event. here is my exiting code. 1 2 here is the javascript code function getPaging(str) { $("#loading-content").load("dataSearch.php?"+str, hideLoader); }
ANSWER:
Try like this... 1 2 or unobtrusively $(function() { $("li").on(... | [
"jquery",
"events",
"onclick",
"html-lists"
] | 23 | 29 | 213,640 | 4 | 0 | 2011-06-08T09:42:54.667000 | 2011-06-08T09:47:14.393000 |
6,276,840 | 6,277,064 | In Glib 1.2 is it safe to remove items from a hashtable while using g_hash_table_foreach? | When using GLib 1.2's GHashTable with the g_hash_table_foreach() method, is it safe to remove items using the g_hash_table_remove() method? I know that Glib 2.0 provides the g_hash_table_foreach_steal() method, but we're stuck with 1.2 for our build at work. | Well it's not allowed in the current API, so I'd be really surprised if that functionality was there in 1.2. | In Glib 1.2 is it safe to remove items from a hashtable while using g_hash_table_foreach? When using GLib 1.2's GHashTable with the g_hash_table_foreach() method, is it safe to remove items using the g_hash_table_remove() method? I know that Glib 2.0 provides the g_hash_table_foreach_steal() method, but we're stuck wit... | TITLE:
In Glib 1.2 is it safe to remove items from a hashtable while using g_hash_table_foreach?
QUESTION:
When using GLib 1.2's GHashTable with the g_hash_table_foreach() method, is it safe to remove items using the g_hash_table_remove() method? I know that Glib 2.0 provides the g_hash_table_foreach_steal() method, b... | [
"c",
"hashtable",
"glib"
] | 1 | 2 | 301 | 1 | 0 | 2011-06-08T09:43:03.557000 | 2011-06-08T10:00:04.500000 |
6,276,844 | 6,276,904 | Regex extract numer into group | I have simple html code: or it could be: I used ((\d+\.\d+)|(\d+)) star but it extracted me 3 groups, I need one with numeric value. How can I extract 4.5 and 5 in both strings using Regex in one group? Thanks! | Try removing the inner parentheses: (\d+\.\d+|\d+) star Also, you may wish to consider using an HTML parser to extract the attributes first rather than applying the regular expression directly to the raw HTML. | Regex extract numer into group I have simple html code: or it could be: I used ((\d+\.\d+)|(\d+)) star but it extracted me 3 groups, I need one with numeric value. How can I extract 4.5 and 5 in both strings using Regex in one group? Thanks! | TITLE:
Regex extract numer into group
QUESTION:
I have simple html code: or it could be: I used ((\d+\.\d+)|(\d+)) star but it extracted me 3 groups, I need one with numeric value. How can I extract 4.5 and 5 in both strings using Regex in one group? Thanks!
ANSWER:
Try removing the inner parentheses: (\d+\.\d+|\d+) ... | [
"c#",
"javascript",
"asp.net",
"python",
"regex"
] | 1 | 4 | 116 | 3 | 0 | 2011-06-08T09:43:07.037000 | 2011-06-08T09:47:16.140000 |
6,276,849 | 6,276,990 | Change the name of the editor itunes app store | How to change the developer name in the appstore. see attached image | Sorry to say but it can't be edited after creation.You can edit other information but not the first name last name and email address through the developer account. | Change the name of the editor itunes app store How to change the developer name in the appstore. see attached image | TITLE:
Change the name of the editor itunes app store
QUESTION:
How to change the developer name in the appstore. see attached image
ANSWER:
Sorry to say but it can't be edited after creation.You can edit other information but not the first name last name and email address through the developer account. | [
"iphone",
"app-store",
"app-store-connect"
] | 1 | 1 | 559 | 1 | 0 | 2011-06-08T09:43:25.220000 | 2011-06-08T09:53:44.917000 |
6,276,850 | 6,280,220 | How to determine what is making Eclipse slow? | We have rather large code base (150+ projects, 400000+ lines of Java code, some Groovy and Gradle code, some Perl code, some XML, a lot of JSPs etc.). I managed to open all those projects in Spring Tools Studio 2.6 to which I also added some plugins for Groovy, Perl, Checkstyle, PMD. And the problem is that Eclipse is ... | One way to know what Eclipse is doing by enabling debugging. There is some information here about debugging eclipse builders, however the process is generic i.e. you need to start eclipse from command line $eclipsec –debug > log.txt and enable debugging for certain plugins using the.options file. I guess you would want... | How to determine what is making Eclipse slow? We have rather large code base (150+ projects, 400000+ lines of Java code, some Groovy and Gradle code, some Perl code, some XML, a lot of JSPs etc.). I managed to open all those projects in Spring Tools Studio 2.6 to which I also added some plugins for Groovy, Perl, Checks... | TITLE:
How to determine what is making Eclipse slow?
QUESTION:
We have rather large code base (150+ projects, 400000+ lines of Java code, some Groovy and Gradle code, some Perl code, some XML, a lot of JSPs etc.). I managed to open all those projects in Spring Tools Studio 2.6 to which I also added some plugins for Gr... | [
"eclipse",
"performance",
"codebase"
] | 12 | 6 | 8,327 | 3 | 0 | 2011-06-08T09:43:28.377000 | 2011-06-08T14:18:57.493000 |
6,276,853 | 6,277,076 | Using factories to create multiple objects when using Dependency Injection | I am trying to figure out how to create multiple objects when using Dependency Injection. As far as I understand the standard approach is to inject a Factory which is then used to create the objects. The part I struggle with is how the Factory creates the objects. So far I see two possible solutions: The Factory just u... | Although the interface for your factory will be defined at the application level, you would typically define the implementation of that factory class close to your DI configuration, thus as part of your composition root. Although calling the container directly from your code is an implementation of the Service Locator ... | Using factories to create multiple objects when using Dependency Injection I am trying to figure out how to create multiple objects when using Dependency Injection. As far as I understand the standard approach is to inject a Factory which is then used to create the objects. The part I struggle with is how the Factory c... | TITLE:
Using factories to create multiple objects when using Dependency Injection
QUESTION:
I am trying to figure out how to create multiple objects when using Dependency Injection. As far as I understand the standard approach is to inject a Factory which is then used to create the objects. The part I struggle with is... | [
"dependency-injection",
"inversion-of-control",
"ioc-container"
] | 5 | 2 | 1,633 | 2 | 0 | 2011-06-08T09:43:36.587000 | 2011-06-08T10:01:42.043000 |
6,276,878 | 6,276,953 | how to perform action for list view in android | in my app i use list view. in the list view i have three image buttons(play,detail,buy). each image button has individual actions. how can i perform onclick action for each image button in list view. my code: public class AndroidThumbnailList extends ListActivity{.......... public class MyThumbnaildapter extends ArrayA... | You will need to write your own Adapter that inflates the view you want to use, and then assigns an OnClick listener to each of the images. Here is some sample code from one of my projects that does something similar (but with a single checkbox that I add a listener to). public class GroupListAdapter extends BaseAdapte... | how to perform action for list view in android in my app i use list view. in the list view i have three image buttons(play,detail,buy). each image button has individual actions. how can i perform onclick action for each image button in list view. my code: public class AndroidThumbnailList extends ListActivity{............ | TITLE:
how to perform action for list view in android
QUESTION:
in my app i use list view. in the list view i have three image buttons(play,detail,buy). each image button has individual actions. how can i perform onclick action for each image button in list view. my code: public class AndroidThumbnailList extends List... | [
"android"
] | 1 | 2 | 934 | 1 | 0 | 2011-06-08T09:45:25.710000 | 2011-06-08T09:50:32.440000 |
6,276,884 | 6,276,967 | Where do i find a list of dummy credit card numbers? | I have a very simple JS check and i am looking for a list of dummy cc numbers which i can exclude. Just for mastercard AmEx and Visa var dummyCCArr = new Array(); dummyCCArr=["5105105105105100","4111111111111111", "4012888888881881", "378282246310005","5454545454545454","5431111111111111",];
if(jQuery.inArray(cardNo, ... | Different credit card companies use different checksums to do an initial validation of the card (make sure it's a valid format for that brand of card). You can find info here on the different checksums used EDIT: To clarify, I would perhaps validate using this kind of approach, it can't prove the fact that it is a vali... | Where do i find a list of dummy credit card numbers? I have a very simple JS check and i am looking for a list of dummy cc numbers which i can exclude. Just for mastercard AmEx and Visa var dummyCCArr = new Array(); dummyCCArr=["5105105105105100","4111111111111111", "4012888888881881", "378282246310005","54545454545454... | TITLE:
Where do i find a list of dummy credit card numbers?
QUESTION:
I have a very simple JS check and i am looking for a list of dummy cc numbers which i can exclude. Just for mastercard AmEx and Visa var dummyCCArr = new Array(); dummyCCArr=["5105105105105100","4111111111111111", "4012888888881881", "37828224631000... | [
"credit-card"
] | 1 | 4 | 1,609 | 2 | 0 | 2011-06-08T09:45:47.143000 | 2011-06-08T09:51:31.633000 |
6,276,893 | 6,276,921 | Templates befriending each other | I have a ResourcePtr class template and a ResouceManager template. I want the two to befriend one another. If I do the following I get a compilation error; how can I fix this? template class ResourcePtr { friend class ResourceManager; };
template class ResourceManager { friend class ResourcePtr; }; error C2059: syntax... | As usual for mutual things: declare one before the definition of the other. template class ResourceManager;
template class ResourcePtr { friend class ResourceManager; };
template class ResourceManager { friend class ResourcePtr; }; | Templates befriending each other I have a ResourcePtr class template and a ResouceManager template. I want the two to befriend one another. If I do the following I get a compilation error; how can I fix this? template class ResourcePtr { friend class ResourceManager; };
template class ResourceManager { friend class Re... | TITLE:
Templates befriending each other
QUESTION:
I have a ResourcePtr class template and a ResouceManager template. I want the two to befriend one another. If I do the following I get a compilation error; how can I fix this? template class ResourcePtr { friend class ResourceManager; };
template class ResourceManager... | [
"c++",
"templates",
"syntax-error"
] | 2 | 6 | 112 | 1 | 0 | 2011-06-08T09:46:19.220000 | 2011-06-08T09:48:10.970000 |
6,276,922 | 6,277,025 | How can I resolve single quote problem while I insert? | What is the best way to avoid \' while we get the values from PHP post method and want to store in the database. I have used simply, echo $_POST['txtname']; it produces the output Uncl\'es Jules, if enter name as Uncl'es Jules Can any one suggest the better way? | This sounds like you have magic_quotes enabled that's why it is escaping data automagically. You should disable magic_quotes. Here is how you can Escape data with mysql_real_escape_string() while inserting them If magic_quotes is not disabled with any reason you can use stripslashes do remove those extra \. echo strips... | How can I resolve single quote problem while I insert? What is the best way to avoid \' while we get the values from PHP post method and want to store in the database. I have used simply, echo $_POST['txtname']; it produces the output Uncl\'es Jules, if enter name as Uncl'es Jules Can any one suggest the better way? | TITLE:
How can I resolve single quote problem while I insert?
QUESTION:
What is the best way to avoid \' while we get the values from PHP post method and want to store in the database. I have used simply, echo $_POST['txtname']; it produces the output Uncl\'es Jules, if enter name as Uncl'es Jules Can any one suggest ... | [
"php"
] | 0 | 0 | 399 | 4 | 0 | 2011-06-08T09:48:12.413000 | 2011-06-08T09:57:18.347000 |
6,276,924 | 6,278,248 | Problem in calling thread inside Eclipse view run method, after using asyncExec. Invalid Thread Exception | I am having an eclipse View. Inside the view I added a Table. Now I am calling a thread from run method of the view using asyncExec. My View class is like - public class SampleViewAction implements IWorkbenchWindowActionDelegate{
Thread t;
int Count;
@Override
public void run(IAction arg0) {
} } Now I added a thre... | Similar to AWT and the EventDispatchThread, SWT must process everything in the UI thread. Your SampleViewAction is run on the UI thread already, in response to a menu or tool item selection. It looks like your problem comes from then using an asyncExec(*) which will post the runnable to be run on the UI thread (which d... | Problem in calling thread inside Eclipse view run method, after using asyncExec. Invalid Thread Exception I am having an eclipse View. Inside the view I added a Table. Now I am calling a thread from run method of the view using asyncExec. My View class is like - public class SampleViewAction implements IWorkbenchWindow... | TITLE:
Problem in calling thread inside Eclipse view run method, after using asyncExec. Invalid Thread Exception
QUESTION:
I am having an eclipse View. Inside the view I added a Table. Now I am calling a thread from run method of the view using asyncExec. My View class is like - public class SampleViewAction implement... | [
"multithreading",
"eclipse",
"eclipse-plugin",
"eclipse-rcp"
] | 0 | 1 | 947 | 1 | 0 | 2011-06-08T09:48:28.463000 | 2011-06-08T11:49:25.163000 |
6,276,926 | 6,277,091 | element with width 100% and padding | how can you make an element with width 100% and padding fit inside another element without changing the width of the parent? var inp = $(' ').appendTo(' '); | You can't use width: 100% and padding: 4px together in this case. The element will always be 8px wider than its parent. You have to go with pixel values for your input element. In your case it would be width: 192px. The box model always (except some older IE versions) adds the padding (and border) to the elements width... | element with width 100% and padding how can you make an element with width 100% and padding fit inside another element without changing the width of the parent? var inp = $(' ').appendTo(' '); | TITLE:
element with width 100% and padding
QUESTION:
how can you make an element with width 100% and padding fit inside another element without changing the width of the parent? var inp = $(' ').appendTo(' ');
ANSWER:
You can't use width: 100% and padding: 4px together in this case. The element will always be 8px wid... | [
"jquery"
] | 0 | 0 | 406 | 2 | 0 | 2011-06-08T09:48:31.900000 | 2011-06-08T10:02:32.813000 |
6,276,933 | 6,287,820 | GetFilesDir() from NDK? | Is there a way to get the application's directory to save private data to a file for my application directly from the NDK? In other words, I need an equivalent of the Java function mContext.getFilesDir(). I have noted that other posts such as this one: Android NDK Write File mention what is the 'usual' place for this d... | If you are using NativeActivity then you have access from native code to an ANativeActivity instance (see /platforms/android-9/arch-arm/usr/include/android/native_activity.h ) which has internalDataPath and externalDataPath members. | GetFilesDir() from NDK? Is there a way to get the application's directory to save private data to a file for my application directly from the NDK? In other words, I need an equivalent of the Java function mContext.getFilesDir(). I have noted that other posts such as this one: Android NDK Write File mention what is the ... | TITLE:
GetFilesDir() from NDK?
QUESTION:
Is there a way to get the application's directory to save private data to a file for my application directly from the NDK? In other words, I need an equivalent of the Java function mContext.getFilesDir(). I have noted that other posts such as this one: Android NDK Write File me... | [
"android",
"android-ndk"
] | 15 | 7 | 12,013 | 2 | 0 | 2011-06-08T09:49:16.123000 | 2011-06-09T03:29:46.483000 |
6,276,939 | 6,277,163 | Is there an invalid pthread_t id? | I would like to call pthread_join for a given thread id, but only if that thread has been started. The safe solution might be to add a variable to track which thread where started or not. However, I wonder if checking pthread_t variables is possible, something like the following code. pthread_t thr1 = some_invalid_valu... | Your assumption is incorrect to start with. pthread_t objects are opaque. You cannot compare pthread_t types directly in C. You should use pthread_equal instead. Another consideration is that if pthread_create fails, the contents of your pthread_t will be undefined. It may not be set to your invalid value any more. My ... | Is there an invalid pthread_t id? I would like to call pthread_join for a given thread id, but only if that thread has been started. The safe solution might be to add a variable to track which thread where started or not. However, I wonder if checking pthread_t variables is possible, something like the following code. ... | TITLE:
Is there an invalid pthread_t id?
QUESTION:
I would like to call pthread_join for a given thread id, but only if that thread has been started. The safe solution might be to add a variable to track which thread where started or not. However, I wonder if checking pthread_t variables is possible, something like th... | [
"linux",
"pthreads"
] | 58 | 18 | 31,585 | 8 | 0 | 2011-06-08T09:49:42.167000 | 2011-06-08T10:08:40.320000 |
6,276,950 | 6,290,901 | WCF client deadlocking due to callback even when callback IsOneWay | new to WCF. I have a client which is deadlocking when calling a WCF service. The service will invoke a callback to the client at the time of the call which is marked as IsOneWay. I have confirmed that the service is not blocking on the callback. The client then immediately calls the same service again (in a tight loop)... | OK, think I've sussed it. WCF services default to single threaded. All calls and callbacks get marshalled to a single thread (or SynchronizationContext to be more accurate). My app is a single threaded WPF app, so the SynchronizationContext gets set to the dispatch thread. When the callback comes in it tries to marshal... | WCF client deadlocking due to callback even when callback IsOneWay new to WCF. I have a client which is deadlocking when calling a WCF service. The service will invoke a callback to the client at the time of the call which is marked as IsOneWay. I have confirmed that the service is not blocking on the callback. The cli... | TITLE:
WCF client deadlocking due to callback even when callback IsOneWay
QUESTION:
new to WCF. I have a client which is deadlocking when calling a WCF service. The service will invoke a callback to the client at the time of the call which is marked as IsOneWay. I have confirmed that the service is not blocking on the... | [
"wcf",
"callback",
"deadlock"
] | 7 | 21 | 7,668 | 2 | 0 | 2011-06-08T09:50:28.780000 | 2011-06-09T09:44:22.330000 |
6,276,968 | 6,306,648 | How to catch a CListCtrl column width change event? | How can I catch CListCtrl column width change event in MFC? I believe there should be an OnNotify() event but I am note sure about various values and the parameters to use for message map and the event itself. Please note that a CListCtrl column width can change by dragging the column divider or by double clicking on t... | I think the key is to understand that there is a difference in the listcontrol itself, and the header control. By using the GetHeaderCtrl() member function of the listcontrol you can get to the header control. For working with the header control, see this article: http://www.codeproject.com/KB/list/headerctrl.aspx?disp... | How to catch a CListCtrl column width change event? How can I catch CListCtrl column width change event in MFC? I believe there should be an OnNotify() event but I am note sure about various values and the parameters to use for message map and the event itself. Please note that a CListCtrl column width can change by dr... | TITLE:
How to catch a CListCtrl column width change event?
QUESTION:
How can I catch CListCtrl column width change event in MFC? I believe there should be an OnNotify() event but I am note sure about various values and the parameters to use for message map and the event itself. Please note that a CListCtrl column widt... | [
"c++",
"mfc",
"clistctrl"
] | 3 | 3 | 5,033 | 1 | 0 | 2011-06-08T09:51:37.393000 | 2011-06-10T12:54:20.823000 |
6,276,974 | 6,278,127 | Working with Lists, Anonymous Types and Suchlike | Following on from an earlier question, I now have a collection of an anonymous type [User: Username (as forename.surname, UserId ]. This collection of 'users' will ultimately need to be bound to a dropdown list. This is fine, but what I need to do is sort them by Surname and forename. but this is complicated by the fac... | Here's the final solution I came up with - it sorts, ToTitleCase s and formats. Rather nifty if I say so myself. Took me all morning tho:-( var salesusers = ( from s in lstReport group s by new { s.SalesUserId,s.Username} into g select new { Username = g.Key.Username.Split('.')[1].ToTitleCase() + " " + g.Key.Username.S... | Working with Lists, Anonymous Types and Suchlike Following on from an earlier question, I now have a collection of an anonymous type [User: Username (as forename.surname, UserId ]. This collection of 'users' will ultimately need to be bound to a dropdown list. This is fine, but what I need to do is sort them by Surname... | TITLE:
Working with Lists, Anonymous Types and Suchlike
QUESTION:
Following on from an earlier question, I now have a collection of an anonymous type [User: Username (as forename.surname, UserId ]. This collection of 'users' will ultimately need to be bound to a dropdown list. This is fine, but what I need to do is so... | [
"c#",
"list",
"sorting",
"anonymous-types"
] | 0 | 0 | 508 | 2 | 0 | 2011-06-08T09:52:21.553000 | 2011-06-08T11:38:21.753000 |
6,276,975 | 6,277,083 | How a variable binds its value to the DOM? | This might be crazy but it intriguing me for quite some time:) I would like to know how a javascript variable can bind itself do the DOM after it is appended to the body, for example? var p = document.createElement('p'); p.innerHTML = 'Hello World';
document.body.appendChild(p); So now I have this p variable which con... | The binding is created on the first line, where you assign the result of document.createElement to p. This is no different from any other time you assign something to a variable, which always binds the variable name to the value. As far as the script is concerned, there is no other binding occurring. The p is an HTMLEl... | How a variable binds its value to the DOM? This might be crazy but it intriguing me for quite some time:) I would like to know how a javascript variable can bind itself do the DOM after it is appended to the body, for example? var p = document.createElement('p'); p.innerHTML = 'Hello World';
document.body.appendChild(... | TITLE:
How a variable binds its value to the DOM?
QUESTION:
This might be crazy but it intriguing me for quite some time:) I would like to know how a javascript variable can bind itself do the DOM after it is appended to the body, for example? var p = document.createElement('p'); p.innerHTML = 'Hello World';
document... | [
"javascript",
"html",
"dom",
"bind"
] | 5 | 0 | 1,650 | 2 | 0 | 2011-06-08T09:52:24.220000 | 2011-06-08T10:02:12.393000 |
6,276,978 | 6,277,916 | Converting physical path to relative one in respect of http://localhost: | I use asp.net 4 and c#. I have this code that allow me to find the physical path for an image. As you can see I get my machine physical pagh file:///C:. string pathRaw = HttpContext.Current.Request.PhysicalApplicationPath + "Statics\\Cms\\Front-End\\Images\\Raw\\"; Result: file:///C:/......../f005aba1-e286-4d9e-b9db-e6... | The easiest thing to do is get rid of the physical application path. If you cannot do that in your code, just strip it off the pathRaw variable. Like this: public string GetVirtualPath( string physicalPath ) { if (!physicalPath.StartsWith( HttpContext.Current.Request.PhysicalApplicationPath ) ) { throw new InvalidOpera... | Converting physical path to relative one in respect of http://localhost: I use asp.net 4 and c#. I have this code that allow me to find the physical path for an image. As you can see I get my machine physical pagh file:///C:. string pathRaw = HttpContext.Current.Request.PhysicalApplicationPath + "Statics\\Cms\\Front-En... | TITLE:
Converting physical path to relative one in respect of http://localhost:
QUESTION:
I use asp.net 4 and c#. I have this code that allow me to find the physical path for an image. As you can see I get my machine physical pagh file:///C:. string pathRaw = HttpContext.Current.Request.PhysicalApplicationPath + "Stat... | [
"c#",
"asp.net",
"relative-path"
] | 6 | 13 | 18,285 | 5 | 0 | 2011-06-08T09:52:32.813000 | 2011-06-08T11:18:05.550000 |
6,276,979 | 6,278,024 | how to consume webservices from asp.net mvc application | There is a external web services. I can invoke it from my winform application, but I cannot invoke it from my asp.net mvc web application. Error message is like this: System.ServiceModel.EndpointNotFoundException: There was no endpoint listening at http://ihexds.nist.gov:9080/tf6/services/xdsrepositoryb that could acce... | Judging from your comments, I think your problem is proxy server related. I think you're using a proxy server internal to your company. You have to specify in you web.config file that you want the dotnet code to use the credentials you're logged on with. Add this to your web.config and try again: It's also possible tha... | how to consume webservices from asp.net mvc application There is a external web services. I can invoke it from my winform application, but I cannot invoke it from my asp.net mvc web application. Error message is like this: System.ServiceModel.EndpointNotFoundException: There was no endpoint listening at http://ihexds.n... | TITLE:
how to consume webservices from asp.net mvc application
QUESTION:
There is a external web services. I can invoke it from my winform application, but I cannot invoke it from my asp.net mvc web application. Error message is like this: System.ServiceModel.EndpointNotFoundException: There was no endpoint listening ... | [
"asp.net-mvc",
"web-services"
] | 0 | 1 | 2,146 | 1 | 0 | 2011-06-08T09:52:35.440000 | 2011-06-08T11:28:26.190000 |
6,276,986 | 6,278,073 | php high memory problem | Here is the stack of my web app. Simply nginx + php-fpm + php5.3 + mysql + memcache. Recently we deployed some refactored code. Which involves SQL refactoring and caching adjustments. We found that after the deployment, the server load had an sharp growth. The memory usage climbed even sharper. And from the top command... | Create an include file to log the memory usage when the program exits, then map it using auto-prepend. If this were apache, then it'd be safe to write this to stderr and it would appear in the error_log - not sure if this works with nginx: | php high memory problem Here is the stack of my web app. Simply nginx + php-fpm + php5.3 + mysql + memcache. Recently we deployed some refactored code. Which involves SQL refactoring and caching adjustments. We found that after the deployment, the server load had an sharp growth. The memory usage climbed even sharper. ... | TITLE:
php high memory problem
QUESTION:
Here is the stack of my web app. Simply nginx + php-fpm + php5.3 + mysql + memcache. Recently we deployed some refactored code. Which involves SQL refactoring and caching adjustments. We found that after the deployment, the server load had an sharp growth. The memory usage clim... | [
"php",
"memory"
] | 7 | 1 | 1,051 | 2 | 0 | 2011-06-08T09:53:13.887000 | 2011-06-08T11:33:09.583000 |
6,276,992 | 6,277,007 | Mysql data type for multiple decimal points | I need to store some data in the following format: 1.2 1.2.1 1.2.2 1.3 etc.. I highly suspect that I must use varchar for this, but my guy says that it's still some kind of int. It's for a catalogue hierarchy system. Google is leading me no where.. Anyone done this before? | I don't think there is a numeric format that works for these. Abusing a DECIMAL won't lead anywhere, as you won't be able to tell apart 1.2.11 and 12.1.1. I would store them in a VARCHAR. | Mysql data type for multiple decimal points I need to store some data in the following format: 1.2 1.2.1 1.2.2 1.3 etc.. I highly suspect that I must use varchar for this, but my guy says that it's still some kind of int. It's for a catalogue hierarchy system. Google is leading me no where.. Anyone done this before? | TITLE:
Mysql data type for multiple decimal points
QUESTION:
I need to store some data in the following format: 1.2 1.2.1 1.2.2 1.3 etc.. I highly suspect that I must use varchar for this, but my guy says that it's still some kind of int. It's for a catalogue hierarchy system. Google is leading me no where.. Anyone do... | [
"mysql"
] | 1 | 2 | 1,695 | 3 | 0 | 2011-06-08T09:53:53.543000 | 2011-06-08T09:55:28.220000 |
6,277,013 | 6,277,824 | accessorytype of uitableview doesn't appear | I allowed selection in edit mode using allowsSelectionDuringEditing = YES; but at selection I want to add accessory the cell the problem is that the accessory doesn't appear I change it in cellForRowAtIndexPath if (self.editing) {
NSLog(@" Editing mode ");
cell.accessoryType = UITableViewCellAccessoryDetailDisclosure... | use editingAccessoryType instead of accessoryType More details at http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UITableViewCell_Class/Reference/Reference.html | accessorytype of uitableview doesn't appear I allowed selection in edit mode using allowsSelectionDuringEditing = YES; but at selection I want to add accessory the cell the problem is that the accessory doesn't appear I change it in cellForRowAtIndexPath if (self.editing) {
NSLog(@" Editing mode ");
cell.accessoryTyp... | TITLE:
accessorytype of uitableview doesn't appear
QUESTION:
I allowed selection in edit mode using allowsSelectionDuringEditing = YES; but at selection I want to add accessory the cell the problem is that the accessory doesn't appear I change it in cellForRowAtIndexPath if (self.editing) {
NSLog(@" Editing mode ");
... | [
"iphone",
"ipad"
] | 1 | 5 | 576 | 1 | 0 | 2011-06-08T09:56:21.233000 | 2011-06-08T11:11:20.563000 |
6,277,022 | 6,277,081 | Regex: Not matching a list of words | I'm looking to apply a regular expression to an input string to make sure it doesn’t match a list of predefined values. For example, if I pass in the word Dog, I don’t want it to match. Likewise for Cat. However, if I pass in Sheep, it should match. I’ve tried: ^(?!(Dog)|(Cat))$ << Doesn’t match Dog, Cat or sheep! ^((?... | The lookahead assertions doesn't match anything. after closing it you need to match the characters, so try e.g. ^(?!.*Dog)(?!.*cat).*$ See it here at Regexr They are described here in detail on msdn If you want to match those words exactly then use word boundaries like this ^(?!.*\bDog\b)(?!.*\bCat\b).*$ Regexr The \b ... | Regex: Not matching a list of words I'm looking to apply a regular expression to an input string to make sure it doesn’t match a list of predefined values. For example, if I pass in the word Dog, I don’t want it to match. Likewise for Cat. However, if I pass in Sheep, it should match. I’ve tried: ^(?!(Dog)|(Cat))$ << D... | TITLE:
Regex: Not matching a list of words
QUESTION:
I'm looking to apply a regular expression to an input string to make sure it doesn’t match a list of predefined values. For example, if I pass in the word Dog, I don’t want it to match. Likewise for Cat. However, if I pass in Sheep, it should match. I’ve tried: ^(?!... | [
"c#",
"regex"
] | 5 | 15 | 18,569 | 2 | 0 | 2011-06-08T09:57:15.263000 | 2011-06-08T10:02:04.730000 |
6,277,023 | 6,277,149 | Any way to stop the page BEHIND jquery tools overlay from scrolling? | I'm using jquery tools overlay and it's great. However, the scrolling behavior is a little strange. If you open an overlay and put your mouse over it, you can still scroll the page behind it if you're at the top/bottom of the overlay. Is there a way (preferably a jquery tools built in way) to prevent the page BEHIND th... | Not used jquery tools but when showing a ui dialog it is common to do the following to prevent the screen scrolling. $("body").css("overflow", "hidden"); You could also add an event to the window scroll to prevent scrolling as this SO answer describes and also this article | Any way to stop the page BEHIND jquery tools overlay from scrolling? I'm using jquery tools overlay and it's great. However, the scrolling behavior is a little strange. If you open an overlay and put your mouse over it, you can still scroll the page behind it if you're at the top/bottom of the overlay. Is there a way (... | TITLE:
Any way to stop the page BEHIND jquery tools overlay from scrolling?
QUESTION:
I'm using jquery tools overlay and it's great. However, the scrolling behavior is a little strange. If you open an overlay and put your mouse over it, you can still scroll the page behind it if you're at the top/bottom of the overlay... | [
"jquery",
"jquery-ui"
] | 2 | 7 | 6,394 | 4 | 0 | 2011-06-08T09:57:16.280000 | 2011-06-08T10:07:21.367000 |
6,277,029 | 6,277,616 | Postgres COPY file with encoding LATIN1 into table with encoding UTF | I have a problem during bulk insert. I'm trying do bulk insert from file with encoding LATIN1 into table where database with encoding UTF8. invalid byte sequence for encoding "UTF8": 0xc33f When I do SET CLIENT_ENCODING='LATIN1' and after do COPY from console, it works OK. but JDBC say me that he can't do SET CLIENT_EN... | Try to set allowEncodingChanges connection parameter to true to allow (temporarily) changing client encoding to LATIN1. According to Table 22-2 PostgreSQL should handle automatic character set conversion between LATIN1 (client) and UTF8 (server). The client_encoding setting is set by the driver and should not be altere... | Postgres COPY file with encoding LATIN1 into table with encoding UTF I have a problem during bulk insert. I'm trying do bulk insert from file with encoding LATIN1 into table where database with encoding UTF8. invalid byte sequence for encoding "UTF8": 0xc33f When I do SET CLIENT_ENCODING='LATIN1' and after do COPY from... | TITLE:
Postgres COPY file with encoding LATIN1 into table with encoding UTF
QUESTION:
I have a problem during bulk insert. I'm trying do bulk insert from file with encoding LATIN1 into table where database with encoding UTF8. invalid byte sequence for encoding "UTF8": 0xc33f When I do SET CLIENT_ENCODING='LATIN1' and ... | [
"sql",
"postgresql",
"encoding",
"copy",
"bulkinsert"
] | 5 | 5 | 8,102 | 1 | 0 | 2011-06-08T09:57:48.383000 | 2011-06-08T10:55:05.177000 |
6,277,034 | 6,277,140 | MSSQL 2008 get all levels of item | say I have xml in a SQL xml type field e.g. @x=' ' How would I go about getting nth level items in a query? Obviously to get the first level you would use; select t.p.query('.') from @x.nodes('/root/item') t(p) and to get the next level as well you would add cross apply @x.nodes('/root/item/item') but at runtime we do ... | If you want all item nodes you can do like this select t.p.query('.') from @x.nodes('//item') t(p) Result: (No column name) If you want only the innermost item node you can do like this select t.p.query('.') from @x.nodes('//item[count(item) = 0]') t(p) Result: (No column name) | MSSQL 2008 get all levels of item say I have xml in a SQL xml type field e.g. @x=' ' How would I go about getting nth level items in a query? Obviously to get the first level you would use; select t.p.query('.') from @x.nodes('/root/item') t(p) and to get the next level as well you would add cross apply @x.nodes('/root... | TITLE:
MSSQL 2008 get all levels of item
QUESTION:
say I have xml in a SQL xml type field e.g. @x=' ' How would I go about getting nth level items in a query? Obviously to get the first level you would use; select t.p.query('.') from @x.nodes('/root/item') t(p) and to get the next level as well you would add cross app... | [
"t-sql",
"xquery-sql"
] | 2 | 2 | 133 | 1 | 0 | 2011-06-08T09:58:07.383000 | 2011-06-08T10:06:45.397000 |
6,277,036 | 6,277,120 | Not able to capture the error in store procedure in sql server | the body of my SP as follow...when i trying to run it then i am getting error. i just do not understand why error thrown...where the actual error is. please help me. Create table #jobs (id int identity(1,1),Specialist varchar(50),JID int) insert into #jobs values('ANA', 1) insert into #jobs values('ANA', 5) insert into... | you cannot Assign default values to Local Variables... so just remove the "= 0" from this line: declare @i smallint, @j smallint = 0; with ct.... so it reads... declare @i smallint, @j smallint; with ct.... HTH. Dave PS... don't forget to Drop your Temp Table when you finished with it... | Not able to capture the error in store procedure in sql server the body of my SP as follow...when i trying to run it then i am getting error. i just do not understand why error thrown...where the actual error is. please help me. Create table #jobs (id int identity(1,1),Specialist varchar(50),JID int) insert into #jobs ... | TITLE:
Not able to capture the error in store procedure in sql server
QUESTION:
the body of my SP as follow...when i trying to run it then i am getting error. i just do not understand why error thrown...where the actual error is. please help me. Create table #jobs (id int identity(1,1),Specialist varchar(50),JID int) ... | [
"sql-server",
"t-sql"
] | 0 | 2 | 88 | 2 | 0 | 2011-06-08T09:58:18.967000 | 2011-06-08T10:05:18.200000 |
6,277,041 | 6,277,089 | Read a TXT file containing two integer columns and save into two arrays in java | I have a text file containing the following content: 0 12 1 15 2 6 3 4 4 3 5 6 6 12 7 8 8 8 9 9 10 13 I want to read these integers from data.txt file and save the two columns into two different arrays in Java. I am a beginner in Java, and thank you for your help. | Unless you know the number of lines in the file in advance, I suggest you collect the numbers in two Lists, such as ArrayList. Something like this should do the trick: List l1 = new ArrayList (); List l2 = new ArrayList ();
Scanner s = new Scanner(new FileReader("filename.txt"));
while (s.hasNext()) { l1.add(s.nextIn... | Read a TXT file containing two integer columns and save into two arrays in java I have a text file containing the following content: 0 12 1 15 2 6 3 4 4 3 5 6 6 12 7 8 8 8 9 9 10 13 I want to read these integers from data.txt file and save the two columns into two different arrays in Java. I am a beginner in Java, and ... | TITLE:
Read a TXT file containing two integer columns and save into two arrays in java
QUESTION:
I have a text file containing the following content: 0 12 1 15 2 6 3 4 4 3 5 6 6 12 7 8 8 8 9 9 10 13 I want to read these integers from data.txt file and save the two columns into two different arrays in Java. I am a begi... | [
"java",
"parsing"
] | 3 | 5 | 4,174 | 1 | 0 | 2011-06-08T09:58:30.827000 | 2011-06-08T10:02:30.170000 |
6,277,043 | 6,277,068 | Measuring memory and CPU used by a Java console application with java.lang.management | I need to measure how much memory and CPU my application is using at the moment, and I need to measure that from the very same application. Any advices how to do that? I've been using jconsole, but I can't find an API which would enable me to use it from a console application. Thanks. EDIT: As the user aix recommended,... | It sounds like you're looking for the Java Virtual Machine Monitoring and Management API. In particular, take a look at MemoryMXBean and ThreadMXBean. | Measuring memory and CPU used by a Java console application with java.lang.management I need to measure how much memory and CPU my application is using at the moment, and I need to measure that from the very same application. Any advices how to do that? I've been using jconsole, but I can't find an API which would enab... | TITLE:
Measuring memory and CPU used by a Java console application with java.lang.management
QUESTION:
I need to measure how much memory and CPU my application is using at the moment, and I need to measure that from the very same application. Any advices how to do that? I've been using jconsole, but I can't find an AP... | [
"java",
"performance",
"monitoring"
] | 1 | 3 | 664 | 1 | 0 | 2011-06-08T09:58:45.023000 | 2011-06-08T10:00:52.060000 |
6,277,058 | 6,277,073 | passing variables through url in DRUPAL | Whenever I try to pass a variable through url with the l() function like: l(t($row['salon_name']),'admin/content/edit-salons-products-services?sid='.$row[salon_id] );? is replaced by "%3F" = is replaced by "%3D" Why is this happening and how can I fix it? | Change it to: 'admin/content/edit-salons-products-services/.$row[salon_id]'. You can access the salon id with arg(3). You may also need to change your module's menu declaration to allow this URL. | passing variables through url in DRUPAL Whenever I try to pass a variable through url with the l() function like: l(t($row['salon_name']),'admin/content/edit-salons-products-services?sid='.$row[salon_id] );? is replaced by "%3F" = is replaced by "%3D" Why is this happening and how can I fix it? | TITLE:
passing variables through url in DRUPAL
QUESTION:
Whenever I try to pass a variable through url with the l() function like: l(t($row['salon_name']),'admin/content/edit-salons-products-services?sid='.$row[salon_id] );? is replaced by "%3F" = is replaced by "%3D" Why is this happening and how can I fix it?
ANSWE... | [
"php",
"drupal",
"drupal-6"
] | 1 | 1 | 4,729 | 2 | 0 | 2011-06-08T09:59:27.167000 | 2011-06-08T10:01:34.203000 |
6,277,065 | 6,277,775 | How to Create Something Like This | I am making a restaurant directory for IPhone. I am using the map view frame work in iPhone. Well the pins got cluttered together. That's especially true when a bunch of restaurants are in a mall, for example. Now my friend suggested that I do something like: That looks awesomely cool if only it's possible. Is it? How ... | if i get to do something like this i will do like as, KFC,Burger King,sushi tel have same address so while the annotationview clicked i will add subview Custom tableview with custom cell to the view. here i will construct the data(array) for the tableview according to the comparison of all annotations exact address or ... | How to Create Something Like This I am making a restaurant directory for IPhone. I am using the map view frame work in iPhone. Well the pins got cluttered together. That's especially true when a bunch of restaurants are in a mall, for example. Now my friend suggested that I do something like: That looks awesomely cool ... | TITLE:
How to Create Something Like This
QUESTION:
I am making a restaurant directory for IPhone. I am using the map view frame work in iPhone. Well the pins got cluttered together. That's especially true when a bunch of restaurants are in a mall, for example. Now my friend suggested that I do something like: That loo... | [
"objective-c",
"xcode4",
"mkmapview"
] | 0 | 1 | 92 | 2 | 0 | 2011-06-08T10:00:43.070000 | 2011-06-08T11:07:00.410000 |
6,277,066 | 6,277,128 | Why should you “NEVER use height in px on anything with text inside”? | In the presentation 'Maintainable CSS' by Natalie Downe, I have seen a recommendation that says: "be afraid of heights, vertigo is healthy on the web. NEVER use height in px on anything with text inside" Why is that? | I'm guessing it's due to two reasons: Web documents are supposed to be fluid. What happens if you have a fixed height and you need to add or remove text later? Font size can be changed by the user. Regarding why the presenter singled out pixels specifically: heights in px don't scale with the font size, while at least ... | Why should you “NEVER use height in px on anything with text inside”? In the presentation 'Maintainable CSS' by Natalie Downe, I have seen a recommendation that says: "be afraid of heights, vertigo is healthy on the web. NEVER use height in px on anything with text inside" Why is that? | TITLE:
Why should you “NEVER use height in px on anything with text inside”?
QUESTION:
In the presentation 'Maintainable CSS' by Natalie Downe, I have seen a recommendation that says: "be afraid of heights, vertigo is healthy on the web. NEVER use height in px on anything with text inside" Why is that?
ANSWER:
I'm gu... | [
"html",
"css"
] | 5 | 5 | 164 | 4 | 0 | 2011-06-08T10:00:47.113000 | 2011-06-08T10:05:53.680000 |
6,277,074 | 6,287,310 | How do I make PHP and IOS Iphone talk together with encryption? | Im looking what is the good way to make talk an iphone apps with a php server, with encryption. In fact, I also have an android app that want also to talk to this php server, with encryption. Which solution can i use that would work both on iphone, android, and php? I have been looking for openssl but on android its qu... | What you're asking for is a form of DRM, and fundamentally impossible. You want to put your code on user devices, but not let them examine it or execute it except in an approved fashion. Since they physically own the device, you can't prevent them from disassembling your code, examining the communications, or just abou... | How do I make PHP and IOS Iphone talk together with encryption? Im looking what is the good way to make talk an iphone apps with a php server, with encryption. In fact, I also have an android app that want also to talk to this php server, with encryption. Which solution can i use that would work both on iphone, android... | TITLE:
How do I make PHP and IOS Iphone talk together with encryption?
QUESTION:
Im looking what is the good way to make talk an iphone apps with a php server, with encryption. In fact, I also have an android app that want also to talk to this php server, with encryption. Which solution can i use that would work both ... | [
"php",
"iphone",
"android",
"encryption",
"cryptography"
] | 1 | 1 | 824 | 3 | 0 | 2011-06-08T10:01:35.653000 | 2011-06-09T02:04:12.063000 |
6,277,079 | 6,277,592 | Linq to SQL string concatenation where clause generates buggy sql | Answers to similar questions are not working for me. Consider this string concat query:.Where(c => ( c.FirstName?? String.Empty + c.LastName?? String.Empty + c.CompanyName?? String.Empty).Contains(searchText) results in the sql below. this actually fails to find a match on last name due to the first case statement. I'm... | Got it. But this is Fugly (so is the sql). String concat needs some serious attention!.Where(c => ( ((c.FirstName?? String.Empty).Length > 0 && (c.FirstName?? String.Empty).Contains(searchText)) || ((c.LastName?? String.Empty).Length > 0 && (c.LastName?? String.Empty).Contains(searchText)) || ((c.CompanyName?? String.E... | Linq to SQL string concatenation where clause generates buggy sql Answers to similar questions are not working for me. Consider this string concat query:.Where(c => ( c.FirstName?? String.Empty + c.LastName?? String.Empty + c.CompanyName?? String.Empty).Contains(searchText) results in the sql below. this actually fails... | TITLE:
Linq to SQL string concatenation where clause generates buggy sql
QUESTION:
Answers to similar questions are not working for me. Consider this string concat query:.Where(c => ( c.FirstName?? String.Empty + c.LastName?? String.Empty + c.CompanyName?? String.Empty).Contains(searchText) results in the sql below. t... | [
"linq",
"entity-framework-4.1"
] | 0 | 0 | 1,372 | 2 | 0 | 2011-06-08T10:01:49.450000 | 2011-06-08T10:53:03.673000 |
6,277,087 | 6,277,132 | Deleting an object and creating a new one instead | I have a pointer to an object, which I want to release, and then create a new one. What I tried: $this->myObject = null; $this->myObject = new myObject($newVar); Should this work? Am I doing it wrong? I tried calling __destructor() manually but that triggered an "unknown function" error. | PHP does not have pointers. But, yes, this is fine. You don't need to set to null either; the original, now-dangling object will be garbage collected just like any other object. Example: | Deleting an object and creating a new one instead I have a pointer to an object, which I want to release, and then create a new one. What I tried: $this->myObject = null; $this->myObject = new myObject($newVar); Should this work? Am I doing it wrong? I tried calling __destructor() manually but that triggered an "unknow... | TITLE:
Deleting an object and creating a new one instead
QUESTION:
I have a pointer to an object, which I want to release, and then create a new one. What I tried: $this->myObject = null; $this->myObject = new myObject($newVar); Should this work? Am I doing it wrong? I tried calling __destructor() manually but that tr... | [
"php"
] | 0 | 4 | 68 | 5 | 0 | 2011-06-08T10:02:27.030000 | 2011-06-08T10:06:21.253000 |
6,277,093 | 6,277,115 | can we remove dom table? | i have to switch in between two table as per users choice i can do it using table object model but there is problem with it as i remove one table and load another it will work but next time when i have switch back to first it will not get table ids and its not working. while working with DOM like this var tbl1 = docume... | To remove an element, you need to remove it from its parent, not from the document. So: b.parentNode.removeChild(b); | can we remove dom table? i have to switch in between two table as per users choice i can do it using table object model but there is problem with it as i remove one table and load another it will work but next time when i have switch back to first it will not get table ids and its not working. while working with DOM li... | TITLE:
can we remove dom table?
QUESTION:
i have to switch in between two table as per users choice i can do it using table object model but there is problem with it as i remove one table and load another it will work but next time when i have switch back to first it will not get table ids and its not working. while w... | [
"javascript",
"html",
"dom"
] | 1 | 7 | 3,180 | 1 | 0 | 2011-06-08T10:02:36.887000 | 2011-06-08T10:04:51.673000 |
6,277,097 | 6,277,767 | Handling lost connection with client inside a .NET webservice - possible? | I have written a webservice which calls a procedure in database and returns this procedure's results as a DataSet. Is there any way to know (inside this webservice) if the connection with client was lost while returning data? I'd like to handle this situation rolling back any changes i made to my db. Any help appreciat... | As I understand your question you want to ensure that your client gets back the data from your service as only in that case you want to commit some changes to the database. That is possible only if client initiates distributed transaction, your service joins the transaction and then when client receives data he commits... | Handling lost connection with client inside a .NET webservice - possible? I have written a webservice which calls a procedure in database and returns this procedure's results as a DataSet. Is there any way to know (inside this webservice) if the connection with client was lost while returning data? I'd like to handle t... | TITLE:
Handling lost connection with client inside a .NET webservice - possible?
QUESTION:
I have written a webservice which calls a procedure in database and returns this procedure's results as a DataSet. Is there any way to know (inside this webservice) if the connection with client was lost while returning data? I'... | [
".net",
"web-services",
"error-handling"
] | 0 | 1 | 873 | 1 | 0 | 2011-06-08T10:03:04.960000 | 2011-06-08T11:06:11.583000 |
6,277,098 | 6,277,169 | base href question bypass for one part? | Hi all am in a pickle:P All my code is working fine apart from one small part Is there anyway I can warp the Only, In a base href or something like that? all the other code in my file runs at gallery.domain.com and the login part has to be forums.domain.com I tested this by adding a "base" to the top and it worked for ... | No, there is no way to have multiple base tags on the same page. From the MDC docs: Must have a start tag, and must not have an end tag You'll have to use absolute URLs in your header. | base href question bypass for one part? Hi all am in a pickle:P All my code is working fine apart from one small part Is there anyway I can warp the Only, In a base href or something like that? all the other code in my file runs at gallery.domain.com and the login part has to be forums.domain.com I tested this by addin... | TITLE:
base href question bypass for one part?
QUESTION:
Hi all am in a pickle:P All my code is working fine apart from one small part Is there anyway I can warp the Only, In a base href or something like that? all the other code in my file runs at gallery.domain.com and the login part has to be forums.domain.com I te... | [
"php",
"html",
"href",
"radix"
] | 0 | 2 | 537 | 1 | 0 | 2011-06-08T10:03:06.337000 | 2011-06-08T10:09:08.077000 |
6,277,100 | 6,277,160 | Problem with getting a cell value OnRowCommand in Gridview | protected void GridView1_OnRowCommand(object sender, GridViewCommandEventArgs e) { int index = Convert.ToInt32(e.CommandArgument); GridViewRow row = GridView1.Rows[index];
k = row.Cells[0].ToString(); Label1.Text = k; } I want to get a value of a particular cell in the selected row.So I tried with this but this is giv... | Try this: k = row.Cells[0].Text; You'll get the text present in it. | Problem with getting a cell value OnRowCommand in Gridview protected void GridView1_OnRowCommand(object sender, GridViewCommandEventArgs e) { int index = Convert.ToInt32(e.CommandArgument); GridViewRow row = GridView1.Rows[index];
k = row.Cells[0].ToString(); Label1.Text = k; } I want to get a value of a particular ce... | TITLE:
Problem with getting a cell value OnRowCommand in Gridview
QUESTION:
protected void GridView1_OnRowCommand(object sender, GridViewCommandEventArgs e) { int index = Convert.ToInt32(e.CommandArgument); GridViewRow row = GridView1.Rows[index];
k = row.Cells[0].ToString(); Label1.Text = k; } I want to get a value ... | [
"c#",
"asp.net",
"gridview",
"gridviewcolumn"
] | 1 | 2 | 2,052 | 3 | 0 | 2011-06-08T10:03:25.950000 | 2011-06-08T10:08:11.267000 |
6,277,106 | 6,277,463 | Does ascending keyword exist purely for clarity when used with orderby? | If i do a query, ordering elements as below, i get ascending order. var i = from a in new int[] { 1, 2, 3, 4, 5 } orderby a select a; If i add the ascending keyword i get the same results. var i = from a in new int[] { 1, 2, 3, 4, 5 } orderby a ascending select a; I recognise that adding the ascending keyword in the se... | Yes it is redundant. There is no circumstance when it does anything different since the order is implicitly ascending. I guess it provides completeness, but it does indeed seem a shame to introduce a keyword into the language that is so... impotent. On the other side, though: it mimics SQL, which is broadly related in ... | Does ascending keyword exist purely for clarity when used with orderby? If i do a query, ordering elements as below, i get ascending order. var i = from a in new int[] { 1, 2, 3, 4, 5 } orderby a select a; If i add the ascending keyword i get the same results. var i = from a in new int[] { 1, 2, 3, 4, 5 } orderby a asc... | TITLE:
Does ascending keyword exist purely for clarity when used with orderby?
QUESTION:
If i do a query, ordering elements as below, i get ascending order. var i = from a in new int[] { 1, 2, 3, 4, 5 } orderby a select a; If i add the ascending keyword i get the same results. var i = from a in new int[] { 1, 2, 3, 4,... | [
"c#",
"linq",
"sql-order-by",
"keyword"
] | 8 | 7 | 137 | 1 | 0 | 2011-06-08T10:04:25.460000 | 2011-06-08T10:39:11.643000 |
6,277,108 | 6,277,147 | Can we change the logging level of a single log-statement during run-time? | I have the following code: private static final Log LOGGER = LogFactory.getLog(MyClass.class); if (LOGGER.isErrorEnabled()) { LOGGER.error("ID_1: Log Message: " + parameter)); } And I want the severity to be set to WARN or FATAL. If I am able to update the log4j.properties during run-time, then how would I change the s... | The short answer is No you can't. To do what you want to do, you would need to change the code to call the Logger method that takes a Level as an argument, and replace the guard; e.g. if (logger.isEnabledFor(level)) { logger.log(level, "ID_1: Log Message: " + parameter, null); } And I don't think this is going to help ... | Can we change the logging level of a single log-statement during run-time? I have the following code: private static final Log LOGGER = LogFactory.getLog(MyClass.class); if (LOGGER.isErrorEnabled()) { LOGGER.error("ID_1: Log Message: " + parameter)); } And I want the severity to be set to WARN or FATAL. If I am able to... | TITLE:
Can we change the logging level of a single log-statement during run-time?
QUESTION:
I have the following code: private static final Log LOGGER = LogFactory.getLog(MyClass.class); if (LOGGER.isErrorEnabled()) { LOGGER.error("ID_1: Log Message: " + parameter)); } And I want the severity to be set to WARN or FATA... | [
"java",
"log4j",
"apache-commons-logging"
] | 1 | 3 | 721 | 2 | 0 | 2011-06-08T10:04:27.790000 | 2011-06-08T10:07:12.713000 |
6,277,119 | 6,277,172 | iPad not reading my plists | When I add an plists-file to my XCode project, my iPad app can't seem to read it. For example: I have massCategories.plist inside my project's folder (where the xproj-file lives). Inside my plist is the following code: Item 1 Key 1 Value 1 Key 2 Value 2 Item 2 Key 3 Value 3 Key 4 Value 4 Inside my ViewController I have... | Got it! Just update the plist such that the main element is an array (just as I should've expected when trying to import it as an array):... | iPad not reading my plists When I add an plists-file to my XCode project, my iPad app can't seem to read it. For example: I have massCategories.plist inside my project's folder (where the xproj-file lives). Inside my plist is the following code: Item 1 Key 1 Value 1 Key 2 Value 2 Item 2 Key 3 Value 3 Key 4 Value 4 Insi... | TITLE:
iPad not reading my plists
QUESTION:
When I add an plists-file to my XCode project, my iPad app can't seem to read it. For example: I have massCategories.plist inside my project's folder (where the xproj-file lives). Inside my plist is the following code: Item 1 Key 1 Value 1 Key 2 Value 2 Item 2 Key 3 Value 3 ... | [
"xcode",
"ios",
"ipad",
"plist"
] | 0 | 0 | 334 | 2 | 0 | 2011-06-08T10:05:03.357000 | 2011-06-08T10:09:13.277000 |
6,277,146 | 6,277,596 | How can I use my classes in several projects? | How can I create a namespace and classes in it, then save it, and reuse the namespace in other projects? Do I have to click on Create Class Library in Visual Studio? | I found the answer in Understanding and Using Assemblies and Namespaces in.NET Here's what you need to do: Create a Class Library Build it to generate a.dll file And add a reference to the dll file in any project to use it | How can I use my classes in several projects? How can I create a namespace and classes in it, then save it, and reuse the namespace in other projects? Do I have to click on Create Class Library in Visual Studio? | TITLE:
How can I use my classes in several projects?
QUESTION:
How can I create a namespace and classes in it, then save it, and reuse the namespace in other projects? Do I have to click on Create Class Library in Visual Studio?
ANSWER:
I found the answer in Understanding and Using Assemblies and Namespaces in.NET He... | [
".net",
"vb.net",
"class-library"
] | 2 | 3 | 96 | 2 | 0 | 2011-06-08T10:07:00.550000 | 2011-06-08T10:53:22.837000 |
6,277,158 | 6,277,177 | Operating on each generated entity of a list comprehension | I am trying to generate a list using list comprehension and I want to do an operation on each generated entity. Something like: a=['1','2','3'] b=['a','b','c'] temp = [[x,y] for x in a for y in b] c=[] for t in temp: c.append("".join(t)) I tried something like: a=['1','2','3'] b=['a','b','c'] c = ",".join([x,y] for x i... | >>> [x + y for x in a for y in b] ['1a', '1b', '1c', '2a', '2b', '2c', '3a', '3b', '3c'] | Operating on each generated entity of a list comprehension I am trying to generate a list using list comprehension and I want to do an operation on each generated entity. Something like: a=['1','2','3'] b=['a','b','c'] temp = [[x,y] for x in a for y in b] c=[] for t in temp: c.append("".join(t)) I tried something like:... | TITLE:
Operating on each generated entity of a list comprehension
QUESTION:
I am trying to generate a list using list comprehension and I want to do an operation on each generated entity. Something like: a=['1','2','3'] b=['a','b','c'] temp = [[x,y] for x in a for y in b] c=[] for t in temp: c.append("".join(t)) I tri... | [
"python",
"string",
"split",
"list-comprehension"
] | 1 | 6 | 114 | 3 | 0 | 2011-06-08T10:08:01.590000 | 2011-06-08T10:09:57.543000 |
6,277,456 | 6,277,635 | Nokogiri installation fails -libxml2 is missing | I always worked my way around Nokogiri installation issues by following the documentation in the " Installing Nokogiri " tutorial. But this time, even after installing all the dependencies, Nokogiri hasn't been installed. I get the following error: libxml2 is missing. please visit I tried installing it by specifying th... | First, install the dependencies: sudo apt-get install libxslt-dev libxml2-dev If you still receive the error, you may be missing a compiler toolchain: sudo apt-get install build-essential You'll get the "libxml2 is missing" error if you're missing a build toolchain (at least I ran into this issue on Debian Lenny). The ... | Nokogiri installation fails -libxml2 is missing I always worked my way around Nokogiri installation issues by following the documentation in the " Installing Nokogiri " tutorial. But this time, even after installing all the dependencies, Nokogiri hasn't been installed. I get the following error: libxml2 is missing. ple... | TITLE:
Nokogiri installation fails -libxml2 is missing
QUESTION:
I always worked my way around Nokogiri installation issues by following the documentation in the " Installing Nokogiri " tutorial. But this time, even after installing all the dependencies, Nokogiri hasn't been installed. I get the following error: libxm... | [
"ruby-on-rails",
"ruby",
"rubygems"
] | 157 | 167 | 92,589 | 19 | 0 | 2011-06-08T10:38:48.537000 | 2011-06-08T10:56:29.640000 |
6,277,459 | 6,277,565 | Django: sending GET messages | I'm using Django 1.1 on a project, and I ran into a problem. I need to send a GET request to an external URL. I want to create a method that would act like this: def Send_msg(object): converted_url = "http://example.com/some/link/?title=" + object.title + "&body=" + object.body LoadURL(converted_url) return True Anothe... | def Send_msg(request, object): import urllib2, urllib base_url = "http://example.com/some/link" values = { 'title': object.title, 'body': object.body } data = urllib.urlencode(values) urllib2.urlopen(base_url+"?"+data).read() return HttpResponse() Something like this. The request bit is not necessary, depends on your r... | Django: sending GET messages I'm using Django 1.1 on a project, and I ran into a problem. I need to send a GET request to an external URL. I want to create a method that would act like this: def Send_msg(object): converted_url = "http://example.com/some/link/?title=" + object.title + "&body=" + object.body LoadURL(conv... | TITLE:
Django: sending GET messages
QUESTION:
I'm using Django 1.1 on a project, and I ran into a problem. I need to send a GET request to an external URL. I want to create a method that would act like this: def Send_msg(object): converted_url = "http://example.com/some/link/?title=" + object.title + "&body=" + object... | [
"python",
"django",
"url",
"get"
] | 0 | 3 | 392 | 1 | 0 | 2011-06-08T10:39:03.887000 | 2011-06-08T10:50:51.103000 |
6,277,460 | 6,277,531 | howto make a simple selection in haskell? | i have a problem, this code dont work and i dont know why: foo:: [String] -> IO [String] foo input = do choice <- getLine if choice == "1" then do putStrLn "good choice" return input else return [] | As is (with a bit of retabbing) the code works for me. if/else is difficult to get correct with the tabs. The Wiki article if/then/else should help. foo:: [String] -> IO [String] foo input = do choice <- getLine if choice == "1" then do putStrLn "good choice" return input else return [] Eliminating the inner do express... | howto make a simple selection in haskell? i have a problem, this code dont work and i dont know why: foo:: [String] -> IO [String] foo input = do choice <- getLine if choice == "1" then do putStrLn "good choice" return input else return [] | TITLE:
howto make a simple selection in haskell?
QUESTION:
i have a problem, this code dont work and i dont know why: foo:: [String] -> IO [String] foo input = do choice <- getLine if choice == "1" then do putStrLn "good choice" return input else return []
ANSWER:
As is (with a bit of retabbing) the code works for me... | [
"haskell"
] | 0 | 2 | 195 | 1 | 0 | 2011-06-08T10:39:07.520000 | 2011-06-08T10:47:21.183000 |
6,277,468 | 6,278,098 | Create a Setup and Deployment Project in windows without .net support | I have got a vc++ project and for that I have created.exe and.lib. Now, I am trying to create a set up project for this. I am following the instructions given on this link: http://msdn.microsoft.com/en-us/library/ms235317(v=vs.90).aspx under the heading: Procedures for deploying Visual C++ library DLLs as private assem... | A.NET Framework installer is launched during install only if you added it as a prerequisite. You can change prerequisites by clicking the "Prerequisites..." button in your setup project Properties pane. For your project you should make sure that no.NET Framework prerequisite is checked. | Create a Setup and Deployment Project in windows without .net support I have got a vc++ project and for that I have created.exe and.lib. Now, I am trying to create a set up project for this. I am following the instructions given on this link: http://msdn.microsoft.com/en-us/library/ms235317(v=vs.90).aspx under the head... | TITLE:
Create a Setup and Deployment Project in windows without .net support
QUESTION:
I have got a vc++ project and for that I have created.exe and.lib. Now, I am trying to create a set up project for this. I am following the instructions given on this link: http://msdn.microsoft.com/en-us/library/ms235317(v=vs.90).a... | [
".net",
"c++",
"visual-studio",
"setup-project"
] | 0 | 1 | 755 | 2 | 0 | 2011-06-08T10:40:11.747000 | 2011-06-08T11:36:06.387000 |
6,277,476 | 6,277,512 | Check all values in an array are same | I have a webpage that has a textbox. When the user enters information into it, it makes a AJAX call to see if the entry is valid, if not it disables a button. They can also add up to 10 textboxes which is done via jQuery Templates. At the moment each textbox has a class of serial and when a serial textbox is blurred it... | I will assume you have a isValid(str) function that returns a boolean. Since you're using jQuery, you can take advantage of jQuery's filter() function to easily check if any inputs are invalid whenever an input blurs: $('.serial').live('blur', function () {
// Get an array of all invalid inputs var invalids = $('.seri... | Check all values in an array are same I have a webpage that has a textbox. When the user enters information into it, it makes a AJAX call to see if the entry is valid, if not it disables a button. They can also add up to 10 textboxes which is done via jQuery Templates. At the moment each textbox has a class of serial a... | TITLE:
Check all values in an array are same
QUESTION:
I have a webpage that has a textbox. When the user enters information into it, it makes a AJAX call to see if the entry is valid, if not it disables a button. They can also add up to 10 textboxes which is done via jQuery Templates. At the moment each textbox has a... | [
"javascript",
"jquery"
] | 6 | 2 | 5,218 | 4 | 0 | 2011-06-08T10:40:42.127000 | 2011-06-08T10:45:21.723000 |
6,277,491 | 6,291,085 | Anyone know what controls/sdk mypad twitter use? | It seems to me the UIs of twitter and mypad for iPad are very similar. I was wondering if anyone knew what sdk is being used as I'd like to use it in an app I'm working on. | Check this: http://cocoacontrols.com/posts/how-to-build-the-twitter-ipad-user-experience | Anyone know what controls/sdk mypad twitter use? It seems to me the UIs of twitter and mypad for iPad are very similar. I was wondering if anyone knew what sdk is being used as I'd like to use it in an app I'm working on. | TITLE:
Anyone know what controls/sdk mypad twitter use?
QUESTION:
It seems to me the UIs of twitter and mypad for iPad are very similar. I was wondering if anyone knew what sdk is being used as I'd like to use it in an app I'm working on.
ANSWER:
Check this: http://cocoacontrols.com/posts/how-to-build-the-twitter-ipa... | [
"cocoa-touch",
"ios",
"twitter",
"sdk"
] | 3 | 2 | 215 | 2 | 0 | 2011-06-08T10:42:26.980000 | 2011-06-09T10:00:52.187000 |
6,277,495 | 6,282,342 | "End element 'jsonCalendarItems' from namespace '' expected. Found element 'item' from namespace '' | I'm getting a strange error, and I cannot figure out the problem. I'm sending an array of objects to my wcf service in json format. var calendarItemsString = JSON.stringify(calendarItems); $.ajax({ cache: false, async: true, url: 'webService.svc/SaveCalendarItems', type: "POST", dataType: "json", contentType: "applicat... | The problem is that your operation is expecting a String parameter (i.e. a JSON string), but the value of the jsonCalendarItems is an array. You can either create a class to represent the array items and change the parameter type to an array of that class, or you can convert the JSON array to a string (which can be don... | "End element 'jsonCalendarItems' from namespace '' expected. Found element 'item' from namespace '' I'm getting a strange error, and I cannot figure out the problem. I'm sending an array of objects to my wcf service in json format. var calendarItemsString = JSON.stringify(calendarItems); $.ajax({ cache: false, async: t... | TITLE:
"End element 'jsonCalendarItems' from namespace '' expected. Found element 'item' from namespace ''
QUESTION:
I'm getting a strange error, and I cannot figure out the problem. I'm sending an array of objects to my wcf service in json format. var calendarItemsString = JSON.stringify(calendarItems); $.ajax({ cach... | [
"jquery",
"asp.net",
"ajax",
"wcf",
"json"
] | 2 | 4 | 4,817 | 1 | 0 | 2011-06-08T10:42:37.503000 | 2011-06-08T16:50:09.263000 |
6,277,505 | 6,277,607 | Whats the difference between using assigned variables and straight access | Considering below what are benefits, uses or gain of each and why do you think so? other than short way to access the data. btw is there a way to use DataView in using (Resource){//Code} format. DataTable dtUsers = UsersRepository.GetAllUsers(); Users.Name = dtUsers.Rows[0]["Name"].ToString(); Users.Address = dtUsers.R... | A DataView is there to be able to perform sorting, filtering, searching, editing, and navigation ( msdn ) without altering the data in the datatable itself. One of the biggest functionality thereof is for databinding to grid like controls so that you can control what data is displayed and how (Other than filtering/sort... | Whats the difference between using assigned variables and straight access Considering below what are benefits, uses or gain of each and why do you think so? other than short way to access the data. btw is there a way to use DataView in using (Resource){//Code} format. DataTable dtUsers = UsersRepository.GetAllUsers(); ... | TITLE:
Whats the difference between using assigned variables and straight access
QUESTION:
Considering below what are benefits, uses or gain of each and why do you think so? other than short way to access the data. btw is there a way to use DataView in using (Resource){//Code} format. DataTable dtUsers = UsersReposito... | [
"c#",
"asp.net",
"datatable",
"equals",
"dataview"
] | 0 | 2 | 86 | 1 | 0 | 2011-06-08T10:44:38.017000 | 2011-06-08T10:53:47.530000 |
6,277,507 | 6,277,608 | Displaying HTML encoded styling in WPF | I get a string from database that includes a HTML styling (not sure what it's called) and I wan't to display it in my WPF app. I can decode in the ViewModel so I can use the.net library. I tried using WebUtility.HtmlDecode(string) method but it doesn't do anything (and probably isn't supposed to). this is what the stri... | This has nothing to do with encoding, this is about conversion. If you don't want to use the WebBrowser control you need to convert from HTML to flow content which can be displayed in a FlowDocument. You can either write the necessary code yourself or see if this converter which converts both ways (or any other existin... | Displaying HTML encoded styling in WPF I get a string from database that includes a HTML styling (not sure what it's called) and I wan't to display it in my WPF app. I can decode in the ViewModel so I can use the.net library. I tried using WebUtility.HtmlDecode(string) method but it doesn't do anything (and probably is... | TITLE:
Displaying HTML encoded styling in WPF
QUESTION:
I get a string from database that includes a HTML styling (not sure what it's called) and I wan't to display it in my WPF app. I can decode in the ViewModel so I can use the.net library. I tried using WebUtility.HtmlDecode(string) method but it doesn't do anythin... | [
"html",
"css",
"wpf",
"html-encode"
] | 1 | 2 | 881 | 1 | 0 | 2011-06-08T10:44:58.423000 | 2011-06-08T10:53:55.037000 |
6,277,509 | 6,277,683 | How to parse JSON String? | In my app, I have send some Request to server using POST Method and in response following JSON string printed on console: [ { "title": "American Heart Association", "link": "www.americanheart.org/" }, { "title": "EverydayHealth.com", "link": "www.everydayhealth.com" }, { "title": "GetFitSlowly.com", "link": "www.getfit... | Yes as Jhaliya posted above... Tutorial: JSON Over HTTP On The iPhone download from code here copy JSON library in your code and simple object = [yourResponseInString JSONValue]; in object you'll get Array or dictionary..;) | How to parse JSON String? In my app, I have send some Request to server using POST Method and in response following JSON string printed on console: [ { "title": "American Heart Association", "link": "www.americanheart.org/" }, { "title": "EverydayHealth.com", "link": "www.everydayhealth.com" }, { "title": "GetFitSlowly... | TITLE:
How to parse JSON String?
QUESTION:
In my app, I have send some Request to server using POST Method and in response following JSON string printed on console: [ { "title": "American Heart Association", "link": "www.americanheart.org/" }, { "title": "EverydayHealth.com", "link": "www.everydayhealth.com" }, { "tit... | [
"objective-c",
"ios4"
] | 4 | 0 | 446 | 1 | 0 | 2011-06-08T10:45:07.723000 | 2011-06-08T11:00:27.700000 |
6,277,511 | 6,289,406 | How do I utilize Row_Number() (partitioning) for my datapool correctly | we have following table (output is already ordered and separated for understanding): | PK | FK1 | FK2 | ActionCode | CreationTS | SomeAttributeValue | +----+-----+-----+--------------+---------------------+--------------------+ | 6 | 100 | 500 | Create | 2011-01-02 00:00:00 | H | ---------------------------------------... | I'm assuming that each partition can only contain a single Create or CreateSystem, otherwise your requirements are ill-defined. The following is untested, since I don't have a sample table, nor sample data in an easily consumed format:;With Partitions as ( Select t1.FK1, t1.FK2, t1.CreationTS as StartTS, t2.CreationTS ... | How do I utilize Row_Number() (partitioning) for my datapool correctly we have following table (output is already ordered and separated for understanding): | PK | FK1 | FK2 | ActionCode | CreationTS | SomeAttributeValue | +----+-----+-----+--------------+---------------------+--------------------+ | 6 | 100 | 500 | Cre... | TITLE:
How do I utilize Row_Number() (partitioning) for my datapool correctly
QUESTION:
we have following table (output is already ordered and separated for understanding): | PK | FK1 | FK2 | ActionCode | CreationTS | SomeAttributeValue | +----+-----+-----+--------------+---------------------+--------------------+ | 6... | [
"sql-server",
"row-number"
] | 3 | 2 | 790 | 2 | 0 | 2011-06-08T10:45:09.063000 | 2011-06-09T07:22:28.027000 |
6,277,513 | 6,278,442 | How to validate textbox for emailid using JQuery? | How do you validate a Textbox field for valid email address using Jquery? Please reply soon. Many Thanks. | var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
var emailaddressVal = $("#txtEmail").val(); if (emailaddressVal == '') { $("#error").html("Please enter your email address.").css({ 'color': 'red' }); return; } else if (!emailReg.test(emailaddressVal)) { $("#error").html("Enter a valid email address.").css({ 'colo... | How to validate textbox for emailid using JQuery? How do you validate a Textbox field for valid email address using Jquery? Please reply soon. Many Thanks. | TITLE:
How to validate textbox for emailid using JQuery?
QUESTION:
How do you validate a Textbox field for valid email address using Jquery? Please reply soon. Many Thanks.
ANSWER:
var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
var emailaddressVal = $("#txtEmail").val(); if (emailaddressVal == '') { $("#error... | [
"jquery",
"asp.net",
"html"
] | 1 | 1 | 5,447 | 3 | 0 | 2011-06-08T10:45:26.093000 | 2011-06-08T12:07:59.417000 |
6,277,517 | 6,277,658 | Qt and X11 fullscreen application , which blocks Window Manager simultaneously | i think i need to use a XEvent with QMainWindow together to make my application unable to close even by Window Manager, could any one provide an example? It's like a fullscreen video game, which blocks all keyboards, mouse buttons. P.S: QWidget::grabKeyboard() && QWidget::grabMouse() doesn't work when i try to switch t... | To completely block all inputs from other apps, you need to use XGrabServer and not XGrabKeyboard / XGrabPointer combination. Dunno whether Qt has an API for that but you can always call the Xlib function directly. I however recommend against it. If the application is for some reason doesn't release the grab, you're st... | Qt and X11 fullscreen application , which blocks Window Manager simultaneously i think i need to use a XEvent with QMainWindow together to make my application unable to close even by Window Manager, could any one provide an example? It's like a fullscreen video game, which blocks all keyboards, mouse buttons. P.S: QWid... | TITLE:
Qt and X11 fullscreen application , which blocks Window Manager simultaneously
QUESTION:
i think i need to use a XEvent with QMainWindow together to make my application unable to close even by Window Manager, could any one provide an example? It's like a fullscreen video game, which blocks all keyboards, mouse ... | [
"c++",
"qt",
"xorg"
] | 0 | 2 | 1,204 | 2 | 0 | 2011-06-08T10:46:26.283000 | 2011-06-08T10:58:23.640000 |
6,277,551 | 6,277,788 | php: constant variable attach with stdclass | Is it possible to call a data from database by attaching a constant variable like this? $table_result->description_{constant_varible}; So that the actual stdclass I intend to call is $table_result->description_B; return '34'; Thanks | Yes, it's possible. E.g. via $obj->{expr} {'description_'.$v};
function foo() { $x = new StdClass; $x->description_B = 34; return $x; } | php: constant variable attach with stdclass Is it possible to call a data from database by attaching a constant variable like this? $table_result->description_{constant_varible}; So that the actual stdclass I intend to call is $table_result->description_B; return '34'; Thanks | TITLE:
php: constant variable attach with stdclass
QUESTION:
Is it possible to call a data from database by attaching a constant variable like this? $table_result->description_{constant_varible}; So that the actual stdclass I intend to call is $table_result->description_B; return '34'; Thanks
ANSWER:
Yes, it's possib... | [
"php",
"variables",
"join",
"constants",
"stdclass"
] | 0 | 0 | 427 | 2 | 0 | 2011-06-08T10:49:17.063000 | 2011-06-08T11:08:19.273000 |
6,277,554 | 6,278,414 | pdfSharp printing with page size | I am using PdfSharp dll to print a pdf. This is the code that i am using. This works fine for me. PdfFilePrinter.AdobeReaderPath = "C:\\Program Files\\Adobe\\Reader 9.0\\Reader\\AcroRd32.exe"; PdfFilePrinter printer = new PdfFilePrinter("C:\\sample.pdf", "HP LaserJet P1007"); printer.Print(); As always!!!! "BUT" I am n... | PdfFilePrinter launches AcroRd32.exe and passes file name and printer name in the command line. I'm afraid the command line does not support selection of paper format or other advanced options. | pdfSharp printing with page size I am using PdfSharp dll to print a pdf. This is the code that i am using. This works fine for me. PdfFilePrinter.AdobeReaderPath = "C:\\Program Files\\Adobe\\Reader 9.0\\Reader\\AcroRd32.exe"; PdfFilePrinter printer = new PdfFilePrinter("C:\\sample.pdf", "HP LaserJet P1007"); printer.Pr... | TITLE:
pdfSharp printing with page size
QUESTION:
I am using PdfSharp dll to print a pdf. This is the code that i am using. This works fine for me. PdfFilePrinter.AdobeReaderPath = "C:\\Program Files\\Adobe\\Reader 9.0\\Reader\\AcroRd32.exe"; PdfFilePrinter printer = new PdfFilePrinter("C:\\sample.pdf", "HP LaserJet P... | [
"pdf",
"printing",
"pdfsharp"
] | 2 | 1 | 4,321 | 1 | 0 | 2011-06-08T10:49:39.037000 | 2011-06-08T12:05:35.153000 |
6,277,561 | 6,277,777 | Linear regression in R (normal and logarithmic data) | I want to carry out a linear regression in R for data in a normal and in a double logarithmic plot. For normal data the dataset might be the follwing: lin <- data.frame(x = c(0:6), y = c(0.3, 0.1, 0.9, 3.1, 5, 4.9, 6.2)) plot (lin$x, lin$y) There I want to calculate draw a line for the linear regression only of the dat... | In R, linear least squares models are fitted via the lm() function. Using the formula interface we can use the subset argument to select the data points used to fit the actual model, for example: lin <- data.frame(x = c(0:6), y = c(0.3, 0.1, 0.9, 3.1, 5, 4.9, 6.2)) linm <- lm(y ~ x, data = lin, subset = 2:4) giving: R>... | Linear regression in R (normal and logarithmic data) I want to carry out a linear regression in R for data in a normal and in a double logarithmic plot. For normal data the dataset might be the follwing: lin <- data.frame(x = c(0:6), y = c(0.3, 0.1, 0.9, 3.1, 5, 4.9, 6.2)) plot (lin$x, lin$y) There I want to calculate ... | TITLE:
Linear regression in R (normal and logarithmic data)
QUESTION:
I want to carry out a linear regression in R for data in a normal and in a double logarithmic plot. For normal data the dataset might be the follwing: lin <- data.frame(x = c(0:6), y = c(0.3, 0.1, 0.9, 3.1, 5, 4.9, 6.2)) plot (lin$x, lin$y) There I ... | [
"r",
"plot",
"linear-regression",
"curve-fitting",
"power-law"
] | 7 | 13 | 36,724 | 2 | 0 | 2011-06-08T10:50:08.967000 | 2011-06-08T11:07:22.330000 |
6,277,572 | 6,278,080 | GetByteArrayRegion in JNI | The question is: Suppose I use the function: (* env) -> GetByteArrayRegion (env, array, 0, len, (jbyte *)buf); In this case, a certain number of bytes written from the array to the buf or vice versa? Maybe a simple question, but I'm confused. Help, please:. In the documentation is not found. | Get ArrayRegion is a family of functions that copies a region of a primitive array into a buffer. That's what the documentation says. It seems clear to me. | GetByteArrayRegion in JNI The question is: Suppose I use the function: (* env) -> GetByteArrayRegion (env, array, 0, len, (jbyte *)buf); In this case, a certain number of bytes written from the array to the buf or vice versa? Maybe a simple question, but I'm confused. Help, please:. In the documentation is not found. | TITLE:
GetByteArrayRegion in JNI
QUESTION:
The question is: Suppose I use the function: (* env) -> GetByteArrayRegion (env, array, 0, len, (jbyte *)buf); In this case, a certain number of bytes written from the array to the buf or vice versa? Maybe a simple question, but I'm confused. Help, please:. In the documentati... | [
"java",
"c",
"java-native-interface",
"byte"
] | 1 | 0 | 13,681 | 1 | 0 | 2011-06-08T10:51:33.800000 | 2011-06-08T11:33:47.393000 |
6,277,580 | 6,277,689 | Convert Values into Table from Dictionary<string,Dictionary<string,int>> in c#? | I Have a Challenge like this, Dictionary > dic=new Dictionary >(); i want them into a table. Main Problem is, each Key of dic is having again a Dictionary with many values. i want to show them in table. How can i do this? please resolve my problem with answer or alternative. Table will be like this..! Desired Output wi... | It looks like one to many relation. So u should have table containing keys from ur dictionary with some primekey, and second table with key, value columns + primekey of corresponding string in first table. | Convert Values into Table from Dictionary<string,Dictionary<string,int>> in c#? I Have a Challenge like this, Dictionary > dic=new Dictionary >(); i want them into a table. Main Problem is, each Key of dic is having again a Dictionary with many values. i want to show them in table. How can i do this? please resolve my ... | TITLE:
Convert Values into Table from Dictionary<string,Dictionary<string,int>> in c#?
QUESTION:
I Have a Challenge like this, Dictionary > dic=new Dictionary >(); i want them into a table. Main Problem is, each Key of dic is having again a Dictionary with many values. i want to show them in table. How can i do this? ... | [
"c#",
"dictionary"
] | 0 | 0 | 741 | 1 | 0 | 2011-06-08T10:51:57.013000 | 2011-06-08T11:01:11.967000 |
6,277,588 | 6,280,391 | Changing row color in not-active DataGridView | What's the best way of changing some rows back color in DataGridView, when it's not active?? In "real" world I would like to use it for formatting all DataGridView rows after button click, depending on some criterias. To reproduce behaviour, please try: 1. In WinForms application put TabControl with two tab pages. On t... | One possibility is to the colour within the datagridview paint event (which gets fired when the tabpage changes). private void dataGridView1_Paint(object sender, PaintEventArgs e) { dataGridView1.Rows[0].DefaultCellStyle.BackColor = Color.Red; } This works nicely for me - the paint event does get called several times w... | Changing row color in not-active DataGridView What's the best way of changing some rows back color in DataGridView, when it's not active?? In "real" world I would like to use it for formatting all DataGridView rows after button click, depending on some criterias. To reproduce behaviour, please try: 1. In WinForms appli... | TITLE:
Changing row color in not-active DataGridView
QUESTION:
What's the best way of changing some rows back color in DataGridView, when it's not active?? In "real" world I would like to use it for formatting all DataGridView rows after button click, depending on some criterias. To reproduce behaviour, please try: 1.... | [
"c#",
"datagridview"
] | 3 | 1 | 1,939 | 1 | 0 | 2011-06-08T10:52:39.173000 | 2011-06-08T14:28:43.093000 |
6,277,590 | 6,277,774 | Vector to closest isosurface point on metaballs | I'm currently making a prototype game where the player walks along the isosurface of a collection of moving metaballs. I've already implemented walking along a sphere with a forward and up vector. To extend this to the metaballs I need to be able to query for an arbitrary point the direction to the closest surface and ... | In general, you would just derive your function to get the normal on the surface. Blackpawn has a nice explanation how to do it with your specific case here. Once you got the normal, move along its direction until you hit the isosurface (this is generic "root" finding). | Vector to closest isosurface point on metaballs I'm currently making a prototype game where the player walks along the isosurface of a collection of moving metaballs. I've already implemented walking along a sphere with a forward and up vector. To extend this to the metaballs I need to be able to query for an arbitrary... | TITLE:
Vector to closest isosurface point on metaballs
QUESTION:
I'm currently making a prototype game where the player walks along the isosurface of a collection of moving metaballs. I've already implemented walking along a sphere with a forward and up vector. To extend this to the metaballs I need to be able to quer... | [
"math",
"vector",
"closest"
] | 1 | 0 | 465 | 1 | 0 | 2011-06-08T10:53:00.560000 | 2011-06-08T11:06:48.243000 |
6,277,601 | 6,277,696 | This actually works but is there another way to loop? | // Loop $key
$key = count($_SESSION['imageURL']);
for ($i = 1; $i <= $key; $i++) {
echo $_SESSION['imageURL'][$i];
echo $_SESSION['clubURL'][$i];
} | There are several other ways: foreach foreach ($_SESSION['imageURL'] as $key => $image) { echo $image; echo $_SESSION['clubURL'][$key]; } while while (list ($key, $image) = each ($_SESSION['imageURL']) { echo $image; echo $_SESSION['clubURL'][$key]; } do..while if (count($_SESSION['imageURL']) { do { echo current($_SES... | This actually works but is there another way to loop? // Loop $key
$key = count($_SESSION['imageURL']);
for ($i = 1; $i <= $key; $i++) {
echo $_SESSION['imageURL'][$i];
echo $_SESSION['clubURL'][$i];
} | TITLE:
This actually works but is there another way to loop?
QUESTION:
// Loop $key
$key = count($_SESSION['imageURL']);
for ($i = 1; $i <= $key; $i++) {
echo $_SESSION['imageURL'][$i];
echo $_SESSION['clubURL'][$i];
}
ANSWER:
There are several other ways: foreach foreach ($_SESSION['imageURL'] as $key => $image... | [
"php",
"arrays",
"session",
"loops",
"for-loop"
] | 1 | 3 | 61 | 4 | 0 | 2011-06-08T10:53:31.970000 | 2011-06-08T11:01:40.943000 |
6,277,602 | 6,277,666 | What is the difference between MVC and MVP | Possible Duplicate: What are MVP and MVC and what is the difference? I know MVC (Model-View-Controller). Can somebody precisely reason how MVP is different from MVC? Also Where is MVP desirable than MVC? | In MVP the view is not allowed to "think". The presenter contains all the logic. look at this: http://code.google.com/webtoolkit/articles/mvp-architecture.html#presenter | What is the difference between MVC and MVP Possible Duplicate: What are MVP and MVC and what is the difference? I know MVC (Model-View-Controller). Can somebody precisely reason how MVP is different from MVC? Also Where is MVP desirable than MVC? | TITLE:
What is the difference between MVC and MVP
QUESTION:
Possible Duplicate: What are MVP and MVC and what is the difference? I know MVC (Model-View-Controller). Can somebody precisely reason how MVP is different from MVC? Also Where is MVP desirable than MVC?
ANSWER:
In MVP the view is not allowed to "think". The... | [
"oop",
"model-view-controller",
"design-patterns",
"mvp"
] | 1 | 3 | 3,108 | 1 | 0 | 2011-06-08T10:53:34.120000 | 2011-06-08T10:59:04.893000 |
6,277,623 | 6,278,228 | release mode uses double precision even for float variables | My algorithm is calculating the epsilon for single precision floating point arithmetic. It is supposed to be something around 1.1921e-007. Here is the code: static void Main(string[] args) { // start with some small magic number float a = 0.000000000000000013877787807814457f; for (;; ) { // add the small a to 1 float t... | As discussed in the comments, this is expected. It can be side-stepped by removing the JIT's ability to keep the value in a register (which will be wider than the actual value) - by forcing it down to a field (which has clearly-defined size): class WorkingContext { public float Value; // you'll excuse me a public field... | release mode uses double precision even for float variables My algorithm is calculating the epsilon for single precision floating point arithmetic. It is supposed to be something around 1.1921e-007. Here is the code: static void Main(string[] args) { // start with some small magic number float a = 0.0000000000000000138... | TITLE:
release mode uses double precision even for float variables
QUESTION:
My algorithm is calculating the epsilon for single precision floating point arithmetic. It is supposed to be something around 1.1921e-007. Here is the code: static void Main(string[] args) { // start with some small magic number float a = 0.0... | [
"c#",
".net",
"cross-platform",
"floating-point-precision"
] | 3 | 3 | 351 | 1 | 0 | 2011-06-08T10:55:34.533000 | 2011-06-08T11:47:09.807000 |
6,277,630 | 6,277,937 | MVVM and service objects | We are currently designing a system using WPF which will communicate with other systems using web services. We are trying to have as few layers and mappings as possible (reduce costs by sticking to the simplest thing that will work). We will use the MVVM pattern. So we must have a view model. Question is could we use t... | You do not have to create an own model layer, BUT: if the service get changed you will have to reflect that changes in all layers which reference the model. if you create now an own model layer you are safer, but its more work. as so often: more work will save you eventually a lot more work in the future. If you own th... | MVVM and service objects We are currently designing a system using WPF which will communicate with other systems using web services. We are trying to have as few layers and mappings as possible (reduce costs by sticking to the simplest thing that will work). We will use the MVVM pattern. So we must have a view model. Q... | TITLE:
MVVM and service objects
QUESTION:
We are currently designing a system using WPF which will communicate with other systems using web services. We are trying to have as few layers and mappings as possible (reduce costs by sticking to the simplest thing that will work). We will use the MVVM pattern. So we must ha... | [
"wpf",
"web-services",
"architecture",
"mvvm"
] | 4 | 1 | 3,200 | 4 | 0 | 2011-06-08T10:56:18.150000 | 2011-06-08T11:20:15.617000 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.