text
stringlengths
74
309k
{"title":"Calling a specific PowerShell function from the command line","tags":["powershell"],"question_text":"I have a PowerShell script that contains several functions. How do I invoke a specific function from the command line?\nThis doesn't work:\n`powershell -File script.ps1 -Command My-Func`","answer_text":"You wo...
{"title":"How do I set a value in CKEditor with Javascript?","tags":["javascript","ckeditor"],"question_text":"I am wondering how I can set a value in\n`CKEditor`\nusing Javascript?\nI have tried the following, but neither of them work...\n`document.[form name].[textarea name].value=data;\n$('#textareaID').val(data);`\...
{"title":"javascript parseFloat '500,000' returns 500 when I need 500000","tags":["javascript","parsefloat"],"question_text":"How would it be a nice way of handling this?\nI already thought on removing the comma and then parsing to float.\nDo you know a better\/cleaner way?\nThanks","answer_text":"`parseFloat( theStrin...
{"title":"emacs command to diff a buffer and its file","tags":["emacs","diff"],"question_text":"Is there an emacs command to show the difference between a buffer and its file?\ne.g. I've made some edits to a buffer, forgotten what they were, and now I need to save the buffer to its file, but want to check what I have a...
{"title":"Store run configuration with project in Eclipse","tags":["java","eclipse"],"question_text":"I'm programming in NetBeans however i like to get used to Eclipse as well. I have a Maven project what i've developed in NetBeans and after importing it compiles fine in Eclipse. I'm using the Run or Debug feature of N...
{"title":"How do I make a default syntax by filetype in Atom text editor?","tags":["atom-editor"],"question_text":"I want my .ejs files to have html syntax, however, it always opens the files as Plain Text.\nIn sublime you can choose \"Open all with current extension as...\" then choose your syntax.\nI see that you can...
{"title":"Difference between response.redirect and server.transfer","tags":["c#","asp.net"],"question_text":"Possible Duplicates:\nResponse.Redirect vs. Server.Transfer\nServer.Transfer Vs. Response.Redirect\nWhat is the difference between response.redirect and server.transfer?\nOnly one difference i know is: In respon...
{"title":"Changing packaging based on active profile in pom","tags":["java","maven-2"],"question_text":"I have a project which I compile with maven. I have different profiles declared in pom.xml.\nFor some of these profiles, I prefer building a war, and for other profiles I prefer a jar. I use to manually edit the pom....
{"title":"Qt compiler warning: overriding commands for target \/ ignoring old commands for target","tags":["c++","qt"],"question_text":"When I'm compiling my Qt project for Windows I receive these 2 warnings:\n`Makefile.Debug:109: warning: overriding commands for target `debug\/moc_mainwindow.cpp'\nMakefile.Debug:106: ...
{"title":"css to center a image horizontally","tags":["html","css"],"question_text":"I am trying to center a image horizontally using css.\nI am displaying my image on the screen with the following HTML code:\n`<div id=\"loading\" class=\"loading-invisible\"> \n <img class=\"loading\" src=\"logo.png\">\n<\/div>`\nI am ...
{"title":"Setting ruby hash .default to a list","tags":["ruby","hashmap"],"question_text":"I thought I understood what the default method does to a hash...\nGive a default value for a key if it doesn't exist:\n`irb(main):001:0> a = {}\n=> {}\nirb(main):002:0> a.default = 4\n=> 4\nirb(main):003:0> a[8]\n=> 4\nirb(main):...
{"title":"How do I sort a VARCHAR column in SQL server that contains numbers?","tags":["sql","tsql"],"question_text":"I have a\n`VARCHAR`\ncolumn in a\n`SQL Server 2000`\ndatabase that can contain either letters or numbers. It depends on how the application is configured on the front-end for the customer.\nWhen it does...
{"title":"Managing SSH keys within Jenkins for Git","tags":["git","ssh","jenkins","continuous-integration"],"question_text":"I'm trying to get Jenkins up and running with a GitHub hosted repository (using the Jenkins Git plugin). The repository has multiple git submodules, so I'm not sure I want to try and manage multi...
{"title":"JSLint's 'Tolerate Stupidity'","tags":["javascript","jslint"],"question_text":"Anyone know what JSLint's 'Tolerate Stupidity' option is all about? What family of warnings does it disable?\nI've found some reference to Node.js and \"Sync\" methods (including Crockford's comment that \"it is very well named\") ...
{"title":"How do I prevent and\/or handle a StackOverflowException?","tags":["c#",".net","stack-overflow","xslcompiledtransform"],"question_text":"I would like to either prevent or handle a StackOverflowException that I am getting from a call to the XslCompiledTransform.Transform method within an Xsl Editor I am writin...
{"title":"The $.param( ) inverse function in JavaScript \/ jQuery","tags":["javascript","jquery"],"question_text":"Given the following form:\n`<form>\n <input name=\"foo\" value=\"bar\">\n <input name=\"hello\" value=\"hello world\">\n<\/form>`\nI can use the\n`$.param( .. )`\nconstruct to serialize the form:\n`$.param...
{"title":"ActionMailer: Default From: address?","tags":["ruby-on-rails","actionmailer"],"question_text":"Googled for this to no avail. Didn't find anything in the API either. I was expecting some kind of class method or configuration option to set it...\nSo, rather than calling\n`from \"my@email.com\"`\nfor every metho...
{"title":"How to get data of parent node in d3.js","tags":["d3.js"],"question_text":"I am doing nesting in D3 and in a nested element, I need to reach data object on its parent.\nRight now I am doing\n`d3.select(this).node().parentNode.__data__;`\nIs there a better way?","answer_text":"`d3.select(this).node()`\nis the ...
{"title":"Determine if two Java objects are of the same class","tags":["java","android","class","comparison"],"question_text":"I am attempting to do the equivalent of\n`if ( object1.class == object2.class )\n{\n \/\/do something\n}`\nwhich of course doesn't work, what method am I overlooking?","answer_text":"If they're...
{"title":"\"Uninitialized constant\" error when including a module","tags":["ruby-on-rails","ruby","ruby-on-rails-3.1"],"question_text":"I am trying to reference an association extension but it errors with:\n`NameError (uninitialized constant User::ListerExtension):\n app\/models\/user.rb:2:in `<class:User>'`\nHere is ...
{"title":"Objective-C: `continue` in collection enumeration block?","tags":["objective-c","ios","nsarray","objective-c-blocks"],"question_text":"If I have an NSArray and I use\n`enumerateUsingBlock`\nto loop through elements in the array, but in some cases I need to skip the loop body and go to next element, is there a...
{"title":"Windows.Forms.Timer OR System.Threading.Timer","tags":["c#",".net","timer"],"question_text":"I have an application that runs many threads. Each thread should have a timer that checks for something in that thread's scope. My question is: Which timer I should use and what is the difference between both.","answe...
{"title":"Get textLabel text of selected Cell using the iPhone SDK","tags":["iphone","uitableview"],"question_text":"I would like to know how to get the\n`textLabel`\nstring value of the selected\n`uitableviewcell`\n.","answer_text":"`- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)ind...
{"title":"When do we use the \"||=\" operator in Rails ? What is its significance?","tags":["ruby","operators"],"question_text":"Possible Duplicate:\nWhat does the operator ||= stands for in ruby?\nI am confused with the usage of\n`||=`\noperator in Rails. I couldn't locate anything useful on the web. Can anyone please...
{"title":"Does std::mt19937 require warmup?","tags":["c++","random","c++11","standard-library","mersenne-twister"],"question_text":"I've read that many pseudo-random number generators require many samples in ordered to be \"warmed up\". Is that the case when using std::random_device to seed std::mt19937, or can we expe...
{"title":"Is overriding to_s methods in Ruby bad?","tags":["ruby"],"question_text":"I've been experimenting and find that I like redefining Object's\n`to_s`\nmethods.\nIs this a bad idea or is it good practice?","answer_text":"No, you should feel free to override\n`to_s`\n- there are no ill side-effects. As long as you...
{"title":"cd -1, -2, -3 etc in Z shell","tags":["shell","autocomplete","zsh","zsh-completion"],"question_text":"How do you set up the Z shell such that typing cd - gives you a list of previously visited paths, and cd -1, -2, -3, etc. will then take you to the directories?","answer_text":"If you have\n`setopt AUTO_PUSHD...
{"title":"Select 5 random elements","tags":["javascript","jquery"],"question_text":"How can I select the first 5 random elements\n`<ul>\n <li>First<\/li>\n <li>Second<\/li>\n <li>Third<\/li>\n ...\n <li>N<\/li>\n<\/ul>`\nI'm using this plugin\n:\n`alert($(\"li:random\").text());`\nbut it takes all random elements. I on...
{"title":"Ruby: Compare 2 arrays for matches, and count the number of match instances","tags":["ruby-on-rails","ruby","arrays"],"question_text":"I have 2 arrays:\n`@array1 = [a,b,c,d,e]\n@array2 = [d,e,f,g,h]`\nI want to compare the two arrays to find matches (d,e) and count the number of matches found (2)?\n`<% if @ar...
{"title":"MySQL JDBC Driver 5.1.33 - Time Zone Issue","tags":["java","mysql","tomcat","jdbc","timezone"],"question_text":"Some background:\nI have a Java 1.6 webapp running on Tomcat 7. The database is MySQL 5.5. Previously, I was using Mysql JDBC driver 5.1.23 to connect to the DB. Everything worked. I recently upgrad...
{"title":"How to grant MODIFY_PHONE_STATE permission for apps ran on Gingerbread","tags":["android","exception","permissions","telephony"],"question_text":"I write an application that attempts to modify phone call state. It works well on Android 2.2 or less, but throw an exception on Android 2.3 because of the lack of ...
{"title":"Standard to follow when writing git commit messages","tags":["git","git-commit","commit-message"],"question_text":"I find myself managing very many files (over 60 but below 70) and my commit messages so far follow this pattern:\nwhen I have added something like on\n`layout.css`\n, my commit message is\n\"adde...
{"title":"calling a java servlet from javascript","tags":["java","javascript","ajax","web-applications","servlets"],"question_text":"I am trying to create a web application using the MVC design pattern. For the GUI part I would like to use JavaScript. And for the controller Java Servlets.\nNow I have never really worke...
{"title":"Programming language for functional parallelism: F# vs Haskell","tags":["haskell","f#","functional-programming","parallel-processing"],"question_text":"Functional programming has immutable data structures and no side effect which are inherently suitable for parallel programming. I investigate how to exploit m...
{"title":"In C#, is it possible to cast a List<Child> to List<Parent>?","tags":["c#","inheritance","casting"],"question_text":"I want to do something like this:\n`List<Child> childList = new List<Child>();\n...\nList<Parent> parentList = childList;`\nHowever, because parentList is a\nList\nof Child's ancestor, rather t...
{"title":"Android Studio: execution failed for task : app:compileDebugAidl FAILED","tags":["android","android-gradle"],"question_text":"I installed Android Studio 1.2.1.1, with Gradle version 2.2.1, and Android plugin version 1.2.3. I tried to create a simple hello world project, and it give me a build failure of :app:...
{"title":"Why in the code \"456\"+1, output is \"56\"","tags":["c++"],"question_text":"`#include <iostream>\nint main()\n{\n std::cout << \"25\"+1;\n return 0;\n}`\nI am getting \"5\" as output.\nwhen I use \"5\"+1,output is blank;\"456\"+1 output is \"56\".\nconfused what is going behind the scenes.","answer_text":"Th...
{"title":"iPhone UITableViewCell layer shadow","tags":["iphone","cocoa-touch","uitableview","shadow"],"question_text":"I'm trying to add a shadow to a UITableViewCell using the layer.shadowColor, Offset, Radius but it doesn't seem to affect it in any way. The table is grouped style. Any ideas why?\nHere is the code i'm...
{"title":"Matching exact string with JavaScript","tags":["javascript","regex"],"question_text":"How can I test if a RegEx matches a string\nexactly\n?\n`var r = \/a\/;\nr.test(\"a\"); \/\/ returns true\nr.test(\"ba\"); \/\/ returns true\ntestExact(r, \"ba\"); \/\/ should return false\ntestExact(r, \"a\"); \/\/ should r...
{"title":"True-way solution in Java: parse 2 numbers from 2 strings and then return their sum","tags":["java","parsing","exception"],"question_text":"Quite a stupid question. Given the code:\n`public static int sum(String a, String b) \/* throws? WHAT? *\/ {\n int x = Integer.parseInt(a); \/\/ throws NumberFormatExcept...
{"title":"Convert List of tuple to map (and deal with duplicate key ?)","tags":["scala","map"],"question_text":"I was thinking about a nice way to convert a List of tuple with duplicate key\n`[(\"a\",\"b\"),(\"c\",\"d\"),(\"a\",\"f\")]`\ninto map\n`(\"a\" -> [\"b\", \"f\"], \"c\" -> [\"d\"])`\n. Normally (in python), I...
{"title":"Detect Safari browser","tags":["javascript","browser-detection"],"question_text":"How to detect Safari browser using JavaScript? I have tried code below and it detects not only Safari but also Chrome browser.\n`function IsSafari() {\n var is_safari = navigator.userAgent.toLowerCase().indexOf('safari\/') > -1;...
{"title":"C# equivalent of C++ map<string,double>","tags":["c#","arrays","hashmap"],"question_text":"I want to keep some totals for different accounts. In C++ I'd use STL like this:\n`map<string,double> accounts;\n\/\/ Add some amounts to some accounts.\naccounts[\"Fred\"] += 4.56;\naccounts[\"George\"] += 1.00;\naccou...
{"title":"If you have multiple spaces inside a string in Java, how do you condense them into a single space between words?","tags":["java","string"],"question_text":"If a string has multiple spaces between words:\n`The cat sat on the mat.`\nHow do you make it a single space?\n`The cat sat on the mat.`\nI tried this but...
{"title":"Sort a Table[] in Lua","tags":["sorting","lua","lua-table"],"question_text":"I have a Lua table that I am trying to sort. The table's format is as follows:\n`tableOfKills[PlayerName] = NumberOfKills`\nWhich means, for example, if I had a player named Robin with a total of 8 kills and another named Jon with a ...
{"title":"What is the \"-d\" in \"npm -d install\"?","tags":["npm"],"question_text":"I've seen some posts that refer to running\n`npm`\nwith a\n`-d`\nargument. For example,\nthis issue\nrefers to doing\n`npm -d install coffee-script`\n. There are\na few other pages\nthat also refer to this syntax, including the\ninstal...
{"title":"NSDictionaryOfVariableBindings swift equivalent?","tags":["ios","swift"],"question_text":"The Apple documentation shows an unsettling blank space under the 'Creating a Dictionary' section of the UIKit reference\nhere\n.\nHas anyone found a replacement for the\n`NSDictionaryOfVariableBindings`\nmacro, or are w...
{"title":"How does 3D collision \/ object detection work?","tags":["algorithm","data-structures","3d","collision-detection"],"question_text":"I'v always wondered this. In a game like\nGTA\nwhere there are 10s of thousands of objects, how does the game know as soon as you're on a health pack?\nThere can't possibly be an...
{"title":"Elasticsearch, Tire, and Nested queries \/ associations with ActiveRecord","tags":["elasticsearch","tire"],"question_text":"I'm using ElasticSearch with Tire to index and search some ActiveRecord models, and I've been searching for the \"right\" way to index and search associations. I haven't found what seems...
{"title":"Accessing Express.js local variables in client side JavaScript","tags":["javascript","node.js","express","jade"],"question_text":"Curious if I'm doing this right and if not how you guys would approach this.\nI have a Jade template that needs to render some data retrieved from a MongoDB database and I also nee...
{"title":"A program made with Java 8 can be run on Java 7?","tags":["java","backwards-compatibility","java-8","java-server"],"question_text":"I am a little confused.\nOracle says Java 8 is highly compatible with Java 7 (backward). But, what possibilities exist that Java 8 program can be run on Java 7 successfully (SE\/...
{"title":"Why is `a = a` `nil` in Ruby?","tags":["ruby","variable-assignment","local-variables"],"question_text":"I watched this\nvideo\n. Why is\n`a = a`\nevaluated to\n`nil`\nif\n`a`\nis not defined?\n`a = a # => nil\nb = c = q = c # => nil`","answer_text":"Ruby interpreter initializes a local variable with\n`nil`\nw...
{"title":"No Main() in WPF?","tags":["c#","wpf","c#-4.0","main"],"question_text":"I am very beginner when it comes to programming but I was sure that one of the universal rules was that an program starts with Main(). I do not see one when I create a WPF project. Is Main() simply named something differently in WPF?","an...
{"title":"System.Web.HttpContextBase' does not contain a definition for 'Current' MVC 4 with Elmah Logging","tags":["c#","asp.net-mvc","asp.net-mvc-4"],"question_text":"I have a C# ASP.NET MVC 4 project, which is using Elmah for catching any unhandled exceptions. This works great in most situations.\nHowever I've found...
{"title":"Python: How to toggle between two values","tags":["python","toggle"],"question_text":"I want to toggle between two values in Python, that is, between 0 and 1.\nFor example, when I run a function the first time, it yields the number 0. Next time, it yields 1. Third time it's back to zero, and so on.\nSorry if ...
{"title":"Xcode 7.3 crashing when debugging with breakpoints","tags":["xcode","xcode7","xcode8"],"question_text":"I just install the Xcode 7.3 version. I can't debug at all because it's crashing when I try to use a breakpoint while I'm debugging. I tried removing Derive Data, Reboot my macbook, reinstall pods... but un...
{"title":"Understanding IEquatable","tags":["c#","iequatable"],"question_text":"If i want to compare objects and they implement the IEquatable<> interface, i have a few questions:\nWhy do i have to override Equals(object ) if i have to implements Equals<>\ncan i use == and != once i implement IEquatable ?","answer_text...
{"title":"ide sublime2 how to find method definition","tags":["ruby-on-rails","ruby","sublimetext"],"question_text":"I'm using\nSublime 2\nfor Ruby On Rails programming.\nI need a ability to click a method name and jump to class where the method is defined. There are many IDE with similar capability...","answer_text":"...
{"title":"STL map--> sort by value?","tags":["c++","algorithm","stl","map","sorting"],"question_text":"I wonder how can I implement the STL map sorting by value.\nFor example, I have a map m\n`map<int, int>;\nm[1] = 10;\nm[2] = 5;\nm[4] = 6;\nm[6] = 1;`\nand then.. I'd like to sort that with the m's value.\nSo, if I pr...
{"title":"Can a program depend on a library during compilation but not runtime?","tags":["java","build-process","runtime","compile-time"],"question_text":"I understand the difference between runtime and compile-time and how to differentiate between the two, but I just don't see the need to make a distinction between co...
{"title":"CGSize sizeWithAttributes in Swift","tags":["ios","swift"],"question_text":"In objective-C I was able to use:\n`CGSize stringsize =\n [strLocalTelefone sizeWithAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:14.0f]}];`\nBut in Swift Language I didn't found any solution for this situation.\nAny Help?...
{"title":"Why does the compiler let me cast a null to a specific type in C#?","tags":["c#","casting",null,"il"],"question_text":"Consider this code:\n`var str = (string)null;`\nWhen write the code this is my\n`IL`\ncode:\n`IL_0001: ldnull`\nAnd\n`IL`\nhas any Cast operator but:\n`var test = (string) new Object();`\nThe...
{"title":"Basic webserver with node.js and express for serving html file and assets","tags":["javascript","node.js","express"],"question_text":"I'm making some frontend experiments and I'd like to have a very basic webserver to quickly start a project and serve the files (one index.html file + some css\/js\/img files)....
{"title":"How to align linearlayout to vertical center?","tags":["android","android-layout"],"question_text":"I'm tyring to align linearlayout's vertical center which shows following pic (skycolor border) to delete button's vertical center.\nso I set gravity of id:groupNumbers to center_vertical.\nbut no changed.\nHow ...
{"title":"Conditional compile when running in Simulator as opposed to on a device","tags":["iphone","objective-c","compiler-directives"],"question_text":"Is there a compiler directive I can use to compile a different line of code when targetting the simulator as opposed to my device. Something like:\n`# IF SIMULATOR\n[...
{"title":"Form submit with AJAX passing form data to PHP without page refresh","tags":["php","jquery","ajax","forms","serialization"],"question_text":"Can anyone tell me why this bit of code isn't working?\n`<html>\n <head>\n <script src=\"http:\/\/code.jquery.com\/jquery-1.9.1.js\"><\/script>\n <script>\n $(function (...
{"title":"Where is the list of predefined Maven properties","tags":["maven"],"question_text":"I know there is a list of all predefined Maven properties (you know like\n`project.build.sourceEncoding`\n, or\n`project.build.sourceDirectory`\n). I once saw the list but I just can't find it again.","answer_text":"Unfortunat...
{"title":"HTML - Form Submit Button Confirmation Dialog","tags":["php","javascript","form-submit"],"question_text":"this is a general form code\n`<form name=\"search_form\" action=\"\" method=\"POST\">\n<input type=\"text\" name=\"search_text\"> \n<input type=\"submit\" name=\"search_bt\" value=\"Go\">\n<\/form>`\nis t...
{"title":"How can I get the first element in an NSDictionary?","tags":["iphone","objective-c","cocoa","cocoa-touch","nsdictionary"],"question_text":"I have an array of NSDictionaries. How can I pull out the first element in the dictionary?\n`NSArray *messages = [[results objectForKey:@\"messages\"] valueForKey:@\"messa...
{"title":"MySql: MyISAM vs. Inno DB!","tags":["mysql","database","innodb","myisam","trivia"],"question_text":"What are the differences between MyISAM and Inno DB types in MySql?","answer_text":"The main difference is that InnoDB supports transactions while MyISAM does not.\nThere are numerous other differences, however...
{"title":"How to run a script as root in Jenkins?","tags":["shell","hudson","jenkins","root"],"question_text":"I need to run a shell script in Jenkins as root instead of the default user. What do I need to change?\nMy sudoers file is like this:\n`# User privilege specification\nroot ALL=(ALL) ALL\nigx ALL=(ALL) ALL\n%w...
{"title":"Azure Blob Storage vs. File Service","tags":["azure","windows-azure-storage","azure-storage-blobs"],"question_text":"Please correct my wrongs. From my reading on the topic so far, it appears to me that both, Azure Blob Storage and File Service offer the ability to store file(s) and folder(s) (I understand tha...
{"title":"Apply stroke to a textblock in WPF","tags":[".net","wpf","xaml"],"question_text":"How do you apply stroke (outline around text) to a textblock in xaml in WPF?","answer_text":"Below is my more idiomatically WPF, full-featured take on this. It supports pretty much everything you'd expect, including:\nall font r...
{"title":"WinForms AcceptButton not working?","tags":["c#","winforms","modal-dialog"],"question_text":"Ok, this is bugging me, and I just can't figure out what is wrong...\nI have made two forms. First form just has a simple button on it, which opens the other as a dialog like so:\n`using (Form2 f = new Form2())\n{\n i...
{"title":"How do I monitor all incoming http requests?","tags":["asp.net","http","fiddler","wireshark"],"question_text":"I need to monitor my application from incoming http\n`POST`\nand\n`GET`\nrequests originating from outside and sometimes inside the machine.\nIs this possible?\nBeen using fiddler but this only does ...
{"title":"How do I show what fields a struct has in gdb?","tags":["c","emacs","gdb","nginx"],"question_text":"I came upon a struct called\n`ngx_http_variable_value_t`\nin my gdb session and I would like to print what fields it has in the console. Is that possible?","answer_text":"You can use the gdb command \"ptype\" t...
{"title":"Why use async requests instead of using a larger threadpool?","tags":["c#","asp.net","asynchronous","async-ctp"],"question_text":"During the Techdays here in the Netherlands Steve Sanderson gave a presentation about\nC#5, ASP.NET MVC 4, and asynchronous Web\n.\nHe explained that when requests take a long time...
{"title":"How do I compile the asm generated by GCC?","tags":["c","gcc","compiler-construction","assembly"],"question_text":"I'm playing around with some asm code, and something is bothering me.\nI compile this:\n`#include <stdio.h>\nint main(int argc, char** argv){\n printf(\"Hello World\\n\");\n return 0;\n}`\nwith\n...
{"title":"Symfony2 -> Twig -> Form -> Field -> Set rendered = true","tags":["symfony2","twig","symfony-forms","symfony-2.2","symfony-2.3"],"question_text":"i have a simple problem.\nI have a form with a field for example:\n`$builder\n ->add('x')\n ->add('y')\n ->add('z')\n;`\nIn my twig files i used multiple blocks and...
{"title":"Add box shadow with transition effect","tags":["html","css","css3"],"question_text":"I'm adding a class to a div that adds a box shadow to that div. This happens dynamically via jquery. Now, when the class is added, the shadow effect is added automatically as well, without any effect. Is there a way to add so...
{"title":"Insert Update stored proc on SQL Server","tags":["sql","sql-server","stored-procedures","upsert"],"question_text":"I've written a stored proc that will do an update if a record exists, otherwise it will do an insert. It looks something like this:\n`update myTable set Col1=@col1, Col2=@col2 where ID=@ID\nif @@...
{"title":"Do DDD and SOA really play well together?","tags":["domain-driven-design","soa"],"question_text":"Please let me know, ever so gently, if I am totally mangling the DDD concept, but here is my dilemma.\nLet's say I have the following domain model:\n`Teacher\n IList<Class>\nClass\n Teacher\n IList<Student>\nStud...
{"title":"Change paid app to free but know if user previously purchased it","tags":["ios","in-app-purchase"],"question_text":"I am considering changing my paid\n`iOS`\napp to be free, making it\n`ad based`\n, and having an\n`in-app purchase`\noption to remove the ads.\nThis sounds like a good idea if I was just launchi...
{"title":"Experience with using h5py to do analytical work on big data in Python?","tags":["python","scipy","sas","hdf5","h5py"],"question_text":"I do a lot of statistical work and use Python as my main language. Some of the data sets I work with though can take 20GB of memory, which makes operating on them using in-me...
{"title":"Copy \/ Put text on the clipboard with FireFox, Safari and Chrome","tags":["firefox","dom","safari","google-chrome","clipboard"],"question_text":"In Internet Explorer I can use the clipboardData object to access the clipboard. How can I do that in FireFox, Safari and\/or Chrome?","answer_text":"For security r...
{"title":"UITableViewCell doesn't get deselected when swiping back quickly","tags":["ios","uitableview","ios7"],"question_text":"I've now updated three of my apps to iOS 7, but in all three, despite them not sharing any code, I have the problem where if the user swipes to go back in the navigation controller (rather th...
{"title":"Backbone.js - how to handle \"login\"?","tags":["javascript","backbone.js"],"question_text":"Hi I'm trying to wrap my head around backbone.js for some days now but since this is my first MVC Framework, it's pretty hard.\nI can easily get my Collections to work, fetching data from the server etc, but it all de...
{"title":"Backup\/Restore from different database causing Restore failed exclusive access could not be obtained","tags":["sql","sql-server","sql-server-2012"],"question_text":"I have a database A. I have taken a backup of database A called A.bak. I created a new database B. Now, I right click and Restore B from A.bak. ...
{"title":"class() vs. type() in Ruby","tags":["ruby","syntax"],"question_text":"What's the difference between the class and type methods in Ruby? I've noticed that type works to find the type of some classes but not others.","answer_text":"The key difference is that\n`Object#type`\nis deprecated. From the RDoc for Obje...
{"title":"How to get and cancel a PendingIntent?","tags":["android","android-intent","alarmmanager","android-pendingintent"],"question_text":"I have an\n`alarmManager`\nwhich I am using to send notifications to the user at specific times. Since there are multiple alarms, I have multiple pending intents that I am creati...
{"title":"Catching java.lang.OutOfMemoryError?","tags":["java","try-catch","out-of-memory"],"question_text":"Documentation\nfor\n`java.lang.Error`\nsays:\nAn Error is a subclass of Throwable that indicates serious problems that a reasonable application should not try to catch\nBut as\n`java.lang.Error`\nis a subclass o...
{"title":"SecurityException during executing jnlp file (Missing required Permissions manifest attribute in main jar)","tags":["java","java-web-start","jnlp"],"question_text":"OS: Windows 7 64 bit\nJava: jdk1.7.0_51\nI have a jnlp file. When I double click on this, exception is occurred as below:\n`Application Error: Un...
{"title":"Gradle failed to resolve library in Android Studio","tags":["android","gradle","libraries"],"question_text":"I want to include a library in Android Studio , but it displays error like below :\n\"Failed to resolve:com.lemonlab:expandable-button-menu:1.0.0\"\nHow to fix this problem?\n`apply plugin: 'com.androi...
{"title":"How to put a symbol above another in LaTeX?","tags":["latex"],"question_text":"How to put a symbol above (on the head of) another? For example, I wanna produce something like this in one line.\na\n#\ni.e., 'a' above '#'.\nEDIT:\nThe effect should be almost the same with $#^a# except that 'a' is on the top ins...
{"title":"Using Chrome JavaScript Debugger \/ How to break on page loading events","tags":["javascript","debugging","google-chrome"],"question_text":"I'm using chrome's debugger and I'm good when it comes to setting break points once a page is running. My problem is when I do either f5 or press enter on the URL line my...
{"title":"Nested For Loops Using List Comprehension","tags":["python","for-loop","list-comprehension"],"question_text":"If I had two strings,\n`'abc'`\nand\n`'def'`\n, I could get all combinations of them using two for loops:\n`for j in s1:\n for k in s2:\n print(j, k)`\nHowever, I would like to be able to do this usin...
{"title":"Rake aborted... table 'users' already exists","tags":["ruby-on-rails","ruby","database"],"question_text":"I have created a database with devise and the nifty generator. I'm trying to make a new database with the nifty generator (\n`rails g nifty:scaffold Asset user_id:integer`\n), but when I try to migrate th...
{"title":"How do I change the locale that JasperReports uses?","tags":["jasper-reports","locale"],"question_text":"The windows installed on my machine has the locale\n`en_AU`\nand that's what JasperReports uses. I already tried changing the locale of all users, including the Administrator but it still uses\n`en_AU`\n.\...
{"title":"jQuery in Google Chrome Content Script?","tags":["google-chrome-extension"],"question_text":"How would I go about including the jQuery library in my Google Chrome Content Script? I have tried, fruitlessly, of course. Should I use\n`<script src=\"...\" \/><\/script>`\n, or is there a different\/better way to g...
{"title":"Access translation file (i18n) from inside rails model","tags":["ruby-on-rails","ruby","localization","translation","rails-i18n"],"question_text":"What I have in my model is:\n`def body_color_enum\n [\n ['Aqua', '#009c9c'],\n ['Grey', '#6d6e71'],\n ['Yellow', '#ffe600'],\n ['White', 'white']\n ]\nend`\nI want...