text
stringlengths
8
267k
meta
dict
Q: Rails 3.1, passing parameters for colection_select from controller I have this collection_select usage in my view: <%= collection_select(:production_year, :id, @car_models, :id, :name, { :prompt => "Year" }, { :disabled => "disabled" } ) %> But it seems, that i'll add much logic for this select box. So i want pass ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7547756", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Using sample() with sample space size = 1 I have a list of dates that I wish to sample from. Sometimes the sample space will just be a single date e.g. sample("10/11/11",1). The dates are stored as chron objects, so when I have just a single date in my sample space (and only then) sample treats this as a vector (1...
{ "language": "en", "url": "https://stackoverflow.com/questions/7547758", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: Question about Timeline, does the user have to be connected? The reason I'm asking is because, right now we already have it setup to prompt users to share things if they're connected. But the biggest problem we have is that without the user being connected, it tries to make a popup window — which is blocked in most ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7547759", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Java Date object problem I'm doing a java program that will take an action based on the date and time. the problem is that when I used the java.util.Date object i found that it is affected by the windows wall clock, i don't know what to do, I'm needing to the date to be never affected by anything, or if any one know...
{ "language": "en", "url": "https://stackoverflow.com/questions/7547776", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "-2" }
Q: Is this the proper way to open a file for input? Is this the proper way to open a file for input? void BinaryTree::read(char * path, int line_number) { ifstream * file(path); //error: cannot convert ‘char*’ to ‘std::ifstream*’ in initialization file->seekg(0, std::ios::beg); int length = file.tellg(); ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7547786", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How to access a JMX Mbean from a tomcat website? I have a web service that exposes an mbean. I am able to view that mbean using jconsole. Now I need that function exposed on a new tomcat website. A: Take a look at http://www.jolokia.org/ and http://directwebremoting.org/dwr/index.html
{ "language": "en", "url": "https://stackoverflow.com/questions/7547788", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: jQuery UI: Slider inside of a Tab? I want my tab content area to have a vertical scrollbar to the right using the jQuery UI Slider API. The tab content area will have a fixed height, and the vertical overflow needs to cause a jQuery UI Slider to appear to scroll through the content. The specific issue I'm having tro...
{ "language": "en", "url": "https://stackoverflow.com/questions/7547789", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: MSDN HMAC-SHA1 example not working Creating an HMAC steps by using CryptoAPI found here: http://msdn.microsoft.com/en-us/library/Aa379863 * *To compute an HMAC * *Get a pointer to the Microsoft Cryptographic Service Provider (CSP) by calling CryptAcquireContext. *Create a handle to an HMAChash object by calli...
{ "language": "en", "url": "https://stackoverflow.com/questions/7547791", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: What is the difference between branch-0.2 and origin/branch-0.2 in Git? I cloned a Git repository and when I do a 'git checkout' I see branch-0.2 and origin/branch-0.2 in the list of the branches. What is the difference between the two branches? I read a couple of articles, but I'm not clear on what the difference i...
{ "language": "en", "url": "https://stackoverflow.com/questions/7547792", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How to wait for threads with low latency in go? I've been trying to create a simple event loop wrapper in Go. But I got stumped, how was I supposed to keep track of operations in the current thread? I wanted CurrentTick to run a function, and even if the calling function quits, not start the next tick until all func...
{ "language": "en", "url": "https://stackoverflow.com/questions/7547796", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How to add footer view dynamically I have created a ListView and added header with addHeaderView, then I called setListAdapter in my ListActivity. Any idea how can I dynamically addFooterView after I called setListAdapter? ANSWER: I added both header view and footer view (actually buttons) into my list view, but bo...
{ "language": "en", "url": "https://stackoverflow.com/questions/7547799", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How to set RGBA Color of a Pixel of an UIImage I am looking for a possibility to set (change) the RGBA color of a Pixel of an UIImage for my Iphone Application. (I actually want to implement some floodfill stuff) So I need something like this: -(void) setPixelColorOfImage: (UIImage*) img atXCord: (int) x atYCord: (i...
{ "language": "en", "url": "https://stackoverflow.com/questions/7547807", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: how to add function to an object in javascript that can access its variables I am trying to do some javascript test driven development, and would like to replace a dao with a mock one. Lets say I have an object myObject that has a private var dao that I would like to create a setter for: var dao = new RealDao(); fu...
{ "language": "en", "url": "https://stackoverflow.com/questions/7547816", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: changing one char in a c string I am trying to understand why the following code is illegal: int main () { char *c = "hello"; c[3] = 'g'; // segmentation fault here return 0; } What is the compiler doing when it encounters char *c = "hello";? The way I understand it, its an automatic array of char, and...
{ "language": "en", "url": "https://stackoverflow.com/questions/7547821", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: How can I checkout a project from CVS? I have never used cvs in my life (only git, svn) - can anyone tell me how in the world I can get the source/jar of this bundle to my local Ubuntu box? http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.equinox/compendium/bundles/org.eclipse.equinox.http/?root=RT_Project I've...
{ "language": "en", "url": "https://stackoverflow.com/questions/7547823", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Removing a Warden strategy - how to ensure original devise_authenticable strategy is gone I created my own Warden strategy for using with Devise. It's very similar to Devise::Strategies::DatabaseAuthenticatable and actually it inherits from it and re-implements authenticate! My issue though is that I want to make su...
{ "language": "en", "url": "https://stackoverflow.com/questions/7547826", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: How does StringBuilder's capacity change? When I have an empty StringBuilder with a capacity of 5 and I write "hello, world!" to it, does the C# standard specify the new capacity of the StringBuilder? I have a vague memory that it's twice the new string's length (to avoid changing the capacity with every new appende...
{ "language": "en", "url": "https://stackoverflow.com/questions/7547827", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Doctrine2: Mapping a parent class field from a child, how? I'm wondering if this can be done using Doctrine annotations: Say you have a parent class (a mapped superclass): abstract class AbstractParent { protected $foo; } which as two child classes: class ConcreteChild1 extends AbstractParent { /** * @...
{ "language": "en", "url": "https://stackoverflow.com/questions/7547828", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: solr: multivalued geospatial search - returning closest point Is there a way in Solr to have a document that: * *contains multiple lat/long pairs *ask to return the closest point to a given (user-supplied) lat/long pair *sort/filter based on that 'closest point'. I was looking at: * *http://wiki.apache....
{ "language": "en", "url": "https://stackoverflow.com/questions/7547833", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: var_dump($_POST); is empty but not var_dump($_POST); die; i have found some similar topics on this issue, but nothing for my case: i send some post data via form, but the $_POST array is always empty (not null). but when i add a "die;" or "exit;" after var_dump($_POST); i can see all data sent. maybe its relevant to...
{ "language": "en", "url": "https://stackoverflow.com/questions/7547840", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Images latitude and longitude like "Places" iphone app I'm trying to find out what are the coordinates of a photo chosen from the photo library via "UIImagePickerController". I present the imagePickerController: [self presentModalViewController:imagePickerController animated:YES]; and then: - (void)imagePickerContr...
{ "language": "en", "url": "https://stackoverflow.com/questions/7547842", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Value from TextBox\Combobox to Range UserForm1.TextBox1.Value = "G4" Set CodeRange = Range(UserForm1.TextBox1.Value, Cells(Rows.Count, "G").End(xlUp)) Gives: methog range of object _global failed Pls some help how to convert value from form to range. A: Your code looks okay to me, although slightly unorthodox. Ha...
{ "language": "en", "url": "https://stackoverflow.com/questions/7547850", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: mod_rewrite, not rewriting when making a change My mod_rewriting seems to be being messed up by this one line at the end of my .htaccess file, and I can't for the life of me work out why. RewriteEngine ON Options FollowSymLinks # User profile with username specified RewriteRule ^([a-z0-9_.-]{1,30}+)$ profile.php?us...
{ "language": "en", "url": "https://stackoverflow.com/questions/7547851", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Javascript scoping query using jQuery $.ajax I am trying to write simple function that checks to see if a designer name exists in the database. I am using jQuery's ajax function to try to do this: function checkDesignerName(name) { var designer_name = $('input[name="name"]').val(); var designer_exists = ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7547861", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: On OS X, can I see how a website renders on an iPhone? I am running OS X Lion with XCode installed and want to know how a website renders on an iPhone. Are there any utilities that do that? A: Launch the iOS Simulator from the iOS SDK.
{ "language": "en", "url": "https://stackoverflow.com/questions/7547874", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Extending class documentation and live templates I am playing with code documentation and live templates and I quite don't get it. I've read Dr.Bob's article about generating documentation and wiki articles about live templates but I have one problem with class description. By class description I understand the IDE ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7547878", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: JQuery blockUI plugin - can't remove iFrame I have upload image form implemented. When user click submit to upload image to server I display modal window with Jquery.BlockUI plugin. In that modal view I display iFrame with uploading information data. Problem is when I add iFrame it displays fine, however it stays on...
{ "language": "en", "url": "https://stackoverflow.com/questions/7547880", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Android : GreenDroid-GoogleAPIs fails with StackOverflow Exception during Import I just tried to Import the GreenDroid-Librarys for my new Android Application. Now, I encounter a confusing Error. I first Import the GreenDroid-Core Library and everything is fine. But when I, after that, try to Import the GreenDroid-...
{ "language": "en", "url": "https://stackoverflow.com/questions/7547887", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Android register touch events on visible portion of image? I've currently been thinking about how I could register only touch events on the visible (non-transparent) parts of a .PNG image. -I've been testing around with AndEngine and it seems they have multiple options: I've tried any I could find to no avail. -I co...
{ "language": "en", "url": "https://stackoverflow.com/questions/7547890", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Help with SimpleGeo Javascript SDK I'm new to Javascript and I'm trying to eventually make something that will get the users location in using the getLocation API with HTML5, and use simpleGeo to get the building of the coordinates. So far I'm trying to get SimpleGeo working and I have this: var client = ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7547893", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Changing UIButton backgroundImage when selected on a UITabBar So I have a UIButton in the middle of my UITabBar in order to mimic, instagram's UITabBar Here's the code (code can also be taken from github here). @interface BaseViewController : UITabBarController { } // Create a view controller and setup it's tab bar...
{ "language": "en", "url": "https://stackoverflow.com/questions/7547895", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: IdDNSResolver QueryResult.count delphi xe2 i am using delphi xe2 i am sending 2 txt record in single request but my application is only recieving 1 IdDNSResolver QueryResult.count =1 i have checked manually by using nslookup server is returning 2 records. what could be the problem.. edit.. nslookup response for the...
{ "language": "en", "url": "https://stackoverflow.com/questions/7547901", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: position input after closest span, if it exists, in jquery I currently have this function which appends an "input" to the #cursor-start div: var $cursorStart= $("#cursor-start"); $("#main-edit").click( function() { var cursorExists = $("#cursor").length; if (!cursorExists){ $cursorStart.append("<input type='te...
{ "language": "en", "url": "https://stackoverflow.com/questions/7547906", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: use php to change a html elements inner text I have a basic form, which i need to put some validation into, I have a span area and I want on pressing of the submit button, for a predefined message to show in that box if a field is empty. Something like if ($mytextfield = null) { //My custom error text to appear ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7547908", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Lighttpd config error I have this config error: $ sudo /etc/init.d/lighttpd restart Stopping web server: lighttpd. Starting web server: lighttpdDuplicate config variable in conditional 0 global: fastcgi.server 2011-09-25 19:12:13: (configfile.c.855) source: /etc/lighttpd/lighttpd.conf line: 178 pos: 10 parser failed...
{ "language": "en", "url": "https://stackoverflow.com/questions/7547912", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Display chinese characters on Windows XP My WPF application needs to display chinese characters. Things work perfectly when running on Windows 7. However, when running the exact same application on Windows XP, the UI shows a series on squares instead of the chinese characters. In both cases, no chinese system packa...
{ "language": "en", "url": "https://stackoverflow.com/questions/7547914", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: upload a javascript File object through an iFrame I'm trying to create a drag and drop file upload UI. The problem is that I have to submit the files using an old fashioned multipart form. Is it possible to take the File objects you get from a drop event and somehow insert them into a form so they can be submitted t...
{ "language": "en", "url": "https://stackoverflow.com/questions/7547915", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Problem with populating textviews from DB rowid I am trying to make a program that has 2 views. The first view is a list populated from a database. What i want is, when i click an item of the list then i want the program to open the secound view and fill some textviews with data from the database according to the it...
{ "language": "en", "url": "https://stackoverflow.com/questions/7547917", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Writing huge Mongo result set to disk w/ Python in a resource friendly way There is a Mongo collection with >5 Million items. I need to get a "representation" (held in a variable, or put into a file on disk, anything at this point) of a single attribute of all of the 'documents'. My query is something like this: c...
{ "language": "en", "url": "https://stackoverflow.com/questions/7547927", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Get and set wchar_t chars from c++ to MySQL to c++ I have a database (Mysql) with some fields in UTF-8 (I can change that if needed). I use an old MySQL 'Communicator' or its predecessor, I wrote the code ~3 years ago and all I know today is that I link with libmysql.lib and #include "mysql.h" (do tell if you want m...
{ "language": "en", "url": "https://stackoverflow.com/questions/7547928", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Animated reloadData on UITableView How would you anime - reloadData on UITableView? Data source is on UIFetchedResultsController so I can't play with – insertSections:withRowAnimation:, – deleteSections:withRowAnimation: wrapped in – beginUpdates, – endUpdates. EDIT: I want to call - reloadData after NSFetchedResult...
{ "language": "en", "url": "https://stackoverflow.com/questions/7547934", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "33" }
Q: PHP while loop - exclude most recent row? I have a PHP while loop that loads user comments - I need to exclude the most recent row in the database. $sql = "SELECT c.trackid, c.comment, c.time, c.userid, u.id, u.username FROM comments c LEFT JOIN users u ON u.id = c.userid WHERE trackid='$trackid' ORDER BY c.time DE...
{ "language": "en", "url": "https://stackoverflow.com/questions/7547936", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: possible to create ebook programmatically? I am investigating whether it is possible to generate an ebook, say, a Kindle book, programmatically. are there any libraries, open source or proprietary? in particular, for python. A: An ebook or epub is just xhtml with some meta info and stuff. Every page is a xhtml file...
{ "language": "en", "url": "https://stackoverflow.com/questions/7547939", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: Really Confused about ajax image upload Over the last couple of weeks I have asked a couple of questions on this subject. It seems as though the harder I try to figure this out, the further away from a solution I appear to be. That may just be a function of me being an idiot Here is a brief summary of what I have ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7547944", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Disable postback at click on a button I want do disable postback after clicking a <asp:Button>. I've tried to do that by assigning onclick="return false", but in the button doesn't work. How can I fix this? A: onclick is used to wire up your server side events. You need to use the OnClientClick handler such as <asp...
{ "language": "en", "url": "https://stackoverflow.com/questions/7547945", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "24" }
Q: NullReferenceException testing dataset in asp.net I have written a 3 layer web site which has singleton repository for accessing database. My repositories use dataset for connecting to and query from database. I want to test the site using Visual Studio 2010 Test project but when I create TableAdapter of dataset in ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7547948", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How can I pass R variable into sqldf? I have some query like this: sqldf("select TenScore from data where State_P = 'AndhraPradesh'") But I have "AndhraPradesh" in a variable stateValue. How can I use this variable in a select query in R to get the same result as above. Please show me the syntax. A: See Example 5 ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7547950", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "11" }
Q: In the SECD Machine how does "rap" work? I am writing a simulator of the SECD machine in C# guided by the description on Wikipedia. I have the basic operations completed, but I am not sure how to implement the rap instruction. At Wikipedia it says about rap: rap works like ap, only that it replaces an occurrence of...
{ "language": "en", "url": "https://stackoverflow.com/questions/7547951", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: Control the clickable area of a link As you can see below I have a set of links quite close together and the clickable area of the links overlap: I've tried playing with the padding and margin to no avail. How to I reduce the overlap? A: It depends on your situation and isn't always possible, but if you could mana...
{ "language": "en", "url": "https://stackoverflow.com/questions/7547955", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: ClassCastException android.view.viewgroup.$layoutParam TextView txt=new TextView(productlist.this); txt.setText(author.get(groupPosition)); TextView txt1=new TextView(productlist.this); txt1.setText(price.get(groupPosition)); txt.setLayoutParams(new LayoutParams(70, L...
{ "language": "en", "url": "https://stackoverflow.com/questions/7547957", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Sorting/Displaying by Numeric and then Alphabetically I have a list of these type of numbers with letters stored in a mySQL table 1 2a 2b 2c 3a 3b 4 5a 5b 10 Some have letters and some don't. For the sample data above, I'd want it do display on the page like this 1 2a / 2b / 2c 3a / 3b 4 5a / 5b 10 and here is t...
{ "language": "en", "url": "https://stackoverflow.com/questions/7547960", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Why is my dictionary released in a NSArray? I've a tableviewcontroller which stores dictionary objects in an Array, when a row gets selected I push a new view controller on the navigation stack and I pass a dictionary object from the array in it's initializer, the dictionary object will be retained in a property of ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7547969", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: HTTP PUT file and data In my RESTful API say I have a picture the user can update via a PUT request. And let's say each of these pictures has a custom name the user can assign them so they can easily browse them. What I'd like to do is send a put request that contains the updated file AND the new name for the pictur...
{ "language": "en", "url": "https://stackoverflow.com/questions/7547970", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Read string without parsing in Python xml.dom As you probably know, Pythons xml.dom readString() throws an exception, if there is anything wrong with the xml code. I am currently writing a simple xmpp chat server, and as you probably also know, one of the first client request message does not close the stream:stream...
{ "language": "en", "url": "https://stackoverflow.com/questions/7547971", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: My file output is being duplicated. Every new println includes all the previous. (Code included) Exactly what I'm doing, FileOutputStream out; PrintStream outputfile; try{ out = new FileOutputStream("Project1.txt"); outputfile = new PrintStream(out); int a[ ] = { 4, -3, 5, -2, -1...
{ "language": "en", "url": "https://stackoverflow.com/questions/7547977", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Sqlite3 inserts to non-indexed table taking longer as table gets larger Without getting into too much detail, I have a process in my iOS app that parses XML and inserts (sometimes up to 10s or 100s of) thousands of records into an Sqlite3 table. For speed, I have no indexes on the table, and I'm inserting records in...
{ "language": "en", "url": "https://stackoverflow.com/questions/7547978", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Android HttpClient memory leak? I was looking at code for a sample Android application. Within the code, the application creates an HttpClient, but I never see anywhere where the connection is closed. So I was wondering does this code create a memory leak? If not, can you explain why? The link to the sample code is ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7547981", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Rectangle Auto Blit I have a container rectangle and element rectangle, both are specified only in height and width. Using PHP I need to figure out what positions and orientation would allow for the most possible blits of the element within the container having absolutely no overlap. An Example : $container = array...
{ "language": "en", "url": "https://stackoverflow.com/questions/7547991", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: connecting three NSStrings Right i have three NSStrings that i want to put together to make one long nsstring (to use as a URL). I have used stringByAppedingString which lets me put two of the together but i do not know how to put three together. Basically what i want to end up with is http://graph.facebook.com/5174...
{ "language": "en", "url": "https://stackoverflow.com/questions/7547992", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: C++ Factory pattern using templates for self registering My questions correspond to the answer from Johannes in Is there a way to instantiate objects from a string holding their class name? and the recent comment from Spencer Rose. Since I cannot add a comment there, I decided to start a new question. Johannes sugg...
{ "language": "en", "url": "https://stackoverflow.com/questions/7548002", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Xcode: Why doesn't my app save the UITextField? I have an app where I switch to a view with a TableView using presentModalViewController. The View with the TableView is however not at UITableViewController but a regular UIViewController. I have written UITextFields into the UITableViewCells. I use this action to sav...
{ "language": "en", "url": "https://stackoverflow.com/questions/7548006", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How to integrate maven 2 in an existing netbeans project? How to integrate maven 2 in an existing netbeans project ? I dont want to do it by creating a new maven web app project and moving my files manually to the new project(as I have versions of this project in my subversion repositories which I wont be able to ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7548008", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: Observablecollection in Listbox is not updating I have a Silverlight Listbox bound to Observablecollection which shows up fine (first time) but when I try to update it through the code behind, the change does not reflect in UI. I have used MVVM pattern . Pl have a look and at view and viewmodel. <UserControl x:Class...
{ "language": "en", "url": "https://stackoverflow.com/questions/7548011", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How do I set custom messages for Zend_File_Transfer_Adapter_Http validators I'm using Zend_File_Transfer for PHP file uploads and I want to add custom messages for validators. This is how I do it: $upload = new Zend_File_Transfer_Adapter_Http(); $upload->addValidator('Size', false, array( 'max' => $userLimits->p...
{ "language": "en", "url": "https://stackoverflow.com/questions/7548012", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Validate Textfield after each character entered I have searched for an answer but cant find an answer related to this. I am trying to validate every input into a textfield but not sure how to go about it, the idea is to check a username exist on a server so I would assume I need to post to the server each time some...
{ "language": "en", "url": "https://stackoverflow.com/questions/7548021", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Android USB Vendor IDs for unknown brand Refer to http://developer.android.com/guide/developing/device.html#VendorIds, I want to buy a unknown brand Android device, such as http://app-4-android.blogspot.com/2011/09/ainol-novo-8-android-22-8-in-tablet.html, How can I get the USB Vendor ID? Can it be used to develop A...
{ "language": "en", "url": "https://stackoverflow.com/questions/7548023", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: unix open file for write given file descriptor I want to open a file for write and I have been given the file descriptor for that file. I know that fdopen can be used to write to the file as follows: FILE * fp; fp = fdopen(filedes, "a+"); fwrite("\n", sizeof(char), 1, fp); Is there any other way to achive the same,...
{ "language": "en", "url": "https://stackoverflow.com/questions/7548025", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Convert recursive binary tree traversal to iterative I was asked to write the iterative version, but I wrote the recursive version i.e. void inorderTraverse(BinaryTree root) { if(root==NULL) printf("%d",root->id); else { inorderTraverse(root->left); printf("%d",root->id); ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7548026", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Stream to Image and back I'm taking a Stream convert it to Image, process that image, then return a FileStream. Is this a performance problem? If not, whats the optimized way to convert and return back a stream? public FileStream ResizeImage(int h, int w, Stream stream) { var img = Image.FromStream(stream); ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7548028", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "5" }
Q: How to find location within list? I suspect this is a basic question(but I tried to google and search SO with no luck). I have a list: [1, 2,3,4] and I want to know where in the list the value of 3 is..but without using a for loop to go through the entire list. Is that possible? I'm already going through a very l...
{ "language": "en", "url": "https://stackoverflow.com/questions/7548029", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: What happens when objects in the scene are outside the range between the near and far planes? From my understanding, the objects would get clipped. Is this correct? And how would this affect performance? Does OpenGL ES then just stop processing the polygons which are in front of the near plane or behind the far plan...
{ "language": "en", "url": "https://stackoverflow.com/questions/7548030", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: How to define two relationships to the same table in SQLAlchemy I’ve looked all over the SQLAlchemy tutorial and other similar questions but I seem to be struggling to get this join to work: The scenario: I have a pages table represented by the Page model. Pages can be created by an user and edited by an user, but n...
{ "language": "en", "url": "https://stackoverflow.com/questions/7548033", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "31" }
Q: UIView animation for CGAffineTransformMake not working I have a simple transform animation that moves a UITableViewCell 70 pixels to the left. In the if part, the animation works just fine and I get a smooth transition. However, when the function is called again to put the cell back in its original position, which ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7548035", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Filter contentresolver query by date and time - Android I'm using the "MediaStore.Images.Media.EXTERNAL_CONTENT_URI" to query for photos stored on the sd-card. Now I only want photos that were added after some specific date. I'm using the "contentResolver.query()" method to query but I don't understand how to filte...
{ "language": "en", "url": "https://stackoverflow.com/questions/7548037", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Adding Google Guava to Android project - significantly slows down the build After adding Google Guava r09 to our Android project the build time increased significantly, especially the DEX generation phase. I understand that DEX generation takes all our classes + all jars we depend on and translates them to DEX forma...
{ "language": "en", "url": "https://stackoverflow.com/questions/7548038", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "16" }
Q: Recreating a shell-like interpreter within python? Before I sit down and start hacking it out, I thought I'd come here and see if you all had any tips or even if something like this has been done before. I want to re-create a basic shell like syntax within a python program. In other words, when people run the file w...
{ "language": "en", "url": "https://stackoverflow.com/questions/7548042", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How can i read the first XML comment in PHP? How can I read the first and only comment in PHP: <?xml version="1.0" encoding="UTF-8"?> <!-- read this --> <root> </root> using DOMDOcument object? $xml = new DOMDocument(); $libxml_error = 'Il file %s non risulta ben formato (%s).'; // Per evitare i warning nel caso ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7548043", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Remove file extension I have this: $name = $_FILES['file']['name']; $skin_name = $_POST['nameXXXXXC']; $price = $_POST['amount']; $by = $_COOKIE['userName']; $KS84JMCN = substr($name, 0,strrpos($name,'.')); mysql_query(" INSERT INTO `Skins`( `Name`, `Skin_Name`, `Price`, `Made_By` ) VALUES ( '$...
{ "language": "en", "url": "https://stackoverflow.com/questions/7548048", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "-6" }
Q: OpenGL, disabling a texture unit, glActiveTexture and glBindTexture How do I turn off a texture unit, or at least prevent its state changing when I bind a texture? I'm using shaders so there's no glDisable for this I don't think. The problem is that the chain of events might look something like this: Create textur...
{ "language": "en", "url": "https://stackoverflow.com/questions/7548049", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: FFmpeg decoding H264 I am decoding a H264 stream using FFmpeg on the iPhone. I know the H264 stream is valid and the SPS/PPS are correct as VLC, Quicktime, Flash all decode the stream properly. The issue I am having on the iPhone is best shown by this picture. It is as if the motion vectors are being drawn. This pi...
{ "language": "en", "url": "https://stackoverflow.com/questions/7548055", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: How can I troubleshoot Delayed Job procs that are failing silently? I will start Delayed Job with the following command: script/delayed_job -n 4 start Then at the end of the day I will check to see how many processes I have left, and there might be two. Or zero. I can't figure out what is causing the procs to die. T...
{ "language": "en", "url": "https://stackoverflow.com/questions/7548057", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "4" }
Q: Session doesn't get cleared I have a google chrome extension talking to a PHP script via XHR. I have a flag in the PHP script to check if a button is clicked in a popup if proper POST data is sent. If this button is clicked, the current session needs to be destroyed and when new data is entered by clicking the add b...
{ "language": "en", "url": "https://stackoverflow.com/questions/7548062", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Android- Get hash code from server my app connected to the server , once the server receive the data , it will send a hash code as response ... my questions is how to get this hashcode ? I use the following code to POST data : try { HttpClient client = new DefaultHttpClient(); String postURL = "http://som...
{ "language": "en", "url": "https://stackoverflow.com/questions/7548065", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How to pass selected uitableviewcell variable to previous viewcontroller? This is the first time I have tried to do this and I understand the concept of what I am trying to do but just not 100% sure on how to execute it. I have a main view and a sub view.. the main view has several custom uitableviewcells each with ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7548067", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How do i include a variable in a nsurl iphone this is what i have - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. // Add the view controller's view to the window and display. ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7548068", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: How to avoid casting from interface to class In trying to design a collision detection component for a game, I came up with the following solution. I define an interface ICollideable that looks something like: interface ICollideable { Sprite Sprite { get; } int Damage { get; } void HandleCollision(IC...
{ "language": "en", "url": "https://stackoverflow.com/questions/7548071", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "10" }
Q: How to normalize benchmark results to obtain distribution of ratios correctly? To give a bit of the context, I am measuring the performance of virtual machines (VMs), or systems software in general, and usually want to compare different optimizations for performance problem. Performance is measured in absolute runti...
{ "language": "en", "url": "https://stackoverflow.com/questions/7548075", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: Mongo - most efficient way to $inc values in this schema I'm a Mongo newbie, and trying to make this schema work. Its intended for logging events as they happen on a high traffic website - just incrementing the number of times a certain action happens. { _id: "20110924", Vals:[ { Key: "SomeStat1": ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7548078", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: php conditional regex problem I'm having a tough time sorthing this out. I'm working with a custom plugin system that presents things like this: <plugin:class:method var1='hello', var2='yes' /> But, ':method' and the variables do not have to exist - only the 'class' is required. For instace, this should still be ok...
{ "language": "en", "url": "https://stackoverflow.com/questions/7548079", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: Could not load file or assembly 'AjaxControlToolkit, <tt:TooltipExtender ID="teAutoServiceShutdown" TargetControlID="cbAutoServiceShutdown" Parser Error Message: Could not load file or assembly 'AjaxControlToolkit, Version=3.0.20820.16598, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e' or one of its dependencies...
{ "language": "en", "url": "https://stackoverflow.com/questions/7548083", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "1" }
Q: using $_SESSION['fb_'.APP_ID.'_user_id'] I'm developing a fb application with php sdk 3.0 and I've noticed that Facebook starts a session that contain the app_ID like that: $_SESSION['fb_'.APP_ID.'_user_id']; This session store the facebook uid of the connected user. Is this a feature of PHP SDK or is not recommende...
{ "language": "en", "url": "https://stackoverflow.com/questions/7548087", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "-1" }
Q: ActionLink does not create the right link This is super straight forward, but somehow it is not working. Can you please take a look? on my page I have: <%= Html.ActionLink("My Recipes", "Index", "Recipes")%> and i have the following controller: namespace MyWebSite.Controllers { public class RecipesController :...
{ "language": "en", "url": "https://stackoverflow.com/questions/7548088", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Clearing Inner Float I'm developing a web page that has an outer floated left column and a regular right column. The right column then contains a list of items where each item has a floated left column and a regular right column. My problem is when a list item's right column isn't tall enough, the next list item is ...
{ "language": "en", "url": "https://stackoverflow.com/questions/7548091", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "2" }
Q: how to show output after executing stored procedure in mssql and php $server = 'x.x.x.x\SQLEXPRESS'; // Connect to MSSQL $link = mssql_connect($server, 'username', 'password'); if (!$link) { die('Something went wrong while connecting to MSSQL'); } else { echo "Connected!";`` } $selected = mssql_select_db...
{ "language": "en", "url": "https://stackoverflow.com/questions/7548095", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: "Recent Solutions" List with multiple versions of MonoDevelop I'm working on Ubuntu 11.04, and am using MonoDevelop 2.4 for my C# and other CLI development. I'm using this version since it's provided in the repos. But I just built MonoDevelop 2.6, mostly to play around with, see what's new, and also 'cause that's th...
{ "language": "en", "url": "https://stackoverflow.com/questions/7548101", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }
Q: Looping and finding empty array I'm working on project in which I have to create a search engine through jQuery. Everything has been going great until I started looping through the array. I don't know whether I'm doing it wrong, but for some reason, when I use a conditional it does not output the statement I want it...
{ "language": "en", "url": "https://stackoverflow.com/questions/7548108", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "-1" }
Q: Unit testing datamodel : related entities I'm new to unit testing & TDD and after reading some articles i decided to start TDD in a small project of mine. it's a simple Theater Ticket Booking which uses NHibernate & also Repository pattern. i decided to first write some tests for my data model, so i started with sim...
{ "language": "en", "url": "https://stackoverflow.com/questions/7548116", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "3" }
Q: Django Performance Tuning Tips? How do you tune Django for better performance? Is there some guide? I have the following questions: * *Is mod_wsgi the best solution? *Is there some opcode cache like in PHP? *How should I tune Apache? *How can I set up my models, so I have fewer/faster queries? *Can I use Memc...
{ "language": "en", "url": "https://stackoverflow.com/questions/7548128", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "7" }
Q: Running a code behind routine from an I have a link that looks like a button from this html <p class="link-styleContact"><a href="#"><span>Email Contact Form</span></a></p> can I run a code behind file when this is clicked on by adding the routine name to the href? like below <p class="link-styleContact"><a href="C...
{ "language": "en", "url": "https://stackoverflow.com/questions/7548129", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "8" }
Q: Flash vs other methods, and, quick and easy I have a question about Flash. I am writing my first browser game, and I am trying to decide on a technology. I have a few requirements: * *I don't want to have to pay to write code and a not-complete-crap free IDE would also be good. *I want most (or > 70%) of "norma...
{ "language": "en", "url": "https://stackoverflow.com/questions/7548132", "timestamp": "2023-03-29T00:00:00", "source": "stackexchange", "question_score": "0" }