text
stringlengths
74
309k
{"title":"Will an inner transaction scope roll back if the outer transaction scope dosen't complete?","tags":["c#","transactionscope"],"question_text":"I have two transaction scopes, one within another. I would love to know if the inner transaction scope will be rolled back after it has been committed and the outer one...
{"title":"SQL Server - Change a Nullable column to NOT NULL with Default Value","tags":["sql","sql-server","alter-table","alter-column"],"question_text":"I came across an old table today with a datetime column called 'Created' which allows nulls. Now, I'd want to change this so that it is NOT NULL, and also include a c...
{"title":"Why ArrayList giving unordered output?","tags":["java","loops"],"question_text":"I have written java program, to add integer in ArrayList and remove that integer from ArrayList . but it not giving me proper result. here is my code..\n`public static void main(String args[])\n {\n ArrayList<Integer> a=new Array...
{"title":"can we check push notification in simulator?","tags":["iphone","ios-simulator","apple-push-notifications"],"question_text":"Possible Duplicate:\nHow can I test Apple Push Notification Service without an iPhone?\nI want to know that can we receive push notification on simulator or not.also i want something lik...
{"title":"How to override equals method in java","tags":["java","equals"],"question_text":"I am trying to override equals method in java. I have a class People which basically has 2 data fields name and age. Now I want to override equals method so that I can check between 2 People objects.\nMy code is as follows\n`publ...
{"title":"csv to excel conversion","tags":["php","linux","apache","command-line"],"question_text":"Is there a way to convert csv file to excel file upon request through apache\/.htaccess","answer_text":"Using\nPHPExcel\n`include 'PHPExcel\/IOFactory.php';\n$objReader = PHPExcel_IOFactory::createReader('CSV');\n\/\/ If ...
{"title":"C++ keypress: getch, cin.get?","tags":["c++","keypress"],"question_text":"I have a Win32 program that runs on a loop. I would like to be able to pause that program while awaiting a keypress. It doesn't matter whether I use 'any key' or a specific key, but I need to have the program freeze until I press someth...
{"title":"Populating a ComboBox using C#","tags":["c#",".net","winforms","combobox"],"question_text":"I would like to populate a combobox with the following:\nVisible item \/ Item Value\n`English \/ En\nItalian \/ It\nSpainish \/ Sp \netc....`\nAny help please?\nAlso it is possible that after populating the Combobox, t...
{"title":"fillAfter and fillEnabled not working in Android view animation XML","tags":["android","animation"],"question_text":"I'm curious as to this behavior ... I'm currently setting the two values in the anim XML:\n`android:fillEnabled=\"true\"\n android:fillAfter=\"true\"`\nHowever, the transformation does not appl...
{"title":"Android and getting a view with id cast as a string","tags":["java","android","layout"],"question_text":"In the Java code of an Android project if you want the reference for a view resource you can do something like:\n`View addButton = findViewById(R.id.button_0);`\nIn the above R.id.button_0 is not a String....
{"title":"Clojure performance really bad on simple loop versus Java","tags":["java","performance","math","clojure"],"question_text":"Spoiler alert, this is problem 5 of Project Euler.\nI am attempting to learn Clojure and solved problem 5, but it is a couple orders of magnitude slower (1515 ms in Java versus 169932 ms ...
{"title":"CakePHP ACL Database Setup: ARO \/ ACO structure?","tags":["php","cakephp","permissions","acl","security-roles"],"question_text":"I'm struggling to implement ACL in CakePHP. After reading the documentation in the\ncake manual\nas well as several other tutorials, blog posts etc, I found Aran Johnson's excellen...
{"title":"Java: Enum parameter in method","tags":["java","parameters","methods","enums"],"question_text":"I have a method lets say:\n`private static String drawCellValue(\n int maxCellLength, String cellValue, String align) { }`\nand as you can notice, I have a parameter called align. Inside this method I'm going to ha...
{"title":"Get URL Path in PHP","tags":["php","url"],"question_text":"I have a quick question in php.\nI need to get the current page url, and then find the path. For example, if the current url is:\n`\"http:\/\/www.example.com\/example\/test\/hi.php?randomvariable=1\"`\nI would want this:\n`\"\/example\/test\/hi.php?ra...
{"title":"Is there a better way to switch between HTML and JSON output in Pyramid?","tags":["python","api","pylons","pyramid"],"question_text":"`# \/test{.format} no longer seems to work...\nconfig.add_route('test', '\/test.{ext}', view='ms.views.test')`\nviews.py:\n`from pyramid.response import Response\nfrom pyramid....
{"title":"How do I generate a hashcode from a byte array in C#?","tags":["c#","hash"],"question_text":"Say I have an object that stores a byte array and I want to be able to efficiently generate a hashcode for it. I've used the cryptographic hash functions for this in the past because they are easy to implement, but th...
{"title":"Find Java classes implementing an interface","tags":["java","interface"],"question_text":"Some time ago, I came across a piece of code, that used some piece of standard Java functionality to locate the classes that implemented a given interface. I know the functions were hidden in some non-logical place, but ...
{"title":"Open source alternatives to Pusher","tags":["websocket","open-source","pusher"],"question_text":"Are there any open source alternatives to Pusher.com? I love the ease of use and the fallback to flash, but I'm put off by the monthly membership costs. I don't mind hosting my own open source alternative. Any hel...
{"title":"When a method has too many parameters?","tags":["language-agnostic","ide","parameters"],"question_text":"When debugging some web-service client code today (in Java, with jax-ws) I ran across a web-service method with the mind-blowing amount of 97 parameters!\nI had to create a test case that calls this method...
{"title":"Android setError(\"error\") not working in Textview","tags":["android","error-handling","popup","textview"],"question_text":"We can set error in Edittext successfully but failed to set in textview. is there any problem??\ni tried\n`((TextView) findViewById(R.id.df)).requestFocus();\n((TextView) findViewById(R...
{"title":"How do task killers work?","tags":["android","task","kill-process"],"question_text":"The usefullness of\n`task killer`\napps is debated, but I'm wondering: how do they actually work? How is it possible to kill particular process?\nIs there an API for this, and if so what does it actually\ndo\n?\nEDIT\nWorth a...
{"title":"Converting string series to float list in python","tags":["python"],"question_text":"I am quite new to programing so I hope this question is simple enough.\nI need to know how to convert a string input of numbers separated by spaces on a single line:\n`5.2 5.6 5.3`\nand convert this to a float list\n`lsit = [...
{"title":"MFMailComposeViewController bar background color not changing in iOS7","tags":["ios","objective-c","ipad","ios7"],"question_text":"I'm trying to\nchange the background color\nof the\n`MFMailComposeViewController`\nin\niOS7\nbut I cannot make it work.\nI'm using the following snipped:\n`MFMailComposeViewContro...
{"title":"Android: Activity getting Destroyed after calling Camera Intent","tags":["android","android-activity","android-camera-intent"],"question_text":"I am having two Activities (A1 , A2). A1 calls A2 and from A2 i am calling the camera intent as below\n`launchIntent = new Intent(android.provider.MediaStore.ACTION_I...
{"title":"Unit Testing - Is it bad form to have unit test calling other unit tests","tags":["c#","visual-studio","unit-testing"],"question_text":"I have a unit test called\n`TestMakeAValidCall()`\n. It tests my phone app making a valid call.\nI am about to write another test called\n`TestShowCallMessage()`\nthat needs ...
{"title":"How to avoid scientific notation for large numbers in JavaScript?","tags":["javascript"],"question_text":"JavaScript converts a large INT to scientific notation when the number becomes large. How can I prevent this from happening?","answer_text":"There's\nNumber.toFixed\n, but it uses scientific notation if t...
{"title":"how to change the style of alert box","tags":["javascript","css"],"question_text":"I need to change the style of the \"OK\" Button in an alert box.\n`<head>\r\n <script type=\"text\/javascript\">\r\n function show_alert() {\r\n alert(\"Hello! I am an alert box!\");\r\n }\r\n <\/script>\r\n<\/head>\r\n<body>\r...
{"title":"Moment.js Check a date is today","tags":["javascript","date","momentjs"],"question_text":"How do I check a date is actually today (the same date) rather than the difference between hours in a day?\nI have three timestamps as examples, one is today (22\/07\/14) and the other two are yesterday (21\/07\/14)\n`14...
{"title":"GAS: Explanation of .cfi_def_cfa_offset","tags":["assembly","callstack","gas","dwarf"],"question_text":"I would like an explanation for the values used with the .cfi_def_cfa_offset directives in assembly generated by GCC. I know vaguely that the .cfi directives are involved in call frames and stack unwinding,...
{"title":"Error running basic tensorflow example","tags":["python","tensorflow"],"question_text":"I have just reinstalled latest tensorflow on ubuntu:\n`$ sudo pip install --upgrade https:\/\/storage.googleapis.com\/tensorflow\/linux\/cpu\/tensorflow-0.7.1-cp27-none-linux_x86_64.whl\n[sudo] password for ubuntu: \nThe d...
{"title":"Many to Many Relationships not saving","tags":["entity-framework","many-to-many"],"question_text":"I have two entities with a fairly standard Many to Many relationship that I created in EF 5 Code First. These are Service and ServiceItem. The Service entity contains a collection of ServiceItems and the Service...
{"title":"How do I define a compile-time *only* classpath in Gradle?","tags":["compilation","classpath","gradle"],"question_text":"Can someone please give me a simple build.gradle example of how I can specify compile-time-only classes that are not included in the runtime deployment (war).\nGradle seems to have gotten t...
{"title":"iPhone icon size","tags":["iphone","xcode","icons"],"question_text":"I am developing an application for iPhone to support multiple devices, iPhone 2-4. I had an issue with the app icon as it was shown pixelated in the iPhone 4\nsimulator\nso I have used a new image with higher resolution (300 x 300) to be pre...
{"title":"Best way to stream files in ASP.NET","tags":["asp.net","flash","streaming","video-streaming"],"question_text":"What's the best way to stream files using ASP.NET?\nThere appear to be various methods for this, and I'm currently using the\nResponse.TransmitFile()\nmethod inside an http handler, which sends the f...
{"title":"Letter spacing in iOS","tags":["ios","objective-c","uilabel","uifont"],"question_text":"I have the following code:\n`[[cancelButton titleLabel] setFont:[UIFont fontWithName:@\"ProximaNova-Regular\" size:15]];`\nHow would I set the letter-spacing as well?","answer_text":"You can't change the letter spacing in ...
{"title":"Why isn't a final variable always a constant expression?","tags":["java","expression","constants","compile-time-constant","narrowing"],"question_text":"In the below code:\n`final int a;\na=2;\nbyte b=a; \/\/ error: possible loss of precision`\nWhy do I get this error? Isn't\n`a`\nfinal variable compile time c...
{"title":"NSFetchedResultsController: changing predicate not working?","tags":["iphone","uitableview","core-data","nspredicate","nsfetchedresultscontrolle"],"question_text":"I'm writing an app with two tables on one screen. The left table is a list of folders and the right table shows a list of files. When tapped on a ...
{"title":"server-side browser detection? node.js","tags":["javascript","browser","node.js","browser-detection"],"question_text":"Most implementations i've seen are for browser detection on the client side. I was just wondering if it was possible to do browser detection before sending any resources to the client.\nThank...
{"title":"Is there a way to draw colored text using the UIKit addition for NSString on the iPhone?","tags":["iphone","objective-c"],"question_text":"Is there a way to draw colored text using the UIKit addition for NSString on the iPhone?","answer_text":"Brad's solution adds quite a bit of code if you do not have a cont...
{"title":"Subclipse conflict resolution","tags":["eclipse","svn","version-control","subclipse"],"question_text":"Me and my friend using flex builder (eclipse based) with subclipse for a project.\nBefore committing I always update but sometimes I could not commit because of conflicts. Then I use Team->Synchronize with R...
{"title":"Getting coordinates of marker in Google Maps API","tags":["google-maps"],"question_text":"I'm using Google Maps API. And I'm using the code below to get the coordinates of the marker.\n`var lat = homeMarker.getPosition().$a;\nvar lng = homeMarker.getPosition().ab;`\nEverything is working fine with the app tha...
{"title":"Draggables and Resizables in SVG","tags":["javascript","svg","raphael"],"question_text":"I want to make an svg element (path, rect, or circle) be able to be draggable and give it resize handles.\nBut unlike HTML DOM, not all elements have an upper left hand corner x,y coordinate and a width and height for a b...
{"title":"Aspect Oriented Programming in C#","tags":["c#",".net","aop"],"question_text":"Are there any good resources to wrap my head around Aspect Oriented Programming?\nPS: I need to understand AO programming, not the libraries or frameworks available for .NET or C# :)","answer_text":"Just to get your head around it:...
{"title":"whoami in python","tags":["python","posix"],"question_text":"What is the best way to find out the user that a python process is running under?\nI could do this:\n`name = os.popen('whoami').read()`\nBut that has to start a whole new process.\n`os.environ[\"USER\"]`\nworks sometimes, but sometimes that environm...
{"title":"Can you change templateUrl on the fly?","tags":["angularjs","angularjs-directive"],"question_text":"Is it possible to change templateUrl on the fly by passing values in the directive's scope?\nI want to pass data to controller that will render the page based on the data that passed from the directive\nsomethi...
{"title":"When I `throw` something, where is it stored in memory?","tags":["c++","exception","exception-handling"],"question_text":"I understand that when something is\n`throw`\nn, the stack is 'unwound' to the point where it is caught, and the destructors of class instances on the stack in each function context are ru...
{"title":"Styling JQuery UI Autocomplete","tags":["javascript","jquery","css","jquery-ui","jquery-ui-autocomplete"],"question_text":"Fiddle\nI'm trying to style the sections inside the AutoComplete, but I don't know what to put in the CSS\nfor\nthe sections. I'm specifically trying to make:\n`color: #96f226;\nborder-ra...
{"title":"What is the rule for parenthesis in Scala method invocation?","tags":["scala"],"question_text":"Isn't toList a method that converts something into a List?\nIf yes so why can't I use parenthesis with it? I must be missing something more fundamental here.\nHere is the example:\n`val l = Array(1,2,3).toList \/\/...
{"title":"NLog performance","tags":["c#","nlog"],"question_text":"What should the expected overhead be for logging?\nI have tried this example\n`private class Person\n {\n private static Logger logger = LogManager.GetCurrentClassLogger();\n public string Name { get; private set; }\n public Person(string name)\n {\n Nam...
{"title":"Enabling broker after Restoring Sql Server DataBase","tags":["sql-server","sql-server-2008","database-restore","service-broker"],"question_text":"I have DataBase with enabled Service Broker. Then I want to restore my database in program from backup of other database, but after restoring(I restore on existing ...
{"title":"Using scandir() to find folders in a directory (PHP)","tags":["php","directory"],"question_text":"I am using this peice of code:\n`$target = 'extracted\/' . $name[0]; \n$scan = scandir($target);`\nTo scan the directory of a folder which is used for zip uploads. I want to be able to find all the folders inside...
{"title":"== or .Equals()","tags":["c#"],"question_text":"Why use one over the other?","answer_text":"== is the identity test. It will return true if the two objects being tested are in fact the same object.\n`Equals()`\nperforms an equality test, and will return true if the two objects consider themselves equal.\nIden...
{"title":"How to prevent vim from creating (and leaving) temporary files?","tags":["vim","text-editor","temporary-files"],"question_text":"Why does vim create\n`<filename>~`\nfiles? Is there a way to disable that?\nIf it's for backup (or something), I use git for that.\nAlso, these\n`.<filename.with.path.hints>.swp`\nf...
{"title":"How do you use object initializers for a list of key value pairs?","tags":["c#"],"question_text":"I can't figure out the syntax to do inline collection initialization for:\n`var a = new List<KeyValuePair<string, string>>();`","answer_text":"Note that the dictionary collection initialization\n`{ { key1, value1...
{"title":"Android Intent.getStringExtra() returns null","tags":["android","string","android-intent",null,"extras"],"question_text":"This is how strings are being added to Extras:\n`Intent i = new Intent();\ni.putExtra(\"Name\", edt_name.getText());\ni.putExtra(\"Description\", edt_desc.getText());\ni.putExtra(\"Priorit...
{"title":"JSDoc with AngularJS","tags":["angularjs","jsdoc","jsdoc3"],"question_text":"Currently within my Project we are using JSDoc, we have recently started to implement Angular and I want to continue using JSDoc to ensure that all the documentation is within the same place.\nI have taken a look at people mainly jus...
{"title":"Isotope relayout method error, no such a method","tags":["javascript","html"],"question_text":"Sorry if i am not the first, but is the isotope relayout method works? Did they change it or I am doing something wrong?\nI have a container with images. At some moment I need to replace images with new images and I...
{"title":"Does XSLT have a Split() function?","tags":[".net","xml","vb.net","xslt","split"],"question_text":"I have a string in a node and I'd like to split the string on '?' and return the last item in the array.\nFor example, in the block below:\n`<a>\n <xsl:attribute name=\"href\">\n \/newpage.aspx?<xsl:value-of sel...
{"title":"Get File Icon used by Shell","tags":["c#",".net","vb.net","winforms","shell-icons"],"question_text":"In .Net (C# or VB: don't care), given a file path string, FileInfo struct, or FileSystemInfo struct for a real existing file, how can I determine the icon(s) used by the shell (explorer) for that file?\nI'm no...
{"title":"Unable to create Android AVD because of Target and CPU\/ABI settings?","tags":["android","avd","eclipse-juno"],"question_text":"I'm running Juno and just beginning to learn Android programming on\nMac\n, on the latest SDK, 4.2 (API 17), and when I try to create an AVD, and as you can see from the screenshot (...
{"title":"Uncompress tar.gz file","tags":["linux","ubuntu","debian"],"question_text":"With the usage of wget command line I got a tar.gz file. I downloaded it in the root@raspberrypi. Is there any way to uncompress it in the \/usr\/src folder?","answer_text":"Use\n`-C`\noption of tar:\n`tar zxvf <yourfile>.tar.gz -C \/...
{"title":"Windows Explorer icons in TortoiseSVN take a long time to refresh to correct state","tags":["windows","tortoisesvn"],"question_text":"After I commit files, the icons stay on either modified or waiting for commit for a long time. Is there any way to force a refresh to ensure that the icon that I am seeing is t...
{"title":"Resize UIImage with aspect ratio?","tags":["iphone","uiimage","core-graphics"],"question_text":"I'm using this code to resize an image on the iPhone:\n`CGRect screenRect = CGRectMake(0, 0, 320.0, 480.0);\nUIGraphicsBeginImageContext(screenRect.size);\n[value drawInRect:screenRect blendMode:kCGBlendModePlusDar...
{"title":"C\/C++: Static function in header file, what does it mean?","tags":["c","function","static"],"question_text":"I know what it means when declared in source file. I reading some code, find that static function in header files could be invoke in other files.","answer_text":"Is the function defined in the header ...
{"title":"Django: Does prefetch_related() follow reverse relationship lookup?","tags":["django","django-models","django-queryset"],"question_text":"I've tried prefetch_related() in django 1.4 from trunk and can't make it to prefetch reverse lookup.\nMy simplified models (each book has many prices):\n`class Book(models....
{"title":"Can't add an image to a pdf using PDFBox","tags":["java","pdf","pdfbox"],"question_text":"I'm writing a java app that creates a pdf from scratch using the pdfbox library.\nI need to place a jpg image in one of the page.\nI'm using this code:\n`PDDocument document = new PDDocument();\nPDPage page = new PDPage(...
{"title":"Cannot find module 'coffee-script'","tags":["javascript","node.js","coffeescript","towerjs"],"question_text":"Trying to get a basic site set up with TowerJS as a test, but ran into this error when running the scaffold generator.\n`Macbook:app john$ tower generate scaffold Post title:string body:text belongsTo...
{"title":"How to get one value from a generator in Python?","tags":["python","generator"],"question_text":"Very basic question - how to get one value from a generator in Python?\nSo far I found I can get one by writing\n`gen.next()`\n. I just want to make sure this is the right way?","answer_text":"Yes, or\n`next(gen)`...
{"title":"android java.io.IOException: Service not Available","tags":["android","google-maps-android-api-2"],"question_text":"Description:\nI am using\n`Google maps API V2`\n.I have implemented\n`Android Reverse Geocoding`\nat touched location.\nProblem: It throws exception on\n`try {\n addresses = geocoder.getFromLoca...
{"title":"Using GROUP_CONCAT on subquery in MySQL","tags":["mysql","sql","group-concat","mysql-error-1242"],"question_text":"I have a MySQL query in which I want to include a list of ID's from another table. On the website, people are able to add certain items, and people can then add those items to their favourites. I...
{"title":"Center Twitter Bootstrap 3 Glyphicons in buttons","tags":["css","twitter-bootstrap","glyphicons"],"question_text":"I am now using Twitter Bootstrap 3 RC2 as well as Twitter Bootstrap which has moved into a separate repository. I have noticed, if used in a button with text the icon is not centered very well:\n...
{"title":"How to refresh a WPF DataGrid?","tags":["wpf","data-binding","datagrid"],"question_text":"I have a WPF DataGrid with some data. You can add rows through a separate window. The DataContext is the same, a LINQ-to-SQL object. Binding is also the same, I bind the \"ItemsSource\" property to a table.\nIn the other...
{"title":"Check opacity by jQuery","tags":["javascript","jquery","html","css","opacity"],"question_text":"How do I check if the opacity of an element is 0, and then do something in jQuery?","answer_text":"Have you tried using\n.css()\n?\n`if($('elemFoo').css('opacity') == 0) {\n doSomething();\n}`","question_code":[],"...
{"title":"Best OpenId API for ASP.NET MVC application","tags":["asp.net-mvc","openid"],"question_text":"I am developing an ASP.NET MVC application and I want to use OpenId.\nWhat is the best option?\nDotNetOpenId\nRPX\nOther???\nDoes anyone know what StackOverflow uses? Is the Login UI custom-developed, or provided by ...
{"title":"You have already activated X, but your Gemfile requires Y","tags":["ruby","rubygems","bundler"],"question_text":"When running\n`rake`\nI get this error:\nYou have already activated rake 0.9.2, but your Gemfile requires rake 0.8.7. Consider using bundle exec.\nUsing\n`bundle exec rake`\ninstead of just\n`rake`...
{"title":"Convert SVG polygon to path","tags":["svg","raphael"],"question_text":"I have a fairly large SVG file of administrative subdivisions that I need to work with in Raphael.JS (it has 600 polygons and weights 1.2 Mb).\nNow, I need to convert these polygons to paths so that it works in Raphael. The great\npoly2pat...
{"title":"Updating a date in Oracle SQL table","tags":["sql","oracle","date","peoplesoft"],"question_text":"I am trying to update a date in a SQL table. I am using Peoplesoft Oracle. When I run this query:\n`Select ASOFDATE from PASOFDATE;`\nI get 4\/16\/2012\nI tried running this query\n`UPDATE PASOFDATE SET ASOFDATE ...
{"title":"Multiple classes in a header file vs. a single header file per class","tags":["c++","performance","file-organization"],"question_text":"For whatever reason, our company has a coding guideline that states:\n`Each class shall have it's own header and implementation file.`\nSo if we wrote a class called\n`MyStri...
{"title":"What h.264 format loads on android AND IOS?","tags":["iphone","android","ffmpeg","html5-video","h.264"],"question_text":"Theoretically both IOS and ANDROID will play h.264 files, but I can't figure out a setting to encode them so they actually work cross platform. Does anybody know how to encode for both Andr...
{"title":"How to synchronize two Subversion repositories?","tags":["svn","version-control","synchronization"],"question_text":"My company has a subsidiary with a slow Internet connection. Our developers there suffer to interact with our central\nSubversion\nserver. Is it possible to configure a slave\/mirror for them? ...
{"title":"ON DELETE CASCADE in sqlite3","tags":["sql","sqlite"],"question_text":"I have the following structure: (Sorry for awkward names, it is because it is a sqlite database for my iPhone app which is not released yet)\n`CREATE TABLE klb_log (\n id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,\n log_comment varchar(51...
{"title":"Using pre-compiled headers with CMake","tags":["c++","visual-studio","gcc","cmake","precompiled-headers"],"question_text":"I have seen a few (old) posts on the 'net about hacking together some support for pre-compiled headers in CMake. They all seem a bit all-over the place and everyone has their own way of d...
{"title":"Bootstrap Modal sitting behind backdrop","tags":["css","twitter-bootstrap","modal-dialog","z-index"],"question_text":"So I'm having nearly the exact same problem as\n@Jamescoo\nwas but I think that my issue is coming from the fact that I have already positioned a couple of DIVs to create a sliding nav panel.\...
{"title":"Add a month to a Date","tags":["r","date","date-arithmetic"],"question_text":"I am trying to add a month to a date i have. But then its not possible in a straight manner so far. Following is what i tried.\n`> d <- as.Date(\"2004-01-31\")\n> d + 60\n[1] \"2004-03-31\"`\nAdding wont help as the month wont be ov...
{"title":"How to wrap lengthy text in a spinner","tags":["android","text","spinner","wrap"],"question_text":"I have two spinner and EditText controls within a table layout view on a separate row. The spinners are populated with data. My problem is the data (texts) that are populated into the spinners are too lengthy to...
{"title":"how to Check NSString is null or not","tags":["ios","objective-c","xcode","nsstring"],"question_text":"I want to check weather a\n`NSString`\nis null or not. Im assigning from an JSON array. After assigning that string value is\n`<null>`\n. Now I want to check this string is null or not. So I put like this\n`...
{"title":"Which is faster, try catch or if-else in java (WRT performance)","tags":["java","if-statement","try-catch"],"question_text":"Which one is faster:\nEither this\n`try {\n n.foo();\n} \ncatch(NullPointerException ex) {\n}`\nor\n`if (n != null) n.foo();`","answer_text":"It's not a question of which is faster, rat...
{"title":"Inline Disabling of Firefox Spellcheck?","tags":["firefox","spell-checking","html-input"],"question_text":"I researched this a while ago and can't remember how to do it. I want to be able to prevent Firefox from running it's spell-checking functionality on certain input fields from within the page. I know it'...
{"title":"sails.js access controller method from controller method","tags":["javascript","node.js","sails.js","controllers"],"question_text":"How come in sails you cannot access other controller methods from within another one?\nlike this.\n`module.exports = \n findStore: ->\n # do somthing\n index: ->\n @findStore(); ...
{"title":"How do programmers work together on a project?","tags":["unit-testing","version-control","compilation","continuous-integration"],"question_text":"I've always programmed alone, I'm still a student so I never programmed with anyone else, I haven't even used a version control system before.\nI'm working on a pro...
{"title":"Parsing XML with REGEX in Java","tags":["java","xml","regex"],"question_text":"Given the below XML snippet I need to get a list of name\/value pairs for each child under DataElements. XPath or an XML parser cannot be used for reasons beyond my control so I am using regex.\n`<?xml version=\"1.0\"?>\n<StandardD...
{"title":"Giving a border to an HTML table row, <tr>","tags":["html","css","border","html-table"],"question_text":"Is it possible to border a table row,\n`<tr>`\nin one go instead of giving a border to individual cells,\n`<td>`\nlike,\n`<table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" style=\"border: 1px;\" ru...
{"title":"Sublime Text 2: open the same file multiple times","tags":["sublimetext2"],"question_text":"I want to view the same file side-by-side. How do I open up two (or more) tabs for a single file?","answer_text":"File | New View into File will open a second tab for the same file. This can be moved into another windo...
{"title":"Write Content To New Window with JQuery","tags":["jquery"],"question_text":"I have a web page with a DIV element in it. When a user clicks \"print\", I want to print the contents of that div. Please note, I only want to print the contents of the DIV, not the entire page. To attempt this, I decided I would ope...
{"title":"iPhone: performSelector with BOOL parameter?","tags":["iphone"],"question_text":"Is there any way to send BOOL in selector ?\n`[self performSelector:@selector(doSomething:) withObject:YES afterDelay:1.5];`\nOr I should use NSInvocation ? Could somebody write a sample please ?","answer_text":"you can use NSNum...
{"title":"How to get distinct values from an array of objects in JavaScript?","tags":["javascript","arrays","unique"],"question_text":"Assuming I have the following:\n`var array = \n [\n {\"name\":\"Joe\", \"age\":17}, \n {\"name\":\"Bob\", \"age\":17}, \n {\"name\":\"Carl\", \"age\": 35}\n ]`\nWhat is the best way to ...
{"title":"How to change app name per Gradle build type","tags":["android","android-gradle"],"question_text":"I am trying to figure out a way to be able to change my application's app name per build type in gradle.\nFor instance, I would like the debug version to have\n`<APP_NAME>-debug`\nand the qa version to have\n`<A...
{"title":"Complex password Regular expression","tags":["regex"],"question_text":"I have the following criteria for creating a regular expression for a password that conforms to the following rules:\nThe password must be 8 characters long (this I can do :-)).\nThe password must then contain characters from at least 3 of...
{"title":"ASP MVC - Are there any constants for the default content types?","tags":["asp.net-mvc","content-type"],"question_text":"Is there a set of constants in the framework for all the\nstandard content types\n?","answer_text":"Taking it as a resounding no, I wrote my own. That's what Sundays were made for.\n`\/\/\/...
{"title":"django template display item value or empty string","tags":["django","templates"],"question_text":"My code in template is like this:\n`{% for item in items %}\n {{ item.somefield }}\n{% endfor %}`\nI want to display the item value if the item.somefield is not None, or display an empty string. I don't want to ...