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,309,077 | 6,309,204 | Can I run package.skeleton without parsing functions into separate files? | Is it possible to run package.skeleton('pkgname') and have all of the.R files end up in a single file or set of files rather than one file per function? A developer I am working with asked me why I had each function in a separate file and my only rationale was 'that is the default behavior`. | If you specify a file containing several functions in the code_files argument to package.skeleton, that should just be copied to the R directory in the package. So, yes. | Can I run package.skeleton without parsing functions into separate files? Is it possible to run package.skeleton('pkgname') and have all of the.R files end up in a single file or set of files rather than one file per function? A developer I am working with asked me why I had each function in a separate file and my only... | TITLE:
Can I run package.skeleton without parsing functions into separate files?
QUESTION:
Is it possible to run package.skeleton('pkgname') and have all of the.R files end up in a single file or set of files rather than one file per function? A developer I am working with asked me why I had each function in a separat... | [
"r",
"package"
] | 12 | 10 | 405 | 2 | 0 | 2011-06-10T16:07:42.863000 | 2011-06-10T16:17:30.230000 |
6,309,080 | 6,309,153 | Detect completion of multiple async javascript $.ajax calls | I have a javascript function that enters a loop and issues an asynchronous ajax call for each loop. I need to know when ALL the ajax calls have returned and been processed, because I want to update the UI at that point. The loop is as follows: function sync_SyncLocalStorageToServer() { if (helper_IsAppOnline()) { $.log... | Count how many times you execute an AJAX request, and then, count the number of times you have seen a call to the completed callback. Once the callback completed count equals the number of times you issued ajax calls, you know you are done. var total = arr.length; var count = 0; for(var i = 0; i < arr.length; i++){ $.a... | Detect completion of multiple async javascript $.ajax calls I have a javascript function that enters a loop and issues an asynchronous ajax call for each loop. I need to know when ALL the ajax calls have returned and been processed, because I want to update the UI at that point. The loop is as follows: function sync_Sy... | TITLE:
Detect completion of multiple async javascript $.ajax calls
QUESTION:
I have a javascript function that enters a loop and issues an asynchronous ajax call for each loop. I need to know when ALL the ajax calls have returned and been processed, because I want to update the UI at that point. The loop is as follows... | [
"javascript",
"jquery",
"ajax",
"asynchronous"
] | 4 | 7 | 4,385 | 2 | 0 | 2011-06-10T16:07:52.567000 | 2011-06-10T16:13:34.847000 |
6,309,091 | 6,309,434 | Zend form element for customized currency | How to extend zend form element to create customized currency field. For example: $amount = new Example_Form_Element_Currency(1234); The out put should be like this: $1,234.00. I want a custom helper for currency. | Sounds like you're looking to apply a filter. I don't think there's a built-in currency filter however it wouldn't be difficult to create one to run the submitted value through number_format() or similar. class My_Filter_Currency implements Zend_Filter_Interface { public function filter($value) { return '$'. number_for... | Zend form element for customized currency How to extend zend form element to create customized currency field. For example: $amount = new Example_Form_Element_Currency(1234); The out put should be like this: $1,234.00. I want a custom helper for currency. | TITLE:
Zend form element for customized currency
QUESTION:
How to extend zend form element to create customized currency field. For example: $amount = new Example_Form_Element_Currency(1234); The out put should be like this: $1,234.00. I want a custom helper for currency.
ANSWER:
Sounds like you're looking to apply a... | [
"php",
"zend-form",
"currency",
"zend-form-element"
] | 0 | 0 | 781 | 2 | 0 | 2011-06-10T16:08:40.303000 | 2011-06-10T16:35:11.847000 |
6,309,092 | 6,309,111 | jquery: div hide/show on focus issue | Thanks to inti's code I was able to figure out the answer! jQuery: $(document).ready(function(){ $("body").click(function(e) { //checks to see if the tag you clicked has the #login //div as a parent. if($(e.target).closest("#login").size() == 0) { //makes exception for the #login's tag (id of a_login) if((e.target.id) ... | The event you are looking for is.blur() not.focusout(). Edit: click out of #mydiv to hide it: $("body").click(function(e) { if ($(e.target).closest("#mydiv").size() == 0) { $("#mydiv").hide(); } }); This hides #mydiv if what you clicked doesn't have it as one of it's parents. | jquery: div hide/show on focus issue Thanks to inti's code I was able to figure out the answer! jQuery: $(document).ready(function(){ $("body").click(function(e) { //checks to see if the tag you clicked has the #login //div as a parent. if($(e.target).closest("#login").size() == 0) { //makes exception for the #login's ... | TITLE:
jquery: div hide/show on focus issue
QUESTION:
Thanks to inti's code I was able to figure out the answer! jQuery: $(document).ready(function(){ $("body").click(function(e) { //checks to see if the tag you clicked has the #login //div as a parent. if($(e.target).closest("#login").size() == 0) { //makes exception... | [
"jquery"
] | 0 | 3 | 3,233 | 2 | 0 | 2011-06-10T16:08:40.270000 | 2011-06-10T16:10:09.090000 |
6,309,104 | 6,309,289 | better integration with asp.net entity framework or Nhibernate | I'm have a lot of time using hibernate (JPA) in java, but i recently am in a new job in which had used the platform of.net and they ask me to develop and application with certain standards and one of the them requirements are related with the using of ORM, but i have seen looking for resources and frameworks that exit'... | ADO.NET Entity Framework integrates better with Visual Studio 2008+ in terms of visual class designer etc. Even though the Entity Framework supports "Peristence Ignorance" like NHibernate/Hibernate does, NHibernate is much more mature. If you don't need a clean separation of concerns regarding data access layer and the... | better integration with asp.net entity framework or Nhibernate I'm have a lot of time using hibernate (JPA) in java, but i recently am in a new job in which had used the platform of.net and they ask me to develop and application with certain standards and one of the them requirements are related with the using of ORM, ... | TITLE:
better integration with asp.net entity framework or Nhibernate
QUESTION:
I'm have a lot of time using hibernate (JPA) in java, but i recently am in a new job in which had used the platform of.net and they ask me to develop and application with certain standards and one of the them requirements are related with ... | [
".net",
"nhibernate",
"entity-framework-4"
] | 0 | 2 | 107 | 1 | 0 | 2011-06-10T16:09:27.700000 | 2011-06-10T16:23:24.363000 |
6,309,105 | 6,309,134 | Cross-OS distributed computing in C++, rand() issue | I'm working on a small distributed computing project. The server can't handle the calculations without crashing Apache in the process, so I'm giving these calculations to the users. The basic idea is that I run the calculations 3 times, and the results need to be exactly the same. However, the application will need to ... | Take a look at the Boost.Random facilities. They give you a broad choice of algorithms that are guaranteed to give the same results, always. | Cross-OS distributed computing in C++, rand() issue I'm working on a small distributed computing project. The server can't handle the calculations without crashing Apache in the process, so I'm giving these calculations to the users. The basic idea is that I run the calculations 3 times, and the results need to be exac... | TITLE:
Cross-OS distributed computing in C++, rand() issue
QUESTION:
I'm working on a small distributed computing project. The server can't handle the calculations without crashing Apache in the process, so I'm giving these calculations to the users. The basic idea is that I run the calculations 3 times, and the resul... | [
"c++",
"random",
"distributed-computing",
"srand"
] | 1 | 7 | 426 | 3 | 0 | 2011-06-10T16:09:29.620000 | 2011-06-10T16:11:28.607000 |
6,309,113 | 6,309,145 | Collections.unmodifiablemap() and collections where reads also modify | This is more a curiosity question than anything. Say I supply a LinkedHashMap with access ordering set to true to Collections.unmodifiableMap(). Since reads are actually modifying the map. Does it mean there are cases where the view returned by unmodifiableMap() is actually modifiable? public class MyApp {
/** * @para... | The Map is modifying itself. Collections.unmodifiableMap() only provides a decorator for the Map which disallows modifications, it does not make the Map itself unmodifiable. | Collections.unmodifiablemap() and collections where reads also modify This is more a curiosity question than anything. Say I supply a LinkedHashMap with access ordering set to true to Collections.unmodifiableMap(). Since reads are actually modifying the map. Does it mean there are cases where the view returned by unmod... | TITLE:
Collections.unmodifiablemap() and collections where reads also modify
QUESTION:
This is more a curiosity question than anything. Say I supply a LinkedHashMap with access ordering set to true to Collections.unmodifiableMap(). Since reads are actually modifying the map. Does it mean there are cases where the view... | [
"java",
"collections"
] | 4 | 5 | 3,105 | 2 | 0 | 2011-06-10T16:10:21.893000 | 2011-06-10T16:12:40.863000 |
6,309,122 | 6,309,167 | Launch screen on iPad | I have an iPhone app. When I run it on the iPad everything looks great (but small) except for the launch screen that also is small (not full screen) and not really proportional. I have read the documentation, but I'm not sure where I've gone wrong. I have added Default-Portrait.png and Default-Landscape.png, but it doe... | Make sure to add these into your Info.plist file UISupportedInterfaceOrientations~ipad UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight Even of your orientations work properly without, it's absolutely imperative to have thes... | Launch screen on iPad I have an iPhone app. When I run it on the iPad everything looks great (but small) except for the launch screen that also is small (not full screen) and not really proportional. I have read the documentation, but I'm not sure where I've gone wrong. I have added Default-Portrait.png and Default-Lan... | TITLE:
Launch screen on iPad
QUESTION:
I have an iPhone app. When I run it on the iPad everything looks great (but small) except for the launch screen that also is small (not full screen) and not really proportional. I have read the documentation, but I'm not sure where I've gone wrong. I have added Default-Portrait.p... | [
"iphone",
"ipad",
"splash-screen",
"launch"
] | 0 | 1 | 584 | 1 | 0 | 2011-06-10T16:10:54.980000 | 2011-06-10T16:14:31.263000 |
6,309,136 | 6,309,241 | How to save Facebook UID in Devise? | I am using Devise and I have it so a User clicks "log in with facebook". Once they confirm this, it then takes them to the registration url "http://0.0.0.0:3000/users/sign_up". In here I then populate the name and email fields with the ones I got from Facebook. They now just have to pick a password to sign up. I also w... | Using the auth hash provided by Omniauth you should be able to retrieve the user information. For example the hash has a structure that looks like this. You can pull the user information like this: facebook_uid = user_auth.uid facebook_url = user.user_info.urls | How to save Facebook UID in Devise? I am using Devise and I have it so a User clicks "log in with facebook". Once they confirm this, it then takes them to the registration url "http://0.0.0.0:3000/users/sign_up". In here I then populate the name and email fields with the ones I got from Facebook. They now just have to ... | TITLE:
How to save Facebook UID in Devise?
QUESTION:
I am using Devise and I have it so a User clicks "log in with facebook". Once they confirm this, it then takes them to the registration url "http://0.0.0.0:3000/users/sign_up". In here I then populate the name and email fields with the ones I got from Facebook. They... | [
"ruby-on-rails",
"ruby-on-rails-3",
"facebook-graph-api",
"devise"
] | 0 | 0 | 436 | 1 | 0 | 2011-06-10T16:11:49.710000 | 2011-06-10T16:20:31.097000 |
6,309,154 | 6,309,334 | How to intercept WCF faults and return custom response instead? | Consider the following very basic WCF service implementation: public enum TransactionStatus { Success = 0, Error = 1 }
public class TransactionResponse { public TransactionStatus Status { get; set; } public string Message { get; set; } }
[ServiceContract] [XmlSerializerFormat] public interface ITestService { [Operati... | Check out the WCF IErrorHandler interface - it allows you to centrally define one way in your service implementation to catch all exceptions and either swallow them, or convert them to WCF-friendly SOAP exceptions. This will make sure the channel between the client and the server isn't faulted, e.g. it can still be use... | How to intercept WCF faults and return custom response instead? Consider the following very basic WCF service implementation: public enum TransactionStatus { Success = 0, Error = 1 }
public class TransactionResponse { public TransactionStatus Status { get; set; } public string Message { get; set; } }
[ServiceContract... | TITLE:
How to intercept WCF faults and return custom response instead?
QUESTION:
Consider the following very basic WCF service implementation: public enum TransactionStatus { Success = 0, Error = 1 }
public class TransactionResponse { public TransactionStatus Status { get; set; } public string Message { get; set; } }... | [
"wcf",
"exception"
] | 5 | 7 | 4,656 | 1 | 0 | 2011-06-10T16:13:37.907000 | 2011-06-10T16:27:17.133000 |
6,309,155 | 6,309,335 | Sage notebook not opening | I installed the sagemath software on an ubuntu machine and nothing executes. I type sage: notebook() NameError: name 'notebook' is not defined
sage: 2+3 --------------------------------------------------------------------------- NameError Traceback (most recent call last)
/home/myusername/Downloads/sage-4.7-linux-32b... | I think the line ImportError: libgfortran.so.3: cannot open shared object file: No such file or directory is the source of the problem. That error message seemed familiar, and I thought I'd seen it relatively recently: turns out that I was right, it was on a sage-support thread.. Try installing gfortran. On Ubuntu: sud... | Sage notebook not opening I installed the sagemath software on an ubuntu machine and nothing executes. I type sage: notebook() NameError: name 'notebook' is not defined
sage: 2+3 --------------------------------------------------------------------------- NameError Traceback (most recent call last)
/home/myusername/Do... | TITLE:
Sage notebook not opening
QUESTION:
I installed the sagemath software on an ubuntu machine and nothing executes. I type sage: notebook() NameError: name 'notebook' is not defined
sage: 2+3 --------------------------------------------------------------------------- NameError Traceback (most recent call last)
/... | [
"sage"
] | 1 | 1 | 827 | 1 | 0 | 2011-06-10T16:13:41.617000 | 2011-06-10T16:27:31.537000 |
6,309,157 | 6,309,227 | The Stored Procedures Feud | Possible Duplicate: What are the pros and cons to keeping SQL in Stored Procs versus Code I was listening to Hanselminutes podcast "Rise of The Micro ORM," where one of the guests (Sam Saffron and Rob Conery) outlined the classic reasons that DBA's insist on stored procedures: They are pre-compiled, which gives them an... | "but I thought it was well known that sending arbitrary (uncompiled) SQL to the database was a performance hit." The distinction you're making between stored procs and other sql statements regarding precompilation hasn't existed since SQL 6.5. Stored Procedures and Execution Plans In SQL Server version 6.5 and earlier,... | The Stored Procedures Feud Possible Duplicate: What are the pros and cons to keeping SQL in Stored Procs versus Code I was listening to Hanselminutes podcast "Rise of The Micro ORM," where one of the guests (Sam Saffron and Rob Conery) outlined the classic reasons that DBA's insist on stored procedures: They are pre-co... | TITLE:
The Stored Procedures Feud
QUESTION:
Possible Duplicate: What are the pros and cons to keeping SQL in Stored Procs versus Code I was listening to Hanselminutes podcast "Rise of The Micro ORM," where one of the guests (Sam Saffron and Rob Conery) outlined the classic reasons that DBA's insist on stored procedure... | [
"c#",
"database",
"performance",
"stored-procedures",
"orm"
] | 4 | 8 | 493 | 3 | 0 | 2011-06-10T16:13:55.247000 | 2011-06-10T16:19:23.920000 |
6,309,179 | 6,309,371 | How to tell if a file is an EXE or a DLL? | If you've gotten the file extensions messed up, how can you tell an executable apart from a DLL? They both seem to have entry points and everything... | Look at this article for a good explanation of a portable executable on windows. And then look at the section about the PE header. Also the code there-in shows in C the way to open and examine a PE file using Win32. This information you are looking for is stored in the IMAGE_FILE_HEADER. Specifically in the Characteris... | How to tell if a file is an EXE or a DLL? If you've gotten the file extensions messed up, how can you tell an executable apart from a DLL? They both seem to have entry points and everything... | TITLE:
How to tell if a file is an EXE or a DLL?
QUESTION:
If you've gotten the file extensions messed up, how can you tell an executable apart from a DLL? They both seem to have entry points and everything...
ANSWER:
Look at this article for a good explanation of a portable executable on windows. And then look at th... | [
"dll",
"executable",
"file-extension",
"portable-executable"
] | 15 | 5 | 15,551 | 5 | 0 | 2011-06-10T16:15:21.477000 | 2011-06-10T16:30:58.277000 |
6,309,181 | 6,309,247 | php array returned from preg_split not working | I am currently writing a php script that validates a username and password. I am working by testing things little by little and right now I have a password file with only one line in it: user:0011 I am using preg_split to parse the lines in this file and have the following code in my php script: "; echo $login[1]." "; ... | You're on the second iteration of the while loop is my guess; try throwing in a simple counter to check. If you have a newline in the file that would do it. try doing this at the top: $lrec = trim(fgets($f)); if (empty($lrec)) { continue; } $login = preg_split("/:/",$lrec); | php array returned from preg_split not working I am currently writing a php script that validates a username and password. I am working by testing things little by little and right now I have a password file with only one line in it: user:0011 I am using preg_split to parse the lines in this file and have the following... | TITLE:
php array returned from preg_split not working
QUESTION:
I am currently writing a php script that validates a username and password. I am working by testing things little by little and right now I have a password file with only one line in it: user:0011 I am using preg_split to parse the lines in this file and ... | [
"php",
"arrays",
"string-parsing"
] | 0 | 3 | 1,158 | 1 | 0 | 2011-06-10T16:15:22.393000 | 2011-06-10T16:20:53.793000 |
6,309,187 | 6,309,348 | How do I use ajax to auto refresh a section of page without manually invoking a function within javascript? | var xmlhttp;
//Set up ajax first so he knows which guy to play with function loadXMLDoc(url,cfunc) { //Code to catch modern browsers if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); }
//Code to catch crap browsers else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }
//Set up xmlhttp.onreadystatechange=... | function autoRefresh() { var url = "../../../support/ajaxTest.txt"; var target = document.getElementById("statusRefresh");
var doRefresh = function() { loadXMLDoc(url, function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { target.innerHTML=xmlhttp.responseText; } } });
setInterval( doRefresh, 5000 ); } and ... | How do I use ajax to auto refresh a section of page without manually invoking a function within javascript? var xmlhttp;
//Set up ajax first so he knows which guy to play with function loadXMLDoc(url,cfunc) { //Code to catch modern browsers if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); }
//Code to catch ... | TITLE:
How do I use ajax to auto refresh a section of page without manually invoking a function within javascript?
QUESTION:
var xmlhttp;
//Set up ajax first so he knows which guy to play with function loadXMLDoc(url,cfunc) { //Code to catch modern browsers if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); }... | [
"javascript",
"ajax"
] | 0 | 2 | 9,818 | 2 | 0 | 2011-06-10T16:15:53.467000 | 2011-06-10T16:28:34.527000 |
6,309,194 | 6,309,245 | img attribute question re: IE --> won't display native width of images, reverts to 1px wide | This question regards my personal photography website. I use the following javascript to generate random image sequences each time the page is loaded or refreshed: My html and css both validate (css has border radius warnings for three buttons) and the site looks good on everything except any version of IE. The problem... | You should remove width="". If I remember correctly, that screws up IE. Testing it here: http://jsfiddle.net/4pE7E/ In IE9/8/7, it does indeed cause the image to be 1px wide. | img attribute question re: IE --> won't display native width of images, reverts to 1px wide This question regards my personal photography website. I use the following javascript to generate random image sequences each time the page is loaded or refreshed: My html and css both validate (css has border radius warnings fo... | TITLE:
img attribute question re: IE --> won't display native width of images, reverts to 1px wide
QUESTION:
This question regards my personal photography website. I use the following javascript to generate random image sequences each time the page is loaded or refreshed: My html and css both validate (css has border ... | [
"javascript",
"html",
"css"
] | 0 | 0 | 102 | 1 | 0 | 2011-06-10T16:16:31.977000 | 2011-06-10T16:20:47.140000 |
6,309,197 | 6,309,294 | Fetching invisible uitableviewcell | I have a tableview with each cell loaded from a xib. It is in the format UILabel some space and UITextField. On a button click somewhere on the view I need the action to fetch all the textfield values in the UITableView with the labels in a dictionary. The problem is when I alloc a cell and fetch the values from there ... | UITableViewCells are reused when they scroll out of view, so that's probably why it won't let you access attributes of UITableViewCells that are not visible. An NSDictionary might be your best bet: Set a tag for each cell's UITextField based on the indexPath.row value during cell creation. Set the delegate for each UIT... | Fetching invisible uitableviewcell I have a tableview with each cell loaded from a xib. It is in the format UILabel some space and UITextField. On a button click somewhere on the view I need the action to fetch all the textfield values in the UITableView with the labels in a dictionary. The problem is when I alloc a ce... | TITLE:
Fetching invisible uitableviewcell
QUESTION:
I have a tableview with each cell loaded from a xib. It is in the format UILabel some space and UITextField. On a button click somewhere on the view I need the action to fetch all the textfield values in the UITableView with the labels in a dictionary. The problem is... | [
"iphone",
"uitableview"
] | 3 | 4 | 2,405 | 1 | 0 | 2011-06-10T16:16:51.730000 | 2011-06-10T16:23:56.513000 |
6,309,201 | 6,309,318 | Sending TCP data from Android (as client) - no data being sent? | I'm trying to send data from my Android app to my PC over TCP. The code is as follows: Socket socket = new Socket("10.0.78.75", 50505);
OutputStream out = socket.getOutputStream(); PrintWriter output = new PrintWriter(out);
mStatusText.setText("Sending Data to PC"); output.println("Hello from Android"); mStatusText.s... | Try putting an out.flush();out.close(); after the println(..); | Sending TCP data from Android (as client) - no data being sent? I'm trying to send data from my Android app to my PC over TCP. The code is as follows: Socket socket = new Socket("10.0.78.75", 50505);
OutputStream out = socket.getOutputStream(); PrintWriter output = new PrintWriter(out);
mStatusText.setText("Sending D... | TITLE:
Sending TCP data from Android (as client) - no data being sent?
QUESTION:
I'm trying to send data from my Android app to my PC over TCP. The code is as follows: Socket socket = new Socket("10.0.78.75", 50505);
OutputStream out = socket.getOutputStream(); PrintWriter output = new PrintWriter(out);
mStatusText.... | [
"android",
"sockets",
"tcp",
"client",
"communication"
] | 13 | 18 | 46,053 | 3 | 0 | 2011-06-10T16:17:10.307000 | 2011-06-10T16:25:31.773000 |
6,309,207 | 6,309,357 | Does after_commit actually run? | I'm on rails 3.0.8 and trying to use the after_commit callback. It's defined here: https://github.com/rails/rails/blob/v3.0.8/activerecord/lib/active_record/transactions.rb#L210 It's mentioned as one of the callbacks here: https://github.com/rails/rails/blob/v3.0.8/activerecord/lib/active_record/callbacks.rb#L22 Consid... | If you're experimenting with this in your test suite, you'll have to set self.use_transactional_fixtures = false for that class. By default, Rails executes a test suite inside a transaction and does a rollback at the end to clean up. It makes your tests fast, but if you rely on controlling transactions yourself or this... | Does after_commit actually run? I'm on rails 3.0.8 and trying to use the after_commit callback. It's defined here: https://github.com/rails/rails/blob/v3.0.8/activerecord/lib/active_record/transactions.rb#L210 It's mentioned as one of the callbacks here: https://github.com/rails/rails/blob/v3.0.8/activerecord/lib/activ... | TITLE:
Does after_commit actually run?
QUESTION:
I'm on rails 3.0.8 and trying to use the after_commit callback. It's defined here: https://github.com/rails/rails/blob/v3.0.8/activerecord/lib/active_record/transactions.rb#L210 It's mentioned as one of the callbacks here: https://github.com/rails/rails/blob/v3.0.8/acti... | [
"ruby-on-rails",
"ruby",
"activerecord"
] | 4 | 5 | 1,008 | 2 | 0 | 2011-06-10T16:17:39.770000 | 2011-06-10T16:29:19.877000 |
6,309,212 | 6,309,386 | Does div with certain content exist | If I have a container div called #container which has a bunch of.inside divs in it, how would I go about checking whether a certain.inside div with a specified content (just a string of English text) exists or not? I'm doing this to prevent duplicates in a notification system I'm setting up for a website. I don't need ... | To check existence $("#container.inside:contains('old text')").size() > 0 To modify the text $("#container.inside:contains('old text')").text('new text'); | Does div with certain content exist If I have a container div called #container which has a bunch of.inside divs in it, how would I go about checking whether a certain.inside div with a specified content (just a string of English text) exists or not? I'm doing this to prevent duplicates in a notification system I'm set... | TITLE:
Does div with certain content exist
QUESTION:
If I have a container div called #container which has a bunch of.inside divs in it, how would I go about checking whether a certain.inside div with a specified content (just a string of English text) exists or not? I'm doing this to prevent duplicates in a notificat... | [
"javascript",
"jquery"
] | 0 | 1 | 174 | 4 | 0 | 2011-06-10T16:17:56.663000 | 2011-06-10T16:31:45.960000 |
6,309,214 | 6,309,420 | Why use a form tag when you're submitting via ajax? | Philosophical question: Say I've got a web app that requires javascript and a modern browser, so progressive enhancement is not an issue. If my form is being built via javascript, and my data updates are all being done via ajax POSTs & PUTs, is there really any reason to wrap my controls in a form tag? If I'm still goi... | There is at least one important user-experience feature provided specifically by wrapping inputs inside a form tag: The enter key will submit the form. In fact, in Mobile Safari, this is how you get the "Go" button to appear on the keyboard. Without a form wrapping the inputs, there is nothing to submit. You can of cou... | Why use a form tag when you're submitting via ajax? Philosophical question: Say I've got a web app that requires javascript and a modern browser, so progressive enhancement is not an issue. If my form is being built via javascript, and my data updates are all being done via ajax POSTs & PUTs, is there really any reason... | TITLE:
Why use a form tag when you're submitting via ajax?
QUESTION:
Philosophical question: Say I've got a web app that requires javascript and a modern browser, so progressive enhancement is not an issue. If my form is being built via javascript, and my data updates are all being done via ajax POSTs & PUTs, is there... | [
"javascript",
"html",
"ajax",
"forms"
] | 78 | 74 | 16,366 | 7 | 0 | 2011-06-10T16:18:04.600000 | 2011-06-10T16:34:13.970000 |
6,309,220 | 6,309,454 | What playlist format does Android 2.2 support to stream? | Hello i am trying to get my android 2.2 app stream music. So far I have been able to stream from a radio station via the mediaPlayer.setDataSource("STREAM HERE") I have tried with a m3u file and it won't work (unless my m3u file is wrong). Can it support xspf or what other file types? How could i go about solving this ... | The setDataSource() method on the media player will accept file or URIs for a media source. Look at this list to see what media formats the media player accepts: http://developer.android.com/guide/appendix/media-formats.html I am fairly certain that the media player will not play playlist files like M3U. You would have... | What playlist format does Android 2.2 support to stream? Hello i am trying to get my android 2.2 app stream music. So far I have been able to stream from a radio station via the mediaPlayer.setDataSource("STREAM HERE") I have tried with a m3u file and it won't work (unless my m3u file is wrong). Can it support xspf or ... | TITLE:
What playlist format does Android 2.2 support to stream?
QUESTION:
Hello i am trying to get my android 2.2 app stream music. So far I have been able to stream from a radio station via the mediaPlayer.setDataSource("STREAM HERE") I have tried with a m3u file and it won't work (unless my m3u file is wrong). Can i... | [
"android",
"stream",
"audio-streaming",
"playlist"
] | 0 | 1 | 3,403 | 1 | 0 | 2011-06-10T16:18:53.380000 | 2011-06-10T16:37:02.237000 |
6,309,225 | 6,309,314 | UIButton won't gray out | Isn't UIButton supposed to become grayish/grayer when enabled=NO? I have a simple UIButton on a blackbackground (no custom images, no custom nothing, just dragged it with IB and changed size and title). And when I set it programatically to become disabled it stays white as hell! For now I'm using a small stupid workaro... | There is no way to make a UIButton "grayer". But you can use that trick: UIButton *myButton; myButton.alpha = 0.4; myButton.enabled = NO; So your UIButton looks like unusable;) | UIButton won't gray out Isn't UIButton supposed to become grayish/grayer when enabled=NO? I have a simple UIButton on a blackbackground (no custom images, no custom nothing, just dragged it with IB and changed size and title). And when I set it programatically to become disabled it stays white as hell! For now I'm usin... | TITLE:
UIButton won't gray out
QUESTION:
Isn't UIButton supposed to become grayish/grayer when enabled=NO? I have a simple UIButton on a blackbackground (no custom images, no custom nothing, just dragged it with IB and changed size and title). And when I set it programatically to become disabled it stays white as hell... | [
"iphone",
"ios",
"uibutton"
] | 36 | 44 | 17,950 | 5 | 0 | 2011-06-10T16:19:17.820000 | 2011-06-10T16:25:21.640000 |
6,309,237 | 6,309,485 | How would you declare DLL import signature? | this is a follow-up post of Using pHash from.NET How would you declare following C++ declaration in.NET? int ph_dct_imagehash(const char* file,ulong64 &hash); So far i have [DllImport(@"pHash.dll")] public static extern int ph_dct_imagehash(string file, ref ulong hash); But I am now getting following error for ulong ha... | Stack imbalance indicates that the C++ code uses cdecl and your C# uses stdcall calling convention. Change your DLLImport to this: [DLLImport(@"pHash.dll", CallingConvention=CallingConvention.Cdecl)] The function signature in C# (return value and parameters) is otherwise correct. | How would you declare DLL import signature? this is a follow-up post of Using pHash from.NET How would you declare following C++ declaration in.NET? int ph_dct_imagehash(const char* file,ulong64 &hash); So far i have [DllImport(@"pHash.dll")] public static extern int ph_dct_imagehash(string file, ref ulong hash); But I... | TITLE:
How would you declare DLL import signature?
QUESTION:
this is a follow-up post of Using pHash from.NET How would you declare following C++ declaration in.NET? int ph_dct_imagehash(const char* file,ulong64 &hash); So far i have [DllImport(@"pHash.dll")] public static extern int ph_dct_imagehash(string file, ref ... | [
"c#",
".net",
"c++",
"dllimport"
] | 6 | 11 | 7,670 | 3 | 0 | 2011-06-10T16:20:05.400000 | 2011-06-10T16:39:33.870000 |
6,309,254 | 6,309,306 | A way to pretty print a C# object | I have a text box and I want to display a C# object in it in a human-readable way, just for debugging reasons. I don't want to use external libraries if possible. How do I do this? | Serialize it to JSON. It can be done in the ToString() method like others suggested, but I don't think that is appropriate if you are going to use that for debugging only. | A way to pretty print a C# object I have a text box and I want to display a C# object in it in a human-readable way, just for debugging reasons. I don't want to use external libraries if possible. How do I do this? | TITLE:
A way to pretty print a C# object
QUESTION:
I have a text box and I want to display a C# object in it in a human-readable way, just for debugging reasons. I don't want to use external libraries if possible. How do I do this?
ANSWER:
Serialize it to JSON. It can be done in the ToString() method like others sugg... | [
"c#",
"pretty-print"
] | 80 | 25 | 84,882 | 10 | 0 | 2011-06-10T16:21:18.787000 | 2011-06-10T16:24:53.123000 |
6,309,255 | 6,309,343 | Display query in view codeigniter | lets say the query from my controller is $query. how to display the data other than using this kind of code? foreach($query as $row){ echo $row->student_id; } any other than this coz the query only have one row any way that can i access the returned array like this? $query['student_id']; | let's say your table have the following fields student_id and student_name have your model or controller return only one row. function get_first_student() {
$query = this->db->select('*')->from('student')-where('student_id','1')->limit(1); $data['stuff'] = $query->row_array(); // or $query->row() which returns an obje... | Display query in view codeigniter lets say the query from my controller is $query. how to display the data other than using this kind of code? foreach($query as $row){ echo $row->student_id; } any other than this coz the query only have one row any way that can i access the returned array like this? $query['student_id'... | TITLE:
Display query in view codeigniter
QUESTION:
lets say the query from my controller is $query. how to display the data other than using this kind of code? foreach($query as $row){ echo $row->student_id; } any other than this coz the query only have one row any way that can i access the returned array like this? $... | [
"codeigniter"
] | 3 | 2 | 7,510 | 3 | 0 | 2011-06-10T16:21:20.587000 | 2011-06-10T16:28:24.627000 |
6,309,256 | 6,309,388 | How to use Cursor's in non Activity Classes | I wan't to get data's from CallLog.Calls.CONTENT_URI in non Activity classes. Am using cursor to get these data's from CallLog. But in non activity class cursor shows some error so how i can how i can do this? Presently am doing like this, public class CallReceiver extends Activity { @Override public void onCreate(Bund... | Cursor c = context.getContentResolver().query(uri, projection, selection, null, sortOrder); if (c.moveToFirst()) {... } c.close(); | How to use Cursor's in non Activity Classes I wan't to get data's from CallLog.Calls.CONTENT_URI in non Activity classes. Am using cursor to get these data's from CallLog. But in non activity class cursor shows some error so how i can how i can do this? Presently am doing like this, public class CallReceiver extends Ac... | TITLE:
How to use Cursor's in non Activity Classes
QUESTION:
I wan't to get data's from CallLog.Calls.CONTENT_URI in non Activity classes. Am using cursor to get these data's from CallLog. But in non activity class cursor shows some error so how i can how i can do this? Presently am doing like this, public class CallR... | [
"android",
"calllog",
"android-cursor"
] | 1 | 10 | 4,004 | 1 | 0 | 2011-06-10T16:21:30.033000 | 2011-06-10T16:31:55.970000 |
6,309,261 | 6,309,297 | what is the height of a normal webpage | I'm experimenting with this sample page on jsbin: http://jsbin.com/igeca4/edit The height right now is 741px however, at the bottom there is still some white space left. I can keep doing trial and error witht the height pixels but whatever the user viewing the page has a large monitor. My page will then look half empty... | There is no standard height of a webpage; you can't even assume the user has his/her browser maximized. If you are going to have a footer or page-bottom content, you want to make your page the full height of the browser. Here is a link on having 100% height in CSS. Basically, you need to set the html and body objects t... | what is the height of a normal webpage I'm experimenting with this sample page on jsbin: http://jsbin.com/igeca4/edit The height right now is 741px however, at the bottom there is still some white space left. I can keep doing trial and error witht the height pixels but whatever the user viewing the page has a large mon... | TITLE:
what is the height of a normal webpage
QUESTION:
I'm experimenting with this sample page on jsbin: http://jsbin.com/igeca4/edit The height right now is 741px however, at the bottom there is still some white space left. I can keep doing trial and error witht the height pixels but whatever the user viewing the pa... | [
"html",
"css"
] | 1 | 2 | 3,172 | 3 | 0 | 2011-06-10T16:21:43.767000 | 2011-06-10T16:24:01.383000 |
6,309,271 | 6,309,504 | Which are the Error tracking tools that can be used with NetBeans 7.0? | I am new to enterprise Java development.. Most of the time I am busy working with Spring, Hibernate, JSF, Maven and Glassfish server 3.x.. My problem is that NetBeans sucks my mind most of the time by showing errors which are hard to debug. Can anyone tell me which are the tools that I can use for tracking errors. Whic... | Bugzilla is an incident tracking tool which helps analysts, developers and QA manage incidents for a software product. I don't think it's what you're looking for. When you say the errors are hard to debug in Netbeans, do you mean that similar errors are easier in another IDE such as Eclipse? If not, I think instead of ... | Which are the Error tracking tools that can be used with NetBeans 7.0? I am new to enterprise Java development.. Most of the time I am busy working with Spring, Hibernate, JSF, Maven and Glassfish server 3.x.. My problem is that NetBeans sucks my mind most of the time by showing errors which are hard to debug. Can anyo... | TITLE:
Which are the Error tracking tools that can be used with NetBeans 7.0?
QUESTION:
I am new to enterprise Java development.. Most of the time I am busy working with Spring, Hibernate, JSF, Maven and Glassfish server 3.x.. My problem is that NetBeans sucks my mind most of the time by showing errors which are hard ... | [
"hibernate",
"spring",
"netbeans",
"jakarta-ee",
"maven-3"
] | 0 | 1 | 71 | 1 | 0 | 2011-06-10T16:22:12.763000 | 2011-06-10T16:41:21.193000 |
6,309,276 | 6,309,360 | HTTP Request from c# program, requiring no response | I've done some socket work where I had to send a request because I wanted a response back, but I need to write something in C# that's just going to call an old web page which takes about 10 seconds to respond, and not wait for the response (the failures will flag up with DB calls). Is there a simple way to do this? | Try this thread: Async HttpWebRequest with no wait from within a web application (This kind of approach is sometimes known as "fire and forget") | HTTP Request from c# program, requiring no response I've done some socket work where I had to send a request because I wanted a response back, but I need to write something in C# that's just going to call an old web page which takes about 10 seconds to respond, and not wait for the response (the failures will flag up w... | TITLE:
HTTP Request from c# program, requiring no response
QUESTION:
I've done some socket work where I had to send a request because I wanted a response back, but I need to write something in C# that's just going to call an old web page which takes about 10 seconds to respond, and not wait for the response (the failu... | [
"c#"
] | 6 | 6 | 15,137 | 6 | 0 | 2011-06-10T16:22:38.333000 | 2011-06-10T16:29:38.740000 |
6,309,291 | 6,309,482 | Structural type | I have found for self is very interesting a fact. For example i've wrote: type A = { val st: Set[Any] val start: Set[Any] val Sigma: Set[Char] def tr(f: (Tuple2[Any, Any])=>Boolean): Set[Any] } class Fon { val st: Set[Any] val start: Set[Any] val Sigma: Set[Char] def tr(f: (Tuple2[Any, Any])=>Boolean): Set[Any] = Set(o... | There is no such method as A.out, because of how you've defined the A type. Thus, when you try to call a method called out on an object of type A, the compiler correctly tells you that no such method exists. This is not related to structural typing, by the way - if you had made A a trait and had Fon extend it, you'd ru... | Structural type I have found for self is very interesting a fact. For example i've wrote: type A = { val st: Set[Any] val start: Set[Any] val Sigma: Set[Char] def tr(f: (Tuple2[Any, Any])=>Boolean): Set[Any] } class Fon { val st: Set[Any] val start: Set[Any] val Sigma: Set[Char] def tr(f: (Tuple2[Any, Any])=>Boolean): ... | TITLE:
Structural type
QUESTION:
I have found for self is very interesting a fact. For example i've wrote: type A = { val st: Set[Any] val start: Set[Any] val Sigma: Set[Char] def tr(f: (Tuple2[Any, Any])=>Boolean): Set[Any] } class Fon { val st: Set[Any] val start: Set[Any] val Sigma: Set[Char] def tr(f: (Tuple2[Any,... | [
"scala"
] | 1 | 5 | 296 | 3 | 0 | 2011-06-10T16:23:30.543000 | 2011-06-10T16:39:21.210000 |
6,309,299 | 6,309,405 | Struts2: Showing and handling a form in one action (post back to the same action) | Coming from frameworks like Django and RoR I am used to show and handle forms from one action. (posting back to the action that shows the form) Is this possible in Struts2 as well? I'd like the following behavior: 1) "users/xyz/edit" gets called 2) HTTP GET -> showing the form 3) HTTP POST -> form validation -> saving ... | Yes you can use the same Action class. Though its not as elegant as both those frameworks you mentioned since they encapsulate the REST principle at a framework level. Using the base Struts 2 framework, just add an actionType hidden parameter to your page and form, update it according to next expected action (display->... | Struts2: Showing and handling a form in one action (post back to the same action) Coming from frameworks like Django and RoR I am used to show and handle forms from one action. (posting back to the action that shows the form) Is this possible in Struts2 as well? I'd like the following behavior: 1) "users/xyz/edit" gets... | TITLE:
Struts2: Showing and handling a form in one action (post back to the same action)
QUESTION:
Coming from frameworks like Django and RoR I am used to show and handle forms from one action. (posting back to the action that shows the form) Is this possible in Struts2 as well? I'd like the following behavior: 1) "us... | [
"struts2"
] | 0 | 1 | 1,277 | 1 | 0 | 2011-06-10T16:24:20.627000 | 2011-06-10T16:33:26.810000 |
6,309,313 | 6,310,358 | Caching API data, should I serialize the data into a single column? Or other approach? | I am implementing a Twitter app, where the app needs to cache details of users coming from Twitter. Would it be wise to serialize the data into a column called data? Or, in my User model, should I create a column for each field that is returned by the API request? Reading about (ActiveRecord::Base) serialize. If I go w... | So assume for a moment that you have a table with the following three columns: user_id, api_field_name, api_field_value In this table you can add a row for each api field you want to persist. For example: user_d api_field_name api_field_value 1 "meaning_of_life" 42 1 "swallow_type" "africa" This means that user number ... | Caching API data, should I serialize the data into a single column? Or other approach? I am implementing a Twitter app, where the app needs to cache details of users coming from Twitter. Would it be wise to serialize the data into a column called data? Or, in my User model, should I create a column for each field that ... | TITLE:
Caching API data, should I serialize the data into a single column? Or other approach?
QUESTION:
I am implementing a Twitter app, where the app needs to cache details of users coming from Twitter. Would it be wise to serialize the data into a column called data? Or, in my User model, should I create a column fo... | [
"ruby-on-rails",
"ruby-on-rails-3",
"twitter"
] | 0 | 1 | 440 | 1 | 0 | 2011-06-10T16:25:16.863000 | 2011-06-10T18:06:00.993000 |
6,309,325 | 6,309,411 | Common managed C++ gotchas | What are some of the most common issues to look out for when writing managed-C++ for the first time after almost exclusively working with unmanaged C++? | When you convert a managed delegate to a pointer-to-function using the built-in IJW (It Just Works) technology, the pointer-to-function is not holding a reference to the object that the delegate was from. If you don't arrange to hold a reference some other way, the managed object may be collected, and then when you cal... | Common managed C++ gotchas What are some of the most common issues to look out for when writing managed-C++ for the first time after almost exclusively working with unmanaged C++? | TITLE:
Common managed C++ gotchas
QUESTION:
What are some of the most common issues to look out for when writing managed-C++ for the first time after almost exclusively working with unmanaged C++?
ANSWER:
When you convert a managed delegate to a pointer-to-function using the built-in IJW (It Just Works) technology, t... | [
"c++-cli",
"managed-c++"
] | 2 | 2 | 388 | 4 | 0 | 2011-06-10T16:26:01.420000 | 2011-06-10T16:33:36.953000 |
6,309,340 | 6,310,236 | How to add System.ComponentModel.Composition.dll in VS2010 IDE? | With command line, I use /r: to add reference with VS2010 as follows. csc Program.cs /r:System.ComponentModel.Composition.dll /r:SharedLibrary.dll How can I add reference in VS2010 IDE? I tried to right click on the Solution Explorer, then clicked "Add Reference...", but I can't find the System.ComponentModel.Compositi... | The Add Reference Dialog from the Productivity Power Tools is filtering for 3.5 framework assemblies because you're application is undoubtedly targeting 3.5. The System.ComponentModel.Composition.dll is a 4.0 Framework dll. You can add the reference by browsing to the 4.0 framework folder but this will stop your applic... | How to add System.ComponentModel.Composition.dll in VS2010 IDE? With command line, I use /r: to add reference with VS2010 as follows. csc Program.cs /r:System.ComponentModel.Composition.dll /r:SharedLibrary.dll How can I add reference in VS2010 IDE? I tried to right click on the Solution Explorer, then clicked "Add Ref... | TITLE:
How to add System.ComponentModel.Composition.dll in VS2010 IDE?
QUESTION:
With command line, I use /r: to add reference with VS2010 as follows. csc Program.cs /r:System.ComponentModel.Composition.dll /r:SharedLibrary.dll How can I add reference in VS2010 IDE? I tried to right click on the Solution Explorer, the... | [
"visual-studio",
"visual-studio-2010",
"mef"
] | 3 | 8 | 11,154 | 1 | 0 | 2011-06-10T16:27:54.257000 | 2011-06-10T17:52:31.627000 |
6,309,358 | 6,309,401 | "instance of" "type of" What is the use case of this? | While doing some casual reading I came across an interesting quote by Scott Meyers Anytime you find yourself writing code of the form "if the object is of type T1, then do something, but if it's of type T2, then do something else," slap yourself. I was just wondering why Java has "instance of" operator when you could d... | Sometimes you have to use objects whose behavior (e.g. source code) you do not control so you cannot always rely on object-oriented solutions to type-related matters. (Especially consider that authors of libraries cannot anticipate every use case you might have; of course, you could argue that extension and implementat... | "instance of" "type of" What is the use case of this? While doing some casual reading I came across an interesting quote by Scott Meyers Anytime you find yourself writing code of the form "if the object is of type T1, then do something, but if it's of type T2, then do something else," slap yourself. I was just wonderin... | TITLE:
"instance of" "type of" What is the use case of this?
QUESTION:
While doing some casual reading I came across an interesting quote by Scott Meyers Anytime you find yourself writing code of the form "if the object is of type T1, then do something, but if it's of type T2, then do something else," slap yourself. I... | [
"java"
] | 6 | 3 | 345 | 6 | 0 | 2011-06-10T16:29:24.707000 | 2011-06-10T16:33:06.113000 |
6,309,359 | 6,309,397 | Why won't Html.ListBoxFor() highlight current selected items? | I am trying to understand why my Html.ListBoxFor() is not highlighting current selected items when the view loads. I have a database model: public class Issue { [Key] public int IssueId { get; set; } public int Number { get; set; } public string Title { get; set; } public DateTime Date { get; set; }
public virtual ICo... | You need a list of scalar types as first argument to the ListBoxFor helper which will map to the creator ids that you want preselected: public class IssueEditModel { public IEnumerable Creators { get; set; } public IEnumerable SelectedCreatorIds { get; set; } } and then: IssueEditModel issueEdit = new IssueEditModel { ... | Why won't Html.ListBoxFor() highlight current selected items? I am trying to understand why my Html.ListBoxFor() is not highlighting current selected items when the view loads. I have a database model: public class Issue { [Key] public int IssueId { get; set; } public int Number { get; set; } public string Title { get;... | TITLE:
Why won't Html.ListBoxFor() highlight current selected items?
QUESTION:
I am trying to understand why my Html.ListBoxFor() is not highlighting current selected items when the view loads. I have a database model: public class Issue { [Key] public int IssueId { get; set; } public int Number { get; set; } public s... | [
"asp.net",
"asp.net-mvc",
"asp.net-mvc-3"
] | 0 | 3 | 4,241 | 2 | 0 | 2011-06-10T16:29:37.727000 | 2011-06-10T16:32:58.177000 |
6,309,370 | 6,309,458 | PHP header redirection not working as expected | I have the following issue. I collect some user input and then write it to a text file using PHP. After this is done I want to redirect to another web page - here www.google.com. I am having difficulty. $myFile = "testFile.txt"; $fh = fopen($myFile, 'a'); $IP = $_SERVER["REMOTE_ADDR"].','; $logdetails= $IP.date("F j, Y... | what if you try your redirect part first in another PHP. divide and conquer!:) hey and If that does not work, check your html headers, I remember that I had issues with the html headers trying to use: header("Location: http://www.google.com "); | PHP header redirection not working as expected I have the following issue. I collect some user input and then write it to a text file using PHP. After this is done I want to redirect to another web page - here www.google.com. I am having difficulty. $myFile = "testFile.txt"; $fh = fopen($myFile, 'a'); $IP = $_SERVER["R... | TITLE:
PHP header redirection not working as expected
QUESTION:
I have the following issue. I collect some user input and then write it to a text file using PHP. After this is done I want to redirect to another web page - here www.google.com. I am having difficulty. $myFile = "testFile.txt"; $fh = fopen($myFile, 'a');... | [
"php",
"redirect"
] | 2 | 0 | 727 | 7 | 0 | 2011-06-10T16:30:52.230000 | 2011-06-10T16:37:20.243000 |
6,309,376 | 6,309,508 | Graph database query | I have undertaken a project that tracks shops from where a user can buy an item. I have decided to use Neo4j as the database. This is a part of the database that I have in mind: There is a node for each shop, and each of these nodes has child-nodes that store items available in that store. Consider this scenario: Now a... | your use case is actually perfect for a graph db. Could I recommend you implement your items as primary nodes and connect them to your stores? Index your store nodes using Indexing Service. That will give you quick lookup for store and then any particular item is one traversal away. Getting all other stores for an item... | Graph database query I have undertaken a project that tracks shops from where a user can buy an item. I have decided to use Neo4j as the database. This is a part of the database that I have in mind: There is a node for each shop, and each of these nodes has child-nodes that store items available in that store. Consider... | TITLE:
Graph database query
QUESTION:
I have undertaken a project that tracks shops from where a user can buy an item. I have decided to use Neo4j as the database. This is a part of the database that I have in mind: There is a node for each shop, and each of these nodes has child-nodes that store items available in th... | [
"database",
"search",
"graph",
"neo4j",
"graph-databases"
] | 2 | 3 | 1,085 | 1 | 0 | 2011-06-10T16:31:21.573000 | 2011-06-10T16:41:37.573000 |
6,309,379 | 6,309,439 | How to check for a valid Base64 encoded string | Is there a way in C# to see if a string is Base 64 encoded other than just trying to convert it and see if there is an error? I have code code like this: // Convert base64-encoded hash value into a byte array. byte[] HashBytes = Convert.FromBase64String(Value); I want to avoid the "Invalid character in a Base-64 string... | Update: For newer versions of C#, there's a much better alternative, please refer to the answer by Tomas here: https://stackoverflow.com/a/54143400/125981. It's pretty easy to recognize a Base64 string, as it will only be composed of characters 'A'..'Z', 'a'..'z', '0'..'9', '+', '/' and it is often padded at the end wi... | How to check for a valid Base64 encoded string Is there a way in C# to see if a string is Base 64 encoded other than just trying to convert it and see if there is an error? I have code code like this: // Convert base64-encoded hash value into a byte array. byte[] HashBytes = Convert.FromBase64String(Value); I want to a... | TITLE:
How to check for a valid Base64 encoded string
QUESTION:
Is there a way in C# to see if a string is Base 64 encoded other than just trying to convert it and see if there is an error? I have code code like this: // Convert base64-encoded hash value into a byte array. byte[] HashBytes = Convert.FromBase64String(V... | [
"c#",
"validation",
"base64"
] | 179 | 56 | 233,740 | 20 | 0 | 2011-06-10T16:31:29.597000 | 2011-06-10T16:35:41.027000 |
6,309,384 | 6,309,436 | How do I store multiple fields within one field in a MYSQL database | I'm sorry if this a stupid question, but I am new to this. I want to store all the information from all my customers' different contact forms in a database so they can retrieve the information later. Each contact form has a different number of fields. Ideally I'd store all of this info in one MYSQL table, but as I said... | If you don't need it to be relational, that would be fine. You wouldn't be able to query it very easily. You could store the answers in another table using keys to link back to the form and field. Or use a KeyValue store type DB like MongDB, and you could store all your data without worrying about the schema. | How do I store multiple fields within one field in a MYSQL database I'm sorry if this a stupid question, but I am new to this. I want to store all the information from all my customers' different contact forms in a database so they can retrieve the information later. Each contact form has a different number of fields. ... | TITLE:
How do I store multiple fields within one field in a MYSQL database
QUESTION:
I'm sorry if this a stupid question, but I am new to this. I want to store all the information from all my customers' different contact forms in a database so they can retrieve the information later. Each contact form has a different ... | [
"php",
"mysql",
"contact-form"
] | 1 | 1 | 2,358 | 3 | 0 | 2011-06-10T16:31:38.457000 | 2011-06-10T16:35:24.010000 |
6,309,398 | 6,309,502 | How to make this simple SQL query into a Linq Statement? | I have the following SQL statement which is going through a table and selecting out a group of results based on the the data definition. From that group, I get the single result with the highest revision for that group. Now the SQL has been easy, but translating this into Linq so far has yielded nothing which I can use... | try something like that var query = from ds in context.DataSheets where ds.IsParent == true && ds.RevisionNum == context.DataSheets.Where( ds => ds.DataDefinitionId == 34).Max( ds => ds.RevisionNum) subquery could be converted into linq expression as well | How to make this simple SQL query into a Linq Statement? I have the following SQL statement which is going through a table and selecting out a group of results based on the the data definition. From that group, I get the single result with the highest revision for that group. Now the SQL has been easy, but translating ... | TITLE:
How to make this simple SQL query into a Linq Statement?
QUESTION:
I have the following SQL statement which is going through a table and selecting out a group of results based on the the data definition. From that group, I get the single result with the highest revision for that group. Now the SQL has been easy... | [
"c#",
"sql",
"linq"
] | 0 | 3 | 160 | 2 | 0 | 2011-06-10T16:32:58.540000 | 2011-06-10T16:41:05.407000 |
6,309,407 | 6,310,284 | Remove Top-Level Container on Runtime | Unfortunately, it looks like this recently closed question was not well understood. Here is the typical output: run: Trying to Remove JDialog Remove Cycle Done:-) Checking if still exists any of TopLayoutContainers JFrame JDialog Will Try Remove Dialog again, CycleNo. 1 -------------------------------------------------... | Invoking dispose() allows the host platform to reclaim memory consumed by the heavyweight peer, but it can't do so until after the WINDOW_CLOSING event is processed on the EventQueue. Even then, gc() is a suggestion. Addendum: Another way to see the nightmare is via a profiler. Running the example below with jvisualvm,... | Remove Top-Level Container on Runtime Unfortunately, it looks like this recently closed question was not well understood. Here is the typical output: run: Trying to Remove JDialog Remove Cycle Done:-) Checking if still exists any of TopLayoutContainers JFrame JDialog Will Try Remove Dialog again, CycleNo. 1 -----------... | TITLE:
Remove Top-Level Container on Runtime
QUESTION:
Unfortunately, it looks like this recently closed question was not well understood. Here is the typical output: run: Trying to Remove JDialog Remove Cycle Done:-) Checking if still exists any of TopLayoutContainers JFrame JDialog Will Try Remove Dialog again, Cycl... | [
"java",
"swing",
"runtime",
"jdialog"
] | 20 | 21 | 12,499 | 5 | 0 | 2011-06-10T16:33:28.810000 | 2011-06-10T17:57:00.417000 |
6,309,422 | 6,309,455 | Output two-dimensional array | Ok, I'm still struggling with my arrays... I have created a two-dimensional array and saved into a session to get results on another page: $_SESSION['myARRAY'] print_r($_SESSION['myARRAY']);
// will output: Array ( [Car] => Array ( [0] => 1 [1] => 9 [2] => 0 ) [Truck] => Array ( [0] => 2 [1] => 10 [2] => 0 ) [Bus] => ... | $value is already an array. Now you only need to prepend the $key to it. You could use array_unshift: foreach($_SESSION['myARRAY'] AS $key => $value) { array_unshift($value, $key); $xls->addRow($value); } Of course if you do this more than once, you should consider storing the consolidated array. | Output two-dimensional array Ok, I'm still struggling with my arrays... I have created a two-dimensional array and saved into a session to get results on another page: $_SESSION['myARRAY'] print_r($_SESSION['myARRAY']);
// will output: Array ( [Car] => Array ( [0] => 1 [1] => 9 [2] => 0 ) [Truck] => Array ( [0] => 2 [... | TITLE:
Output two-dimensional array
QUESTION:
Ok, I'm still struggling with my arrays... I have created a two-dimensional array and saved into a session to get results on another page: $_SESSION['myARRAY'] print_r($_SESSION['myARRAY']);
// will output: Array ( [Car] => Array ( [0] => 1 [1] => 9 [2] => 0 ) [Truck] => ... | [
"php",
"multidimensional-array"
] | 1 | 5 | 393 | 2 | 0 | 2011-06-10T16:34:15.607000 | 2011-06-10T16:37:12.047000 |
6,309,424 | 6,309,467 | C# Exception: NullReferenceException | I am getting the following message whilt running my test. Message: Test method Automation.Test1.General threw exception: System.NullReferenceException: Object reference not set to an instance of an object. Automation.Library.CheckLogIn() in C:\Documents and Settings\Administrator\My Documents\Visual Studio 2010\Project... | Well I don't really see a question in your post, so I suppose I will point out the obvious... Your error is telling you that you have a NullReferenceException being thrown somewhere in this method: public void CheckLogIn() { if (Sel.IsElementPresent(GetAppConfig("SignOn"))) { Sel.Type(GetAppConfig("UserNameField"), Get... | C# Exception: NullReferenceException I am getting the following message whilt running my test. Message: Test method Automation.Test1.General threw exception: System.NullReferenceException: Object reference not set to an instance of an object. Automation.Library.CheckLogIn() in C:\Documents and Settings\Administrator\My... | TITLE:
C# Exception: NullReferenceException
QUESTION:
I am getting the following message whilt running my test. Message: Test method Automation.Test1.General threw exception: System.NullReferenceException: Object reference not set to an instance of an object. Automation.Library.CheckLogIn() in C:\Documents and Setting... | [
"c#",
"selenium"
] | 0 | 2 | 3,952 | 3 | 0 | 2011-06-10T16:34:32.983000 | 2011-06-10T16:38:07.870000 |
6,309,444 | 6,309,509 | Problem with PHP MYsql Delete syntax with timestamp comparison | All I am trying to do is delete rows in a column that have a timestamp more than 2 days old. I have tried a lot of things I have seen on here, but none of them seem to be working. This is the code: $delquery = $tapeDB->query('DELETE FROM newsItems WHERE news_date < TIMESTAMPADD(DAY,-2,NOW()); These are the errors I am ... | you forgot the closing quote $delquery = $tapeDB->query('DELETE FROM newsItems WHERE news_date < TIMESTAMPADD(DAY,-2,NOW()'); | Problem with PHP MYsql Delete syntax with timestamp comparison All I am trying to do is delete rows in a column that have a timestamp more than 2 days old. I have tried a lot of things I have seen on here, but none of them seem to be working. This is the code: $delquery = $tapeDB->query('DELETE FROM newsItems WHERE new... | TITLE:
Problem with PHP MYsql Delete syntax with timestamp comparison
QUESTION:
All I am trying to do is delete rows in a column that have a timestamp more than 2 days old. I have tried a lot of things I have seen on here, but none of them seem to be working. This is the code: $delquery = $tapeDB->query('DELETE FROM n... | [
"php",
"mysql"
] | 0 | 4 | 275 | 1 | 0 | 2011-06-10T16:36:22.940000 | 2011-06-10T16:41:42.033000 |
6,310,083 | 6,310,105 | C# SQL: How can I increment an integer value in a database by one on multiple records? | I am looking for the best way to update the value I store on the following structure: Table: Pages Fields: id (int) bookid (int) pageorder (int) filename (string/varchar) So I have the book order and a page number. I need to insert a page before the page number I have, lets say 25, and update all the other pages to hav... | declare @newpage int set @newpage = 25 update pages set pageorder = pageorder +1 where pageorder >= @newpage and bookid = @bookid something like that? | C# SQL: How can I increment an integer value in a database by one on multiple records? I am looking for the best way to update the value I store on the following structure: Table: Pages Fields: id (int) bookid (int) pageorder (int) filename (string/varchar) So I have the book order and a page number. I need to insert a... | TITLE:
C# SQL: How can I increment an integer value in a database by one on multiple records?
QUESTION:
I am looking for the best way to update the value I store on the following structure: Table: Pages Fields: id (int) bookid (int) pageorder (int) filename (string/varchar) So I have the book order and a page number. ... | [
"c#",
"sql"
] | 1 | 7 | 2,372 | 2 | 0 | 2011-06-10T17:38:45.773000 | 2011-06-10T17:40:29.413000 |
6,310,095 | 6,310,130 | Adding preference screen to Widget in Android | I want to know how to add preference to widget. What are the changes required in manifest file? Anyone can help? | Koder, You want to create an App Widget Configuration Activity. See the following link: http://developer.android.com/guide/topics/appwidgets/index.html#Configuring | Adding preference screen to Widget in Android I want to know how to add preference to widget. What are the changes required in manifest file? Anyone can help? | TITLE:
Adding preference screen to Widget in Android
QUESTION:
I want to know how to add preference to widget. What are the changes required in manifest file? Anyone can help?
ANSWER:
Koder, You want to create an App Widget Configuration Activity. See the following link: http://developer.android.com/guide/topics/appw... | [
"android",
"android-widget",
"android-preferences"
] | 0 | 1 | 1,081 | 1 | 0 | 2011-06-10T17:39:48.653000 | 2011-06-10T17:43:12.953000 |
6,310,098 | 6,310,117 | HTML div element | I have a div element that is defined on the top of the page and I have this another div element that is defined at the bottom of the page.... is there any way that I can define the first div element (at the top) as a child of the div element that is at the bottom. The problem is I need a div in header in the header fil... | Yes: make the top div a child of the bottom div by placing the child within the markup of the parent, and use absolute positioning to move the child to the top. | HTML div element I have a div element that is defined on the top of the page and I have this another div element that is defined at the bottom of the page.... is there any way that I can define the first div element (at the top) as a child of the div element that is at the bottom. The problem is I need a div in header ... | TITLE:
HTML div element
QUESTION:
I have a div element that is defined on the top of the page and I have this another div element that is defined at the bottom of the page.... is there any way that I can define the first div element (at the top) as a child of the div element that is at the bottom. The problem is I nee... | [
"html"
] | 1 | 1 | 134 | 4 | 0 | 2011-06-10T17:39:55.440000 | 2011-06-10T17:41:39.770000 |
6,310,106 | 6,310,154 | Implementing a templated interface | I'm trying to write this more generically: public static CormantRadDock RecreateDock(RadDockSetting settings) { CormantRadDock dock = new CormantRadDock(); settings.SetSettings(dock); Logger.DebugFormat("Recreated dock {0}", dock.ID); return dock; } I have this: public static T Recreate () where T: new() { T _control =... | Is this what you're trying to do? // move the generic type parameter up here so the interface is generic // and not the method definition public interface ISetting { void SetSettings(T obj); } Then you can implement it successfully in a class: public class SomeClass: ISetting { public void SetSettings(YourSettingType o... | Implementing a templated interface I'm trying to write this more generically: public static CormantRadDock RecreateDock(RadDockSetting settings) { CormantRadDock dock = new CormantRadDock(); settings.SetSettings(dock); Logger.DebugFormat("Recreated dock {0}", dock.ID); return dock; } I have this: public static T Recrea... | TITLE:
Implementing a templated interface
QUESTION:
I'm trying to write this more generically: public static CormantRadDock RecreateDock(RadDockSetting settings) { CormantRadDock dock = new CormantRadDock(); settings.SetSettings(dock); Logger.DebugFormat("Recreated dock {0}", dock.ID); return dock; } I have this: publ... | [
"c#",
"interface",
"refactoring"
] | 0 | 2 | 199 | 3 | 0 | 2011-06-10T17:40:29.543000 | 2011-06-10T17:45:41.347000 |
6,310,124 | 6,310,225 | Using ' in Shellscript (wget) | I'm trying to get wget to work with a post-request and a special password. It contains ' and it's like this: wget --save-cookie cookie.txt --post-data "user=Abraham&password=--my'precious!" http://localhost/login.php But when I use the tick in with wget I get strange errors. Does anybody know how to get it to work? | The backtick in your request is a straightforward issue, although you may have a second one lurking in there. The word you are looking for is 'escape' - the backtick has a special meaning on the commandline and you need to escape it so that it is not interpreted as such. In the bash shell (typical linux console) the es... | Using ' in Shellscript (wget) I'm trying to get wget to work with a post-request and a special password. It contains ' and it's like this: wget --save-cookie cookie.txt --post-data "user=Abraham&password=--my'precious!" http://localhost/login.php But when I use the tick in with wget I get strange errors. Does anybody k... | TITLE:
Using ' in Shellscript (wget)
QUESTION:
I'm trying to get wget to work with a post-request and a special password. It contains ' and it's like this: wget --save-cookie cookie.txt --post-data "user=Abraham&password=--my'precious!" http://localhost/login.php But when I use the tick in with wget I get strange erro... | [
"linux",
"wget"
] | 0 | 2 | 1,004 | 1 | 0 | 2011-06-10T17:42:26.873000 | 2011-06-10T17:51:32.700000 |
6,310,129 | 6,310,389 | Basic SQL Insert statement approach | Given that I have two tables Customer (id int, username varchar) Order (customer_id int, order_date datetime) Now I want to insert into Order table based on customer information which is available in Customer table. There are a couple of ways I can approch this problem. First - I can query the customer information into... | The second approach is better. The first approach will fail if the customer is not found. No check is being done to make sure the customer id has been returned. The second approach will do nothing if the customer is not found. From an overhead approach why create variables if they are not needed. Set based sql is usual... | Basic SQL Insert statement approach Given that I have two tables Customer (id int, username varchar) Order (customer_id int, order_date datetime) Now I want to insert into Order table based on customer information which is available in Customer table. There are a couple of ways I can approch this problem. First - I can... | TITLE:
Basic SQL Insert statement approach
QUESTION:
Given that I have two tables Customer (id int, username varchar) Order (customer_id int, order_date datetime) Now I want to insert into Order table based on customer information which is available in Customer table. There are a couple of ways I can approch this prob... | [
"sql",
"sql-server"
] | 1 | 4 | 146 | 4 | 0 | 2011-06-10T17:43:07.793000 | 2011-06-10T18:09:40.990000 |
6,310,138 | 6,310,221 | Compiling but crashing android app. something to do with intent? help | It keeps crashing. I think it has something to do with the Intent. Please help. package com.SMARTlab.twitterapp; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; i... | Make sure Twitter is registered in your AndroidManifest as an Activity. | Compiling but crashing android app. something to do with intent? help It keeps crashing. I think it has something to do with the Intent. Please help. package com.SMARTlab.twitterapp; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.But... | TITLE:
Compiling but crashing android app. something to do with intent? help
QUESTION:
It keeps crashing. I think it has something to do with the Intent. Please help. package com.SMARTlab.twitterapp; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import ... | [
"java",
"android",
"twitter",
"mobile"
] | 0 | 4 | 732 | 2 | 0 | 2011-06-10T17:43:56.090000 | 2011-06-10T17:51:21.463000 |
6,310,147 | 6,310,171 | mysql error inner join | I used a query like select a.email,b.vuid from user a,inner join group b on a.uid = b.uid where a.email='xx@xx.de' and a.kid=1 and b.vid=29 limit 1 but I always get this error. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'inner jo... | Remove the, after from user a. Your query should be: select a.email,b.vuid from user a inner join group b on a.uid = b.uid where a.email='xx@xx.de' and a.kid=1 and b.vid=29 limit 1 | mysql error inner join I used a query like select a.email,b.vuid from user a,inner join group b on a.uid = b.uid where a.email='xx@xx.de' and a.kid=1 and b.vid=29 limit 1 but I always get this error. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right synta... | TITLE:
mysql error inner join
QUESTION:
I used a query like select a.email,b.vuid from user a,inner join group b on a.uid = b.uid where a.email='xx@xx.de' and a.kid=1 and b.vid=29 limit 1 but I always get this error. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version f... | [
"mysql",
"sql",
"join"
] | 0 | 4 | 116 | 2 | 0 | 2011-06-10T17:44:55.547000 | 2011-06-10T17:47:18.653000 |
6,310,156 | 6,310,334 | Hide hours and mins if they are zero in the function provided | The function below outputs hours:0 whether the time is <1 hour or mins:0 when mins<1. How can I show only the variables that are not zero? Thank you. function time_difference($endtime){
$hours =date("G",$endtime); $mins =date("i",$endtime); $secs =date("s",$endtime); $diff="'hours': ".$hours.",'mins': ".$mins.",'sec':... | Another possible approach: function time_difference($endtime){ $times=array( 'hours' => date("G",$endtime), 'mins' => date("i",$endtime), 'secs' => date("s",$endtime), );
//added a "just a moment ago" feature for you if (intval($times['hours'], 10) == 0 && intval($times['mins'], 10) == 0) { return "just a moment ago";... | Hide hours and mins if they are zero in the function provided The function below outputs hours:0 whether the time is <1 hour or mins:0 when mins<1. How can I show only the variables that are not zero? Thank you. function time_difference($endtime){
$hours =date("G",$endtime); $mins =date("i",$endtime); $secs =date("s",... | TITLE:
Hide hours and mins if they are zero in the function provided
QUESTION:
The function below outputs hours:0 whether the time is <1 hour or mins:0 when mins<1. How can I show only the variables that are not zero? Thank you. function time_difference($endtime){
$hours =date("G",$endtime); $mins =date("i",$endtime)... | [
"php",
"date",
"string",
"if-statement"
] | 2 | 3 | 1,652 | 3 | 0 | 2011-06-10T17:45:57.647000 | 2011-06-10T18:02:38.160000 |
6,310,160 | 6,310,267 | Before insert trigger | I want to disable in before insert trigger inserting into table when some condition is true create or replace trigger CHECK_FOR_MAX_ENTRANTS before insert on application declare entrants_count number; max_entrants number; begin select count(*) into entrants_count from application where id_speciality =:new.id_speciality... | Assuming you're talking about Oracle, then, in place of disable this insert you could: IF entrants_count >= max_entrants THEN raise_application_error(-21010, 'Max number of Entrants Reached'); END IF; See: http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/errors.htm#sthref2006 EDIT: It's generally a bad id... | Before insert trigger I want to disable in before insert trigger inserting into table when some condition is true create or replace trigger CHECK_FOR_MAX_ENTRANTS before insert on application declare entrants_count number; max_entrants number; begin select count(*) into entrants_count from application where id_speciali... | TITLE:
Before insert trigger
QUESTION:
I want to disable in before insert trigger inserting into table when some condition is true create or replace trigger CHECK_FOR_MAX_ENTRANTS before insert on application declare entrants_count number; max_entrants number; begin select count(*) into entrants_count from application... | [
"oracle",
"plsql",
"triggers"
] | 0 | 3 | 4,863 | 2 | 0 | 2011-06-10T17:46:19.847000 | 2011-06-10T17:55:22.947000 |
6,310,164 | 6,310,360 | Relative url mapping for images in django imagefield | I am using imagefield to render images. These are the urls; (r'^site_media/(?P.*)$', 'django.views.static.serve', {'document_root': site_media}), (r'^$', 'webapp.blog.views.index'), url( r'^blog/view/(?P [^\.]+).html', 'webapp.blog.views.view_post', name='view_blog_post'), These are the views: def index(request): retur... | This is not a function of your urlconf, but how you are displaying the images in your template. You are probably doing something like this: when you should be doing... note the initial slash. Alternatively, if you're using STATIC_URL or MEDIA_URL, make sure they're defined with the initial slash in your settings.py. | Relative url mapping for images in django imagefield I am using imagefield to render images. These are the urls; (r'^site_media/(?P.*)$', 'django.views.static.serve', {'document_root': site_media}), (r'^$', 'webapp.blog.views.index'), url( r'^blog/view/(?P [^\.]+).html', 'webapp.blog.views.view_post', name='view_blog_p... | TITLE:
Relative url mapping for images in django imagefield
QUESTION:
I am using imagefield to render images. These are the urls; (r'^site_media/(?P.*)$', 'django.views.static.serve', {'document_root': site_media}), (r'^$', 'webapp.blog.views.index'), url( r'^blog/view/(?P [^\.]+).html', 'webapp.blog.views.view_post',... | [
"django",
"django-templates",
"django-urls",
"django-models"
] | 1 | 3 | 2,172 | 1 | 0 | 2011-06-10T17:47:02.160000 | 2011-06-10T18:06:13.520000 |
6,310,191 | 6,310,239 | How to Query Mysql based on GPS latitude and longitude columns based on relative distance | In an app I'm building, One of the features i'd like users to be able to discover people around them easily. I'm using the GPS to get the latitude and longitude, then storing that information in the mysql db along with the other user information under a column for latitude and another with the longitude. What's would t... | Just search for "Haversine Formula" here on Stackoverflow and you will find several related questions. | How to Query Mysql based on GPS latitude and longitude columns based on relative distance In an app I'm building, One of the features i'd like users to be able to discover people around them easily. I'm using the GPS to get the latitude and longitude, then storing that information in the mysql db along with the other u... | TITLE:
How to Query Mysql based on GPS latitude and longitude columns based on relative distance
QUESTION:
In an app I'm building, One of the features i'd like users to be able to discover people around them easily. I'm using the GPS to get the latitude and longitude, then storing that information in the mysql db alon... | [
"php",
"mysql",
"database",
"gps",
"latitude-longitude"
] | 2 | 2 | 3,296 | 2 | 0 | 2011-06-10T17:48:42.023000 | 2011-06-10T17:52:46.183000 |
6,310,200 | 6,310,219 | Difference between class initializers in C#? | Possible Duplicate: Why are C# 3.0 object initializer constructor parentheses optional? What is the difference between instatiating an object by using classInstance = new Class() { prop1 = "", prop2 = "" }; and classInstance = new Class { prop1 = "", prop2 = "" }; | Nothing. The second is just a short-cut for the first. The first allows you to include arguments to a constructor. So, you can't use the short-cut if the class doesn't have an empty constructor. You may have an interest in this question: Why are C# 3.0 object initializer constructor parentheses optional? And Eric Lippe... | Difference between class initializers in C#? Possible Duplicate: Why are C# 3.0 object initializer constructor parentheses optional? What is the difference between instatiating an object by using classInstance = new Class() { prop1 = "", prop2 = "" }; and classInstance = new Class { prop1 = "", prop2 = "" }; | TITLE:
Difference between class initializers in C#?
QUESTION:
Possible Duplicate: Why are C# 3.0 object initializer constructor parentheses optional? What is the difference between instatiating an object by using classInstance = new Class() { prop1 = "", prop2 = "" }; and classInstance = new Class { prop1 = "", prop2 ... | [
"c#",
".net",
"class",
"object",
"instantiation"
] | 7 | 4 | 479 | 3 | 0 | 2011-06-10T17:50:00.987000 | 2011-06-10T17:51:16.480000 |
6,310,203 | 6,310,270 | How do I make a control that simulates UpdatePanel but with Jquery AJAX? | The question is how do I create a control that simulates an updatepanel? You're asking me why to hell do I want to that???? It's just pure desire for knowledge:)... How do I want it to work exactly like UpdatePanel but with totaly my control. like that: //my html with server controls and other stuff... some scripts and... | That's not something you'd ever really want to do, for learning or otherwise. UpdatePanel was a very cheap solution, good for very (very) simple scenarios. If you're wanting to hand-roll some Ajax, then you should take a look at jQuery's Ajax, and com-manipulation APIs. You would essentially use jQuery (or Prototype, D... | How do I make a control that simulates UpdatePanel but with Jquery AJAX? The question is how do I create a control that simulates an updatepanel? You're asking me why to hell do I want to that???? It's just pure desire for knowledge:)... How do I want it to work exactly like UpdatePanel but with totaly my control. like... | TITLE:
How do I make a control that simulates UpdatePanel but with Jquery AJAX?
QUESTION:
The question is how do I create a control that simulates an updatepanel? You're asking me why to hell do I want to that???? It's just pure desire for knowledge:)... How do I want it to work exactly like UpdatePanel but with total... | [
"jquery",
"c#-4.0",
"updatepanel",
"custom-controls"
] | 0 | 1 | 168 | 2 | 0 | 2011-06-10T17:50:10.167000 | 2011-06-10T17:55:32.480000 |
6,310,206 | 6,310,254 | Iterate a script X times | I have several functions that may or may not need to be repeated a certain number of times. The number of times is set by the user, and is stored in a variable: xTcount. if (xTcount > 0) { for (i=0; xTcount <= i; i++) { $(document).miscfunction(); }
} I haven't actually tested the script above, as i'm sure it's incorr... | Repeat some things xTcount times? Maybe I'm misunderstanding, but it looks pretty simple: for(var i = 0; i < xTcount; i++) { doSomething(); doSomethingElse(); } If the trouble is that you don't like the look of the for loop, or that your script requires you to build the same loop multiple times, you could extract it if... | Iterate a script X times I have several functions that may or may not need to be repeated a certain number of times. The number of times is set by the user, and is stored in a variable: xTcount. if (xTcount > 0) { for (i=0; xTcount <= i; i++) { $(document).miscfunction(); }
} I haven't actually tested the script above... | TITLE:
Iterate a script X times
QUESTION:
I have several functions that may or may not need to be repeated a certain number of times. The number of times is set by the user, and is stored in a variable: xTcount. if (xTcount > 0) { for (i=0; xTcount <= i; i++) { $(document).miscfunction(); }
} I haven't actually teste... | [
"jquery",
"function",
"loops"
] | 4 | 18 | 24,135 | 1 | 0 | 2011-06-10T17:50:16.117000 | 2011-06-10T17:54:01.507000 |
6,310,207 | 6,310,235 | How to separate css style from common to different statement | I have two elements, I want to apply same background style, but different font style to them, how to write the style statement in the header part without having to write duplicate statement? | It doesn't get simpler than: #element1, #element2 { background: red } #element1 { font: 20px sans-serif } #element2 { font: 24px serif } You should read up on selector grouping. | How to separate css style from common to different statement I have two elements, I want to apply same background style, but different font style to them, how to write the style statement in the header part without having to write duplicate statement? | TITLE:
How to separate css style from common to different statement
QUESTION:
I have two elements, I want to apply same background style, but different font style to them, how to write the style statement in the header part without having to write duplicate statement?
ANSWER:
It doesn't get simpler than: #element1, #... | [
"css"
] | 0 | 3 | 109 | 3 | 0 | 2011-06-10T17:50:21.957000 | 2011-06-10T17:52:28.130000 |
6,310,208 | 6,310,229 | Overriding remote git repository with my repository | The remote repository contains a bad version. I have the copy of a good version locally. I want to replace everything that's on the remote repository with my current repository (the remote repository has a few more commits (including a merge) that should not have happened). If I try to push, it tells me I need to pull ... | Use the --force, Luke. http://www.kernel.org/pub/software/scm/git/docs/git-push.html | Overriding remote git repository with my repository The remote repository contains a bad version. I have the copy of a good version locally. I want to replace everything that's on the remote repository with my current repository (the remote repository has a few more commits (including a merge) that should not have happ... | TITLE:
Overriding remote git repository with my repository
QUESTION:
The remote repository contains a bad version. I have the copy of a good version locally. I want to replace everything that's on the remote repository with my current repository (the remote repository has a few more commits (including a merge) that sh... | [
"git"
] | 24 | 72 | 22,454 | 2 | 0 | 2011-06-10T17:50:24.027000 | 2011-06-10T17:51:57.657000 |
6,310,214 | 6,310,243 | Javascript: Iterate through objects | I'm iterating through this object: var object = { first: { child1: 'test1', child2: 'test2' },
second: { child1: 'test3', child2: 'test4' },
first: { child1: 'test5', child2: 'test6!' } }; with this: for(var attribute in object){ alert(attribute + ": " + object[attribute]); } First it seemed that it works, but it ite... | JavaScript objects are associative maps, and cannot have multiple values with the same key (name). Your data cannot have that structure. Another option might be an array of key-value pairs. var object = [ ["first", { child1: 'test1', child2: 'test2' }], ["second", { child1: 'test3', child2: 'test4' }], ["first", { chil... | Javascript: Iterate through objects I'm iterating through this object: var object = { first: { child1: 'test1', child2: 'test2' },
second: { child1: 'test3', child2: 'test4' },
first: { child1: 'test5', child2: 'test6!' } }; with this: for(var attribute in object){ alert(attribute + ": " + object[attribute]); } First... | TITLE:
Javascript: Iterate through objects
QUESTION:
I'm iterating through this object: var object = { first: { child1: 'test1', child2: 'test2' },
second: { child1: 'test3', child2: 'test4' },
first: { child1: 'test5', child2: 'test6!' } }; with this: for(var attribute in object){ alert(attribute + ": " + object[at... | [
"javascript",
"object",
"loops"
] | 0 | 4 | 236 | 2 | 0 | 2011-06-10T17:51:06.927000 | 2011-06-10T17:52:54.773000 |
6,310,215 | 6,310,371 | ASP.NET: How to fix FAST blinking cursor in edit control? | I set focus to an edit control and don't do anything else. When I run the web app, this cursor is at the edit control but blinks much faster than normal. It is more like jittering or flickering than blinking. What might be the cause of this behavior and how do I prevent it? I want a blinking cursor, or a non-blinking c... | The cursor blink rate isn't something you can control by Javascript. It's an accessibility setting set by either the Operating System or the Browser itself. Likely, what you're seeing is something that is either reflective of that setting, or as Brandon Boone suggests, a side effect of other Javascript happening on the... | ASP.NET: How to fix FAST blinking cursor in edit control? I set focus to an edit control and don't do anything else. When I run the web app, this cursor is at the edit control but blinks much faster than normal. It is more like jittering or flickering than blinking. What might be the cause of this behavior and how do I... | TITLE:
ASP.NET: How to fix FAST blinking cursor in edit control?
QUESTION:
I set focus to an edit control and don't do anything else. When I run the web app, this cursor is at the edit control but blinks much faster than normal. It is more like jittering or flickering than blinking. What might be the cause of this beh... | [
"asp.net",
"web-applications"
] | 0 | 1 | 789 | 1 | 0 | 2011-06-10T17:51:10.713000 | 2011-06-10T18:07:15.873000 |
6,310,217 | 6,310,401 | UIWIndow Not Declared iOS 4.3 AppDelegate | I just downloaded the newest iOS SDK (4.3) and noticed that when I start a Window Based Application, the UIWindow is not declared in the header file, it is only mentioned as a property. #import @interface GleekAppDelegate: NSObject { IBOutlet UILabel *label; }
@property (nonatomic, retain) IBOutlet UIWindow *window;
... | The new Objective-C runtime has the ability to synthesize ivars without explicitly declaring them. From Runtime Difference in The Objective-C Programming Language: In general the behavior of properties is identical on both modern and legacy runtimes (see “Runtime Versions and Platforms” in Objective-C Runtime Programmi... | UIWIndow Not Declared iOS 4.3 AppDelegate I just downloaded the newest iOS SDK (4.3) and noticed that when I start a Window Based Application, the UIWindow is not declared in the header file, it is only mentioned as a property. #import @interface GleekAppDelegate: NSObject { IBOutlet UILabel *label; }
@property (nonat... | TITLE:
UIWIndow Not Declared iOS 4.3 AppDelegate
QUESTION:
I just downloaded the newest iOS SDK (4.3) and noticed that when I start a Window Based Application, the UIWindow is not declared in the header file, it is only mentioned as a property. #import @interface GleekAppDelegate: NSObject { IBOutlet UILabel *label; }... | [
"iphone",
"ios",
"xcode",
"ipad"
] | 3 | 3 | 511 | 1 | 0 | 2011-06-10T17:51:14.527000 | 2011-06-10T18:10:47.033000 |
6,310,226 | 6,310,297 | Business Case for abandoning IE7 as the *developer's* browser? | I'm a software developer. The only browser I have at work is IE7. I don't have freedom to select my browser. I am constantly learning and researching things online and, of course, IE7 is a very poor tool for doing that work. I've been invited to present a business case for replacing the dev team's IE7 browsers w/ a som... | Words that important people like to hear: Security (use open security vulnerability charts and such) Standards (talk very briefly about web standards, but then hammer in the point that IE does not follow them throughout the presentation) Productivity (here's where you get to talk about speed, additional features etc) A... | Business Case for abandoning IE7 as the *developer's* browser? I'm a software developer. The only browser I have at work is IE7. I don't have freedom to select my browser. I am constantly learning and researching things online and, of course, IE7 is a very poor tool for doing that work. I've been invited to present a b... | TITLE:
Business Case for abandoning IE7 as the *developer's* browser?
QUESTION:
I'm a software developer. The only browser I have at work is IE7. I don't have freedom to select my browser. I am constantly learning and researching things online and, of course, IE7 is a very poor tool for doing that work. I've been invi... | [
"internet-explorer-7"
] | 0 | 2 | 219 | 2 | 0 | 2011-06-10T17:51:48.840000 | 2011-06-10T17:58:22.210000 |
6,310,241 | 6,310,278 | Pros and Cons of implementing a generic custom exception | What are the pros and cons of implementing a custom exception as follows: Create an enum which represents error messages in its descriptions: public class Enums { public enum Errors { [Description("This is a test exception")] TestError,... } } Create a custom exception class: public class CustomException: ApplicationEx... | Personally, i don't think it's a good idea. You should always throw as specific exceptions as possible. The same goes for catching. It's easy to decide if we want to catch a WebServiceException or AuthenticationException, but with your Enum-example, we have to parse a string to decide if we want to catch it or not. Wha... | Pros and Cons of implementing a generic custom exception What are the pros and cons of implementing a custom exception as follows: Create an enum which represents error messages in its descriptions: public class Enums { public enum Errors { [Description("This is a test exception")] TestError,... } } Create a custom exc... | TITLE:
Pros and Cons of implementing a generic custom exception
QUESTION:
What are the pros and cons of implementing a custom exception as follows: Create an enum which represents error messages in its descriptions: public class Enums { public enum Errors { [Description("This is a test exception")] TestError,... } } C... | [
"c#",
".net",
"exception",
"custom-exceptions"
] | 2 | 5 | 2,192 | 6 | 0 | 2011-06-10T17:52:48.753000 | 2011-06-10T17:56:15.690000 |
6,310,274 | 6,310,309 | Smooth transition from launch image to main view | Is it possible to implement a smooth transition when the app loads, from the launch image to the first view? The default behavior is on/off, with an immediate change: the launch image appears, then it instantaneously disappears to let the main view controller take place. I'd like to implement some fading or zooming in ... | There's no framework support, but you can get that result if you do it yourself, manually. Depending on what your launch image is, and what your UI looks like, you can do it in different ways, but basically: make your first view controller load and display your default.png image in an image view when it loads up. Then ... | Smooth transition from launch image to main view Is it possible to implement a smooth transition when the app loads, from the launch image to the first view? The default behavior is on/off, with an immediate change: the launch image appears, then it instantaneously disappears to let the main view controller take place.... | TITLE:
Smooth transition from launch image to main view
QUESTION:
Is it possible to implement a smooth transition when the app loads, from the launch image to the first view? The default behavior is on/off, with an immediate change: the launch image appears, then it instantaneously disappears to let the main view cont... | [
"iphone",
"transition",
"launch"
] | 8 | 15 | 10,724 | 4 | 0 | 2011-06-10T17:56:02.060000 | 2011-06-10T17:59:51.540000 |
6,310,289 | 6,310,324 | Ajax.ActionLink triggering from Javascript? | I am successfully using @Ajax.ActionLink to refresh data on a portion of my page, but I would like to do the same from Javascript. How can I simulate the effects of clicking that ActionLink in js? Thanks! @Ajax.ActionLink("ClickMe", "List", "Organizations", New AjaxOptions With {.UpdateTargetId = "dashboardDetails"}) | You need to look at using the $.get() and.$post() jQuery functions. So basically, you can perform a call to a controller action, from Javascript, using either of these functions (depending on whether your getting or posting data). An example can be found here. | Ajax.ActionLink triggering from Javascript? I am successfully using @Ajax.ActionLink to refresh data on a portion of my page, but I would like to do the same from Javascript. How can I simulate the effects of clicking that ActionLink in js? Thanks! @Ajax.ActionLink("ClickMe", "List", "Organizations", New AjaxOptions Wi... | TITLE:
Ajax.ActionLink triggering from Javascript?
QUESTION:
I am successfully using @Ajax.ActionLink to refresh data on a portion of my page, but I would like to do the same from Javascript. How can I simulate the effects of clicking that ActionLink in js? Thanks! @Ajax.ActionLink("ClickMe", "List", "Organizations", ... | [
"javascript",
"jquery",
"ajax",
"razor"
] | 1 | 2 | 5,935 | 3 | 0 | 2011-06-10T17:57:18.913000 | 2011-06-10T18:01:45.843000 |
6,310,292 | 6,310,331 | Most efficient way to retrieve/update an object from a collection? | I'm working with a silverlight datagrid that is bound to an observable collection of a business object. We do not support inline editing of the objects within the grid but we do display a corresponding editing panel for the user selected row. When the user submits the edits from this panel, I'm persisting the changes i... | can you bind your edit grid to the selected item of the display grid? Since they are references this will push/pull changes into the observable collection which can then be persisted. | Most efficient way to retrieve/update an object from a collection? I'm working with a silverlight datagrid that is bound to an observable collection of a business object. We do not support inline editing of the objects within the grid but we do display a corresponding editing panel for the user selected row. When the u... | TITLE:
Most efficient way to retrieve/update an object from a collection?
QUESTION:
I'm working with a silverlight datagrid that is bound to an observable collection of a business object. We do not support inline editing of the objects within the grid but we do display a corresponding editing panel for the user select... | [
"c#",
".net",
"collections",
"iterator"
] | 1 | 2 | 305 | 2 | 0 | 2011-06-10T17:57:57.483000 | 2011-06-10T18:02:21.323000 |
6,310,308 | 6,310,326 | input radio button hover issues in IE 9 | I'm having a problem in IE9: Whenever i hover over my top level wrapper div the first radio button acts like it's being hovered over. So even if i have the last radio input pressed, if i click anywhere within the wrapper, the radio will go back to the first one. As soon as i hover my mouse off the wrapper div the light... | What you are describing is the behavior of the label tag. Label tags act like a hover and click target for the input with the id specified in the label's for attribute. Either you have inadvertently applied a large label to one specific radio button, or maybe one of them is incorrectly closed, causing it to wrap the wh... | input radio button hover issues in IE 9 I'm having a problem in IE9: Whenever i hover over my top level wrapper div the first radio button acts like it's being hovered over. So even if i have the last radio input pressed, if i click anywhere within the wrapper, the radio will go back to the first one. As soon as i hove... | TITLE:
input radio button hover issues in IE 9
QUESTION:
I'm having a problem in IE9: Whenever i hover over my top level wrapper div the first radio button acts like it's being hovered over. So even if i have the last radio input pressed, if i click anywhere within the wrapper, the radio will go back to the first one.... | [
"javascript",
"html",
"css"
] | 1 | 2 | 1,894 | 1 | 0 | 2011-06-10T17:59:35.160000 | 2011-06-10T18:01:56.053000 |
6,310,328 | 6,310,413 | Real world array covariance problem | I'm trying to create an array of the class DataTableColumn, but unfortunately I'm going crazy with that. By now that's what I tried to do without any success public interface IDataTableColumn { string Expression { get; } DataTableFilterType FilterType { get; }
TValue Cast(string value); }
public class DataTableColumn... | I believe it is because int and DateTime are value types which are not covariant with object (they require boxing). I receive the following error when I compile your code: covar.cs(23,13): error CS0266: Cannot implicitly convert type 'DataTableColumn ' to 'IDataTableColumn '. An explicit conversion exists (are you miss... | Real world array covariance problem I'm trying to create an array of the class DataTableColumn, but unfortunately I'm going crazy with that. By now that's what I tried to do without any success public interface IDataTableColumn { string Expression { get; } DataTableFilterType FilterType { get; }
TValue Cast(string val... | TITLE:
Real world array covariance problem
QUESTION:
I'm trying to create an array of the class DataTableColumn, but unfortunately I'm going crazy with that. By now that's what I tried to do without any success public interface IDataTableColumn { string Expression { get; } DataTableFilterType FilterType { get; }
TVal... | [
"c#",
"c#-4.0",
"covariance",
"contravariance"
] | 2 | 4 | 368 | 1 | 0 | 2011-06-10T18:01:58.997000 | 2011-06-10T18:11:53.923000 |
6,310,329 | 6,310,363 | How can I div two columns that are summed in a select statement? | This statement below gets me some data I need. select TankName, COUNT(*) as Tanks, sum(Battles) as Battles, SUM(victories) as Victories from MemberTanks where Tier = 9 and Class = 'Medium' group by TankName order by Tanks desc I would like to show the percentage of the Victories in the resultset but I'm not sure how to... | When you are calculating the percentage column since SUM(X) is returning a INT value, the result is getting floored and hence returning 0 as floored result Multiply the SUM(victories) with a decimal value like 1.0 (so as to convert one operand to decimal/numeric) and then you would get correct result. Try this: SELECT ... | How can I div two columns that are summed in a select statement? This statement below gets me some data I need. select TankName, COUNT(*) as Tanks, sum(Battles) as Battles, SUM(victories) as Victories from MemberTanks where Tier = 9 and Class = 'Medium' group by TankName order by Tanks desc I would like to show the per... | TITLE:
How can I div two columns that are summed in a select statement?
QUESTION:
This statement below gets me some data I need. select TankName, COUNT(*) as Tanks, sum(Battles) as Battles, SUM(victories) as Victories from MemberTanks where Tier = 9 and Class = 'Medium' group by TankName order by Tanks desc I would li... | [
"sql"
] | 0 | 4 | 289 | 2 | 0 | 2011-06-10T18:02:02.947000 | 2011-06-10T18:06:25.237000 |
6,310,338 | 6,310,439 | regex for mysql query? | say, I have a varchar(18) field(name:firmware) in a mysql database table. The string format is like: ABC100-DE-3.10-0347, or it might looks like ABC100-DE-3.1-347. Basically, the only thing I can rely on is the "-" delimiter, the last part( 0347,347 ) is called build number. The 3.1/3.10 part is called version number. ... | Give this a shot: select SUBSTRING_INDEX(theField,'-',-1) as buildNumber, SUBSTRING_INDEX(SUBSTRING_INDEX(theField,'-',-2),'-',1) as versionNumber from theTable | regex for mysql query? say, I have a varchar(18) field(name:firmware) in a mysql database table. The string format is like: ABC100-DE-3.10-0347, or it might looks like ABC100-DE-3.1-347. Basically, the only thing I can rely on is the "-" delimiter, the last part( 0347,347 ) is called build number. The 3.1/3.10 part is ... | TITLE:
regex for mysql query?
QUESTION:
say, I have a varchar(18) field(name:firmware) in a mysql database table. The string format is like: ABC100-DE-3.10-0347, or it might looks like ABC100-DE-3.1-347. Basically, the only thing I can rely on is the "-" delimiter, the last part( 0347,347 ) is called build number. The... | [
"mysql",
"regex",
"string"
] | 0 | 2 | 472 | 3 | 0 | 2011-06-10T18:02:53.597000 | 2011-06-10T18:14:18.623000 |
6,310,343 | 6,310,428 | Why is before_save not getting called for my ActiveRecord model? | Nothing prints out to the console when I use IRB to create a new model instance and save, and I get a "ActiveRecord::StatementInvalid: Mysql::Error: Column 'user_id' cannot be null" error, so I assume before_save is not getting called. I can't figure out why. I've even tried using the before_save filter. Here's my code... | As you can see in the documentation, before_save happens after validation. In your case, validation will fail and before_save will never be invoked. Since the goal of your callback is to set your object to a valid state before validation happens, try the before_validation callback. | Why is before_save not getting called for my ActiveRecord model? Nothing prints out to the console when I use IRB to create a new model instance and save, and I get a "ActiveRecord::StatementInvalid: Mysql::Error: Column 'user_id' cannot be null" error, so I assume before_save is not getting called. I can't figure out ... | TITLE:
Why is before_save not getting called for my ActiveRecord model?
QUESTION:
Nothing prints out to the console when I use IRB to create a new model instance and save, and I get a "ActiveRecord::StatementInvalid: Mysql::Error: Column 'user_id' cannot be null" error, so I assume before_save is not getting called. I... | [
"ruby-on-rails",
"validation",
"activerecord",
"callback"
] | 11 | 42 | 11,028 | 1 | 0 | 2011-06-10T18:03:17.357000 | 2011-06-10T18:13:33.087000 |
6,310,344 | 6,310,356 | HttpContext.Current.Server.MapPath alternative in windows application | what is alternative of "HttpContext.Current.Server.MapPath" in Windows application, which is used in web application. What should I use in windows application to access a file. [EDIT] What is alternate of this in window application? reader = XmlReader.Create( @"D:\EnviroTrack\EnviroTracker.Web\TestDevice\Data.xml", set... | You can use the normal Path methods. MapPath helps convert the virtual path to the physical path on the web server. There's no need for this conversion in winforms. You may be looking for Assembly.GetExecutingAssembly().Location which returns the location of the assembly being executed. Edit - Your updated question sho... | HttpContext.Current.Server.MapPath alternative in windows application what is alternative of "HttpContext.Current.Server.MapPath" in Windows application, which is used in web application. What should I use in windows application to access a file. [EDIT] What is alternate of this in window application? reader = XmlReade... | TITLE:
HttpContext.Current.Server.MapPath alternative in windows application
QUESTION:
what is alternative of "HttpContext.Current.Server.MapPath" in Windows application, which is used in web application. What should I use in windows application to access a file. [EDIT] What is alternate of this in window application?... | [
"asp.net",
"c#-4.0"
] | 2 | 3 | 9,504 | 2 | 0 | 2011-06-10T18:03:18.257000 | 2011-06-10T18:05:45.513000 |
6,310,357 | 6,310,395 | Store multiple sizes of an image or just store the main and resize? | I'm working on a CMS and I'm trying to figure out the common practice for doing a REST style image request. I have three sizes, small, medium, and full. My thought is to store only the full and write a function that will resize on each page request. This has obvious cpu costs. The other end is that I could store all th... | Another option is to maintain a cache of resized images. Serve up the ones that are available. Create new ones if they are not available. Delete images that have not been requested for a while. This will be a compromise between the CPU and storage issues. | Store multiple sizes of an image or just store the main and resize? I'm working on a CMS and I'm trying to figure out the common practice for doing a REST style image request. I have three sizes, small, medium, and full. My thought is to store only the full and write a function that will resize on each page request. Th... | TITLE:
Store multiple sizes of an image or just store the main and resize?
QUESTION:
I'm working on a CMS and I'm trying to figure out the common practice for doing a REST style image request. I have three sizes, small, medium, and full. My thought is to store only the full and write a function that will resize on eac... | [
"c#",
"asp.net-mvc-3",
"content-management-system",
"storage"
] | 3 | 3 | 242 | 6 | 0 | 2011-06-10T18:05:46.073000 | 2011-06-10T18:10:18.010000 |
6,310,394 | 6,310,422 | Css for Blackberry only? | I doubt this exists, but is there a way to make a css file only be read if it is a blackberry phone (lower then V6 is preferred, but if not that's ok) I am using JQuery mobile so the css is perfect for everything else, I just wanna edit Blackberry | You could check the browser name, in javascript, and make your css file as required. Conditional CSS for Backberry. function getcss(cssfile){ loadcss = document.createElement('link') loadcss.setAttribute("rel", "stylesheet") loadcss.setAttribute("type", "text/css") loadcss.setAttribute("href", cssfile) document.getElem... | Css for Blackberry only? I doubt this exists, but is there a way to make a css file only be read if it is a blackberry phone (lower then V6 is preferred, but if not that's ok) I am using JQuery mobile so the css is perfect for everything else, I just wanna edit Blackberry | TITLE:
Css for Blackberry only?
QUESTION:
I doubt this exists, but is there a way to make a css file only be read if it is a blackberry phone (lower then V6 is preferred, but if not that's ok) I am using JQuery mobile so the css is perfect for everything else, I just wanna edit Blackberry
ANSWER:
You could check the ... | [
"css",
"blackberry"
] | 0 | 3 | 1,338 | 1 | 0 | 2011-06-10T18:09:59.697000 | 2011-06-10T18:13:02.273000 |
6,310,411 | 6,310,429 | using 'global' in php | I'm in learning mode here, very new to PHP, so I'm working with a code sample. Please forgive my use of 'global' here, but I want to understand php variable scoping. Here is myGlobals.php: Here is connectToDb.php: Here is addDbRecords.php: Here is index.php: Here is the problem. When I call doAddDeleteRecord($db_server... | So, you have: and you include this where needed: require_once 'myGlobals.php'; // other inline code..... doAddDeleteRecord($db_server); The problem is that if you already included 'myGlobals.php' elsewhere, it won't be included here. So you can't guarantee that the global will be brought into scope. Instead, write: req... | using 'global' in php I'm in learning mode here, very new to PHP, so I'm working with a code sample. Please forgive my use of 'global' here, but I want to understand php variable scoping. Here is myGlobals.php: Here is connectToDb.php: Here is addDbRecords.php: Here is index.php: Here is the problem. When I call doAddD... | TITLE:
using 'global' in php
QUESTION:
I'm in learning mode here, very new to PHP, so I'm working with a code sample. Please forgive my use of 'global' here, but I want to understand php variable scoping. Here is myGlobals.php: Here is connectToDb.php: Here is addDbRecords.php: Here is index.php: Here is the problem. ... | [
"php",
"global",
"scoping"
] | 4 | 5 | 491 | 2 | 0 | 2011-06-10T18:11:33.313000 | 2011-06-10T18:13:36.970000 |
6,310,415 | 6,310,436 | Java: Store variables in file | I know how to write text to a file and store it in Java, but I was wondering if there is a way of storing lots of variables that can be retrieved from the file at a later date, and put back into the Java application as variables. I would be storing numbers and strings, but groups of them. Thanks:) | Java can read properties files like it reads a map. This gives you an easy way of storing information using a key/value system. Check out http://download.oracle.com/javase/6/docs/api/java/util/Properties.html | Java: Store variables in file I know how to write text to a file and store it in Java, but I was wondering if there is a way of storing lots of variables that can be retrieved from the file at a later date, and put back into the Java application as variables. I would be storing numbers and strings, but groups of them. ... | TITLE:
Java: Store variables in file
QUESTION:
I know how to write text to a file and store it in Java, but I was wondering if there is a way of storing lots of variables that can be retrieved from the file at a later date, and put back into the Java application as variables. I would be storing numbers and strings, bu... | [
"java",
"file"
] | 9 | 14 | 17,700 | 3 | 0 | 2011-06-10T18:12:19.570000 | 2011-06-10T18:14:08.637000 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.