text
stringlengths
74
309k
{"title":"Is there a table or catalog of aesthetics for ggplot2?","tags":["r","ggplot2"],"question_text":"I am new to ggplot2 and have been trying to find a comprehensive list of aesthetics. I think I understand their purpose but it is hard to know which can be used in various situations (mostly geoms?). Hadley's websi...
{"title":"MySQL\/Writing file error (Errcode 28)","tags":["mysql","logging"],"question_text":"I have the following error with one of our web applications -\n`Query3 failed: Error writing file '\/tmp\/MY1fnqpm' (Errcode: 28) ... INSERT MailList... (removed the rest of the query for security reasons)`\nAny ideas - is thi...
{"title":"Mockito: InvalidUseOfMatchersException","tags":["java","unit-testing","mockito"],"question_text":"I have a command line tool that performs a DNS check. If the DNS check succeeds, the command proceeds with further tasks. I am trying to write unit tests for this using Mockito. Here's my code:\n`public class Com...
{"title":"How do I get the key at a specific index from a Dictionary in Swift?","tags":["ios","dictionary","swift"],"question_text":"I have a\n`Dictionary`\nin Swift and I would like to get a key at a specific index.\n`var myDict : Dictionary<String,MyClass> = Dictionary<String,MyClass>()`\nI know that I can iterate ov...
{"title":"How to use Twitter Bootstrap popovers for jQuery validation notifications?","tags":["jquery","validation","twitter-bootstrap","popover"],"question_text":"I can make popovers appear using\nbootstrap\neasily enough, and I can also do validations using the standard\njQuery validation plugin\nor the\njQuery valid...
{"title":"Programming P2P application","tags":["c#",".net","sockets","networking","p2p"],"question_text":"I am writing a custom p2p program that runs on port 4900. In some cases when the person is behind a router, this port is not accessible from the internet.\nIs there an automatic way of enabling the access to the po...
{"title":"Applying ColorFilter to ImageView with ShapedDrawable","tags":["android","drawable","android-imageview","colorfilter","shapedrawable"],"question_text":"I have an\n`ImageView`\nwith\n`android:src`\nset to a\n`ShapedDrawable`\n, namely a white circle. What I want is to colorize this\n`ImageView`\nin runtime res...
{"title":"AngularJS - Passing data between pages","tags":["angularjs"],"question_text":"I am an AngularJS starter. I am trying to send data from :\nPage A : Van Listing page\nto\nPage B: Van Update page.\nWhen user click the update link for a van, I am invoking a controller and retrieving the van details in the control...
{"title":"Socket.IO handling disconnect event","tags":["javascript","socket.io","disconnect"],"question_text":"Cant handle this disconnect event, dont know why socket its not send to the client \/ client doesnt response!\nServer\n`io.sockets.on('connection', function (socket) {\n socket.on('NewPlayer', function(data1) ...
{"title":"Could not read from the device","tags":["ios","xcode"],"question_text":"I am trying to install new version of my application on the top of the last version through Xcode.\nWhenever i try to install it with the same provisional profile and details, i encountered with this problem.\nThis problem occurs after bu...
{"title":"Javascript Confirm popup Yes, No button instead of OK and Cancel","tags":["javascript","html","button","popup","confirm"],"question_text":"Javascript Confirm popup, I want to show Yes, No button instead of OK and Cancel.\nI have used this vbscript code:\n`<script language=\"javascript\">\n function window.con...
{"title":"What is the best way to get the executing exe's path in .NET?","tags":["c#",".net","filesystems"],"question_text":"From program a.exe located in c:\/dir I need to open text file c:\/dir\/text.txt. I don't know where a.exe could be located, but text.txt will always be in the same path. How to get the name of t...
{"title":"Why is there no xrange function in Python3?","tags":["python","python-3.x","pep","xrange"],"question_text":"Recently I started using Python3 and it's lack of xrange hurts.\nSimple example:\n1)\nPython2:\n`from time import time as t\ndef count():\n st = t()\n [x for x in xrange(10000000) if x%4 == 0]\n et = t(...
{"title":"How to specify a multi-line shell variable?","tags":["bash","shell"],"question_text":"I have written a query:\n`function print_ui_hosts\n{\nlocal sql = \"select .........\"\nprint_sql \"$ sql\"\n}`\nlocal sql - a very long string. Query is not formatted.\nHow can I split a string into multiple lines?","answer...
{"title":"mongoDB\/mongoose: unique if not null","tags":["mongodb","node.js","mongoose"],"question_text":"I was wondering if there is way to force a unique collection entry\nbut only if entry is not null\n.\ne\nSample schema:\n`var UsersSchema = new Schema({\n name : {type: String, trim: true, index: true, required: tr...
{"title":"Switching between Android Navigation Drawer image and Up caret when using fragments","tags":["android","android-fragments","android-actionbar","navigation-drawer"],"question_text":"When using the Navigation Drawer the Android devs are recommending that in the ActionBar \"only those screens that are represente...
{"title":"How to insert a Controller in Twig with \"render\" in Symfony 2.2?","tags":["symfony2","twig","symfony-2.2"],"question_text":"I'm upgrading my project from Symfony 2.0.22 to 2.2.0 and review somes changes, but i'm blocked on this :\nI would like to render (like in Sf 2.0.X) a header with their controller and ...
{"title":"Property getters and setters","tags":["swift","properties","compiler-warnings","getter-setter"],"question_text":"With this simple class I am getting the compiler warning \"Attempting to modify\/access 'x' within its own setter\/getter\" and when I use it like this:\n`var p:point = point()\np.x = 12`\nI get an...
{"title":"Why doesn't Haskell's Prelude.read return a Maybe?","tags":["parsing","haskell","types"],"question_text":"Is there a good reason why the type of Prelude.read is\n`read :: Read a => String -> a`\nrather than returning a\n`Maybe`\nvalue?\n`read :: Read a => String -> Maybe a`\nSince the string might fail to be ...
{"title":"How to prevent blank xmlns attributes in output from .NET's XmlDocument?","tags":["c#",".net","xml","xml-namespaces","xmldocument"],"question_text":"When generating XML from XmlDocument in .NET, a blank\n`xmlns`\nattribute appears the first time an element\nwithout\nan associated namespace is inserted; how ca...
{"title":"Associativity math: (a + b) + c != a + (b + c)","tags":["c#",".net","math","numeric"],"question_text":"Recently I was going through an\nold blog post by Eric Lippert\nin which, while writing about associativity he mentions that in C#,\n`(a + b) + c`\nis not equivalent to\n`a + (b + c)`\nfor certain values of ...
{"title":"Kotlin Ternary Conditional Operator","tags":["ternary-operator","kotlin"],"question_text":"What is the equivalent of this expression in Kotlin?\n`a ? b : c`\nThis is not valid code in Kotlin.","answer_text":"In Kotlin,\n`if`\nstatements are expressions. So the following code is equivalent:\n`if (a) b else c`"...
{"title":"Advantages \/ Disadvantages of pconnect option in CodeIgniter","tags":["php","database","performance","codeigniter"],"question_text":"One of the parameters in the CodeIgniter database config is the following\n`['pconnect'] TRUE\/FALSE - Whether to use a persistent connection`\nWhat do you recommend I set this...
{"title":"Where can I find my .emacs file for Emacs running on Windows?","tags":["windows","emacs","winapi","path","customization"],"question_text":"I tried looking for the .emacs file for my Windows install for Emacs but could not find it. Does it have the same filename under Windows as in Unix? Do I have to create it...
{"title":"Cannot connect to local SQL Server Express 2008 R2","tags":["sql-server","sql-server-express"],"question_text":"I just installed SQL Server Express 2008 R2 and I have a problem connecting to it using the SQL Server Management Studio (locally).\nAll SQL Server services are started (SQL Server (SQLEXPRESS), SQL...
{"title":"Fragment inner class should be static","tags":["android","fragment","android-dialogfragment"],"question_text":"I have a\n`FragmentActivity`\nclass with inner class that should display\n`Dialog`\n. But I am required to make it\n`static`\n. Eclipse offers me to suppress error with\n`@SuppressLint(\"ValidFragmen...
{"title":"How to retrieve field names from temporary table (SQL Server 2008)","tags":["sql","sql-server","sql-server-2008","temp-tables"],"question_text":"I'm using SQL Server 2008. Say I create a temporary table like this one:\n`create table #MyTempTable (col1 int,col2 varchar(10))`\nHow can I retrieve the list of fie...
{"title":"Combining JavaScript Objects into One","tags":["javascript","jquery"],"question_text":"I have a function called \"Colorbox\" (jQuery plugin) that takes a number of parameters like so:\n`$(this).colorbox({\n width : \"500px\",\n height : \"500px\"\n});`\nI have several different types of \"this\", though, each...
{"title":"Appending\/concatenating two IEnumerable sequences","tags":["ienumerable","unions"],"question_text":"I have two sets of datarows. They are each IEnumerable. I want to append\/concatenate these two lists into one list. I'm sure this is doable. I don't want to do a for loop and noticed that there is a Union met...
{"title":"Difference between style = \"position:absolute\" and style = \"position:relative\"","tags":["css","css-position"],"question_text":"Can any one tell me the Difference between\n`style = \"position:absolute\"`\nand\n`style = \"position:relative\"`\nand how they differ in case I add it to\n`div`\n\/\n`span`\n\/\n...
{"title":"In Rails, how to add a new method to String class?","tags":["ruby","ruby-on-rails-3","monkeypatching"],"question_text":"I want to build an index for different objects in my Rails project and would like to add a 'count_occurences' method that I can call on String objects.\nI saw I could do something like\n`cla...
{"title":"What does this square bracket and parenthesis bracket notation mean [first1,last1)?","tags":["mathematical-notation","interval-notation"],"question_text":"I have seen number ranges represented as\n`[first1,last1)`\nand\n`[first2,last2)`\n.\nI would like to know what such a notation means.","answer_text":"A br...
{"title":"Difference between logger.info and logger.debug","tags":["java","logging","log4j"],"question_text":"What is the difference between\n`logger.debug`\nand\n`logger.info`\n?\nWhen will\n`logger.debug`\nbe printed?","answer_text":"I suggest you look at the article called\n\"Short Introduction to log4j\"\n. It cont...
{"title":"Split array into chunks of N length","tags":["javascript","arrays"],"question_text":"How to split an array (which has 10 items) into 4 chunks, which contain a maximum of\n`n`\nitems.\n`var a = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'];\n\/\/a function splits it to four arrays.\nconsole.log(b, c, d, e...
{"title":"DatatypeContexts Deprecated in Latest GHC: Why?","tags":["haskell","deprecated","language-extension"],"question_text":"I was just doing some Haskell development and I recompiled some old code on a new version of GHC:\n`The Glorious Glasgow Haskell Compilation System, version 7.2.1`\nAnd when I did I received ...
{"title":"Where you can and cannot declare new variables in C?","tags":["c","declaration"],"question_text":"I heard (probably from a teacher) that one should declare all variables on top of the program\/function, and that declaring new ones among the statements could cause problems.\nBut then I was reading K&R and I ca...
{"title":"Differences between Java interfaces and Objective-C protocols?","tags":["java","objective-c"],"question_text":"I know Java, and now I'm learning Objective-C. What exactly are the differences between Java interfaces and Objective-C protocols?","answer_text":"First off, a little\nhistorical perspective on the t...
{"title":"How to use int.TryParse with nullable int?","tags":["c#"],"question_text":"I am trying to use TryParse to find if the string value is an integer. If the value is an integer then skip foreach loop. Here is my code.\n`string strValue = \"42 \"\n if (int.TryParse(trim(strValue) , intVal)) == false\n {\n break;\n...
{"title":"view content of apk file","tags":["android","apk"],"question_text":"Is there a way to extract and view the content of an .apk file?","answer_text":"Actually the apk file is just a zip archive, so you can try to rename the file to\n`theappname.apk.zip`\nand extract it with any zip utility (e.g. 7zip).\nThe\n`a...
{"title":"Putting <div> inside <p> is adding an extra <p>","tags":["html","html5"],"question_text":"From\nhttp:\/\/webdesign.about.com\/od\/htmltags\/p\/aadivtag.htm\nIn HTML 4, the DIV element cannot be inside another block-level element, like a P element.\n However, in HTML5 the DIV element can be found inside and ca...
{"title":"Service has zero application (non-infrastructure) endpoints","tags":[".net","wcf","exception-handling","wcf-configuration","wcf-endpoint"],"question_text":"I recently created a WCF service (dll) and a service host (exe). I know my WCF service is working correctly since I am able to successfully add the servic...
{"title":"How to allow copying message on MessageBox","tags":["c#",".net","wpf"],"question_text":"How can I allow selecting and copying of text from MessageBox in WPF?","answer_text":"If you don't need\nselecting text\nas a requirement, just use System.Windows.Forms.MessageBox. It maps to the system-default one which a...
{"title":"ffmpeg mp3 conversion failed","tags":["ffmpeg","mp3","flv"],"question_text":"using ffmpeg to convert from flv to mp3 gives the following result\n] ffmpeg-0.6.1 >> ffmpeg -i name.flv name.mp3\nFFmpeg version 0.6.1, Copyright (c) 2000-2010 the FFmpeg developers\nbuilt on Feb 14 2011 12:33:38 with gcc 4.1.2 2008...
{"title":"Jquery .animate() stop scrolling when user scrolls manually?","tags":["javascript","jquery","css"],"question_text":"I have set up a snippet that scrolls a page section into view when it's clicked, the problem is that if the user wants to scroll in the middle of the animation the scroll kinda stutters.\n`$( \"...
{"title":"How to establish a connection pool in JDBC?","tags":["java","jdbc","connection-pooling"],"question_text":"Can anybody provide examples or links on how to establish a JDBC connection pool?\nFrom searching google I see many different ways of doing this and it is rather confusing.\nUltimately I need the code to ...
{"title":"Naming my application in android","tags":["android","android-manifest"],"question_text":"I think I'm getting senile because I was convinced that to give a name to your application, you had to fill this part of the manifest:\n`<application android:icon=\"@drawable\/icon\" android:label=\"MyApplicationName\">`\...
{"title":"When do I define objective-c methods?","tags":["objective-c","declaration","definition","api-design"],"question_text":"I'm learning Objective-C, and have a C\/C++ background.\nIn object-oriented C++, you always need to declare your method before you define (implement) it, even if it is declared in the parent ...
{"title":"Is onload equal to readyState==4 in XMLHttpRequest?","tags":["javascript","ajax","xmlhttprequest"],"question_text":"I am confuse about the xhr return event, as I can tell, there are not so much different between\nonreadystatechange --> readyState == 4\nand onload, is it true?\n`var xhr = new XMLHttpRequest();...
{"title":"Automatically deleting related rows in Laravel (Eloquent ORM)","tags":["php","laravel"],"question_text":"When I delete a row using this syntax:\n`$user->delete();`\nIs there a way to attach a callback of sorts, so that it would e.g. do this automatically:\n`$this->photo()->delete();`\nPreferably inside the mo...
{"title":"Obtain user's home directory","tags":["go"],"question_text":"Is the following the best way of obtaining the running user's home directory? Or is there a specific function that I've ovelooked?\n`os.Getenv(\"HOME\")`\nIf the above is correct, does anyone happen to know whether this approach is guaranteed to wor...
{"title":"Get last record in a queryset","tags":["django","django-queryset"],"question_text":"How can I retrieve the last record in a certain queryset?","answer_text":"Django Doc\n:\n`latest(field_name=None)`\nreturns the latest object in the table, by date, using the field_name provided as the date field.\nThis exampl...
{"title":"Generating a single Entity from existing database using symfony2 and doctrine","tags":["php","database","symfony2","doctrine"],"question_text":"Is it possible to generate a single entity from database using the Symfony2 console tool?\nIn the middle of coding I had to add a table and there are modifications ma...
{"title":"Why does `free` in C not take the number of bytes to be freed?","tags":["c","memory-management","malloc","free"],"question_text":"Just to be clear: I do know that\n`malloc`\nand\n`free`\nare implemented in the C library, which usually allocates chunks of memory from the OS and does its own management to parce...
{"title":"How to put GridView inside ScrollView","tags":["android","gridview","scrollview"],"question_text":"I have to design layout such that whole layout should scroll and inside layout I have to display related content in\n`Grid`\nform so I decided to use\n`GridView`\n.But problem is that I\u00e2\u0080\u0099m unable...
{"title":"How to pass an event object to a function in Javascript?","tags":["javascript","javascript-events"],"question_text":"`<button type=\"button\" value=\"click me\" onclick=\"check_me();\" \/>\nfunction check_me() {\n \/\/event.preventDefault();\n var hello = document.myForm.username.value;\n var err = '';\n if(h...
{"title":"std::thread calling method of class","tags":["c++","multithreading","c++11"],"question_text":"Possible Duplicate:\nStart thread with member function\nI have a small class:\n`class Test\n{\npublic:\n void runMultiThread();\nprivate:\n int calculate(int from, int to);\n}`\nHow its possible to run method\n`calcu...
{"title":"What does \"wrong number of arguments (1 for 0)\" mean in Ruby?","tags":["ruby"],"question_text":"What does \"Argument Error: wrong number of arguments (1 for 0)\" mean?","answer_text":"When you define a function, you also define what info (arguments) that function needs to work. If it is designed to work wit...
{"title":"Make some options in a select menu \"unselectable\"","tags":["html","html-select"],"question_text":"I have a\n`select`\nelement with a few options, but I want some of the options to not be selectable.\nBasically it's like this:\n`<select>\n <option> CITY 1 <\/option>\n <option> City 1 branch A <\/option>\n <o...
{"title":"Setting up PHPUnit on OSX","tags":["installation","osx-snow-leopard","phpunit","pear"],"question_text":"Though I'm sure others have eventually managed to figure this out, I've been following the various documentation out there and have been having a heck of a rough time of it.\nhttp:\/\/www.phpunit.de\/manual...
{"title":"How can I override inline styles with external CSS?","tags":["css"],"question_text":"I have markup that uses inline styles, but I don't have access to change this markup. How do I override inline styles in a document using only CSS? I don't want to use jQuery or JavaScript.\nHTML:\n`<div style=\"font-size: 18...
{"title":"Why does 00.0 cause a syntax error?","tags":["javascript","numbers","syntax-error"],"question_text":"This is weird. This is what happens at the JavaScript console in Chrome (version 42.0.2311.135, 64-bit).\n`> 0\n< 0\n> 00\n< 0\n> 0.0\n< 0\n> 00.0\nX Uncaught > SyntaxError: Unexpected number`\nFirefox 37.0.2 ...
{"title":"HTML Drag And Drop On Mobile Devices","tags":["javascript","html","jquery-ui","mobile-devices"],"question_text":"When you add drag and drop to a web page using JavaScript, such as jQuery UI draggable and droppable, how do you get this to work when viewed via a browser on a mobile device - where the touch-scre...
{"title":"Handling the window closing event with WPF \/ MVVM Light Toolkit","tags":["c#","wpf","mvvm","mvvm-light"],"question_text":"I'd like to handle the \"Closing\" event (when a user clicks the upper right 'X' button) of my window in order to eventually display a confirm message or\/and cancel the closing.\nI know ...
{"title":"Remove an attribute from a Backbone.js model","tags":["javascript","backbone.js"],"question_text":"Is there a way to remove an attribute from a\nBackbone\nmodel?\nReason being is I pass up extra data on save to perform certain actions, but then that data gets automatically added to my model\nThe documentation...
{"title":"How do I disable a UIButton?","tags":["ios","objective-c","cocoa-touch","uibutton"],"question_text":"I am working on a project in which I have to show all photos of Photo Library in a plist and show them horizontally on\n`UIButton`\ns.\nMy app will also have an edit button: when the user clicks this button, a...
{"title":"Asynchronous downloading of images for UITableView with GCD","tags":["ios","objective-c","ios6"],"question_text":"I'm downloading images for my uitableview asynchronously using GCD, but there is a problem - when scrolling images flicker and change all the time. I tried setting image to nil with every cell, bu...
{"title":"Warning! PATH is not properly set up, usually this is caused by shell initialization files","tags":["ruby","rvm"],"question_text":"Whenever I go to a folder with a\n`.rvmrc`\nfile, there is a warning:\n`Warning! PATH is not properly set up, '\/home\/me\/.rvm\/gems\/ruby-2.0.0-p247\/bin' is not available,\n us...
{"title":"How do I pop two views at once from a navigation controller?","tags":["iphone","ios","uinavigationcontroller","pop"],"question_text":"I want to pop to the third view on the navigation stack back to the first view.\nI know how to pop one view at once:\n`[self.navigationController popViewControllerAnimated:YES]...
{"title":"Short cut for close HTML tag in Sublime Text 2","tags":["html","sublimetext2"],"question_text":"Is there a shortcut to close the HTML tag you've just opened in sublime text 2?","answer_text":"I just found out pressing\nFor Mac:\nAlt\n+\nCommand\n+\n.\nFor PC:\nAlt\n+\n.\nFor Linux:\nAlt\n+\n.\nwill finish the...
{"title":"How to add a view behind other view in iOS","tags":["iphone","ios","view","core-animation"],"question_text":"I want to add a view under my tab bar analog in iOS and then show it with animation coming from behind it. But when I use my code, the view that must come from behind my tab bar overlaps my tab bar for...
{"title":"What is the difference between parent.frame() and parent.env() in R; how do they differ in call by reference?","tags":["r","environment","function-call","stackframe"],"question_text":"It would be helpful if someone can illustrate this with a simple example?\nAlso, where would it be useful to use\n`parent.fram...
{"title":"NOTICES for sequence after running migration in rails on postgresql Application","tags":["ruby-on-rails","ruby","postgresql","database-migration"],"question_text":"When i run my migration in Rails application on postgresql i got following NOTICES\n`NOTICE: CREATE TABLE will create implicit sequence \"notifica...
{"title":"Split string containing command-line parameters into string[] in C#","tags":["c#","command-line","text-parsing"],"question_text":"I have a single string that contains the command-line parameters to be passed to another executable and I need to extract the string[] containing the individual parameters in the s...
{"title":"how to countdown to a date","tags":["javascript"],"question_text":"I am wondering if anyone can help me. After hours of searching tirelessly on here and the web I can't seem to find a simple countdown using jquery. I don't want to use any sort of plugin just a simple jquery code to countdown from a date. I ha...
{"title":"What does \u00e2\u0080\u0098::\u00e2\u0080\u0099 (double colon) do in javascript?","tags":["javascript","syntax"],"question_text":"The documentation of some JavaScript API shows the following snippets as example how to invoke some function:\n`<button type=\"button\" onClick=\"foo.DoIt(72930)\">Click<\/button>...
{"title":"Pad with leading zeros","tags":["c#"],"question_text":"How can i pad my integer variable with leading zeros.\nlike i have an integer abc with value 20 but i want it to be '0000020'.\nCode:\n`quarterlyReportDataCMMS.QRTrailerRecord.FileRecordCount = Convert.ToInt32(refEligibleClaimants.Count);`","answer_text":...
{"title":"CSS word-wrapping in div","tags":["css","html","word-wrap"],"question_text":"I have a div with a width of 250px. When the innertext is wider than that i want it to break down. The div is float: left and now has an overflow. I want the scrollbar to go away by using word-wrapping. How can i achieve this?\n`<div...
{"title":"How do I replace a character in a string in Java?","tags":["java","replace"],"question_text":"Using Java, I want to go through the lines of a text and replace all ampersand symbols (\n`&`\n) with the XML entity reference\n`&amp;`\n.\nI scan the lines of the text and then each word in the text with the Scanner...
{"title":"Scala: Elegant conversion of a string into a boolean","tags":["scala"],"question_text":"In Java you can write\n`Boolean.valueOf(myString)`\n. However in Scala,\n`java.lang.Boolean`\nis hidden by\n`scala.Boolean`\nwhich lacks this function. It's easy enough to switch to using the original Java version of a boo...
{"title":"AutoLayout: removeFromSuperview \/ removeConstraints throws exception and crashes hard","tags":["ios","automatic-ref-counting","autolayout"],"question_text":"We use auto layout constraints selectively, primarily to position labels in relation to editable field elements (UITextView, UITextField, typically). Ho...
{"title":"Sublime Text 2 : colour of edited file tab?","tags":["sublimetext","sublimetext2"],"question_text":"I see that the Sublime Text theme (.config\/sublime-text-2\/Packages\/Theme - Default\/Default.sublime-theme) can be edited to make the open tab more obvious.\nFor that I use\n`{\n \"class\": \"tab_control\", \...
{"title":"How do I disable C# 6 Support in Visual Studio 2015?","tags":["c#","visual-studio","c#-5.0","visual-studio-2015","c#-6.0"],"question_text":"Background\nWe have a project that we're developing in VS 2015 with C#6 enabled that occasionally needs to be opened by developers using VS 2013 without C#6.\nWe have no ...
{"title":"JavaScript SPA-Frameworks (Single Page Application)","tags":["javascript","singlepage"],"question_text":"my goal is to migrate an existing web application to a RESTful\nSPA (single page application)\n.\nCurrently I'm evaluating several javascript web application frameworks.\nMy requirements are as follow:\nRE...
{"title":"Generate random 5 characters string","tags":["php","random"],"question_text":"I want to create exact 5 random characters string with least possibility of getting duplicated. What would be the best way to do it? Thanks.","answer_text":"`$rand = substr(md5(microtime()),rand(0,26),5);`\nWould be my best guess--U...
{"title":"What is the maximum length of a String in PHP?","tags":["php"],"question_text":"So how big can a\n`$variable`\nin PHP get? I've tried to test this, but I'm not sure that I have enough system memory (~2gb). I figure there has to be some kind of limit. What happens when a string gets too large? Is it concatenat...
{"title":".NET DateTime to SqlDateTime Conversion","tags":["c#",".net","datetime","sqldatetime"],"question_text":"While converting .NET DateTime (when is default(DateTime)) to SqlDateTime should I always check if the .NET date is between SqlDateTime.MinValue and SqlDateTime.MaxValue [or] Is there a good way to do this....
{"title":"Differences between IQueryable, List, IEnumerator?","tags":["c#","linq","list","ienumerable","iqueryable"],"question_text":"I am wondering what the different is between IQueryable, List, IEnumerator and when I should using each one?\nFor instance when using linq to sql I would do something like this\n`public ...
{"title":"In-app Purchase \"ready to submit\", but won't let me submit it","tags":["iphone","in-app-purchase","itunesconnect"],"question_text":"I have some in-app purchases setup for an application. The in-app purchases are all tested, and working great - however I can't submit them for review. I submitted the applicat...
{"title":"Get current URL from IFRAME","tags":["javascript","url","iframe"],"question_text":"Is there a simple way to get the current URL from an iframe?\nThe viewer would going through multiple sites. \nI'm guessing I would be using something in javascript.","answer_text":"For security reasons, you can only get the ur...
{"title":"MXMLC and 64bit JRE","tags":["flash","64bit","java","mxmlc"],"question_text":"Are there any workarounds to get the Flex compiler to work with a 64bit JRE? If I use an MXMLC task in an Ant buildfile in Eclipse it works fine but if I try to use MXMLC from the command line (or try the Run... command from FDT in ...
{"title":"iif equivalent in c#","tags":["c#",".net","ternary-operator","iif-function"],"question_text":"Is there a\n`IIf`\nequivalent in\n`C#`\n? Or similar shortcut?","answer_text":"C# has the \"?\" ternary operator, like other C-style languages. However, this is not perfectly equivalent to iif. There are two importan...
{"title":"python circular imports once again (aka what's wrong with this design)","tags":["python","design","dependencies","class-design","python-import"],"question_text":"Let's consider python (3.x) scripts:\nmain.py:\n`from test.team import team\nfrom test.user import user\nif __name__ == '__main__':\n u = user()\n t...
{"title":"differences among grep, awk and sed","tags":["linux","bash","sed","awk","grep"],"question_text":"Possible Duplicate:\nWhat are the differences between Perl, Python, AWK and sed?\nWhat is the difference between sed and awk?\nMaybe not a very specific question, but I am confusing aboutthe differences among grep...
{"title":"Namespace or Assembly?","tags":["c#",".net","namespaces","assemblies"],"question_text":"I am getting very confused between Namespaces and Assemblies. Are\n`System.Data`\nand\n`System.Web`\nNamespaces or Assemblies?\nI have noticed these are called namespaces and at the same time they are present in\n`GAC_32`\...
{"title":"css display table cell requires percentage width","tags":["html","css","css-tables"],"question_text":"I've been put in a position where I need to use the display:table-cell command for div elements.\nHowever I've discovered that the \"cells\" will only work correctly if a percentage is added to the width.\nIn...
{"title":"How can I set CG_CONTEXT_SHOW_BACKTRACE environmental variable?","tags":["ios","xcode","swift","core-graphics"],"question_text":"I have three buttons in my view. After setting the cornerRadus in the viewDidLoad() :\n`button.layer.cornerRadius = 20`\nI get the following error message in the log:\n`<Error>: CGC...
{"title":"resetting a stringstream","tags":["c++","string","stringstream"],"question_text":"How do I \"reset\" the state of a stringstream to what it was when I created it?\n`int firstValue = 1;\nint secondValue = 2;\nstd::wstringstream ss;\nss << \"Hello: \" << firstValue;\nstd::wstring firstText(ss.str());\n\/\/print...
{"title":"What is the right way to populate a DropDownList from a database?","tags":["c#","asp.net","sql-server-2008"],"question_text":"I am populating a DropDownList from a SQL Server database as shown below. It works fine, but I'm not sure it's a good way. Can someone shed some light on this method, and give some imp...
{"title":"Convert between string, u16string & u32string","tags":["c++","string","unicode","c++11","unicode-string"],"question_text":"I've been looking for a way to convert between the Unicode string types and came across\nthis method\n. Not only do I not completely understand the method (there are no comments) but also...
{"title":"How does TransactionScope roll back transactions?","tags":["c#",".net","nhibernate","transactions","transactionscope"],"question_text":"I'm writing an integration test where I will be inserting a number of objects into a database and then checking to make sure whether my method retrieves those objects.\nMy co...