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,232,817
6,232,829
How to create Windows User interface in asp.net
I want to create a windows interface in ASP.net which include Taskbar, Windows(have option:Maximum, Minimize) I m also attaching the screen shot what i want to do. Is there is any 3rd party control???
You can try ExtJs for example! http://dev.sencha.com/deploy/ext-4.0.1/examples/desktop/desktop.html
How to create Windows User interface in asp.net I want to create a windows interface in ASP.net which include Taskbar, Windows(have option:Maximum, Minimize) I m also attaching the screen shot what i want to do. Is there is any 3rd party control???
TITLE: How to create Windows User interface in asp.net QUESTION: I want to create a windows interface in ASP.net which include Taskbar, Windows(have option:Maximum, Minimize) I m also attaching the screen shot what i want to do. Is there is any 3rd party control??? ANSWER: You can try ExtJs for example! http://dev.se...
[ "asp.net", "windows", "interface", "controls", "taskbar" ]
0
3
379
1
0
2011-06-03T21:20:45.500000
2011-06-03T21:22:55.743000
6,232,831
6,232,848
how to make a regular expression to accept
how to make a regular expression to accept only alphanumeric characters, accents, Asian and Arab? accept: á í ó ú is 個 の Д deny: /'. thanks
You can use Unicode character classes to pick and choose. Not sure, but I guess in your case that would be: preg_match('/^[\p{Latin}\p{Han}\p{Arabic}]+$/u'
how to make a regular expression to accept how to make a regular expression to accept only alphanumeric characters, accents, Asian and Arab? accept: á í ó ú is 個 の Д deny: /'. thanks
TITLE: how to make a regular expression to accept QUESTION: how to make a regular expression to accept only alphanumeric characters, accents, Asian and Arab? accept: á í ó ú is 個 の Д deny: /'. thanks ANSWER: You can use Unicode character classes to pick and choose. Not sure, but I guess in your case that would be: pr...
[ "php", "preg-replace", "special-characters" ]
0
1
117
1
0
2011-06-03T21:23:17.683000
2011-06-03T21:26:09.613000
6,232,833
6,232,869
Is it possible to rewrite this with proper termination?
I can't seem to figure out how to properly terminate these statements...append(" #{@new_topic.name} @new_topic.id,:class => 'button delete_topic')}\' ") Right now its not closing the last div and anchor tag properly.
This should do the trick.append(" #{@new_topic.name} @new_topic.id,:class => 'button delete_topic')}\"> ") You were missing a > and the using \" is more clear then mixing ' \' with " in my option.
Is it possible to rewrite this with proper termination? I can't seem to figure out how to properly terminate these statements...append(" #{@new_topic.name} @new_topic.id,:class => 'button delete_topic')}\' ") Right now its not closing the last div and anchor tag properly.
TITLE: Is it possible to rewrite this with proper termination? QUESTION: I can't seem to figure out how to properly terminate these statements...append(" #{@new_topic.name} @new_topic.id,:class => 'button delete_topic')}\' ") Right now its not closing the last div and anchor tag properly. ANSWER: This should do the t...
[ "html", "ruby-on-rails" ]
0
1
58
2
0
2011-06-03T21:23:38.877000
2011-06-03T21:28:46.737000
6,232,839
6,233,147
destroy uiviewcontroller containing UIWebView when playing video?
Hey all... I have a view controller (A) which on some action, alloc init's another view controller (B) and then adds B's view to its view as a subview. So now ViewController B's view is a subview of ViewController A. The problem I have is If I simply remove B's view from A it seems to still stick around for example. Vi...
Does ViewController B really need to be a ViewController? If you're adding subviews you should probably have B subclass UIView instead of UIViewController. Adding B's view as a subview essentially negates any advantage you'd have of B being a ViewController. Anyway to answer your question. You might want to make viewco...
destroy uiviewcontroller containing UIWebView when playing video? Hey all... I have a view controller (A) which on some action, alloc init's another view controller (B) and then adds B's view to its view as a subview. So now ViewController B's view is a subview of ViewController A. The problem I have is If I simply rem...
TITLE: destroy uiviewcontroller containing UIWebView when playing video? QUESTION: Hey all... I have a view controller (A) which on some action, alloc init's another view controller (B) and then adds B's view to its view as a subview. So now ViewController B's view is a subview of ViewController A. The problem I have ...
[ "iphone", "uiwebview", "uiviewcontroller" ]
0
1
1,503
2
0
2011-06-03T21:24:20.843000
2011-06-03T22:08:01.393000
6,232,842
6,236,653
How do I write a gzipped byte array via SFTP (Jsch) without decompressing it?
(This was x-posted to the Jsch mailing list BTW). I'm reading data from a database and carrying that as a byte[] (for transportation across middleware components). From that byte[] I know how to create a gzipped file on the local file system by using the GZIPOutputStream class. Want I want to do is create a gzipped fil...
It looks like your problem is in the usage of the GZipOutputStream combined with the ByteArrayOutputStream, and totally unrelated to JSch. GZipOutputStream is using (by its superclass, a DeflatorOutputStream) a Deflator to do the actual work. This deflator is allowed to buffer any amount of data it deems appropriate, u...
How do I write a gzipped byte array via SFTP (Jsch) without decompressing it? (This was x-posted to the Jsch mailing list BTW). I'm reading data from a database and carrying that as a byte[] (for transportation across middleware components). From that byte[] I know how to create a gzipped file on the local file system ...
TITLE: How do I write a gzipped byte array via SFTP (Jsch) without decompressing it? QUESTION: (This was x-posted to the Jsch mailing list BTW). I'm reading data from a database and carrying that as a byte[] (for transportation across middleware components). From that byte[] I know how to create a gzipped file on the ...
[ "java", "gzip", "sftp", "jsch" ]
4
8
4,792
1
0
2011-06-03T21:24:23.520000
2011-06-04T12:07:50.397000
6,232,843
6,243,525
Am i using eventmachine in the right way?
I am using ruby-smpp and redis to achive a queue based background worker to send SMPP messages. And i am wondering if I am using eventmachine in the right way. It works but it doesnt feel right. #!/usr/bin/env ruby # Sample SMS gateway that can receive MOs (mobile originated messages) and # DRs (delivery reports), and...
Some easy steps to make this code more EventMachine-ish: Get rid of the blocking Redis driver, use em-hiredis Stop using defer. Pushing work out to threads with the Redis driver will make things even worse as it relies on locks around the socket it's using. Get rid of the add_timer(3) Get rid of the inner loop, replace...
Am i using eventmachine in the right way? I am using ruby-smpp and redis to achive a queue based background worker to send SMPP messages. And i am wondering if I am using eventmachine in the right way. It works but it doesnt feel right. #!/usr/bin/env ruby # Sample SMS gateway that can receive MOs (mobile originated m...
TITLE: Am i using eventmachine in the right way? QUESTION: I am using ruby-smpp and redis to achive a queue based background worker to send SMPP messages. And i am wondering if I am using eventmachine in the right way. It works but it doesnt feel right. #!/usr/bin/env ruby # Sample SMS gateway that can receive MOs (m...
[ "ruby", "redis", "eventmachine", "smpp" ]
4
13
3,499
2
0
2011-06-03T21:24:44.597000
2011-06-05T14:31:12.873000
6,232,844
6,232,881
Segmentation fault in File I/O
I have written a code to read a file, store it in a structure and just display it. But somehow it is giving me a segmentation fault and I dont know why. Can someone please help me? Output: file: /home/neel/map2.txt file opened Start Intersection a->road: 4 a->roadId[0]: 1 a->lane[0][0]: 2 a->lane[0][1]: 2 a->roadId[1...
Your lane is an array of 2 elements, however when i reaches 2 in your inner loop you are trying to print a->lane[2][0], which doesn't exist.
Segmentation fault in File I/O I have written a code to read a file, store it in a structure and just display it. But somehow it is giving me a segmentation fault and I dont know why. Can someone please help me? Output: file: /home/neel/map2.txt file opened Start Intersection a->road: 4 a->roadId[0]: 1 a->lane[0][0]: ...
TITLE: Segmentation fault in File I/O QUESTION: I have written a code to read a file, store it in a structure and just display it. But somehow it is giving me a segmentation fault and I dont know why. Can someone please help me? Output: file: /home/neel/map2.txt file opened Start Intersection a->road: 4 a->roadId[0]:...
[ "c++", "pointers", "file-io", "segmentation-fault", "fstream" ]
1
6
3,677
3
0
2011-06-03T21:25:45.603000
2011-06-03T21:31:12.240000
6,232,846
6,232,878
Best email validation function in general and specific (college domain)?
I know email validation is one of those things which is not the funniest thing on the block. I'm starting up a website and i want to limit my audience to only the people in my college and i also want a preferred email address for my user. So this is a two part question. Is there a really solid php function out there fo...
This is what I use: function check_email_address($email) { // First, we check that there's one @ symbol, and that the lengths are right if (!preg_match("/^[^@]{1,64}@[^@]{1,255}$/", $email)) { // Email invalid because wrong number of characters in one section, or wrong number of @ symbols. return false; } // Split it i...
Best email validation function in general and specific (college domain)? I know email validation is one of those things which is not the funniest thing on the block. I'm starting up a website and i want to limit my audience to only the people in my college and i also want a preferred email address for my user. So this ...
TITLE: Best email validation function in general and specific (college domain)? QUESTION: I know email validation is one of those things which is not the funniest thing on the block. I'm starting up a website and i want to limit my audience to only the people in my college and i also want a preferred email address for...
[ "php", "email-validation" ]
5
24
24,262
7
0
2011-06-03T21:25:55.470000
2011-06-03T21:29:52.867000
6,232,859
6,233,290
Call a function from its name as a string in f#
I thought that I might be able to do this with quotations - but I can't see how. Should I just use a table of the functions with their names - or is their a way of doing this? Thanks. For more info...... I'm calling a lot of f# functions from excel and I wondered if I could write a f# function let fs_wrapper (f_name:st...
You'll need to use standard.NET Reflection to do this. Quotations aren't going to help, because they represent function calls using standard.NET MethodInfo, so you'll need to use reflection anyway. The only benefit of quotations (compared to naive reflection) is that you can compile them, which could give you better pe...
Call a function from its name as a string in f# I thought that I might be able to do this with quotations - but I can't see how. Should I just use a table of the functions with their names - or is their a way of doing this? Thanks. For more info...... I'm calling a lot of f# functions from excel and I wondered if I cou...
TITLE: Call a function from its name as a string in f# QUESTION: I thought that I might be able to do this with quotations - but I can't see how. Should I just use a table of the functions with their names - or is their a way of doing this? Thanks. For more info...... I'm calling a lot of f# functions from excel and I...
[ "f#", "quotations" ]
5
10
1,723
3
0
2011-06-03T21:27:34.900000
2011-06-03T22:30:24.743000
6,232,864
6,232,894
Which C/C++ Compilers do enterprises use on Linux?
I have been using the GCC Compiler for months, which is great, and works very well. But I wonder which C++ Compiler do big/medium enterprises use for high optimizations/performance in Linux (x86, PowerPC...). It may seem a very stupid question, but I havent found the answer anywhere. As far as I know, the best PowerPC ...
In the places I have worked we have always used gcc, even for embedded applications/software. Performance improvements are much more likely to come from your code rather than your compiler choice anyway!
Which C/C++ Compilers do enterprises use on Linux? I have been using the GCC Compiler for months, which is great, and works very well. But I wonder which C++ Compiler do big/medium enterprises use for high optimizations/performance in Linux (x86, PowerPC...). It may seem a very stupid question, but I havent found the a...
TITLE: Which C/C++ Compilers do enterprises use on Linux? QUESTION: I have been using the GCC Compiler for months, which is great, and works very well. But I wonder which C++ Compiler do big/medium enterprises use for high optimizations/performance in Linux (x86, PowerPC...). It may seem a very stupid question, but I ...
[ "c++", "c", "linux", "compiler-construction", "enterprise" ]
12
10
1,682
6
0
2011-06-03T21:28:00.423000
2011-06-03T21:33:01.197000
6,232,867
6,236,464
COM exceptions on exit with WPF
After execution both of the following test cases, a COM execution is printed to the console. What am I doing wrong? If I run either test singly, or if I run both tests together, the exception is written to the console exactly once. This makes me suspect that there's some sort of a per-AppDomain resource that I'm not cl...
Looking at my own code again, the following line might help for the WPF test, right at the end. Dispatcher.CurrentDispatcher.InvokeShutdown();
COM exceptions on exit with WPF After execution both of the following test cases, a COM execution is printed to the console. What am I doing wrong? If I run either test singly, or if I run both tests together, the exception is written to the console exactly once. This makes me suspect that there's some sort of a per-Ap...
TITLE: COM exceptions on exit with WPF QUESTION: After execution both of the following test cases, a COM execution is printed to the console. What am I doing wrong? If I run either test singly, or if I run both tests together, the exception is written to the console exactly once. This makes me suspect that there's som...
[ "c#", "wpf", "com", "rcw" ]
13
20
3,152
2
0
2011-06-03T21:28:31.237000
2011-06-04T11:25:50.563000
6,232,872
6,282,666
Issue with Microsoft Enterprise Library 5.0 and custom powershell cmdlet
I'm creating a custom powershell 1.0 cmdlet that will allow me to feed exceptions from powershell scripts to the Microsoft Enterprise Library v5.0 exception handling block. I load up my Exception handling config from an external file since the cmdlet is compiled into a dll, and then try to create an instance of Excepti...
Turns out I wasn't giving an absolute path to my configuration file, which was causing weirdness. I originally just set it to "widgit.dll.config", and threw it under %systemroot%\System32, since that's the default working directory of my powershell, and seemed to get rid of the initial "file not found" errors I was hav...
Issue with Microsoft Enterprise Library 5.0 and custom powershell cmdlet I'm creating a custom powershell 1.0 cmdlet that will allow me to feed exceptions from powershell scripts to the Microsoft Enterprise Library v5.0 exception handling block. I load up my Exception handling config from an external file since the cmd...
TITLE: Issue with Microsoft Enterprise Library 5.0 and custom powershell cmdlet QUESTION: I'm creating a custom powershell 1.0 cmdlet that will allow me to feed exceptions from powershell scripts to the Microsoft Enterprise Library v5.0 exception handling block. I load up my Exception handling config from an external ...
[ "c#", "powershell", "enterprise-library", "powershell-cmdlet" ]
2
1
1,810
1
0
2011-06-03T21:29:03.140000
2011-06-08T17:19:32.180000
6,232,885
6,232,924
Is there a way I can create a variable number of arrays using a loop in java?
I am wondering if there is a way to create arrays in java based on a variable amount. So if I needed to create 10 arrays a loop would make 10(all named sequentially). But if I did not need 10 arrays the loop would create and many as needed. I am envisioning something like this: for(i=0 up to i=imax) create arrayi wher...
Yes; you can create an array of arrays. Let's say that you want arrays of int: int numberOfArrays = 10; int[][] arrays = new int[numberOfArrays][]; for (int i = 0; i < numberOfArrays; i++) arrays[i] = new int[x]; // Where x is the size you want array i to be However, you can not dynamically create variables called arra...
Is there a way I can create a variable number of arrays using a loop in java? I am wondering if there is a way to create arrays in java based on a variable amount. So if I needed to create 10 arrays a loop would make 10(all named sequentially). But if I did not need 10 arrays the loop would create and many as needed. I...
TITLE: Is there a way I can create a variable number of arrays using a loop in java? QUESTION: I am wondering if there is a way to create arrays in java based on a variable amount. So if I needed to create 10 arrays a loop would make 10(all named sequentially). But if I did not need 10 arrays the loop would create and...
[ "java", "variables", "loops", "dynamic", "creation" ]
3
7
4,393
3
0
2011-06-03T21:31:58.910000
2011-06-03T21:36:39.300000
6,232,886
6,233,006
SL Turn Hierarchical Data into Flat Data to Populate a DataGrid
I have a list of Object's, each Object has a Children property which is a list of Object's, which in turn has a Children property which is a list of Object's... the same thing 4 layers deep. I'm trying to pull out every instance of Object inside the entire hierarchy. At each level down the hierarchy it's still the same...
If I am following your line of logic correctly I think what you are looking for is something like what this guy wanted... LINQ: How to convert the nested hierarchical object to flatten object Sounds like you are trying to flatten the object which you can do through a recursive function.
SL Turn Hierarchical Data into Flat Data to Populate a DataGrid I have a list of Object's, each Object has a Children property which is a list of Object's, which in turn has a Children property which is a list of Object's... the same thing 4 layers deep. I'm trying to pull out every instance of Object inside the entire...
TITLE: SL Turn Hierarchical Data into Flat Data to Populate a DataGrid QUESTION: I have a list of Object's, each Object has a Children property which is a list of Object's, which in turn has a Children property which is a list of Object's... the same thing 4 layers deep. I'm trying to pull out every instance of Object...
[ "c#", "silverlight", "linq", "hierarchical-data" ]
2
1
1,797
1
0
2011-06-03T21:32:03.603000
2011-06-03T21:49:16.363000
6,232,887
6,232,913
Multiple projects referencing MFC: "use mfc in a static library" vs "use mfc in a shared dll"?
Using Visual Studio 2010 C++. I have a project which uses MFC and I am statically linking to MFC. I am in the process of trying to extract the non-GUI functionality into a separate static library project. Because I want to use CStrings in my library project (debatable whether I should, but for the sake of argument) I n...
You don't need to link a library project, so there won't be an extra copy of MFC being linked in. You'll be creating a dependency on the MFC library from your static library, but that's normal. As long as the.exe project includes both libraries, everything will come out all right in the end.
Multiple projects referencing MFC: "use mfc in a static library" vs "use mfc in a shared dll"? Using Visual Studio 2010 C++. I have a project which uses MFC and I am statically linking to MFC. I am in the process of trying to extract the non-GUI functionality into a separate static library project. Because I want to us...
TITLE: Multiple projects referencing MFC: "use mfc in a static library" vs "use mfc in a shared dll"? QUESTION: Using Visual Studio 2010 C++. I have a project which uses MFC and I am statically linking to MFC. I am in the process of trying to extract the non-GUI functionality into a separate static library project. Be...
[ "c++", "visual-studio", "mfc", "shared-libraries", "static-libraries" ]
3
2
1,249
1
0
2011-06-03T21:32:13.443000
2011-06-03T21:35:09.900000
6,232,899
6,232,936
basic json decode question
good evening. ingore all other elements, I want get first image in each foreach. how to? $data = json_decode($json,true); foreach ($data['data'][0] as $image) { echo ' '; } json tree is too large, over the letters paste limit. Oops! Your question couldn't be submitted because: body is limited to 30000 characters; you ...
With json_decode every {} (object) will become an object(stdClass) and every [] (array) will become an array. So: $data->data[0]->images[0]->source is what you need, to reach the first image source. Edit: since the second parameter of json_decode is true, it will become an associative array, and it will be like: $data[...
basic json decode question good evening. ingore all other elements, I want get first image in each foreach. how to? $data = json_decode($json,true); foreach ($data['data'][0] as $image) { echo ' '; } json tree is too large, over the letters paste limit. Oops! Your question couldn't be submitted because: body is limite...
TITLE: basic json decode question QUESTION: good evening. ingore all other elements, I want get first image in each foreach. how to? $data = json_decode($json,true); foreach ($data['data'][0] as $image) { echo ' '; } json tree is too large, over the letters paste limit. Oops! Your question couldn't be submitted becaus...
[ "php", "json" ]
0
1
257
1
0
2011-06-03T21:33:32.160000
2011-06-03T21:39:08.440000
6,232,917
6,233,424
Looking for simple ideas on how mysql data is usually structured
I'm playing around with this idea where i was saving "logs" in a "LOGS" table, with each row containing the info like "id" "title" "logtext" "views" "upvotes" "downotes"...you get the basic idea. And this all works great for displaying the logs on the page and it's all done within one table which is nice and clean. But...
I think what you are reaching for is something like this: TABLE LOGS | logid | title | views |... TABLE COMMENTS | comid | logid | author | comment |... And then whenever you fetch a particular log for display, you also go ahead and fetch any comments on that log~ Similarly whenever you delete from LOGS just be sure t...
Looking for simple ideas on how mysql data is usually structured I'm playing around with this idea where i was saving "logs" in a "LOGS" table, with each row containing the info like "id" "title" "logtext" "views" "upvotes" "downotes"...you get the basic idea. And this all works great for displaying the logs on the pag...
TITLE: Looking for simple ideas on how mysql data is usually structured QUESTION: I'm playing around with this idea where i was saving "logs" in a "LOGS" table, with each row containing the info like "id" "title" "logtext" "views" "upvotes" "downotes"...you get the basic idea. And this all works great for displaying t...
[ "php", "mysql", "database", "database-design", "cron" ]
0
0
54
2
0
2011-06-03T21:35:29.227000
2011-06-03T22:55:14.573000
6,232,921
6,232,948
Dynamically ALTERing MySQL tables to add missing fields on INSERT
I'm attempting to merge data from one MySQL database into another. The problem is, some of the tables in Source_DB have fields that the matching table in Target_DB does not have. Is there a way to automatically ALTER the table in Target_DB to add these missing fields as they are found? Or should I go about it another w...
You could query the INFORMATION_SCHEMA.COLUMNS on each DB and figure out what's missing with a NOT IN query and then using the data in the INFORMATION_SCHEMA.COLUMNS dynamically generate the DDL. Or you could use a tool like MySQL Compare to do it.
Dynamically ALTERing MySQL tables to add missing fields on INSERT I'm attempting to merge data from one MySQL database into another. The problem is, some of the tables in Source_DB have fields that the matching table in Target_DB does not have. Is there a way to automatically ALTER the table in Target_DB to add these m...
TITLE: Dynamically ALTERing MySQL tables to add missing fields on INSERT QUESTION: I'm attempting to merge data from one MySQL database into another. The problem is, some of the tables in Source_DB have fields that the matching table in Target_DB does not have. Is there a way to automatically ALTER the table in Target...
[ "mysql", "insert", "field", "alter" ]
1
2
1,044
1
0
2011-06-03T21:35:53.970000
2011-06-03T21:40:20.720000
6,232,923
6,232,990
How to test a grails Criteria query?
first post here and hopefully relevant to many people. I'm working on writing integration tests for a domain and on that domain I have a query using the withCriteria() method. I've searched all over the net and found many that give you detailed instructions on how to go about mocking a criteria query, but none on how t...
One way: move the test from test/unit to test/integration folder. Criteria won't work in unit test (there's no Hibernate there), but will in integration. Never use mockDomain() in integration tests. Note: don't make the method static - it only complicates testing. Second way: In unit tests - use mockDomain(). Just rely...
How to test a grails Criteria query? first post here and hopefully relevant to many people. I'm working on writing integration tests for a domain and on that domain I have a query using the withCriteria() method. I've searched all over the net and found many that give you detailed instructions on how to go about mockin...
TITLE: How to test a grails Criteria query? QUESTION: first post here and hopefully relevant to many people. I'm working on writing integration tests for a domain and on that domain I have a query using the withCriteria() method. I've searched all over the net and found many that give you detailed instructions on how ...
[ "testing", "grails", "criteria" ]
7
7
4,959
3
0
2011-06-03T21:36:35.930000
2011-06-03T21:46:40.320000
6,232,926
6,233,072
What is a good open source package for building flexible spam detection on a large Rails site?
My site is getting larger and it's starting to attract a lot of spam through various channels. The site has a lot of different types of UGC (profiles, forums, blog comments, status updates, private messages, etc, etc). I have various mitigation efforts underway, which I hope to deploy in a blitzkrieg fashion to convinc...
We looked for an acceptable open source solution and didn't find one. If you come to the same conclusion and decide to consider proprietary anti-spam, check out the paid Akismet collaborative spam filtering service. We've had decent performance from it across a dozen medium sized sites. It integrates with rails through...
What is a good open source package for building flexible spam detection on a large Rails site? My site is getting larger and it's starting to attract a lot of spam through various channels. The site has a lot of different types of UGC (profiles, forums, blog comments, status updates, private messages, etc, etc). I have...
TITLE: What is a good open source package for building flexible spam detection on a large Rails site? QUESTION: My site is getting larger and it's starting to attract a lot of spam through various channels. The site has a lot of different types of UGC (profiles, forums, blog comments, status updates, private messages,...
[ "ruby", "linux", "soa", "spam", "bayesian" ]
6
5
516
1
0
2011-06-03T21:37:29.690000
2011-06-03T21:58:33.853000
6,232,935
6,233,271
Rotating a png image representing a unit in a game
I am using png's in my tower defense game. How would I rotate a picture so it follows the movement of another picture (like a turret always pointing at a target)?
Look into the AffineTransform class. The rotate method is what you're looking for. Here 's an example! If you've got some other specific game-development-related questions, there's a Game Development StackExchange site too.
Rotating a png image representing a unit in a game I am using png's in my tower defense game. How would I rotate a picture so it follows the movement of another picture (like a turret always pointing at a target)?
TITLE: Rotating a png image representing a unit in a game QUESTION: I am using png's in my tower defense game. How would I rotate a picture so it follows the movement of another picture (like a turret always pointing at a target)? ANSWER: Look into the AffineTransform class. The rotate method is what you're looking f...
[ "java", "graphics", "png", "jpanel" ]
0
3
1,273
1
0
2011-06-03T21:39:08.080000
2011-06-03T22:28:06.943000
6,232,940
6,232,952
Sql query for inserting all records from one table to another existing table
I am using sql server as my database engine. I need a sql query, so that I can insert all records from one table to another existing table. Both tables are in same DB. I need to use this query in my code.
insert into destination_table ( field1, field2, field3,... ) select field1, field2, field3,... from source_table
Sql query for inserting all records from one table to another existing table I am using sql server as my database engine. I need a sql query, so that I can insert all records from one table to another existing table. Both tables are in same DB. I need to use this query in my code.
TITLE: Sql query for inserting all records from one table to another existing table QUESTION: I am using sql server as my database engine. I need a sql query, so that I can insert all records from one table to another existing table. Both tables are in same DB. I need to use this query in my code. ANSWER: insert into...
[ "sql-server" ]
4
10
13,597
2
0
2011-06-03T21:39:18.667000
2011-06-03T21:40:58.897000
6,232,941
6,232,969
Simple error checking in PHP class function chaining?
I've found some limited use in chaining class functions, say $class->setUser('foo')->getInfo() (bad example) although am having trouble understanding how to handle any errors that arise from one of the calls in the chain. If setUser() for example came with an error, and returned false, it would not return $this and not...
Yes, throwing exceptions would probably be a good idea in this case. You'll be able to pinpoint where the error happened in the chain. Here's an example of how that could work: try { $class->setUser('foo')->getInfo(); } catch(UnknownUser $ex) { // setUser failed } catch(CannotFetchInfo $ex) { // getInfo failed }
Simple error checking in PHP class function chaining? I've found some limited use in chaining class functions, say $class->setUser('foo')->getInfo() (bad example) although am having trouble understanding how to handle any errors that arise from one of the calls in the chain. If setUser() for example came with an error,...
TITLE: Simple error checking in PHP class function chaining? QUESTION: I've found some limited use in chaining class functions, say $class->setUser('foo')->getInfo() (bad example) although am having trouble understanding how to handle any errors that arise from one of the calls in the chain. If setUser() for example c...
[ "php", "oop", "exception", "method-chaining" ]
1
3
734
2
0
2011-06-03T21:39:22.770000
2011-06-03T21:43:21.070000
6,232,942
6,233,263
MS Access get Average only if one record meets criteria
In MS Access I am trying to get an average of data but only when the last record of each set is larger than a value. almost have it but cant get the last part. So my data looks like so: CarID WeekOf NumDataPoints Fuel 3AA May-14-2011 4 300 7BB May-14-2011 9 250 3AA May-21-2011 35 310 7BB May-21-2011 7 275 3AA May-28-...
You can use this query to show which cars have 5 or more NumDataPoints. SELECT CarID FROM tblCars WHERE (((WeekOf)=#2011-05-28#) AND ((NumDataPoints)>=5)); And this to average the Fuel values for each car over the 3 week range. SELECT CarID, Avg(Fuel) AS AvgF FROM tblCars WHERE (((WeekOf)>=#2011-05-14# And (WeekOf)<=#2...
MS Access get Average only if one record meets criteria In MS Access I am trying to get an average of data but only when the last record of each set is larger than a value. almost have it but cant get the last part. So my data looks like so: CarID WeekOf NumDataPoints Fuel 3AA May-14-2011 4 300 7BB May-14-2011 9 250 3...
TITLE: MS Access get Average only if one record meets criteria QUESTION: In MS Access I am trying to get an average of data but only when the last record of each set is larger than a value. almost have it but cant get the last part. So my data looks like so: CarID WeekOf NumDataPoints Fuel 3AA May-14-2011 4 300 7BB Ma...
[ "sql", "ms-access", "group-by", "aggregate", "average" ]
0
1
1,307
1
0
2011-06-03T21:39:24.713000
2011-06-03T22:27:00.220000
6,232,951
6,233,997
How to create custom View and Layouts in Grails
I am wanting to create a page that can load a property file into a text box, edit the properties, and then save the new properties to the file. Would this be possible by simply using HTML markup? How do I get the push buttons to correlate with my Grails application? The HTML seems simple enough: Select property file: I...
In order to make full use of Grails functionality, you'll probably want to use the associated HTML tags - form (or uploadForm for a form that's uploading the file) and actionSubmit. Grails doesn't offer a custom file input for reasons which I don't remember, so you'll need to use the as shown in your example.
How to create custom View and Layouts in Grails I am wanting to create a page that can load a property file into a text box, edit the properties, and then save the new properties to the file. Would this be possible by simply using HTML markup? How do I get the push buttons to correlate with my Grails application? The H...
TITLE: How to create custom View and Layouts in Grails QUESTION: I am wanting to create a page that can load a property file into a text box, edit the properties, and then save the new properties to the file. Would this be possible by simply using HTML markup? How do I get the push buttons to correlate with my Grails ...
[ "html", "layout", "grails", "groovy", "view" ]
0
2
1,214
1
0
2011-06-03T21:40:44.687000
2011-06-04T01:04:26.820000
6,232,954
6,232,989
Android - Inflate a view and draw to canvas?
I have a problem that would be easily solved if I could somehow inflate a view (this part is doable) but instead of letting android's UI framework handle it, I would like to be able to explicitly draw it to a Canvas object. Is that possible? Thanks
To be able to draw directly on the canvas, you'll have to extend the View to create your custom component. See http://developer.android.com/guide/topics/ui/custom-components.html
Android - Inflate a view and draw to canvas? I have a problem that would be easily solved if I could somehow inflate a view (this part is doable) but instead of letting android's UI framework handle it, I would like to be able to explicitly draw it to a Canvas object. Is that possible? Thanks
TITLE: Android - Inflate a view and draw to canvas? QUESTION: I have a problem that would be easily solved if I could somehow inflate a view (this part is doable) but instead of letting android's UI framework handle it, I would like to be able to explicitly draw it to a Canvas object. Is that possible? Thanks ANSWER:...
[ "android" ]
0
1
1,947
1
0
2011-06-03T21:41:20.697000
2011-06-03T21:46:30.700000
6,232,958
6,234,660
ERROR 704 & 12154 while connecting sqlloader to server
I have a oracle database based on a server, and I want to import the data in the tables on the server. I am trying to use sqlloadr(sqlldr) for inserting all data in the oracle database, which is on localhost and there is no problem in this case, but the problem occurs while I try to connect a web-server(not localhost)....
"where I created a tnsnames.ora which is like following:" That seems to mean you have posted the TNSNAMES.ORA file from the database server. Remember you also need a TNSNAMES.ORA file on the client. Is that correctly configured too?
ERROR 704 & 12154 while connecting sqlloader to server I have a oracle database based on a server, and I want to import the data in the tables on the server. I am trying to use sqlloadr(sqlldr) for inserting all data in the oracle database, which is on localhost and there is no problem in this case, but the problem occ...
TITLE: ERROR 704 & 12154 while connecting sqlloader to server QUESTION: I have a oracle database based on a server, and I want to import the data in the tables on the server. I am trying to use sqlloadr(sqlldr) for inserting all data in the oracle database, which is on localhost and there is no problem in this case, b...
[ "oracle", "sql-loader", "tnsnames" ]
0
1
27,068
5
0
2011-06-03T21:41:43.220000
2011-06-04T04:19:39.363000
6,232,959
6,233,150
Graphic of binary variable in R
I would like to plot a simple graphic. I have a dat set with n rowns and k columns, in which each row has a a sequence of 0 and 1. I would like to plot exactly this sequence for all rows. Actually I want to reproduce the figure 24.1, p. 516, of Gelman and Hill's book (Data aAnalysis Using Regression and Multilevel/Hier...
I would go with a formatted text output using sprintf. Much cleaner and simpler. If you still want a plot, you could go with the following: Given matrix tbl containing your data: tbl <- matrix(data=rep(0:1,25), nrow=5) You can generate a plot as: plot(1, 1, xlim=c(1,dim(tbl)[2]+.5), ylim=c(0.5,dim(tbl)[1]), type="n") l...
Graphic of binary variable in R I would like to plot a simple graphic. I have a dat set with n rowns and k columns, in which each row has a a sequence of 0 and 1. I would like to plot exactly this sequence for all rows. Actually I want to reproduce the figure 24.1, p. 516, of Gelman and Hill's book (Data aAnalysis Usin...
TITLE: Graphic of binary variable in R QUESTION: I would like to plot a simple graphic. I have a dat set with n rowns and k columns, in which each row has a a sequence of 0 and 1. I would like to plot exactly this sequence for all rows. Actually I want to reproduce the figure 24.1, p. 516, of Gelman and Hill's book (D...
[ "r" ]
3
4
1,638
3
0
2011-06-03T21:41:48.167000
2011-06-03T22:08:22.827000
6,232,961
6,232,997
priority queue insertion
Im working on a method for insertion into priority queue using the huffman method. However I keep getting the same error: prioque.c:46: error: expected ")" before "prioque_ref" my structures are: typedef struct prioque *prioque_ref; struct prioque { int dim; int last; prioque_item *array; cmpfn_prioque cmpfn; }; my cod...
You have already done a typedef for prioque * void insert_prioque (prioque prioque_ref *queue, prioque_item item) // ^ complaining about this space So, it should be - void insert_prioque (prioque_ref queue, prioque_item item) { /*.... */ }
priority queue insertion Im working on a method for insertion into priority queue using the huffman method. However I keep getting the same error: prioque.c:46: error: expected ")" before "prioque_ref" my structures are: typedef struct prioque *prioque_ref; struct prioque { int dim; int last; prioque_item *array; cmpfn...
TITLE: priority queue insertion QUESTION: Im working on a method for insertion into priority queue using the huffman method. However I keep getting the same error: prioque.c:46: error: expected ")" before "prioque_ref" my structures are: typedef struct prioque *prioque_ref; struct prioque { int dim; int last; prioque_...
[ "c", "priority-queue" ]
0
4
260
1
0
2011-06-03T21:42:03.847000
2011-06-03T21:48:12.553000
6,232,962
6,233,776
how do you get rmagick to work on windows 7 64-bit with rails 3.1 and carrierwave?
I'm having trouble getting rmagick to work on windows. Does anyone know how to get this working correctly? And even better, hopefully in a way that is compatible with a production environment, although I'll take whatever I can get. C:\> gem install rmagick --platform=ruby -- --with-opt-lib=%IMAGE_MAGICK_HOME%/lib --wit...
Answer in this thread made it work on both of my computer: RMagick on Windows I hope it'll work for you too!
how do you get rmagick to work on windows 7 64-bit with rails 3.1 and carrierwave? I'm having trouble getting rmagick to work on windows. Does anyone know how to get this working correctly? And even better, hopefully in a way that is compatible with a production environment, although I'll take whatever I can get. C:\> ...
TITLE: how do you get rmagick to work on windows 7 64-bit with rails 3.1 and carrierwave? QUESTION: I'm having trouble getting rmagick to work on windows. Does anyone know how to get this working correctly? And even better, hopefully in a way that is compatible with a production environment, although I'll take whateve...
[ "ruby-on-rails", "ruby", "windows", "rmagick" ]
3
4
4,661
2
0
2011-06-03T21:42:33.123000
2011-06-04T00:06:05.850000
6,232,963
6,233,014
Django: Form field size
In Django Templates, how do i specify the size of a field This is my form class: class PstForm(forms.Form): hours = forms.ChoiceField(choices=[(6,6),(24,24),(48,48)], widget=forms.Select(attrs={'size':'3'})) however this still renders a rather long field how do i limit the size?
You could try adjusting the CSS: attrs={'style': 'width:10px'}, (or 'class': 'some-class', etc).
Django: Form field size In Django Templates, how do i specify the size of a field This is my form class: class PstForm(forms.Form): hours = forms.ChoiceField(choices=[(6,6),(24,24),(48,48)], widget=forms.Select(attrs={'size':'3'})) however this still renders a rather long field how do i limit the size?
TITLE: Django: Form field size QUESTION: In Django Templates, how do i specify the size of a field This is my form class: class PstForm(forms.Form): hours = forms.ChoiceField(choices=[(6,6),(24,24),(48,48)], widget=forms.Select(attrs={'size':'3'})) however this still renders a rather long field how do i limit the size...
[ "django", "django-templates", "django-forms" ]
15
21
19,161
1
0
2011-06-03T21:42:44.280000
2011-06-03T21:50:35.107000
6,232,971
6,236,836
Re-Write complex query (COS, SIN, RADIANS, ACOS) into Entity-to-SQL
The following store procedure retrives nearest 500 addresses for the given latitude and longitude. Many applications use it, and it is one of the useful query. Is it possible to rewrite with Entity-to-SQL? If so, could you please point me to the right direction (I am not new to Entity-to-SQL)? Thanks in advance. DECLAR...
If you are using Ms Sql Server, you can use SqlClient functions with Entity SQL http://msdn.microsoft.com/en-us/library/bb399586.aspx According to this those functions are available for LINQ queries aswell. I couldn't find an example but it seems straightforward. var qry = from r in mytable select new {Acos = SqlFuncti...
Re-Write complex query (COS, SIN, RADIANS, ACOS) into Entity-to-SQL The following store procedure retrives nearest 500 addresses for the given latitude and longitude. Many applications use it, and it is one of the useful query. Is it possible to rewrite with Entity-to-SQL? If so, could you please point me to the right ...
TITLE: Re-Write complex query (COS, SIN, RADIANS, ACOS) into Entity-to-SQL QUESTION: The following store procedure retrives nearest 500 addresses for the given latitude and longitude. Many applications use it, and it is one of the useful query. Is it possible to rewrite with Entity-to-SQL? If so, could you please poin...
[ "entity-framework", "sqlclr" ]
1
4
838
1
0
2011-06-03T21:43:34.537000
2011-06-04T12:50:12.577000
6,232,981
6,233,062
What are all the available alternatives to WCF?
I would like to use a technology that is used for communication between services and several thousands of clients. I came to know of WCF and read a little about it. While it looks attractive and has no interoperability issues, i would like to know about other leading technologies which can give me the same features as ...
I don't think there is any.net framework with comparable features. But the core protocols of WCF such as WSDL/SOAP are not Microsoft specific so it's not as if you're tying yourself into a particular protocol, you're just choosing an implementation. To put it another way if you choose to migrate away from.net in the fu...
What are all the available alternatives to WCF? I would like to use a technology that is used for communication between services and several thousands of clients. I came to know of WCF and read a little about it. While it looks attractive and has no interoperability issues, i would like to know about other leading tech...
TITLE: What are all the available alternatives to WCF? QUESTION: I would like to use a technology that is used for communication between services and several thousands of clients. I came to know of WCF and read a little about it. While it looks attractive and has no interoperability issues, i would like to know about ...
[ "wcf", "client-server", "distributed-computing" ]
6
3
5,732
2
0
2011-06-03T21:45:01.117000
2011-06-03T21:58:00.257000
6,232,984
6,233,028
Why does this MySQL query not work in PHP code?
I am writing PHP code for a dynamic web page. The SQL query code below looks correct, but whenever the page runs, I keep getting the message within the die parameter. $recipeid = $_GET['id']; $query = "select title from recipes where recipeid = $recipeid"; $result = mysql_query($query) or die('Could not retrieve file')...
Aside from the SQL Injection ( look into mysql_real_escape_string ) add this to your error statement to see the exact error: $result = mysql_query($query) or die('Could not retrieve file: '. mysql_error()); And it will tell you what is wrong.
Why does this MySQL query not work in PHP code? I am writing PHP code for a dynamic web page. The SQL query code below looks correct, but whenever the page runs, I keep getting the message within the die parameter. $recipeid = $_GET['id']; $query = "select title from recipes where recipeid = $recipeid"; $result = mysql...
TITLE: Why does this MySQL query not work in PHP code? QUESTION: I am writing PHP code for a dynamic web page. The SQL query code below looks correct, but whenever the page runs, I keep getting the message within the die parameter. $recipeid = $_GET['id']; $query = "select title from recipes where recipeid = $recipeid...
[ "php", "mysql" ]
1
2
93
3
0
2011-06-03T21:45:20.787000
2011-06-03T21:52:03.020000
6,232,986
6,233,024
How do I initialize a two-dimensional List statically?
How can I initialize a multidimensional List statically? This works: List > list = new ArrayList >(); But I'd like to init the list with some static lists like: (1,2,3), (4,5,6) and (7,8,9)
This is an old answer, but things have changed a bit. For java 9+ this can be done using the List.of() method which returns an immutable List which is a subclass of AbstractImmutableList. import java.util.List; List > list = List.of( List.of(1, 2, 3), List.of(4, 5, 6), List.of(7, 8, 9) ); For older version of java or ...
How do I initialize a two-dimensional List statically? How can I initialize a multidimensional List statically? This works: List > list = new ArrayList >(); But I'd like to init the list with some static lists like: (1,2,3), (4,5,6) and (7,8,9)
TITLE: How do I initialize a two-dimensional List statically? QUESTION: How can I initialize a multidimensional List statically? This works: List > list = new ArrayList >(); But I'd like to init the list with some static lists like: (1,2,3), (4,5,6) and (7,8,9) ANSWER: This is an old answer, but things have changed a...
[ "java", "list", "initialization", "arraylist", "multidimensional-array" ]
25
28
47,093
3
0
2011-06-03T21:45:44.017000
2011-06-03T21:51:33.543000
6,232,988
6,233,011
Accessing text/template contents in javascript
I'm trying to access the html contents of an script block with the type set to "text/template". I've heard of template engines using such tags, but my application is very simple and loading an entire engine is unnecessary. Can someone shed some light on how I select that element? I think jQuery's.html() function will g...
Both: $('#repeating-form-section-template'); $("script[type='text/template']"); Work fine. Make sure you check them after DOM load. Example: http://jsfiddle.net/niklasvh/VKqPX/
Accessing text/template contents in javascript I'm trying to access the html contents of an script block with the type set to "text/template". I've heard of template engines using such tags, but my application is very simple and loading an entire engine is unnecessary. Can someone shed some light on how I select that e...
TITLE: Accessing text/template contents in javascript QUESTION: I'm trying to access the html contents of an script block with the type set to "text/template". I've heard of template engines using such tags, but my application is very simple and loading an entire engine is unnecessary. Can someone shed some light on h...
[ "javascript", "jquery", "templates" ]
4
3
17,645
3
0
2011-06-03T21:46:23.923000
2011-06-03T21:50:09.067000
6,232,991
6,233,040
How to limit mysql query and also limit it by a timestamp?
How could I take a mysql query like this: SELECT id,title,timestamp,upvotes,downvotes,views FROM {$table} ORDER BY count DESC LIMIT $start_from, 20 and based on the timestamp (which is a standard mysql timestamp) make my mysql not only LIMIT $start_from, 20 but in addition... Limit by: if it was made today if it was ma...
SELECT id, title, timestamp, upvotes, downvotes, views FROM {$table} WHERE timestamp >= DATE_SUB(CURRENT_DATE, INTERVAL 1 MONTH) ORDER BY count DESC LIMIT $start_from, 20 MySQL Reference Manual DATE_SUB
How to limit mysql query and also limit it by a timestamp? How could I take a mysql query like this: SELECT id,title,timestamp,upvotes,downvotes,views FROM {$table} ORDER BY count DESC LIMIT $start_from, 20 and based on the timestamp (which is a standard mysql timestamp) make my mysql not only LIMIT $start_from, 20 but...
TITLE: How to limit mysql query and also limit it by a timestamp? QUESTION: How could I take a mysql query like this: SELECT id,title,timestamp,upvotes,downvotes,views FROM {$table} ORDER BY count DESC LIMIT $start_from, 20 and based on the timestamp (which is a standard mysql timestamp) make my mysql not only LIMIT $...
[ "mysql", "database", "timestamp", "limit" ]
3
9
3,424
3
0
2011-06-03T21:47:09.867000
2011-06-03T21:52:59.490000
6,232,992
6,256,588
AnkhSVN is not showing as a source control plugin in VS 2008 on windows 7 (64 bit)
I installed AnkhSVN without error and when I open Visual Studio I don't see AnkhSVN as an available Source Control Plugin. The list is empty. I've tried the usual - restart VS, reboot, repair installation but it won't seem to Is it anything to do with me having 64-bit windows 7? The registry location that I believe Ank...
There are at least thousands of users using AnkhSVN under Windows 7 64 bit without any problems. (And I'm one of them). If you are just using an official MSI to install AnkhSVN (2.0, 2.1 or 2.2) you shouldn't have any problem.
AnkhSVN is not showing as a source control plugin in VS 2008 on windows 7 (64 bit) I installed AnkhSVN without error and when I open Visual Studio I don't see AnkhSVN as an available Source Control Plugin. The list is empty. I've tried the usual - restart VS, reboot, repair installation but it won't seem to Is it anyth...
TITLE: AnkhSVN is not showing as a source control plugin in VS 2008 on windows 7 (64 bit) QUESTION: I installed AnkhSVN without error and when I open Visual Studio I don't see AnkhSVN as an available Source Control Plugin. The list is empty. I've tried the usual - restart VS, reboot, repair installation but it won't s...
[ "visual-studio-2008", "ankhsvn" ]
1
2
1,141
1
0
2011-06-03T21:47:30.143000
2011-06-06T18:47:11.717000
6,232,998
6,234,256
cakephp how to use call back method
I am new to cakephp. I am trying to put a query in after getting the result part in model and use it in call back. But getting errors when I try to get the debug of $newArray from model.. In my controller I have this function index($var = null){ if (empty($this->data)) { } else { $results = array(); $getRecords = $...
Callbacks are automatically called by Cake, you do not call them by hand (that's the point, otherwise they'd be normal methods). The flow is: Controller calls Model::find Cake triggers Model::beforeFind callback, if present Cake finds results Cake triggers Model::afterFind callback if present, passing in an array of fo...
cakephp how to use call back method I am new to cakephp. I am trying to put a query in after getting the result part in model and use it in call back. But getting errors when I try to get the debug of $newArray from model.. In my controller I have this function index($var = null){ if (empty($this->data)) { } else { ...
TITLE: cakephp how to use call back method QUESTION: I am new to cakephp. I am trying to put a query in after getting the result part in model and use it in call back. But getting errors when I try to get the debug of $newArray from model.. In my controller I have this function index($var = null){ if (empty($this->da...
[ "cakephp", "cakephp-1.3" ]
1
2
1,931
1
0
2011-06-03T21:48:18.440000
2011-06-04T02:13:03.323000
6,233,009
6,233,346
How do you copy one column in one sheet to another column in a different sheet, while skipping over blank cells?
I have a one sheet with a column which ranges from C2 till C6115. In that range there are many empty cells. I want to copy the filled cells only into a seperate sheet using VB in excel 2007. Can anyone give me a general code that can help me perform that?
Sub copy() Dim i As Long Dim cell As Range i = 1 For Each cell In Sheets(1).Range("c2:c6115") If Not IsEmpty(cell) Then Sheets(2).Range("c" & i).Value = cell.Value i = i + 1 End If Next cell End Sub
How do you copy one column in one sheet to another column in a different sheet, while skipping over blank cells? I have a one sheet with a column which ranges from C2 till C6115. In that range there are many empty cells. I want to copy the filled cells only into a seperate sheet using VB in excel 2007. Can anyone give ...
TITLE: How do you copy one column in one sheet to another column in a different sheet, while skipping over blank cells? QUESTION: I have a one sheet with a column which ranges from C2 till C6115. In that range there are many empty cells. I want to copy the filled cells only into a seperate sheet using VB in excel 2007...
[ "excel", "vba", "spreadsheet", "copy-paste" ]
2
1
608
1
0
2011-06-03T21:49:52.507000
2011-06-03T22:40:44.073000
6,233,019
6,233,092
How to pass a variable to a php function inside a Bash Script
How can I pass a variable to a php function inside a Bash Script? For example: #! /bin/bash VAR='/$#' php_cwd=`/usr/bin/php << 'EOF' EOF` echo "$php_cwd" This is another attempt: VAR='VARIABLE' php_var=`php -r 'echo $VAR;'` echo $php_var Resulting: PHP Notice: Undefined variable: VAR in Command line code on line 1 Noti...
Enclose the variable in quote to make it static string for php #! /bin/bash VAR='/$#' php_cwd=`/usr/bin/php < EOF` echo "$php_cwd"
How to pass a variable to a php function inside a Bash Script How can I pass a variable to a php function inside a Bash Script? For example: #! /bin/bash VAR='/$#' php_cwd=`/usr/bin/php << 'EOF' EOF` echo "$php_cwd" This is another attempt: VAR='VARIABLE' php_var=`php -r 'echo $VAR;'` echo $php_var Resulting: PHP Notic...
TITLE: How to pass a variable to a php function inside a Bash Script QUESTION: How can I pass a variable to a php function inside a Bash Script? For example: #! /bin/bash VAR='/$#' php_cwd=`/usr/bin/php << 'EOF' EOF` echo "$php_cwd" This is another attempt: VAR='VARIABLE' php_var=`php -r 'echo $VAR;'` echo $php_var Re...
[ "php", "bash" ]
1
1
959
2
0
2011-06-03T21:51:22.523000
2011-06-03T22:01:03.670000
6,233,020
6,233,177
How to retain AJAX data after a POST with limited AJAX requests
I'm using C# with.NET 4 (though as per company policy, we never use any ASP controls, only HTML inputs, so our pages aren't really all that much different from Rails or PHP pages). My page is required to make a number of AJAX requests to populate a few 's based on the values in other inputs on the form. The AJAX reques...
How about saving the option values in a hidden input before posting so if the posted form doesnt pass server-side validation you will be able to have the option data in the Request.Form object and you will be able to re-populate the control on the server with these values and use some kind of if() condition to prevent ...
How to retain AJAX data after a POST with limited AJAX requests I'm using C# with.NET 4 (though as per company policy, we never use any ASP controls, only HTML inputs, so our pages aren't really all that much different from Rails or PHP pages). My page is required to make a number of AJAX requests to populate a few 's ...
TITLE: How to retain AJAX data after a POST with limited AJAX requests QUESTION: I'm using C# with.NET 4 (though as per company policy, we never use any ASP controls, only HTML inputs, so our pages aren't really all that much different from Rails or PHP pages). My page is required to make a number of AJAX requests to ...
[ "ajax" ]
0
0
456
2
0
2011-06-03T21:51:24.480000
2011-06-03T22:12:28.363000
6,233,022
6,233,175
Live data on datagrid for newly added or deleted row in database
public void RefreshEntities(object sender) { for (;; ) { try { //refreshing entities will not add new rows added so datagrid needs to be recreated if (isChanged()) { Fetch(); //Reset binding or reconstruct data grid networkEntityTracker = pLCSignilinxEntities.SIGNILINX_NETWORK.ToList().Count; systemEntityTracker = pLCS...
First thing a better approach would be to Threading.Timer instead of the infinite loop that sleeps. http://msdn.microsoft.com/en-us/library/system.threading.timer.aspx Or if you have access you could setup a Sql Dependency to fire a change event every time data is updated, added or deleted. Though for me this has never...
Live data on datagrid for newly added or deleted row in database public void RefreshEntities(object sender) { for (;; ) { try { //refreshing entities will not add new rows added so datagrid needs to be recreated if (isChanged()) { Fetch(); //Reset binding or reconstruct data grid networkEntityTracker = pLCSignilinxEnti...
TITLE: Live data on datagrid for newly added or deleted row in database QUESTION: public void RefreshEntities(object sender) { for (;; ) { try { //refreshing entities will not add new rows added so datagrid needs to be recreated if (isChanged()) { Fetch(); //Reset binding or reconstruct data grid networkEntityTracker ...
[ "c#", ".net", "wpf", "ado.net", "binding" ]
0
0
1,315
1
0
2011-06-03T21:51:24.250000
2011-06-03T22:12:12.850000
6,233,029
6,233,090
Android - Slide Back to Home Screen
I've created a "back to home" type button in Android by using the code: Intent i=new Intent(this, Home.class); i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(i); However, when android transitions to the Home activity, it slides the activity in from right-to-left, giving the user the impression that a new act...
You can override the animation by calling overridePendingTransition() after startActivity(). Look at this example from google. Take a look at how to create an animation resource too.
Android - Slide Back to Home Screen I've created a "back to home" type button in Android by using the code: Intent i=new Intent(this, Home.class); i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(i); However, when android transitions to the Home activity, it slides the activity in from right-to-left, giving th...
TITLE: Android - Slide Back to Home Screen QUESTION: I've created a "back to home" type button in Android by using the code: Intent i=new Intent(this, Home.class); i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(i); However, when android transitions to the Home activity, it slides the activity in from right-...
[ "android", "android-activity", "transition" ]
0
1
2,173
2
0
2011-06-03T21:52:11.787000
2011-06-03T22:00:56.450000
6,233,037
6,233,217
SQL statement which returns id and splits comma separated values
I have a table with the following data: NodeId ExternalIds 50 601 56 700,701 How do I write an SQL-statement which splits the ExternalIds-column and returns: NodeId ExternalIds 50 601 56 700 56 701 I have found a lot of user defined functions and procedure which splits a string into a table, but I cannot get any of the...
select NodeId, S.part from #tmpTable cross apply [dbo].[SplitString](ExternalIds, ',') as S
SQL statement which returns id and splits comma separated values I have a table with the following data: NodeId ExternalIds 50 601 56 700,701 How do I write an SQL-statement which splits the ExternalIds-column and returns: NodeId ExternalIds 50 601 56 700 56 701 I have found a lot of user defined functions and procedur...
TITLE: SQL statement which returns id and splits comma separated values QUESTION: I have a table with the following data: NodeId ExternalIds 50 601 56 700,701 How do I write an SQL-statement which splits the ExternalIds-column and returns: NodeId ExternalIds 50 601 56 700 56 701 I have found a lot of user defined func...
[ "sql-server" ]
7
6
5,042
2
0
2011-06-03T21:52:41.467000
2011-06-03T22:19:37.670000
6,233,060
6,233,088
SQL Server 2005 find all columns in database for a certain datatype
Is there a way to query the system tables to find all the columns in a database that has a certain datatype. For example if I needed to know the table name and the column where the datatype = ntext Is there a way to do that?
Try this: SELECT a.name -- OR a.* FROM syscolumns a INNER JOIN systypes b ON a.xtype = b.xtype AND b.name = 'ntext' -- OR OTHER DATA TYPE.
SQL Server 2005 find all columns in database for a certain datatype Is there a way to query the system tables to find all the columns in a database that has a certain datatype. For example if I needed to know the table name and the column where the datatype = ntext Is there a way to do that?
TITLE: SQL Server 2005 find all columns in database for a certain datatype QUESTION: Is there a way to query the system tables to find all the columns in a database that has a certain datatype. For example if I needed to know the table name and the column where the datatype = ntext Is there a way to do that? ANSWER: ...
[ "sql-server", "sql-server-2005" ]
2
6
4,671
4
0
2011-06-03T21:57:49.477000
2011-06-03T22:00:40.190000
6,233,073
6,233,185
adding UITextField to UIImageView layout issue
Possible Duplicate: custom UITextField with image as a background blinking cursor issue I have a UIImageView (the image has a pattern, gradient, and shadow in it). I have added a UITextField as a subview of this UIImageView and set the textField background to clear so that it's seen through, the code is: UITextField *t...
Add the UITextField as a subview on the view of the viewcontroller, and not the 'username_background' UIImageView. I believe this should fix your problem.
adding UITextField to UIImageView layout issue Possible Duplicate: custom UITextField with image as a background blinking cursor issue I have a UIImageView (the image has a pattern, gradient, and shadow in it). I have added a UITextField as a subview of this UIImageView and set the textField background to clear so that...
TITLE: adding UITextField to UIImageView layout issue QUESTION: Possible Duplicate: custom UITextField with image as a background blinking cursor issue I have a UIImageView (the image has a pattern, gradient, and shadow in it). I have added a UITextField as a subview of this UIImageView and set the textField backgroun...
[ "iphone", "objective-c", "uiimageview", "uitextfield" ]
0
0
916
2
0
2011-06-03T21:58:40.530000
2011-06-03T22:14:20.987000
6,233,080
6,236,456
Are there any Java Profilers which one can get with an MSDN membership?
Are there any Java Profilers one can get with an MSDN membership? I would like a Profiler that can intergrate with WebSphere 6.1. Grae
It's unlikely MS would develop a profiler for the competitors platform don't you think? If you wanted a.Net profiler that integrated with BizTalk you might have a chance with MSDN, but even then, I don't know of any free commercial profiler included in MSDN that is not free anyway (without MSDN). For Java and Websphere...
Are there any Java Profilers which one can get with an MSDN membership? Are there any Java Profilers one can get with an MSDN membership? I would like a Profiler that can intergrate with WebSphere 6.1. Grae
TITLE: Are there any Java Profilers which one can get with an MSDN membership? QUESTION: Are there any Java Profilers one can get with an MSDN membership? I would like a Profiler that can intergrate with WebSphere 6.1. Grae ANSWER: It's unlikely MS would develop a profiler for the competitors platform don't you think...
[ "java", "optimization", "jakarta-ee", "profiler", "msdn" ]
0
1
72
1
0
2011-06-03T21:59:42.440000
2011-06-04T11:23:00.397000
6,233,081
6,233,304
The specified procedure could not be found (MapVirtualKeyEx) JNA (Java)
I am using JNA and need to use the MapVirtualKeyEx function. Here is the signature: UINT WINAPI MapVirtualKeyEx( __in UINT uCode, __in UINT uMapType, __inout_opt HKL dwhkl ); More information on the signature can be found here: http://msdn.microsoft.com/en-us/library/ms646307(v=vs.85).aspx I tried this: int MapVirtual...
Since MapVirtualKeyEx() deals with characters there is an ANSI and WIDE version of it. Therefore the function is MapVirtualKeyExA()/MapVirtualKeyExW() depending which one you want to use.
The specified procedure could not be found (MapVirtualKeyEx) JNA (Java) I am using JNA and need to use the MapVirtualKeyEx function. Here is the signature: UINT WINAPI MapVirtualKeyEx( __in UINT uCode, __in UINT uMapType, __inout_opt HKL dwhkl ); More information on the signature can be found here: http://msdn.microso...
TITLE: The specified procedure could not be found (MapVirtualKeyEx) JNA (Java) QUESTION: I am using JNA and need to use the MapVirtualKeyEx function. Here is the signature: UINT WINAPI MapVirtualKeyEx( __in UINT uCode, __in UINT uMapType, __inout_opt HKL dwhkl ); More information on the signature can be found here: h...
[ "java", "windows", "api", "java-native-interface", "jna" ]
1
1
740
2
0
2011-06-03T21:59:49.180000
2011-06-03T22:33:16.550000
6,233,085
6,233,157
C++ pure virtual methods
Consider this demo program: #include class Base { public: virtual int f(int) =0; virtual int f(){ return f(0); } virtual ~Base(){ } }; class Derived: public Base { public: int f(int i) { return (10 + i); } }; int main(void) { Derived obj; printf("%d\n", obj.f(1)); // This works, and returns 11 printf("%d\n", obj.f()...
The reason is, that the defined f (in Derived ) hides the f functions from the Base class. The solution is to add using. Like this: class Derived: public Base { public: int f(int i) { return (10 + i); } // vvvvvvvvvvvvvv using Base::f; };
C++ pure virtual methods Consider this demo program: #include class Base { public: virtual int f(int) =0; virtual int f(){ return f(0); } virtual ~Base(){ } }; class Derived: public Base { public: int f(int i) { return (10 + i); } }; int main(void) { Derived obj; printf("%d\n", obj.f(1)); // This works, and returns ...
TITLE: C++ pure virtual methods QUESTION: Consider this demo program: #include class Base { public: virtual int f(int) =0; virtual int f(){ return f(0); } virtual ~Base(){ } }; class Derived: public Base { public: int f(int i) { return (10 + i); } }; int main(void) { Derived obj; printf("%d\n", obj.f(1)); // This w...
[ "c++", "inheritance", "pure-virtual" ]
5
3
2,939
3
0
2011-06-03T22:00:25.060000
2011-06-03T22:09:42.697000
6,233,086
6,233,244
ORA-00918: column ambiguously defined in SELECT *
Getting ORA-00918: column ambiguously defined: running this SQL: SELECT * FROM (SELECT DISTINCT(coaches.id), people.*, users.*, coaches.* FROM "COACHES" INNER JOIN people ON people.id = coaches.person_id INNER JOIN users ON coaches.person_id = users.person_id LEFT OUTER JOIN organizations_users ON organizations_users.u...
A query's projection can only have one instance of a given name. As your WHERE clause shows, you have several tables with a column called ID. Because you are selecting * your projection will have several columns called ID. Or it would have were it not for the compiler hurling ORA-00918. The solution is quite simple: yo...
ORA-00918: column ambiguously defined in SELECT * Getting ORA-00918: column ambiguously defined: running this SQL: SELECT * FROM (SELECT DISTINCT(coaches.id), people.*, users.*, coaches.* FROM "COACHES" INNER JOIN people ON people.id = coaches.person_id INNER JOIN users ON coaches.person_id = users.person_id LEFT OUTER...
TITLE: ORA-00918: column ambiguously defined in SELECT * QUESTION: Getting ORA-00918: column ambiguously defined: running this SQL: SELECT * FROM (SELECT DISTINCT(coaches.id), people.*, users.*, coaches.* FROM "COACHES" INNER JOIN people ON people.id = coaches.person_id INNER JOIN users ON coaches.person_id = users.pe...
[ "sql", "oracle", "ora-00918" ]
44
67
260,818
4
0
2011-06-03T22:00:37.550000
2011-06-03T22:24:37.037000
6,233,089
6,233,163
How to save Intents
I have launcher buttons in my app that can be set by the user to either launch an application or a shortcut. The problem Im having is how to save those intents and then reload them when the application is closed and restarted. I was saving two strings for the package name and activity name and recreating the intent whi...
Have you tried using the Intent class's toUri() method? All the data for the Intent should be in the URI.
How to save Intents I have launcher buttons in my app that can be set by the user to either launch an application or a shortcut. The problem Im having is how to save those intents and then reload them when the application is closed and restarted. I was saving two strings for the package name and activity name and recre...
TITLE: How to save Intents QUESTION: I have launcher buttons in my app that can be set by the user to either launch an application or a shortcut. The problem Im having is how to save those intents and then reload them when the application is closed and restarted. I was saving two strings for the package name and activ...
[ "android", "android-intent", "save" ]
0
1
88
1
0
2011-06-03T22:00:55.870000
2011-06-03T22:10:28.640000
6,233,091
6,233,140
paintComponent question
What purpose does super.paintComponent(g) serve in this sample code? protected void paintComponent(Graphics g) { super.paintComponent(g); g.setColor(Color.GRAY); g.fillRect(gridX * 50, gridY * 50, 50, 50); for (int i = 0;i < 10; i++) { for (int j = 0;j < 10; j++) { if (savedTiles[i][j]) g.fillRect(i * 50, j * 50, 50, 5...
super tutorial http://download.oracle.com/javase/tutorial/java/IandI/super.html
paintComponent question What purpose does super.paintComponent(g) serve in this sample code? protected void paintComponent(Graphics g) { super.paintComponent(g); g.setColor(Color.GRAY); g.fillRect(gridX * 50, gridY * 50, 50, 50); for (int i = 0;i < 10; i++) { for (int j = 0;j < 10; j++) { if (savedTiles[i][j]) g.fillRe...
TITLE: paintComponent question QUESTION: What purpose does super.paintComponent(g) serve in this sample code? protected void paintComponent(Graphics g) { super.paintComponent(g); g.setColor(Color.GRAY); g.fillRect(gridX * 50, gridY * 50, 50, 50); for (int i = 0;i < 10; i++) { for (int j = 0;j < 10; j++) { if (savedTil...
[ "java", "swing", "paintcomponent" ]
2
4
244
2
0
2011-06-03T22:01:00.880000
2011-06-03T22:07:06.183000
6,233,105
6,259,007
How do I extend WCF WebHttp (REST) to support ETags and Conditional Gets?
I have a read-only WCF REST service (all GET 's baby!) I'd like to add ETag/Conditional get support to every single operation in my service. Basically I'm interested in extending the technique in this article: http://blogs.msdn.com/b/endpoint/archive/2010/02/25/conditional-get-and-etag-support-in-wcf-webhttp-services.a...
This turned out not to be so bad. I used an IDispatchMessageInspector which I hooked into a ServiceBehavior that's applied to all my services. I'm a little uncomfortable with how the request gets routed but it seems to work. public class ConditionalGetMessageInspector: IDispatchMessageInspector { private enum GetState ...
How do I extend WCF WebHttp (REST) to support ETags and Conditional Gets? I have a read-only WCF REST service (all GET 's baby!) I'd like to add ETag/Conditional get support to every single operation in my service. Basically I'm interested in extending the technique in this article: http://blogs.msdn.com/b/endpoint/arc...
TITLE: How do I extend WCF WebHttp (REST) to support ETags and Conditional Gets? QUESTION: I have a read-only WCF REST service (all GET 's baby!) I'd like to add ETag/Conditional get support to every single operation in my service. Basically I'm interested in extending the technique in this article: http://blogs.msdn....
[ "wcf", "rest", "header", "webhttp" ]
1
2
1,350
2
0
2011-06-03T22:02:46.690000
2011-06-06T23:06:40.813000
6,233,117
6,233,275
How to correctly deal with System.Nullable<T> fields of LinqToSql classes?
I've got a table with some nullable double fields. Working with LinqToSQL trying to use the field directly I get Argument type System.Nullable is not assignable to parameter type double How do I deal with this correctly?
The problem has nothing to do with Linq. It's got to do with conversion between double and double? / Nullable. Implicit conversion from double? to double is not allowed: double? foo; double bar = foo; You can reference the double value directly: double? foo; double bar = foo.Value; This will throw a NullReferenceExcept...
How to correctly deal with System.Nullable<T> fields of LinqToSql classes? I've got a table with some nullable double fields. Working with LinqToSQL trying to use the field directly I get Argument type System.Nullable is not assignable to parameter type double How do I deal with this correctly?
TITLE: How to correctly deal with System.Nullable<T> fields of LinqToSql classes? QUESTION: I've got a table with some nullable double fields. Working with LinqToSQL trying to use the field directly I get Argument type System.Nullable is not assignable to parameter type double How do I deal with this correctly? ANSWE...
[ "c#", ".net", "nullable" ]
8
24
15,108
4
0
2011-06-03T22:03:51.533000
2011-06-03T22:28:53.323000
6,233,120
6,233,296
protobuf: consecutive serialize and deserialize to/from socket
My simple communication between C++ client and C# server got stuck after a message was serialized to socket (SerializeToFileDescritor). C++ client: Person person; person.set_id(54321); person.set_name("bla"); person.mutable_address()->set_line1("sdfa"); person.mutable_address()->set_line2("asdfsdfa"); cout << person.i...
The default behaviour for a root object is to consume all data to the end of the stream. And since you don't close the stream, that end never comes. If your intention is to send multiple objects down the same socket (which is pretty normal) then you need to give it a clue. The most common approach would be to prefix ea...
protobuf: consecutive serialize and deserialize to/from socket My simple communication between C++ client and C# server got stuck after a message was serialized to socket (SerializeToFileDescritor). C++ client: Person person; person.set_id(54321); person.set_name("bla"); person.mutable_address()->set_line1("sdfa"); per...
TITLE: protobuf: consecutive serialize and deserialize to/from socket QUESTION: My simple communication between C++ client and C# server got stuck after a message was serialized to socket (SerializeToFileDescritor). C++ client: Person person; person.set_id(54321); person.set_name("bla"); person.mutable_address()->set_...
[ "c#", "c++", "protocol-buffers", "protobuf-net" ]
2
2
3,125
2
0
2011-06-03T22:04:10.357000
2011-06-03T22:31:53.597000
6,233,123
6,233,205
Passing thread routine multiple variables & stack size
In examples on the web, calls to CreateThread typically pass a pointer to a struct for LPVOID lpParameter, and you use that pointer to access the struct itself. #include #include struct Point { float x,y,z; }; DWORD WINAPI threadStartPoint( LPVOID data ) { Sleep( 1000 ); Point *p = (Point*)data; printf( "%f %f %f\n", ...
CreateThread accepts only one type of function, the one that takes a single LPVOID parameter. There's no way to communicate to kernel32.dll, which is the code that calls your thread function, that it should call it with any other parameter list. The kernel always calls the function the same way. You'll just have to con...
Passing thread routine multiple variables & stack size In examples on the web, calls to CreateThread typically pass a pointer to a struct for LPVOID lpParameter, and you use that pointer to access the struct itself. #include #include struct Point { float x,y,z; }; DWORD WINAPI threadStartPoint( LPVOID data ) { Sleep( ...
TITLE: Passing thread routine multiple variables & stack size QUESTION: In examples on the web, calls to CreateThread typically pass a pointer to a struct for LPVOID lpParameter, and you use that pointer to access the struct itself. #include #include struct Point { float x,y,z; }; DWORD WINAPI threadStartPoint( LPVOI...
[ "c++", "windows", "multithreading" ]
1
7
2,228
3
0
2011-06-03T22:04:50.270000
2011-06-03T22:17:55.140000
6,233,127
6,233,280
Different wcf services for different tasks in server-client application, Sharing data between services
We are developing a server-client application in c# using wcf services and wpf. We were thinking about 3 different wcf services: service for logging in and out service for getting data from database service for file transfer The problem is that we want to store currently logged in users in some list. Login service whou...
If the services are hosted in the same process, you can simply use some local dictionary ( Dictionary ) in memory (or in a persistent storage, if necessary), and access it via a shared (static) class. Do you need anything more complex than that?
Different wcf services for different tasks in server-client application, Sharing data between services We are developing a server-client application in c# using wcf services and wpf. We were thinking about 3 different wcf services: service for logging in and out service for getting data from database service for file t...
TITLE: Different wcf services for different tasks in server-client application, Sharing data between services QUESTION: We are developing a server-client application in c# using wcf services and wpf. We were thinking about 3 different wcf services: service for logging in and out service for getting data from database ...
[ "c#", "wcf", "client-server" ]
1
0
185
1
0
2011-06-03T22:05:37.523000
2011-06-03T22:29:19.190000
6,233,128
6,242,863
Debugging CakePHP White Screen of Death
I'm new to CakePHP, so I apologize in advance for my lack of knowledge. I have a custom CakePHP application that works great on my webhosting account. I've downloaded it to my local machine and I'm trying to get it to run on my WAMP server. I've set up the database correctly, downloaded all the.htaccess files and turne...
What's the value of Configure:read('debug') (it is set in config/core.php )? It should be greater than zero, so you'll get PHP errors displayed. Setting debug to zero is for live environments, in development mode you should use a value of 1, 2 or 3 (every level up means more debug information being shown). If your debu...
Debugging CakePHP White Screen of Death I'm new to CakePHP, so I apologize in advance for my lack of knowledge. I have a custom CakePHP application that works great on my webhosting account. I've downloaded it to my local machine and I'm trying to get it to run on my WAMP server. I've set up the database correctly, dow...
TITLE: Debugging CakePHP White Screen of Death QUESTION: I'm new to CakePHP, so I apologize in advance for my lack of knowledge. I have a custom CakePHP application that works great on my webhosting account. I've downloaded it to my local machine and I'm trying to get it to run on my WAMP server. I've set up the datab...
[ "cakephp" ]
1
2
5,115
3
0
2011-06-03T22:05:46.463000
2011-06-05T12:20:35.867000
6,233,132
6,233,155
Ambiguous call to overloaded sqrt function when passing size_t
string aux; int maxy, auxx = 0; cin >> aux; maxy = (int)sqrt(aux.size()); Why am I getting this error: 1> error C2668: 'sqrt': ambiguous call to overloaded function 1> could be 'long double sqrt(long double)' 1> or 'float sqrt(float)' 1> or 'double sqrt(double)'
string::size() returns size_t, and sqrt doesn't accept it in any of its versions. So the compiler has to cast, and cannot choose to what - all of them are OK. You have to put explicit cast: maxy = (int)sqrt((double)aux.size());
Ambiguous call to overloaded sqrt function when passing size_t string aux; int maxy, auxx = 0; cin >> aux; maxy = (int)sqrt(aux.size()); Why am I getting this error: 1> error C2668: 'sqrt': ambiguous call to overloaded function 1> could be 'long double sqrt(long double)' 1> or 'float sqrt(float)' 1> or 'double sqrt(d...
TITLE: Ambiguous call to overloaded sqrt function when passing size_t QUESTION: string aux; int maxy, auxx = 0; cin >> aux; maxy = (int)sqrt(aux.size()); Why am I getting this error: 1> error C2668: 'sqrt': ambiguous call to overloaded function 1> could be 'long double sqrt(long double)' 1> or 'float sqrt(float)' 1>...
[ "c++", "overloading", "overload-resolution" ]
20
33
61,099
4
0
2011-06-03T22:06:12.487000
2011-06-03T22:09:07.290000
6,233,134
6,233,358
How can I set a layout_Above with 2 values?
Right now, I have a layout that looks like one of the two images below, depending on the exact size of the screen. Bot that on one, the Play Game! button is on top, and on the other, the copyright text is on top. What I'm trying to do is to put an image between the adview and the higher of the top text box/layout. Depe...
I've made a layout that will work for you - it looks like this: Edit: Try this one... Use this layout (replace the top button with your ad) (changed a bit since last edit to use anther relative layout...)
How can I set a layout_Above with 2 values? Right now, I have a layout that looks like one of the two images below, depending on the exact size of the screen. Bot that on one, the Play Game! button is on top, and on the other, the copyright text is on top. What I'm trying to do is to put an image between the adview and...
TITLE: How can I set a layout_Above with 2 values? QUESTION: Right now, I have a layout that looks like one of the two images below, depending on the exact size of the screen. Bot that on one, the Play Game! button is on top, and on the other, the copyright text is on top. What I'm trying to do is to put an image betw...
[ "android", "android-layout", "android-relativelayout", "android-xml" ]
0
4
2,359
1
0
2011-06-03T22:06:22.810000
2011-06-03T22:42:57.863000
6,233,144
6,234,354
How to show only 1 marker on Google Maps?
Hi I have this weird problem with Google Maps V3 API. Showing multiple markers on a google map is fine, but when I only want to show a single marker on the map, I get no markers displaying? The code below only shows a map with no markers. var map = new google.maps.Map(document.getElementById('map_canvas'), options); m...
Your first code block totally works for me. Here's the entire file I have where it's working, if this helps: Map Test Map
How to show only 1 marker on Google Maps? Hi I have this weird problem with Google Maps V3 API. Showing multiple markers on a google map is fine, but when I only want to show a single marker on the map, I get no markers displaying? The code below only shows a map with no markers. var map = new google.maps.Map(document....
TITLE: How to show only 1 marker on Google Maps? QUESTION: Hi I have this weird problem with Google Maps V3 API. Showing multiple markers on a google map is fine, but when I only want to show a single marker on the map, I get no markers displaying? The code below only shows a map with no markers. var map = new google....
[ "javascript", "google-maps", "google-maps-api-3" ]
1
2
4,664
2
0
2011-06-03T22:07:34.170000
2011-06-04T02:38:57.640000
6,233,156
6,233,811
Android TableLayout change padding programmatic
How can I change the padding of a TableLayout programmatic. I try this code, but it does not wok. I get a java.lang.ClassCastException: android.widget.TableLayout$LayoutParams exception. TextView destinationView = (TextView) view.findViewById(R.id.departure_destination); destinationView.setText(departure.destination.na...
If you're having a cast exception, try using the right class for it, i.e. TableLayout.MarginLayoutParams instead of MarginLayoutParams and LayoutParams (which ones are you including?) TableLayout.MarginLayoutParams destinationMarginLayout = new TableLayout.MarginLayoutParams(
Android TableLayout change padding programmatic How can I change the padding of a TableLayout programmatic. I try this code, but it does not wok. I get a java.lang.ClassCastException: android.widget.TableLayout$LayoutParams exception. TextView destinationView = (TextView) view.findViewById(R.id.departure_destination); ...
TITLE: Android TableLayout change padding programmatic QUESTION: How can I change the padding of a TableLayout programmatic. I try this code, but it does not wok. I get a java.lang.ClassCastException: android.widget.TableLayout$LayoutParams exception. TextView destinationView = (TextView) view.findViewById(R.id.depart...
[ "android", "padding", "tablelayout" ]
0
0
969
1
0
2011-06-03T22:09:37.193000
2011-06-04T00:15:19.693000
6,233,159
6,233,212
How can I use strings in Javascript to validate data in two separate JSON dictionaries?
I need to parse data from one JSON file in order to validate arrays, keys, and values in a second JSON file. For example, I have a JSON file filled with data in this format: { "someData":["array", "key", "value"] } I have a second JSON file with data like this: { "fruit": [ {"type":"apple"}, {"type":"cherry"}, {"type":...
You can acces a property of an object either directly or if dynamically via dictionary notation (if you have its name as string): var j2 = { "fruit": [ {"type":"apple"}, {"type":"cherry"}, {"type":"pear"} ] }; j2.fruit[0].type = j2["fruit"][0]["type"] = "apple"
How can I use strings in Javascript to validate data in two separate JSON dictionaries? I need to parse data from one JSON file in order to validate arrays, keys, and values in a second JSON file. For example, I have a JSON file filled with data in this format: { "someData":["array", "key", "value"] } I have a second J...
TITLE: How can I use strings in Javascript to validate data in two separate JSON dictionaries? QUESTION: I need to parse data from one JSON file in order to validate arrays, keys, and values in a second JSON file. For example, I have a JSON file filled with data in this format: { "someData":["array", "key", "value"] }...
[ "javascript", "string", "json" ]
1
0
262
4
0
2011-06-03T22:09:53.217000
2011-06-03T22:18:52.110000
6,233,167
6,233,186
How to get these PHP includes working?
I've got the following file structure: / +--- inc/ | +--- lib1.php +--- inc2/ | +--- lib2.php | +--- view2.php +--- view1.php Both view1.php and view2.php include lib2.php. Lib2.php includes lib1.php. Graphically: View1.php ---\ +---> Lib2.php ---> Lib1.php View2.php ---/ However I cannot get this working, because the ...
If you use php >= 5.3 you can use __DIR__ to build the path. If not, use dirname(__FILE__) So in lib2.php, just put this: require_once(__DIR__. '../inc/lib1.php');
How to get these PHP includes working? I've got the following file structure: / +--- inc/ | +--- lib1.php +--- inc2/ | +--- lib2.php | +--- view2.php +--- view1.php Both view1.php and view2.php include lib2.php. Lib2.php includes lib1.php. Graphically: View1.php ---\ +---> Lib2.php ---> Lib1.php View2.php ---/ However ...
TITLE: How to get these PHP includes working? QUESTION: I've got the following file structure: / +--- inc/ | +--- lib1.php +--- inc2/ | +--- lib2.php | +--- view2.php +--- view1.php Both view1.php and view2.php include lib2.php. Lib2.php includes lib1.php. Graphically: View1.php ---\ +---> Lib2.php ---> Lib1.php View2...
[ "php", "path", "include" ]
3
6
117
3
0
2011-06-03T22:11:23.867000
2011-06-03T22:14:26.513000
6,233,178
6,233,668
What is the meaning of this error "org.hibernate.MappingException: Same physical table name reference several logical table names:"
Can somebody explain what is the meaning of this error? org.hibernate.MappingException: Same physical table name reference several logical table names:
Most likely, your database table is defined more than once (in.hbm.xml or using annotations). It could well be accidental if your classloader sees too much resources.
What is the meaning of this error "org.hibernate.MappingException: Same physical table name reference several logical table names:" Can somebody explain what is the meaning of this error? org.hibernate.MappingException: Same physical table name reference several logical table names:
TITLE: What is the meaning of this error "org.hibernate.MappingException: Same physical table name reference several logical table names:" QUESTION: Can somebody explain what is the meaning of this error? org.hibernate.MappingException: Same physical table name reference several logical table names: ANSWER: Most like...
[ "hibernate", "spring", "jpa" ]
1
1
3,580
1
0
2011-06-03T22:13:04.200000
2011-06-03T23:40:11.890000
6,233,182
6,233,257
Keeping dialogs on top of window, but not on top of everything
In my WPF application I have a lot of custom dialog boxes that pop open so the user can do various things with someDialogClass.ShowDialog(). To make sure that the dialog stays on top of the window that called it, I add Topmost="True" to the Window tag of the dialog's XAML file. This works, but the dialog is shown over ...
You need to set the Owner of the Dialog / Window and it will then be on top of only that window. For example: var loginForm = new LoginForm(); loginForm.Owner = Application.Current.MainWindow; var success = loginForm.ShowDialog(); Do not set the TopMost property on the Window otherwise it will be on top of every window...
Keeping dialogs on top of window, but not on top of everything In my WPF application I have a lot of custom dialog boxes that pop open so the user can do various things with someDialogClass.ShowDialog(). To make sure that the dialog stays on top of the window that called it, I add Topmost="True" to the Window tag of th...
TITLE: Keeping dialogs on top of window, but not on top of everything QUESTION: In my WPF application I have a lot of custom dialog boxes that pop open so the user can do various things with someDialogClass.ShowDialog(). To make sure that the dialog stays on top of the window that called it, I add Topmost="True" to th...
[ "c#", "wpf", "xaml", "layout", "dialog" ]
17
40
16,676
1
0
2011-06-03T22:14:01.320000
2011-06-03T22:26:43.833000
6,233,183
6,233,245
Haskell and typeclasses with multiple parameters
I'm having a simple problem when it comes to writing up typeclasses that inherit from one another. I'm trying to create a hierarchy of typeclasses to achieve some level of representational abstraction. Let's say I want a collections typeclass: {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE FlexibleInstances #-} c...
The issue here is that, by default, each type class parameter is independent of the others. Simply applying isMember to a Char and a tree of unknown element type isn't enough to let it deduce that it should use the (seemingly obvious) instance. This is clearly not how you want it to work, and a bit silly to boot, but t...
Haskell and typeclasses with multiple parameters I'm having a simple problem when it comes to writing up typeclasses that inherit from one another. I'm trying to create a hierarchy of typeclasses to achieve some level of representational abstraction. Let's say I want a collections typeclass: {-# LANGUAGE MultiParamType...
TITLE: Haskell and typeclasses with multiple parameters QUESTION: I'm having a simple problem when it comes to writing up typeclasses that inherit from one another. I'm trying to create a hierarchy of typeclasses to achieve some level of representational abstraction. Let's say I want a collections typeclass: {-# LANGU...
[ "haskell" ]
8
11
556
3
0
2011-06-03T22:14:04.690000
2011-06-03T22:24:37.863000
6,233,197
6,233,539
Delegate Thread Must be allowed to complete
So I invoke a thread from managed code this way: Action updateReference = UpdateReferenceBaseline; IAsyncResult ar = updateReference.BeginInvoke(_context, baseline.Id, updatedBaseline.Id, null, null); I have taken care to make sure that this class's destructor waits for the thread to complete. So for most normal cases,...
I think your way of doing this should be safe, unless your finalizer (also known as destructor) throws an exception itself. But I would not recommend to you doing it this way. A better way would be to create a new thread for your method. Unless you change the Thread.ISBackground property, it is not created as a backgro...
Delegate Thread Must be allowed to complete So I invoke a thread from managed code this way: Action updateReference = UpdateReferenceBaseline; IAsyncResult ar = updateReference.BeginInvoke(_context, baseline.Id, updatedBaseline.Id, null, null); I have taken care to make sure that this class's destructor waits for the t...
TITLE: Delegate Thread Must be allowed to complete QUESTION: So I invoke a thread from managed code this way: Action updateReference = UpdateReferenceBaseline; IAsyncResult ar = updateReference.BeginInvoke(_context, baseline.Id, updatedBaseline.Id, null, null); I have taken care to make sure that this class's destruct...
[ "c#", "multithreading", "exit" ]
3
3
347
3
0
2011-06-03T22:17:00.583000
2011-06-03T23:16:50.150000
6,233,201
6,297,060
VS2008 Load Testing Error (LoadTest Database)
I have the LoadTest database setup on my machine. I can connect to it from my development box. No problems there. When I go to TEST -> Administer Test Controllers and test my connection, it succeeds. I have the LoadTest db on my server and it does connect with Windows Authentication. However, when running the load test...
FYI for everyone -- Must have an instance of SQL Server that is NOT the Express Edition.
VS2008 Load Testing Error (LoadTest Database) I have the LoadTest database setup on my machine. I can connect to it from my development box. No problems there. When I go to TEST -> Administer Test Controllers and test my connection, it succeeds. I have the LoadTest db on my server and it does connect with Windows Authe...
TITLE: VS2008 Load Testing Error (LoadTest Database) QUESTION: I have the LoadTest database setup on my machine. I can connect to it from my development box. No problems there. When I go to TEST -> Administer Test Controllers and test my connection, it succeeds. I have the LoadTest db on my server and it does connect ...
[ "database", "visual-studio-2008", "testing", "load" ]
0
0
1,000
2
0
2011-06-03T22:17:36.430000
2011-06-09T17:46:28.553000
6,233,204
6,233,480
On click function for the border greyed around the activity?
In the attached screenshot, the grey areas around the activity are translucent and have activity is shown with the following xml. The problem that I am facing is that whenever I touch the white area(where the activity is present) it senses the backgrndListner which I just want for the areas in grey(highlighted in red c...
I think you need to prevent the inside view from propagating the touch event. So you could try to add an id to the 2nd LinearLayout and then in your onCreate try this: findViewById(R.id.ignorebox).setOnTouchListener(new View.OnTouchListener(){ public boolean onTouch(View v, MotionEvent event){ return true; } });
On click function for the border greyed around the activity? In the attached screenshot, the grey areas around the activity are translucent and have activity is shown with the following xml. The problem that I am facing is that whenever I touch the white area(where the activity is present) it senses the backgrndListner...
TITLE: On click function for the border greyed around the activity? QUESTION: In the attached screenshot, the grey areas around the activity are translucent and have activity is shown with the following xml. The problem that I am facing is that whenever I touch the white area(where the activity is present) it senses t...
[ "android", "android-layout" ]
0
1
300
1
0
2011-06-03T22:17:51.520000
2011-06-03T23:05:17.493000
6,233,213
6,233,281
How to circumvent the lack of capability of extending enumerations?
I am sorry ahead of time for how this question may turn out. I really can't think of a good way to word it. I would very much like to have an enumeration extend another for the sake of use method abstraction. It would make life so much easier. Alas, I cannot. So, does anyone know how I may be able to implement a featur...
We often use the visitor pattern to allow extending enums with external functionality. Something like boolean reallyLoveThisDay = dayOfWeek.accept(new DefaultDayOfWeekVisitor () { public Boolean visitMonday(DayOfWeek dayOfWeek) { return false; } public Boolean visitDefault(DayOfWeek dayOfWeek) { return true; } });
How to circumvent the lack of capability of extending enumerations? I am sorry ahead of time for how this question may turn out. I really can't think of a good way to word it. I would very much like to have an enumeration extend another for the sake of use method abstraction. It would make life so much easier. Alas, I ...
TITLE: How to circumvent the lack of capability of extending enumerations? QUESTION: I am sorry ahead of time for how this question may turn out. I really can't think of a good way to word it. I would very much like to have an enumeration extend another for the sake of use method abstraction. It would make life so muc...
[ "java", "enumeration" ]
1
0
336
1
0
2011-06-03T22:18:57.780000
2011-06-03T22:29:39.383000
6,233,216
6,233,239
Database Design Suggestion
I am building a shopping cart system on my localserver for practice. Now, I am using sessions to insert the product to the MySQL database, but I am creating a table for each of the sessions. I know this is not an ideal way to do things. My question: Should I define a number of rows in the sessions table, so that there ...
No, this design will be incredibly difficult to maintain. Instead, have one table that will hold all cart data; something like: User Product Quantity 2 5 1 2 3 3 2 7 1 3 5 2 3 6 2 where the "user" column is a foreign key on the user table (or cart table, whichever), and the "product" column is a foreign key on the prod...
Database Design Suggestion I am building a shopping cart system on my localserver for practice. Now, I am using sessions to insert the product to the MySQL database, but I am creating a table for each of the sessions. I know this is not an ideal way to do things. My question: Should I define a number of rows in the ses...
TITLE: Database Design Suggestion QUESTION: I am building a shopping cart system on my localserver for practice. Now, I am using sessions to insert the product to the MySQL database, but I am creating a table for each of the sessions. I know this is not an ideal way to do things. My question: Should I define a number ...
[ "mysql", "database" ]
1
4
110
2
0
2011-06-03T22:19:28.977000
2011-06-03T22:23:38.767000
6,233,230
6,233,347
UnicodeEncodeError in django app
I'm trying to create an app using Django on webfaction. I basically was messing around with the Amazon API, and when one of the search results has a trademark symbol, which is passed to my template...the error is thrown. I'm getting the error Caught UnicodeEncodeError while rendering: 'ascii' codec can't encode charact...
It probably means you are calling str() on a a peice of unicode data - the str function could be called ascii to better describe what it does! Your templates will be totally happy with unicode data so given that you are using Django I suspect the problem is in a __unicode__ method or some such. Unicode is a tricky subj...
UnicodeEncodeError in django app I'm trying to create an app using Django on webfaction. I basically was messing around with the Amazon API, and when one of the search results has a trademark symbol, which is passed to my template...the error is thrown. I'm getting the error Caught UnicodeEncodeError while rendering: '...
TITLE: UnicodeEncodeError in django app QUESTION: I'm trying to create an app using Django on webfaction. I basically was messing around with the Amazon API, and when one of the search results has a trademark symbol, which is passed to my template...the error is thrown. I'm getting the error Caught UnicodeEncodeError ...
[ "python", "django", "unicode", "webfaction" ]
1
3
1,373
2
0
2011-06-03T22:22:09.590000
2011-06-03T22:40:48.857000
6,233,243
6,233,390
Can I determine if a given "hostname" is a CNAME via Perl
At work I have something like this... $ host www.something.com www.something.com is an alias for some.other.address some.other.address is an alias for one.more.address one.more.address has address xxx.xxx.xxx.xxx I would like a way, in Perl to put in www.something.com and determine if it's a CNAME, A record, etc.
use Net::DNS qw(); my $query = Net::DNS::Resolver->new->search('conferences.yapceurope.org'); if ($query) { foreach my $rr ($query->answer) { next unless 'CNAME' eq $rr->type; print $rr->cname; } } else { warn sprintf "query failed: %s\n", $res->errorstring; }
Can I determine if a given "hostname" is a CNAME via Perl At work I have something like this... $ host www.something.com www.something.com is an alias for some.other.address some.other.address is an alias for one.more.address one.more.address has address xxx.xxx.xxx.xxx I would like a way, in Perl to put in www.somethi...
TITLE: Can I determine if a given "hostname" is a CNAME via Perl QUESTION: At work I have something like this... $ host www.something.com www.something.com is an alias for some.other.address some.other.address is an alias for one.more.address one.more.address has address xxx.xxx.xxx.xxx I would like a way, in Perl to ...
[ "perl", "dns", "cname" ]
4
9
2,090
1
0
2011-06-03T22:24:22.513000
2011-06-03T22:48:52.357000
6,233,251
6,233,309
Is it possible to publish iphone apps from outside the US?
I live outside the us and want to publish iphone apps in the US appstore, is it possible to do so? I heard that apps will be published at a regional appstore. thanks
You can publish apps from any country approved by Apple. Angry Birds developers are Finland based.
Is it possible to publish iphone apps from outside the US? I live outside the us and want to publish iphone apps in the US appstore, is it possible to do so? I heard that apps will be published at a regional appstore. thanks
TITLE: Is it possible to publish iphone apps from outside the US? QUESTION: I live outside the us and want to publish iphone apps in the US appstore, is it possible to do so? I heard that apps will be published at a regional appstore. thanks ANSWER: You can publish apps from any country approved by Apple. Angry Birds...
[ "iphone", "app-store", "publish" ]
1
5
1,020
2
0
2011-06-03T22:25:52.310000
2011-06-03T22:34:06.633000
6,233,252
6,233,373
Using jQuery (or JavaScript) to find and replace HTML special characters
I've been banging my head against a wall here for hours. Long story short, I have a webpage that spits out the following HTML: &trade; That HTML, of course, does not display properly so I need to dynamically convert to the following to get a proper trademark symbol: ™ I'm trying to achieve this either through JavaScrip...
If its due to jQuery conflict the below should solve it. Its plain JavaScript code. document.body.innerHTML = document.body.innerHTML.replace(/&trade;/g, "™"); Don't you have access to the server side code of the page? If you have it then you would be better changing that code to spit the required thing instead of usin...
Using jQuery (or JavaScript) to find and replace HTML special characters I've been banging my head against a wall here for hours. Long story short, I have a webpage that spits out the following HTML: &trade; That HTML, of course, does not display properly so I need to dynamically convert to the following to get a prope...
TITLE: Using jQuery (or JavaScript) to find and replace HTML special characters QUESTION: I've been banging my head against a wall here for hours. Long story short, I have a webpage that spits out the following HTML: &trade; That HTML, of course, does not display properly so I need to dynamically convert to the follow...
[ "javascript", "jquery", "replace" ]
1
1
9,236
3
0
2011-06-03T22:26:09.947000
2011-06-03T22:46:21.787000
6,233,259
6,233,305
First array element getting overwritten by the second when getting data from db using PHP
I have a few lines of code that start something like this: $trailheads = array(); // Then a db call with a query. Then loop through the results. // This gives a diff value every time, so here we are still ok $trailhead->trailhead_name = $row['trailhead_name']; // Before the look iteration ends, I do something like th...
If that's your full loop, then one problem is that you're not initializing $trailhead inside the loop. Do this: while($row = mysql_fetch_assoc($trailhead_result)) { $trailhead = new trailhead(); $trailhead->trailhead_name = $row['trailhead_name']; $trailhead->park_id = $row['park_id']; $trailhead->trailhead_id = $row['...
First array element getting overwritten by the second when getting data from db using PHP I have a few lines of code that start something like this: $trailheads = array(); // Then a db call with a query. Then loop through the results. // This gives a diff value every time, so here we are still ok $trailhead->trailhead...
TITLE: First array element getting overwritten by the second when getting data from db using PHP QUESTION: I have a few lines of code that start something like this: $trailheads = array(); // Then a db call with a query. Then loop through the results. // This gives a diff value every time, so here we are still ok $tr...
[ "php" ]
0
3
72
1
0
2011-06-03T22:26:47.267000
2011-06-03T22:33:32.017000
6,233,274
6,240,496
android NDK:compilation error:libstdc++:multiple definition of `std::bad_exception::~bad_exception()'
While compiling the c++ code using android NDK I am getting the following error: /System/Library/android-ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/lib/libsupc++.a(eh_exception.o): In function `~exception': /tmp/ndk/src/bui...
I finally found the answer by going through the CPLUSPLUS-SUPPORT.html. There was a multiple definition of the exception class functions in stdc++ and stlport libraries. So instead of adding stlport library statically, I added it dynamically by changing APP_STL in the Application.mk as: APP_STL:= stlport_shared And it ...
android NDK:compilation error:libstdc++:multiple definition of `std::bad_exception::~bad_exception()' While compiling the c++ code using android NDK I am getting the following error: /System/Library/android-ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../....
TITLE: android NDK:compilation error:libstdc++:multiple definition of `std::bad_exception::~bad_exception()' QUESTION: While compiling the c++ code using android NDK I am getting the following error: /System/Library/android-ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86/bin/../lib/gcc/arm-linux-android...
[ "android-ndk" ]
1
8
8,285
2
0
2011-06-03T22:28:37.303000
2011-06-05T01:39:03.570000
6,233,277
6,233,454
If statements based on url
I'm attempting to show a div tag based on the root url of my site i.e. if the url is dev.foo.com display div if else www.foo.com don't display etc. I've come up with this THIS IS THE DEV SITE!! '; }?> But it isn't working and I can't see a reason - any thoughts greatly appreciated!
$url = explode('.', $_SERVER['HTTP_HOST'], 2); /* you might want pretty variable that exactly gets the subdomain. * $subdomain = $url[0]!= "www"? $url[0]: ""; * if($subdomain == "dev") { * // dev site... * }else if($subdomain == "") { * // www site... * } */ if($url[0] == "dev") { echo ' THIS IS THE DEV SITE!! '; } s...
If statements based on url I'm attempting to show a div tag based on the root url of my site i.e. if the url is dev.foo.com display div if else www.foo.com don't display etc. I've come up with this THIS IS THE DEV SITE!! '; }?> But it isn't working and I can't see a reason - any thoughts greatly appreciated!
TITLE: If statements based on url QUESTION: I'm attempting to show a div tag based on the root url of my site i.e. if the url is dev.foo.com display div if else www.foo.com don't display etc. I've come up with this THIS IS THE DEV SITE!! '; }?> But it isn't working and I can't see a reason - any thoughts greatly appre...
[ "php" ]
1
1
521
3
0
2011-06-03T22:28:57.083000
2011-06-03T23:00:44.273000
6,233,279
6,233,396
Creating dynamically named textBoxes
I need to create a new textbox every time I click a button. I see how it will work once, but not multiple times. TextBox NewTB = new TextBox(); NewTB...// set textbox properties this.Controls.Add(NewTB); I need NewTB to be different everytime I click the button (NewTB1, NewTB2, etc), I tried a List<> that contained the...
The name "NewTB" in your example is just a variable name. It is not assigned to that textbox in any way. The "list" of textboxes resides within the control structure. In other words, when you say this.Controls.Add(NewTB), you are adding that textbox to the list of controls. If the code that you show us happens as part ...
Creating dynamically named textBoxes I need to create a new textbox every time I click a button. I see how it will work once, but not multiple times. TextBox NewTB = new TextBox(); NewTB...// set textbox properties this.Controls.Add(NewTB); I need NewTB to be different everytime I click the button (NewTB1, NewTB2, etc)...
TITLE: Creating dynamically named textBoxes QUESTION: I need to create a new textbox every time I click a button. I see how it will work once, but not multiple times. TextBox NewTB = new TextBox(); NewTB...// set textbox properties this.Controls.Add(NewTB); I need NewTB to be different everytime I click the button (Ne...
[ "c#", "winforms" ]
0
1
952
2
0
2011-06-03T22:29:04.453000
2011-06-03T22:50:34.850000
6,233,288
6,233,306
NSNotificationCenter: is it possible for it to listen in to other classes that do not explicitly post Notifications?
I am trying to listen for UIViewController methods being triggered ( -viewDidLoad, -viewDidAppear, -viewDidUnload, -viewDidDisappear and so on) without modifying the actual code in the methods. Is this impossible? I'm trying to have an observer in another class listen in for those methods being called, but I don't want...
No, it is not possible. You will have to add postNotifications: I'm afraid.
NSNotificationCenter: is it possible for it to listen in to other classes that do not explicitly post Notifications? I am trying to listen for UIViewController methods being triggered ( -viewDidLoad, -viewDidAppear, -viewDidUnload, -viewDidDisappear and so on) without modifying the actual code in the methods. Is this i...
TITLE: NSNotificationCenter: is it possible for it to listen in to other classes that do not explicitly post Notifications? QUESTION: I am trying to listen for UIViewController methods being triggered ( -viewDidLoad, -viewDidAppear, -viewDidUnload, -viewDidDisappear and so on) without modifying the actual code in the ...
[ "uiviewcontroller", "nsnotifications", "nsnotificationcenter" ]
0
0
191
2
0
2011-06-03T22:30:15.173000
2011-06-03T22:33:33.293000
6,233,311
6,233,477
How to create a crosstab programatically with Telerik Reporting?
I am working with the telerik reporting platform. I am trying to create a crosstab programatically and I cant seem to find any documentation on this particular subject. I have created a forum post Crosstab Documenation Question but I'm not counting on telerik to do anything helpful. If anyone has a link or code sample ...
I would advise you create CrossTabs using the designer. Create a few examples along the lines of those you want to create programmatically and then look at the backing code - it's all code driven.
How to create a crosstab programatically with Telerik Reporting? I am working with the telerik reporting platform. I am trying to create a crosstab programatically and I cant seem to find any documentation on this particular subject. I have created a forum post Crosstab Documenation Question but I'm not counting on tel...
TITLE: How to create a crosstab programatically with Telerik Reporting? QUESTION: I am working with the telerik reporting platform. I am trying to create a crosstab programatically and I cant seem to find any documentation on this particular subject. I have created a forum post Crosstab Documenation Question but I'm n...
[ "telerik", "reporting", "crosstab", "telerik-reporting" ]
1
1
2,528
1
0
2011-06-03T22:34:25.097000
2011-06-03T23:04:56.793000
6,233,319
6,233,438
How to improve performance of non-deterministic function of a column in a where clause or join?
I would like to improve the performance of a query, which does has a where clause with a non-deterministic function call. Select Count(*) From table1 Where DateDiff(month, Cast(table1.Date As DateTime), GetDate()) = 0 I think the question is equally valid for Joins: Select table1.column1 From table1 Inner Join table2 O...
Besides the non-deterministic function, the problem I see is that you do calculations on a field. This (usually) makes any index on the field unusable by the query. The second paragraph of this link ( Ten Common SQL Programming Mistakes (Functions on indexed columns in predicates) ) provides more detailed info on when ...
How to improve performance of non-deterministic function of a column in a where clause or join? I would like to improve the performance of a query, which does has a where clause with a non-deterministic function call. Select Count(*) From table1 Where DateDiff(month, Cast(table1.Date As DateTime), GetDate()) = 0 I thin...
TITLE: How to improve performance of non-deterministic function of a column in a where clause or join? QUESTION: I would like to improve the performance of a query, which does has a where clause with a non-deterministic function call. Select Count(*) From table1 Where DateDiff(month, Cast(table1.Date As DateTime), Get...
[ "sql-server", "performance", "sql-server-2005", "join", "where-clause" ]
4
3
1,865
2
0
2011-06-03T22:35:52.493000
2011-06-03T22:58:27.520000
6,233,322
6,233,335
how to make increase number in 2 foreach unite?
... $count=1; while ($row = mysql_fetch_array($result)){ $result1 = mysql_query("SELECT something from something where name like %$row['name']% "); while ($data = mysql_fetch_array($result1)){ echo $data[title]; echo $count; } $count++ } How do I increase a number in foreach united like this? First foreach result for a...
while ($data = mysql_fetch_array($result1)){ echo $data[title]; echo $count; $count++; } Basically put $count++ inside the nested while
how to make increase number in 2 foreach unite? ... $count=1; while ($row = mysql_fetch_array($result)){ $result1 = mysql_query("SELECT something from something where name like %$row['name']% "); while ($data = mysql_fetch_array($result1)){ echo $data[title]; echo $count; } $count++ } How do I increase a number in fore...
TITLE: how to make increase number in 2 foreach unite? QUESTION: ... $count=1; while ($row = mysql_fetch_array($result)){ $result1 = mysql_query("SELECT something from something where name like %$row['name']% "); while ($data = mysql_fetch_array($result1)){ echo $data[title]; echo $count; } $count++ } How do I increas...
[ "php", "foreach" ]
0
3
361
2
0
2011-06-03T22:36:17.630000
2011-06-03T22:38:38.447000
6,233,327
6,233,354
Android Listview Questions
I have the following class in my program: public class RZoom extends Activity { private ArrayList m_FItems; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.fchooser); TextView tvName = (TextView)f...
lv.setOnItemClickListener() Override FItemAdapter's getView() to change colors depending on the item/position
Android Listview Questions I have the following class in my program: public class RZoom extends Activity { private ArrayList m_FItems; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.fchooser); Te...
TITLE: Android Listview Questions QUESTION: I have the following class in my program: public class RZoom extends Activity { private ArrayList m_FItems; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.lay...
[ "android", "android-listview" ]
1
2
175
2
0
2011-06-03T22:37:12.677000
2011-06-03T22:41:53.777000
6,233,329
6,233,508
Using '.ToString()' with numeric variables
Is there any drawback for omitting.ToString() while converting numeric values to string? int i = 1234; string s; // Instead of s = "i is " + i.ToString(); // Writing s = "i is " + i;
It doesn't make a difference in this case. "Count: " + i compiles down to String.Concat("Count: ",i) String.Concat has multiple overloads, and I believe that the Concat(Object, Object) overload is chosen (since the only common ancestor of string and int is object). The internal implementation is this: return (arg0.ToSt...
Using '.ToString()' with numeric variables Is there any drawback for omitting.ToString() while converting numeric values to string? int i = 1234; string s; // Instead of s = "i is " + i.ToString(); // Writing s = "i is " + i;
TITLE: Using '.ToString()' with numeric variables QUESTION: Is there any drawback for omitting.ToString() while converting numeric values to string? int i = 1234; string s; // Instead of s = "i is " + i.ToString(); // Writing s = "i is " + i; ANSWER: It doesn't make a difference in this case. "Count: " + i compiles d...
[ "c#", "string", "numeric" ]
2
4
261
4
0
2011-06-03T22:37:59.020000
2011-06-03T23:10:50.533000
6,233,332
6,233,821
How can I display all records created by a user?
I have a table of users, venues and reviews where a user can have many reviews and a venue has many reviews. How can I go about displaying all the reviews written by a user on each users show page? I'm currently displaying the reviews written by users on the associated venue show pages using this bit of code: <%= rende...
Each review only has one venue, right? So try replacing link_to review.title, [@venue, review] with link_to review.title, [review.venue, review] As @Devin said, @venue is nil in your user-directed reviews list.
How can I display all records created by a user? I have a table of users, venues and reviews where a user can have many reviews and a venue has many reviews. How can I go about displaying all the reviews written by a user on each users show page? I'm currently displaying the reviews written by users on the associated v...
TITLE: How can I display all records created by a user? QUESTION: I have a table of users, venues and reviews where a user can have many reviews and a venue has many reviews. How can I go about displaying all the reviews written by a user on each users show page? I'm currently displaying the reviews written by users o...
[ "ruby-on-rails", "list", "activerecord" ]
0
1
315
2
0
2011-06-03T22:38:13.467000
2011-06-04T00:16:19.570000
6,233,333
6,240,852
Maven Embedded Glassfish Plugin - Datasource and JDBC driver
I'm trying to follow this approach to create a datasource for embedded glassfish. The only significant difference between the tutorial and my code is that I'm running the server using the official maven plugin and the embedded-glassfish:run goal. There is a dependency for the JDBC driver in the pom file: com.h2database...
Figured it out. It had nothing to do with glassfish-resources.xml after all. The jdbc resource was properly created and bound to java:app/jdbc/myDatasource. My persistence unit (generated by Netbeans) was looking for jdbc/myDatasource and not finding anything. I ended up changing my persistence unit to point to the app...
Maven Embedded Glassfish Plugin - Datasource and JDBC driver I'm trying to follow this approach to create a datasource for embedded glassfish. The only significant difference between the tutorial and my code is that I'm running the server using the official maven plugin and the embedded-glassfish:run goal. There is a d...
TITLE: Maven Embedded Glassfish Plugin - Datasource and JDBC driver QUESTION: I'm trying to follow this approach to create a datasource for embedded glassfish. The only significant difference between the tutorial and my code is that I'm running the server using the official maven plugin and the embedded-glassfish:run ...
[ "jakarta-ee", "maven-plugin", "glassfish-3", "glassfish-embedded" ]
4
6
5,163
1
0
2011-06-03T22:38:25.447000
2011-06-05T03:37:28.233000
6,233,338
6,233,483
Ajax callback with 2 parameters (int, List)
Working with jquery.ajax for first time... I have a class in C#: public class myValues { string Value1 { get; set; } string Value2 { get; set; } } Then, my method is as follows: [WebMethod] public static string MyMethod(List levels) { //loop levels here } Now, in client (javascript, jquery) I'm doing an ajax' callback ...
You need to json stringify the id also, for example: var jsonText = JSON.stringify({ levels: levels, id: 1});
Ajax callback with 2 parameters (int, List) Working with jquery.ajax for first time... I have a class in C#: public class myValues { string Value1 { get; set; } string Value2 { get; set; } } Then, my method is as follows: [WebMethod] public static string MyMethod(List levels) { //loop levels here } Now, in client (java...
TITLE: Ajax callback with 2 parameters (int, List) QUESTION: Working with jquery.ajax for first time... I have a class in C#: public class myValues { string Value1 { get; set; } string Value2 { get; set; } } Then, my method is as follows: [WebMethod] public static string MyMethod(List levels) { //loop levels here } No...
[ "jquery", "asp.net", "ajax" ]
0
3
2,191
1
0
2011-06-03T22:39:21.217000
2011-06-03T23:06:00.113000
6,233,343
6,238,366
How to add unmanaged dll to show up in Add Reference's COM tab
I am currently trying to use pHash.dll on http://phash.org Unfortunately it was written in C++, I'd have to use DLLImport But the problem I am having is how to register pHash.dll (compiled thru VS2010/C++) I've tried to register using regsrv32 and have been fruitless giving an error message. Now, How can i register pHa...
The DLL in question exports flat APIs. The Add COM References Tab is for DLLs that expose COM objects. Instead of using Add Reference to refer to the DLL, you need to write a pinvoke declaration to let.NET know about your flat API. Here's a helpful article: http://msdn.microsoft.com/en-us/magazine/cc164123.aspx Martyn
How to add unmanaged dll to show up in Add Reference's COM tab I am currently trying to use pHash.dll on http://phash.org Unfortunately it was written in C++, I'd have to use DLLImport But the problem I am having is how to register pHash.dll (compiled thru VS2010/C++) I've tried to register using regsrv32 and have been...
TITLE: How to add unmanaged dll to show up in Add Reference's COM tab QUESTION: I am currently trying to use pHash.dll on http://phash.org Unfortunately it was written in C++, I'd have to use DLLImport But the problem I am having is how to register pHash.dll (compiled thru VS2010/C++) I've tried to register using regs...
[ ".net", "com", "reference", "phash" ]
0
2
1,197
1
0
2011-06-03T22:40:20.563000
2011-06-04T17:39:38.747000
6,233,353
6,256,705
Adding second .edmx file makes first one stop working with metadata error upon entity object creation
After a git merge of a branch that uses the Entity framework, using Entities on a different database have stopped working with the error "The member with identity 'Path.To.Class' does not exist in the metadata collection." This error is encountered when the following line of code executes: var databaseTable = database....
We were able to fix this by deleting the two.edmx and associated.tt files and then for each we: Created new ADO.NET Entity Data Model Kept all names automatically generated from importing from the database untouched Added code generation from the.edmx file itself and used ADO.NET EntityObject Generator (resulting in a ...
Adding second .edmx file makes first one stop working with metadata error upon entity object creation After a git merge of a branch that uses the Entity framework, using Entities on a different database have stopped working with the error "The member with identity 'Path.To.Class' does not exist in the metadata collecti...
TITLE: Adding second .edmx file makes first one stop working with metadata error upon entity object creation QUESTION: After a git merge of a branch that uses the Entity framework, using Entities on a different database have stopped working with the error "The member with identity 'Path.To.Class' does not exist in the...
[ "c#", "entity-framework", "exception", "asp.net-mvc-3", "metadata" ]
1
0
353
1
0
2011-06-03T22:41:51.717000
2011-06-06T18:59:33.083000
6,233,356
6,233,506
Size of popover in a UIViewController
I had a calculator app that can draw a function. I'm stuck in an exercise that says: Your CalculatorViewController is also going to need to know (and report when asked by the appropriate method) what size it should be when displayed in a popover. The best way to do this is to find the bounding box of all the views in y...
Try this CGRect boundingRect = CGRectZero; for (UIView *view in self.view.subviews) { boundingRect = CGRectUnion(view.frame, boundingRect); } self.view.subviews contains all your view's subviews. By iterating over them and adding each subview's frame to a union of the current boundingRect and the subview, you should ge...
Size of popover in a UIViewController I had a calculator app that can draw a function. I'm stuck in an exercise that says: Your CalculatorViewController is also going to need to know (and report when asked by the appropriate method) what size it should be when displayed in a popover. The best way to do this is to find ...
TITLE: Size of popover in a UIViewController QUESTION: I had a calculator app that can draw a function. I'm stuck in an exercise that says: Your CalculatorViewController is also going to need to know (and report when asked by the appropriate method) what size it should be when displayed in a popover. The best way to d...
[ "iphone", "xcode", "uiviewcontroller" ]
0
1
591
1
0
2011-06-03T22:42:29.183000
2011-06-03T23:10:06.137000
6,233,359
6,233,385
base64 to reduce digits required to encode a decimal number
I have to manage an ID of some objects. I need these ID be unique. I have the constraint that these ID can't be too long in term of digits required Is base64 is a nice way to reduce the number of digits required to encoding an ID? EDIT: langage: c++ data type: integer, then convert in a std::string
Each character in Base64 can represent 6 bits, so divide your ID length by 6 to see how many characters it will be. Binary data is 8 bits per byte so it will always be shorter, but the bytes won't all be readable. Base64 will make the ID readable, but it still won't be good if the ID needs to be hand entered, like a ke...
base64 to reduce digits required to encode a decimal number I have to manage an ID of some objects. I need these ID be unique. I have the constraint that these ID can't be too long in term of digits required Is base64 is a nice way to reduce the number of digits required to encoding an ID? EDIT: langage: c++ data type:...
TITLE: base64 to reduce digits required to encode a decimal number QUESTION: I have to manage an ID of some objects. I need these ID be unique. I have the constraint that these ID can't be too long in term of digits required Is base64 is a nice way to reduce the number of digits required to encoding an ID? EDIT: langa...
[ "c++", "base64" ]
1
1
1,892
3
0
2011-06-03T22:42:59.503000
2011-06-03T22:48:22.667000
6,233,364
6,233,479
Open Source Alternatives to WCF
Could you tell me the open source alternatives to WCF?? I'm a newbie and just started using WCF. I wanted to know about the alternatives that are open source too. Also, what makes them better options/not so good compared to WCF. Thanks, Thothathri
There are open source projects for REST services - for example Open Rasta Perhaps you will also find some open source projects for basic SOAP services but I doubt that there is an open source project implementing all WS-* related stuff implemented in WCF. WS-* protocols are mostly implemented only in API from big compa...
Open Source Alternatives to WCF Could you tell me the open source alternatives to WCF?? I'm a newbie and just started using WCF. I wanted to know about the alternatives that are open source too. Also, what makes them better options/not so good compared to WCF. Thanks, Thothathri
TITLE: Open Source Alternatives to WCF QUESTION: Could you tell me the open source alternatives to WCF?? I'm a newbie and just started using WCF. I wanted to know about the alternatives that are open source too. Also, what makes them better options/not so good compared to WCF. Thanks, Thothathri ANSWER: There are ope...
[ "wcf", "open-source", "wcf-security" ]
11
6
5,181
4
0
2011-06-03T22:44:48.330000
2011-06-03T23:05:03.970000
6,233,369
6,233,395
For Tomcat 6, is context.xml for my webapp required to be in $catalina_base/conf/?
Reading through the documentation on Apache Tomcat, when I deploy a webapp it copies the webapp/META-INF/context.xml to $catalina_base/conf/{engine}/{host}/{webapp}.xml. However, in server.xml I have set Hosts to have deployXML=false and would like to read context.xml file from straight from webapp/META-INF/context.xml...
See this: if you set deployXML to false you disable parsing of the webapp/META-INF/context.xml and require the context.xml files to be in conf. Change deployXML to true and you should be all set.
For Tomcat 6, is context.xml for my webapp required to be in $catalina_base/conf/? Reading through the documentation on Apache Tomcat, when I deploy a webapp it copies the webapp/META-INF/context.xml to $catalina_base/conf/{engine}/{host}/{webapp}.xml. However, in server.xml I have set Hosts to have deployXML=false and...
TITLE: For Tomcat 6, is context.xml for my webapp required to be in $catalina_base/conf/? QUESTION: Reading through the documentation on Apache Tomcat, when I deploy a webapp it copies the webapp/META-INF/context.xml to $catalina_base/conf/{engine}/{host}/{webapp}.xml. However, in server.xml I have set Hosts to have d...
[ "web-applications", "tomcat", "tomcat6" ]
4
3
4,009
1
0
2011-06-03T22:45:19.387000
2011-06-03T22:50:04.523000
6,233,370
6,234,811
jQuery delivery of a file with AJAX call
If I have an AJAX call that returns, say, a CSV, how do I get the browser to prompt the user for a download? Below, the ProductsExport will return the CSV in the success data. I just need what I'd replace the // Deliver file to user line with... $.ajax({ type: "POST", url: "/Search/ProductsExport", data: $('#CustomerId...
You cannot as far as I'm aware. You can't use ajax here as a file download. YEs - its a support datatype as per jQuery but not for a file. You need to link to the file for a non ajax request either via a link or a jQuery get request. See: Unable to open download save dialog and "datatype" on http://api.jquery.com/jQuer...
jQuery delivery of a file with AJAX call If I have an AJAX call that returns, say, a CSV, how do I get the browser to prompt the user for a download? Below, the ProductsExport will return the CSV in the success data. I just need what I'd replace the // Deliver file to user line with... $.ajax({ type: "POST", url: "/Sea...
TITLE: jQuery delivery of a file with AJAX call QUESTION: If I have an AJAX call that returns, say, a CSV, how do I get the browser to prompt the user for a download? Below, the ProductsExport will return the CSV in the success data. I just need what I'd replace the // Deliver file to user line with... $.ajax({ type: ...
[ "c#", "jquery", "asp.net", "ajax" ]
2
3
6,374
3
0
2011-06-03T22:45:35.220000
2011-06-04T05:01:53.693000
6,233,371
6,233,889
check_box_tag - one to many relationship
I have 2 models - batch and submision. Batch has_many:submissions Submission belongs_to:batch My submissions table has a field/column which stores the batch id for each submission, In my new batch form, user can select submissions via the checkbox and save the form. This will associate the newly created batch id to the...
I encountered the same problem once. The thing is that unchecked boxes are not send. From: http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html#method-i-check_box "Gotcha The HTML specification says unchecked check boxes are not successful, and thus web browsers do not send them. [...] " Although it's ...
check_box_tag - one to many relationship I have 2 models - batch and submision. Batch has_many:submissions Submission belongs_to:batch My submissions table has a field/column which stores the batch id for each submission, In my new batch form, user can select submissions via the checkbox and save the form. This will as...
TITLE: check_box_tag - one to many relationship QUESTION: I have 2 models - batch and submision. Batch has_many:submissions Submission belongs_to:batch My submissions table has a field/column which stores the batch id for each submission, In my new batch form, user can select submissions via the checkbox and save the ...
[ "ruby-on-rails" ]
2
2
772
1
0
2011-06-03T22:45:36.367000
2011-06-04T00:34:42.023000
6,233,372
6,233,399
Regular expression over where clause?
I'm trying to match specific terms on a XML file and save the results. Here is the XML text on a string: Goodbye Welcome James Welcome John See you later! I want to use linq to select any text that has welcome in it. However the name after welcome (ex. welcome James) can change. Thus, i'm trying to understand is there ...
For a scenario as simple as yours there is no need to use regular expressions. You can use the String.StartsWith(String) method that determines whether a string starts with a specified string as follows: private static void Test(string stream) { XDocument doc = XDocument.Parse(stream); var list = from hello in doc.Desc...
Regular expression over where clause? I'm trying to match specific terms on a XML file and save the results. Here is the XML text on a string: Goodbye Welcome James Welcome John See you later! I want to use linq to select any text that has welcome in it. However the name after welcome (ex. welcome James) can change. Th...
TITLE: Regular expression over where clause? QUESTION: I'm trying to match specific terms on a XML file and save the results. Here is the XML text on a string: Goodbye Welcome James Welcome John See you later! I want to use linq to select any text that has welcome in it. However the name after welcome (ex. welcome Jam...
[ "c#", "linq", "where-clause" ]
2
5
1,114
3
0
2011-06-03T22:46:19.197000
2011-06-03T22:50:57.927000
6,233,376
6,233,664
How to find out if a content provider contains data?
So basically, I have this content provider which I use to store and retrieve some data in a database. In one of my activities, I have a function for adding data to this database; however, I do not want there to be duplicate entries. My function would look something like this: public void addData(String data) { if ( /* ...
I figured it out myself, using the following code: Cursor c = getContentResolver().query(CONTENT_URI, null, DATA_FIELD + " = " + DatabaseUtils.sqlEscapeString(data), null, null); if(c.getCount() == 0) { // not found in database }
How to find out if a content provider contains data? So basically, I have this content provider which I use to store and retrieve some data in a database. In one of my activities, I have a function for adding data to this database; however, I do not want there to be duplicate entries. My function would look something l...
TITLE: How to find out if a content provider contains data? QUESTION: So basically, I have this content provider which I use to store and retrieve some data in a database. In one of my activities, I have a function for adding data to this database; however, I do not want there to be duplicate entries. My function woul...
[ "android", "android-contentprovider" ]
2
10
8,638
2
0
2011-06-03T22:46:27.763000
2011-06-03T23:39:22.673000