text
stringlengths
74
309k
{"title":"Why is the first element always blank in my Rails multi-select, using an embedded array?","tags":["html","ruby-on-rails","forms","serialization","multi-select"],"question_text":"I'm using\nRails 3.2.0.rc2\n. I've got a\n`Model`\n, in which I have a static\n`Array`\nwhich I'm offering up through a form such th...
{"title":"iPhone UIWebView local resources using Javascript and handling onorientationChange","tags":["uiwebview","iphone"],"question_text":"I'm trying to server HTML Javascript and CSS content from an iPhone application's local resources, and I'm having trouble handling onOrientationChange events and including externa...
{"title":"What is the best way to connect and use a sqlite database from C#","tags":["c#","sqlite"],"question_text":"I've done this before in C++ by including sqlite.h but is there a similarly easy way in C#?","answer_text":"I'm with, Bruce. I AM using\nhttp:\/\/system.data.sqlite.org\/\nwith great success as well. Her...
{"title":"Node.js\/Express.js App Only Works on Port 3000","tags":["javascript","node.js","configuration","express","port"],"question_text":"I have a Node.js\/Express.js app running on my server that only works on port 3000 and I'm trying to figure out why. Here's what I've found:\nWithout specifying a port (\n`app.lis...
{"title":"html parsing of cricinfo scorecards","tags":["html","regex","xml","vba","parsing"],"question_text":"Aim\nI am looking to scrape 20\/20 cricket scorecard data from the\nCricinfo website\n, ideally into\nCSV form\nfor data analysis in Excel\nAs an example the current\nAustralian Big Bash 2011\/12 scorecards\nar...
{"title":"Replacement for source in sh","tags":["bash","shell","sh"],"question_text":"I need to set the environment variables, usually we do this by\n`source script.sh`\nBut now, I am automating it during the boot process and it looks like the root boots by default with\n`sh`\nshell. How do I source this script in\n`sh...
{"title":"Python sqlite3 version","tags":["python","sqlite"],"question_text":"`Python 2.6.2 (r262:71605, Apr 14 2009, 22:40:02) [MSC v.1500 32 bit (Intel)] on\nwin32\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n>>> import sqlite3\n>>> sqlite3.version\n'2.4.1'`\nQuestions:\nWhy is the...
{"title":"How can I split a string into chunks of two characters each in Perl?","tags":["regex","arrays","perl","split"],"question_text":"How do I take a string in Perl and split it up into an array with entries two characters long each?\nI attempted this:\n`@array = split(\/..\/, $string);`\nbut did not get the expect...
{"title":"display Java.util.Date in a specific format","tags":["java","date"],"question_text":"I have the following scenario :\n`SimpleDateFormat dateFormat = new SimpleDateFormat(\"dd\/MM\/yyyy\");\nSystem.out.println(dateFormat.parse(\"31\/05\/2011\"));`\ngives an output\n`Tue May 31 00:00:00 SGT 2011`\nbut I want th...
{"title":"Getting value of std::list<>::iterator to pointer?","tags":["c++","stl","iterator"],"question_text":"How can i loop thru a stl::List and store the value of one of the objects for use later in the function?\n`Particle *closestParticle;\nfor(list<Particle>::iterator p1 = mParticles.begin(); p1 != mParticles.end...
{"title":"How to add attributes for C# XML Serialization","tags":["c#","xml-serialization"],"question_text":"I am having an issue with serializing and object, I can get it to create all the correct outputs except for where i have an Element that needs a value and an attribute. Here is the required output:\n`<Root>\n <M...
{"title":"How to install trusted CA certificate on Android device?","tags":["android","ssl","installation","certificate"],"question_text":"I have created my own CA certificate and now I want to install it on my Android Froyo device (HTC Desire Z), so that the device trusts my certificate.\nAndroid stores CA certificate...
{"title":"How to copy files from folder tree dropping all the folders with Robocopy?","tags":["command-line","command-prompt","robocopy"],"question_text":"I have the following folder structure:\nFolderA\n--Folder1\n--Folder2\n--Folder3\n...\n--Folder99\nFolders 1 through 99 have files in them.\nAll I want to do is to c...
{"title":"Best practice to get EntityManagerFactory","tags":["java","jpa","jndi"],"question_text":"What is the best approach to get EntityManagerFactory in web app(jsp\/servlets).\nis this a good way\nWhen should EntityManagerFactory instance be created\/opened?\n,\nor it's better get it from JNDI, or something else......
{"title":"Git: Apply part of a commit to another branch","tags":["git"],"question_text":"How can I apply\npart\nof a commit from one branch to another? I understand that I can cherry-pick a commit, but I need to go one step further and \"cherry pick\" some of the changes introduced by that commit and apply them to anot...
{"title":"Which Python async library would be best suited for my code? Asyncore? Twisted?","tags":["python","asynchronous","twisted","asyncore"],"question_text":"I have a program I'm working on that will be reading from two 'network sources' simultaneously. I wanted to try out an asynchronous approach rather than use t...
{"title":"How to sanity check a date in java","tags":["java","validation","calendar","date"],"question_text":"I find it curious that the most obvious way to create Date objects in Java has been deprecated and appears to have been \"substituted\" with not so obvious to use lenient calendar. So...\nHow do you check that ...
{"title":"PHP GD Use one image to mask another image, including transparency","tags":["php","gd"],"question_text":"I am trying to create a PHP script that takes an image:\nhttp:\/\/i.stack.imgur.com\/eNvlM.png\nand then applies a PNG image:\nhttp:\/\/i.stack.imgur.com\/iJr2I.png\nas a mask.\nThe end result needs to mai...
{"title":"Where is the default terminal $PATH located on Mac?","tags":["osx","bash","path"],"question_text":"I have been looking throughout the system but I cannot find it. When I do echo $PATH I get the stuff I added, plus the default path. I do not have a .profile, and I do have a .bashrc, but the default path is not...
{"title":"Alternatives to Toad","tags":["database","oracle"],"question_text":"I'm currently using\nToad\nfor my day-to-day work on our databases (queries, updates, small scripts, browsing of db objects, etc.).\nMy question is: since my version of Toad is old and buggy, which are the (possibly free, but not necessarily)...
{"title":"How to get NSArray of localised day-of-week names in IOS?","tags":["iphone","ios","localization","internationalization","nsdateformatter"],"question_text":"How to get NSArray of localised day-of-week names in IOS?\ni.e. don't want to have to hardcode them in myself. Is there an easy way to get this from an IO...
{"title":"Checking for empty\/null JToken in a JObject","tags":["c#","sql","json.net"],"question_text":"I have the following...\n`JArray clients = (JArray)clientsParsed[\"objects\"];\nforeach (JObject item in clients.Children())\n{\n \/\/ etc.. SQL params stuff...\n command.Parameters[\"@MyParameter\"].Value = JTokenTo...
{"title":"Android WebView inside ScrollView scrolls only scrollview","tags":["android","webview","scroll","scrollview"],"question_text":"In my app I have a ScrollView that contains some linearviews, some textviews and One Webview, then other linear layouts etc. The problem is that the WebView does not scroll. The Scrol...
{"title":"MVC jQuery submit form (without page refresh) from JavaScript function","tags":["jquery","asp.net-mvc","ajax","form-submit"],"question_text":"I'm pretty new to all this.\nI'm using ASP.NET MVC C#\nLINQ to SQL\n.\nI have an edit page that loads Authors and all their Books.\nThe Books are loaded via an\nAjax\nc...
{"title":"how to extract a subset of a data frame based on a condition involving a field?","tags":["r","csv"],"question_text":"I have a large CSV with the results of a medical survey from different locations (the location is a factor present in the data). As some analyses are specific to a location and for convenience,...
{"title":"Phonegap run from CLI with --release and self-signed app requires me to patch cordova.js","tags":["cordova","cordova-cli"],"question_text":"I suppose I'm doing something wrong but I had to patch\nhttps:\/\/github.com\/phonegap\/phonegap\/blob\/master\/lib\/android\/bin\/templates\/cordova\/lib\/cordova.js#L31...
{"title":"Timestamp to human readable format","tags":["javascript","timestamp"],"question_text":"Well I have a strange problem while convert from unix timestamp to human representation using javascript\nHere is timestamp\n`1301090400`\nThis is my javascript\n`var date = new Date(timestamp * 1000);\nvar year = date.getF...
{"title":"When I should use one to one relationship?","tags":["database","database-design","relational-database"],"question_text":"Sorry for that noob question but is there any real needs to use one-to-one relationship with tables in your database? You can implement all necessary fields inside one table. Even if data b...
{"title":"JOptionPane Yes or No window","tags":["java","swing","return-value","joptionpane"],"question_text":"I am trying to create a message with a Yes or No button. Then a window will appear with a certain message that depends on if the user clicked Yes or No.\nHere is my code:\n`public class test{\n public static vo...
{"title":"Java8 Lambdas vs Anonymous classes","tags":["java","lambda","java-8","anonymous-class"],"question_text":"Since Java8 has been recently released and its brand new lambda expressions looks to be really cool, I was wondering if this means the demise of the Anonymous classes that we were so used to.\nI've been re...
{"title":"How can I rotate display only in landscape mode in android?","tags":["android","rotation","orientation","landscape","sensor"],"question_text":"I want that my View rotates only in landscape mode, clockwise and counterclockwise.\nI read about the only counterclockwise for android < 2.2 and that's not a problem,...
{"title":"Is it possible to allow didSet to be called during initialization in Swift?","tags":["ios","swift","didset"],"question_text":"Question\nApple's docs\nspecify that:\nwillSet and didSet observers are not called when a property is first initialized. They are only called when the property\u00e2\u0080\u0099s value...
{"title":"NSNotifications name best practice","tags":["objective-c","c-preprocessor","nsnotification"],"question_text":"In trying to de-couple my model from the view controllers that display fetched data, when an asynchronous fetch completes, I post an NSNotification.\n`[[NSNotificationCenter defaultCenter] postNotific...
{"title":"Why is it bad to use an iteration variable in a lambda expression","tags":["vb.net","lambda","iteration","warnings"],"question_text":"I was just writing some quick code and noticed this complier error\nUsing the iteration variable in a lambda expression may have unexpected results.\nInstead, create a local va...
{"title":"Detecting that the browser has no mouse and is touch-only","tags":["javascript","html5","touch","mouse"],"question_text":"I'm developing a webapp (not a website with pages of interesting text) with a very different interface for touch (your finger hides the screen when you click) and mouse (relies heavily on ...
{"title":"Running an ipython notebook non-interactively","tags":["ipython","ipython-notebook"],"question_text":"Does anyone know if it is possible to run an ipython notebook non-interactively from the command line and have the resulting .ipynb file saved with the results of the run. If it isn't already possible, how ha...
{"title":"How I could add dir to $PATH in Makefile?","tags":["linux","makefile"],"question_text":"I want to write a Makefile which would run tests. Test are in a directory '.\/tests' and executable files to be tested are in the directory '.\/bin'.\nWhen I run the tests, they don't see the exec files, as the directory ....
{"title":"Does the order of headers in an HTTP response ever matter?","tags":["http-headers"],"question_text":"Is it ever meaningful whether the order of headers is\n`A: 1\nB: 2`\nvs\n`B:2\nA:1`\nI'm trying to figure out if I can use a dictionary to store a list of headers or if it needs to be some kind of list or orde...
{"title":"validates :presence vs validates_presence_of using rails 3","tags":["ruby-on-rails-3"],"question_text":"I have a couple of simple models that are associated like so:\nMODELS\n`class Task < ActiveRecord::Base\n belongs_to :user\n validates :name, :presence => true, :message => 'Name cannot be blank, Task not s...
{"title":"How to get indexpath in prepareForSegue","tags":["ios","uitableview"],"question_text":"`- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender \n {\n if ([segue.identifier isEqualToString:@\"Action\"])\n {\n NSIndexPath *indexPath = [self.tbl indexPathForSelectedRow];\n SecondViewController *des...
{"title":"Synthesize error \"Missing Context for Property Implementation Declaration\"","tags":["xcode","properties","declaration"],"question_text":"Anyone have any ideas? When I try to synthesize a property I have declared in the .h file its not letting me synthesize it. Any ideas? Thanks!","answer_text":"This can hap...
{"title":"Twitter Bootstrap dropdown menu","tags":["css","twitter-bootstrap"],"question_text":"I'm trying to use Twitter Bootstrap's dropdown menu in its top nav bar. You can see an example working here.\nhttp:\/\/twitter.github.com\/bootstrap\/#\nIn mine, the arrow indicating that it's a dropdown shows on the menu but...
{"title":"Is there a way to exit only the php file being included?","tags":["php"],"question_text":"So, I have a sidebar.php that is included in the\n`index.php`\n. Under a certain condition, I want\n`sidebar.php`\nto stop running, so I thought of putting\n`exit`\nin\n`sidebar.php`\n, but that actually exits all the co...
{"title":"When should std::string be used over character arrays?","tags":["c++","string","character-arrays"],"question_text":"I sit around and think about whether or not I should be using\n`const char*`\nor\n`const std::string&`\npretty often when I'm designing class interfaces and when it comes down to it, I often fee...
{"title":"Replacing illegal character in fileName","tags":["java","regex","replace"],"question_text":"In Java, I've a File-Name-String. There I want to replace all illegal Characters with '_', but not\n`a-z`\n,\n`0-9`\n,\n`-`\n,\n`.`\nand\n`_`\nI tried following code: But this did not worked!\n`myString = myString.repl...
{"title":"Find position of element in C++11 range-based for loop?","tags":["c++","iterator","c++11"],"question_text":"Assume I have the following code:\n`vector<int> list;\nfor(auto& elem:list) {\n int i = elem;\n}`\nCan I find the position of\n`elem`\nin the vector without maintaining a separate iterator?","answer_tex...
{"title":"What is the difference between = and := in Scala?","tags":["scala","syntax"],"question_text":"What is the difference between = and := in Scala?\nI have googled extensively for \"scala colon-equals\", but was unable to find anything definitive.","answer_text":"`=`\nin scala is the actual assignment operator --...
{"title":"self.window.rootViewController vs window addSubview","tags":["iphone","objective-c"],"question_text":"I've noticed a lot of examples for iPhone apps in the Application Delegate\n`- (void)applicationDidFinishLaunching:(UIApplication *)application`\nhave\n`[window addSubview: someController.view];`\n(1)\nas opp...
{"title":"Add a new line to a text file in MS-DOS","tags":["batch-file","newline"],"question_text":"I am making a\n`.bat`\nfile, and I would like it to write\nASCII art\ninto a text file.\nI was able to find the command to append a new line to the file when echoing text, but when I read that text file, all I see is a l...
{"title":"Python 2.7: round number to nearest integer","tags":["python","python-2.7"],"question_text":"I've been trying to round long float numbers like:\n`32.268907563;\n32.268907563;\n31.2396694215;\n33.6206896552;\n...`\nWith no success so far. I tried\n`math.ceil(x)`\n,\n`math.floor(x)`\n(although that would round ...
{"title":"How to rotate the background image in the container?","tags":["css","background-image","image-rotation"],"question_text":"I want to rotate the image which is placed in the button of scrollbar in Chrome. Now I have a CSS with this content:\n`::-webkit-scrollbar-button:vertical:decrement\n{\n background-image:u...
{"title":"scala - Any vs underscore in generics","tags":["scala","generics","any","underscores"],"question_text":"What is the different between the following Generics definitions in Scala:\n`class Foo[T <: List[_]]`\nand\n`class Bar[T <: List[Any]]`\nMy gut tells me they are about the same but that the latter is more e...
{"title":"How do I generate a SQL script from my diagram in MySQL Workbench?","tags":["mysql","sql","mysql-workbench"],"question_text":"I've created an EER diagram with tables, foreign keys, etc in MySQL Workbench and now I want to generate a \".sql\" script that will create this database. How do I do that?","answer_te...
{"title":"Can't declare an abstract method private","tags":["java","oop"],"question_text":"I want to do this, yet I can't. Here is my scenario and rational. I have an abstract class for test cases that has an abstract method called test(). The test() method is to be defined by the subclass; it is to be implemented with...
{"title":"How to connect to a java program on localhost jvm using JMX?","tags":["java","localhost","rmi","jmx","jconsole"],"question_text":"I should connect to a java program on localhost jvm using JMX. In other words I want to develop a JMX client to config a java program on localhost.\nDon't recommend using JConsole!...
{"title":"Android: findviewbyid: finding view by id when view is not on the same layout invoked by setContentView","tags":["android","layout"],"question_text":"I have an activity MyActivity that extends from MapActivity. In the .xml file containing the layout I can only include the MapView\n`<com.google.android.maps.Ma...
{"title":"Jquery Hide table rows","tags":["jquery"],"question_text":"I am hiding a bunch of textboxes and it works fine, the problem is, the textboxes are in a table, so I also need to hide the corresponding labels.\nthe structure is something like this\n`<tr>\n<td>\nLabel\n<\/td>\n<td>\nInputFile\n<\/td>\n<\/tr>`\nin ...
{"title":"How do I put a Bootstrap Glyphicon inside an asp:Button in ASP.Net?","tags":["html","asp.net","twitter-bootstrap","button","aspbutton"],"question_text":"I'm using Bootstrap 3 in my project, and I want to use Bootstrap Glyphicons in ASP.net buttons.\nHere is the code I used, though it didn't work out (I got a ...
{"title":"Why write <script type=\"text\/javascript\"> when the mime type is set by the server?","tags":["javascript","html","css","mime-types"],"question_text":"My understanding is that mime types are set by the web server. Why do we add the\n`type=\"text\/javascript`\nor\n`type=\"text\/css\"`\nattribute? Isn't this a...
{"title":"How to remove an app that's waiting for review?","tags":["itunesconnect"],"question_text":"Because we have discovered and fixed a bug in our app after we uploaded the application to iTunes Connect, we now need to remove the one that has been posted for review and upload the newer version we just built.\nIs it...
{"title":"How to put WPF Tab Control tabs on the side","tags":["wpf","xaml","tabcontrol"],"question_text":"I am trying to create a Tab Control in WPF that has the tabs arranged down the right side of the control, with the text rotated 90 degrees The look is similar to those plastic tabs you can buy and use in a noteboo...
{"title":"How can I be notified when a Snackbar has dismissed itself?","tags":["android","material-design","android-design-library","android-snackbar","snackbar"],"question_text":"I'm using a Snackbar from the\n`com.android.support:design:22.2.0`\nlibrary. I'm using it to undo deletions. To make my life easier, I'm goi...
{"title":"How to combine two 32-bit integers into one 64-bit integer?","tags":["c","printf"],"question_text":"I have a count register, which is made up of two 32-bit unsigned integers, one for the higher 32 bits of the value (most significant word), and other for the lower 32 bits of the value (least significant word)....
{"title":"How does :g\/^$\/,\/.\/-j (reduce multiple blank lines to a single blank) work in vim?","tags":["regex","vim"],"question_text":"In the article,\nVim Regular Expressions\n, Oleg Raisky gives the following command to reduce multiple blank lines to a single blank:\n`:g\/^$\/,\/.\/-j`\nCan someone please describe...
{"title":"Converting between NSData and base64\u00c2\u00a0strings","tags":["ios","objective-c","nsstring","nsdata"],"question_text":"What is the easiest and fastest code to do a conversion between\n`NSData`\nand a base64 string? I've read a bunch of solutions at SO and mostly they involve in adding another class etc. I...
{"title":"Strike-through font in objective C","tags":["iphone","objective-c","uitableview","fonts"],"question_text":"How can I use\nstrike-through font\nin objective C??? More specifically in UITableViewCell\n`cell.textLabel.text = name;\ncell.detailTextLabel.text = quantity ;\ncell.XXX = ??`","answer_text":"this is Ma...
{"title":"convert month from name to number","tags":["php","time"],"question_text":"Is there an easy way to change\n`$month = \"July\";`\nso that\n`$nmonth = 7`\n(\n`07`\nwould be fine too).\nI could do a case statement, but surely there is already a function to convert?\nEDIT:\nI wish I could accept multiple answers, ...
{"title":"Parsec vs Yacc\/Bison\/Antlr: Why and when to use Parsec?","tags":["haskell","parsec"],"question_text":"I'm new to Haskell and Parsec. After reading\nChapter 16 Using Parsec of Real World Haskell\n, a question appeared in my mind: Why and when is Parsec better than other parser generators like Yacc\/Bison\/An...
{"title":"3 Digit currency code to currency symbol","tags":["c#",".net","sql-server-2008","currency"],"question_text":"In C# is it possible to get a currency symbol, like '\u00c2\u00a3', from the 3 character currency code, in this case 'GBP'?\nIs this possible either in SQL Server or in C#?","answer_text":"While a bit ...
{"title":".NET Unit Testing packages?","tags":["c#",".net","unit-testing","testing"],"question_text":"Getting back into a bit more .NET after a few-years of not using it full-time, and wondering what the good unit testing packages are these days.\nI'm familiar with NUnit (a few years ago), and have played briefly aroun...
{"title":"PushSharp APNS production: The credentials supplied to the package were not recognized (development works fine though)","tags":["ssl","apple-push-notifications","production-environment","pushsharp"],"question_text":"My app just got ready for sale on App Store, but none of my production devices (devices that h...
{"title":"Getting Ruby 1.8.7 installed on Mountain Lion (10.8)","tags":["ruby","rvm","osx-mountain-lion"],"question_text":"I'm having a lot of trouble getting Ruby 1.8.7 installed on my clean install of Mountain Lion. I've looked around on Stack Overflow and don't see anything that specifically addresses this issue and...
{"title":"Accessing Asp.net controls using jquery (all options)","tags":["javascript","c#","jquery","asp.net"],"question_text":"How to access asp.net control using jquery\n`<asp:TextBox runat=\"server\" ID=\"myTextBox\" \/>`\n`$('#myTextBox')`\nwouldn't work.","answer_text":"`<asp:TextBox runat=\"server\" ID=\"myTextBo...
{"title":"Efficiency: arrays vs pointers","tags":["c","arrays","pointers","performance","memory-access"],"question_text":"Memory access through pointers is said to be more efficient than memory access through an array. I am learning C and the above is stated in K&R. Specifically they say\nAny operation that can be achi...
{"title":"css h1 - only as wide as the text","tags":["css"],"question_text":"I have an H1 style for my site:\n`.centercol h1 {\n color: #006bb6;\n font-weight: normal;\n font-size: 18px;\n padding:3px 3px 3px 6px;\n border-left:3px solid #c6c1b8;\n background:#f2efe9;\n display:block;\n}`\nThe background color spans th...
{"title":"Find the max of 3 numbers in Java with different data types","tags":["java","math","max"],"question_text":"Say I have the following three constants:\n`final static int MY_INT1 = 25;\nfinal static int MY_INT2 = -10;\nfinal static double MY_DOUBLE1 = 15.5;`\nI want to take the three of them and use\n`Math.max()...
{"title":"Optional Parameters in Web Api Attribute Routing","tags":["c#","asp.net","asp.net-web-api","asp.net-web-api-routing"],"question_text":"I want to handle POST of the following API-Call:\n`\/v1\/location\/deviceid\/appid`\nAdditional Parameter are coming from the Post-Body.\nThis all works fine for me. Now I wna...
{"title":"API Documentation Theme or Template","tags":["api","doc"],"question_text":"I am looking for either a Wordpress theme, or just the raw CSS, Images, HTML of a great looking API Doc template to use. I am building a RESTFul API, and need to create documentation, and would like to ovoid writing our own API doc tem...
{"title":"Immutable.js relationships","tags":["javascript","reactjs","immutable.js"],"question_text":"Imagine a situation that John have two childrens Alice and Bob, and Bob have a cat Orion.\n`var Immutable = require('immutable');\nvar parent = Immutable.Map({name: 'John'});\nvar childrens = Immutable.List([\n Immutab...
{"title":"Is there a timeout for idle PostgreSQL connections?","tags":["postgresql","database-connection"],"question_text":"`1 S postgres 5038 876 0 80 0 - 11962 sk_wai 09:57 ? 00:00:00 postgres: postgres my_app ::1(45035) idle \n1 S postgres 9796 876 0 80 0 - 11964 sk_wai 11:01 ? 00:00:00 postgres: postgres my_app ::1...
{"title":"Golang: http server leaving open goroutines","tags":["http","go"],"question_text":"I've put up an http server written in Go and it's getting a little over a thousand visitors a day. I have an accumulating Goroutine problem now. Over the course of a day I seem to get a little over a thousand new Goroutines fro...
{"title":"How to programmatically make cocoa application active","tags":["objective-c","cocoa","osx","nsapplication"],"question_text":"I've got a background process that makes a transparent window appear when a hotkey is pressed:\n`[window makeKeyAndOrderFront:nil];\n[[content animator] setAlphaValue:1.0]; \/\/ alpha w...
{"title":"How to use all view and helper methods inside of Rails console for Rails 2.x and 3.x?","tags":["ruby-on-rails","ruby-on-rails-3"],"question_text":"`helper.method_name`\nworked in some version of Rails... are there ways that work in both Rails 2.2.2, 2.3.5, and 3.0.1? (to use all view and helper methods)","ans...
{"title":"Android emulator error: \"System UI has stopped\"","tags":["android","eclipse","android-emulator","adt"],"question_text":"I have recently set up my Android development environment. Every thing is alright but when I run my emulator it takes to much time with an error dialog on the emulator screen says- \"Unfor...
{"title":"How do you set autocommit in an SQL Server session?","tags":["sql-server","session","autocommit"],"question_text":"How do you set autocommit in an SQL Server session?","answer_text":"You can turn autocommit ON by setting implicit_transactions OFF:\n`SET IMPLICIT_TRANSACTIONS OFF`\nWhen the setting is ON, it r...
{"title":"How to access parent object from lambda functions?","tags":["php","class","function","lambda","closures"],"question_text":"I have a recursive lambda function in one of my objects, and it needs to access the object's mysqli connection. This attempt\n`$recfunc = function($id, $name) use($this) {`\nProduced an u...
{"title":"What does 'Acme' stand for in Symfony2?","tags":["php","symfony2"],"question_text":"The standard bundle in Symfony2 is 'Acme', but what does that stand for?","answer_text":"ACME is a fictional company from the Looney Tunes:\nhttp:\/\/en.wikipedia.org\/wiki\/Acme_Corporation\nIt's used as a\nplaceholder name\n...
{"title":"How Long Does it Take to Learn Java for a Complete Newbie?","tags":["java","java-me"],"question_text":"I have absolutely no programming experience but need to learn Java - enough to take a J2ME fasttrack course. I only have 10 weeks. Can I do this? What's your advice about the best resources I can use ?(curre...
{"title":"Callback to .delay()","tags":["jquery"],"question_text":"I have an\n`$image`\nthat I\n`.fadeIn`\nand\n`.fadeOut`\n, and then\n`.remove`\nafter\n`.fadeOut`\ncompletes. This is my code:\n`$image\n .fadeIn()\n .fadeOut(function() {\n $(this).remove();\n });`\nI want to add a\n`.delay`\nafter\n`.fadeOut`\n, and\n...
{"title":"Concurrent Modification exception","tags":["java","concurrentmodification"],"question_text":"I have this little piece of code and it gives me the concurrent modification exception. I cannot understand why I keep getting it, even though I do not see any concurrent modifications being carried out.\n`import java...
{"title":"iOS: Open Source VoIP\/SIP Objective-C Code","tags":["iphone","objective-c","open-source","voip","sip"],"question_text":"I have been tasked with investigating the feasibility of writing an iPhone App to access our internal VoIP\/SIP systems.\nI've never coded anything close to VoIP before. Are there any open ...
{"title":"Dropdownlist control with <optgroup>s for asp.net (webforms)?","tags":["asp.net","drop-down-menu","custom-server-controls","webforms"],"question_text":"Can anyone recommend a dropdownlist control for asp.net (3.5) that can render option groups? Thanks","answer_text":"I've used the standard control in the past...
{"title":"How do I make a HTML input box default text remove AFTER starting to type","tags":["html","input","inputbox"],"question_text":"Say I have an input box with default text \"name\" in it. I would like for the user to click the box, the text stays in the box until the user starts to type.\nI am\nnot\nlooking for ...
{"title":"Android: show\/hide a view using an animation","tags":["android","animation","android-layout","relativelayout","android-animation"],"question_text":"I've been looking through many google results \/ questions on here to determine how to show\/hide a view via a vertical animation, but I can't seem to find one t...
{"title":"What is the difference between css-selector & Xpath? which is better(according to performance & for cross browser testing)?","tags":["xpath","selenium-webdriver","css-selectors"],"question_text":"I am working with the Selenium WebDriver 2.25.0 on multilingual web application & mainly test the page content (Fo...
{"title":"curl: (60) SSL certificate : unable to get local issuer certificate","tags":["curl","ssl","openssl","ssl-certificate","x509certificate"],"question_text":"`root@sclrdev:\/home\/sclr\/certs\/FreshCerts# curl --ftp-ssl --verbose ftp:\/\/{abc}\/ -u trup:trup --cacert \/etc\/ssl\/certs\/ca-certificates.crt\n* Abou...
{"title":"What are the disadvantage(s) of using HTTP pipelining?","tags":["http","http-pipelining"],"question_text":"WWDC 2012 session 706 - Networking Best Practices\ntalks about something called\nHTTP Pipelining\n.\nIt looks great - I don't understand why you would ever want to turn it off. From my experiments,\n`HTT...
{"title":"Absolute URL from base + relative URL in C#","tags":["c#",".net","url","path"],"question_text":"I have a base URL :\n`http:\/\/my.server.com\/folder\/directory\/sample`\nAnd a relative one :\n`..\/..\/other\/path`\nHow to get the absolute URL from this ? It's pretty straighforward using string manipulation, b...
{"title":"How to parse a JSON and turn its values into an Array?","tags":["java","json"],"question_text":"`public static void parseProfilesJson(String the_json){\n try {\n JSONObject myjson = new JSONObject(the_json);\n JSONArray nameArray = myjson.names();\n JSONArray valArray = myjson.toJSONArray(nameArray);\n for(in...
{"title":"jQuery AJAX polling for JSON response, handling based on AJAX result or JSON content","tags":["javascript","jquery","ajax","json","polling"],"question_text":"I'm a novice-to-intermediate JavaScript\/jQuery programmer, so concrete\/executable examples would be very much appreciated.\nMy project requires using ...