text
stringlengths
74
309k
{"title":"Trying to understand CMTime","tags":["ios","avcapturesession","cmtime"],"question_text":"I have seen some\nexamples\nof\nCMTime\n(Three separate links), but I still don't get it. I'm using an AVCaptureSession with AVCaptureVideoDataOutput and I want to set the max and min frame rate of the the output. My prob...
{"title":"How to use ActiveAdmin on models using has_many through association?","tags":["ruby-on-rails","ruby-on-rails-3","associations","gem","activeadmin"],"question_text":"I am using\nActiveAdmin\ngem in my project.\nI have 2 models using has_many through association. The database schema looks exactly the same as th...
{"title":"How to convert two dimensional array to one dimensional array in php5","tags":["php","arrays","multidimensional-array"],"question_text":"Possible Duplicate:\nTurning multidimensional array into one-dimensional array\nI have this kind of an array\n`Array\n(\n [0] => Array\n (\n [0] => 88868\n )\n [1] => Array\...
{"title":"unique_ptr boost equivalent?","tags":["c++","boost","c++11","unique-ptr"],"question_text":"Is there some equivalent class for C++1x's std::unique_ptr in the boost libraries? The behavior I'm looking for is being able to have an exception-safe factory function, like so...\n`std::unique_ptr<Base> create_base()\...
{"title":"\"Illegal instance declaration\" when declaring instance of IsString","tags":["haskell","typeclass"],"question_text":"I'm writing an application that uses UTF-16 strings, and to make use of the overloaded strings extension I tried to make an\n`IsString`\ninstance for it:\n`import Data.Word ( Word16 )\nimport ...
{"title":"Why is a char and a bool the same size in c++?","tags":["c++","boolean"],"question_text":"I'm reading\nThe C++ Programming Language.\nIn it Stroustrup states that\n`sizeof(char) == 1`\nand\n`1 <= sizeof(bool)`\n. The specifics depend on the implementation. Why would such a simple value as a boolean take the s...
{"title":"How to declare abstract method in non-abstract class in PHP?","tags":["php","abstract-function"],"question_text":"`class absclass {\n abstract public function fuc();\n}`\nreports:\nPHP Fatal error: Class absclass\n contains 1 abstract method and must\n therefore be declared abstract or\n implement the remaini...
{"title":"How to set unit for Paint.setTextSize()","tags":["java","android","view"],"question_text":"Is it possible to change the unit for Paint.setTextSize()? As far as I know, it's pixel but I like to set the text size in DIP for multiple screen support.\nThanks","answer_text":"I know this topic is old and already an...
{"title":"Passing a method as a parameter in Ruby","tags":["ruby","parameters","methods"],"question_text":"I am trying to mess around a little bit with Ruby. Therefor I try to implement the algorithms (given in Python) from the book \"Programming Collective Intelligence\" Ruby.\nIn chapter 8 the author passes a method ...
{"title":"How do a read a xdebug profile in webgrind?","tags":["php","profiling","xdebug"],"question_text":"I have setup xdebug and webgrind and I have generated a profile so I can start improving the speed of my code execution. I have displayed the profile in webgrind but I haven't got a clue what any of it means. All...
{"title":"MySQL: What's the difference between float and double?","tags":["mysql"],"question_text":"Checking in the new database structure I saw that someone changed a field from float to double. Wondering why, I checked the mysql documentation, but honestly didn't understand what the difference is.\nCan someone explai...
{"title":"How do I make entire div a link?","tags":["html","css"],"question_text":"I have a div like this\n`<div class=\"xyz\"><\/div>`\nand all the content in that div is in the css. How do I make that div into a link? I tried wrapping the a tag around it, but that didn't seem to work.\nThanks!!","answer_text":"You ne...
{"title":"Android Studio: You must specify a path to Genymotion folder to use this feature","tags":["android","android-studio","genymotion"],"question_text":"I've downloaded and installed the Genymotion emulator plugin via the plugin wizard in Android Studio. I'm running Android Studio on a\nWindows\nmachine.\nI'm gett...
{"title":"How to testing for enum equality in JSF?","tags":["jsf","enums","el"],"question_text":"Is it possible to test for enum equality in JSF?\nE.g. where\n`stuff`\nis an\n`enum Stuff`\n:\n`<h:outputText value=\"text\" rendered=\"#{mrBean.stuff == mrsBean.stuff}\"\/>`","answer_text":"This is actually more EL related...
{"title":"Fighting client-side caching in Django","tags":["django","caching"],"question_text":"I'm using the render_to_response shortcut and don't want to craft a specific Response object to add additional headers to prevent client-side caching.\nI'd like to have a response that contains:\nPragma: no-cache\nCache-contr...
{"title":"Size for storing IPv4, IPv6 addresses as a string","tags":["mysql"],"question_text":"what should be the ideal size for storing IPv4, IPv6 addresses as a string in the MySQL database. should varchar(32) be sufficient?","answer_text":"Assuming textual representation in a string :\n15 characters for IPv4 (\n`xxx...
{"title":"C++ convert from 1 char to string?","tags":["c++","casting"],"question_text":"I really didn't find any answer that close...\nthe opposite way is pretty simple like str[0]\nBut I need to cast only 1 char to string...\nlike this:\n`char c = 34;\nstring(1,c);\n\/\/this doesn't work, the string is always empty.\n...
{"title":"Entity Framework Code First and Connection String Issue","tags":["entity-framework","entity-framework-4.1","ef-code-first","connection-string"],"question_text":"I am getting this error when using Entity Framework 4.1 code first. I can not find any sources of what exactly to use.\n`Unable to load the specified...
{"title":"Mimic UIAlertView Bounce?","tags":["iphone","cocoa-touch","uikit","core-animation","uialertview"],"question_text":"Whats the best way to mimic the bouncing animation from the UIAlertView on the iPhone? Is there some built-in mechanism for this? The UIAlertView itself won't work for my needs.\nI looked into an...
{"title":"iOS - Globally change navigation bar title color using appearance?","tags":["ios"],"question_text":"This crashes the app:\n`[[UINavigationBar appearance] setTitleColor:[UIColor darkGrayColor] forState:UIControlStateNormal];`\nIs there a way to do this using appearance?","answer_text":"This worked:\n`NSDiction...
{"title":"How to split a string with angularJS","tags":["javascript","angularjs"],"question_text":"I wanted to know if I can split a string simply in angularJS.\nI have my\n`$scope.test = \"test1,test2\";`\nin my controller and in my view,\nI wanted to do something like that\n`{{test[0] | split(',')}}\n{{test[1] | spli...
{"title":"How does Task<int> become a int?","tags":["c#",".net","asynchronous",".net-4.5","c#-5.0"],"question_text":"We have this method.\n`async Task<int> AccessTheWebAsync()\n{ \n HttpClient client = new HttpClient();\n Task<string> getStringTask = client.GetStringAsync(\"http:\/\/msdn.microsoft.com\");\n \/\/ You ca...
{"title":"Redirect console output to textbox in separate program","tags":["c#",".net","winforms","textbox","console"],"question_text":"I'm developing an Windows Forms application that requires me to call a separate program to perform a task. The program is a console application and I need to redirect standard output fr...
{"title":"How to make Visual Studio copy a DLL file to the output directory?","tags":["visual-studio","visual-c++","dll"],"question_text":"I have a Visual Studio C++ project that relies on an external DLL file. How can I make Visual Studio copy this DLL file automatically into the output directory (debug\/release) when...
{"title":"How do I refresh Netbeans workspace?","tags":["netbeans","netbeans-6.9"],"question_text":"In Eclipse, there is something called refresh workspace or F5 that refreshes the files, to make sure to pick-up any files that are changed outside eclipse.\nHow do i do that in Netbeans ? I am using 6.9.1 for PHP\/Java d...
{"title":"Free software for Windows installers: NSIS vs. WiX?","tags":["installer","wix","windows-installer","nsis"],"question_text":"I'm need to choose a software package for installing software. NSIS and WiX seem promising. Which one would you recommend over the other and why?\nFeel free to offer something else if yo...
{"title":"Normalizing from [0.5 - 1] to [0 - 1]","tags":["c++","math","hlsl","normalize"],"question_text":"I'm kind of stuck here, I guess it's a bit of a brain teaser. If I have numbers in the range between 0.5 to 1 how can I normalize it to be between 0 to 1?\nThanks for any help, maybe I'm just a bit slow since I've...
{"title":"Why do people use Puppet\/Chef with Amazon Cloud Formation instead of just using CloudInit?","tags":["amazon-ec2","amazon-web-services","chef","puppet"],"question_text":"We're planning to use AMI EC2 instances which are not \"pre-baked\". I.e. when they are spun up, they are bare installs of AWS linux. Our bo...
{"title":"Swift SourceKitService Crashed","tags":["ios","core-data","swift","crash","xcode6"],"question_text":"I have a Swift project using Core Data and the generated code for\n`saveContext()`\nis causing Xcode to crash with the SourceKitService Crashed error. When I comment it out the error stops, and it seems to be\...
{"title":"What is the C++ iostream endl fiasco?","tags":["c++","iostream","endl"],"question_text":"I was listening to a\ngoogle talk by Andrei Alexandrescu on the D programming\nlanguage when he threw out a one liner about the \"endl\" fiasco. I just thought endl was the preferred way to signify the end of a line and f...
{"title":"Are form elements outside of a FORM tag semantic html5?","tags":["forms","html5"],"question_text":"If I have a SELECT tag that will filter a table based on a user choice, does the SELECT tag need to be in a FORM tag (to be valid HTML5), if the resulting functionality will not work if JS disabled (i.e. we'll s...
{"title":"How to time expire Rails fragment caches?","tags":["ruby-on-rails","ruby"],"question_text":"How would I go about expiring a fragment cache after a period of time. I came across references to a\n`timed_fragment_cache`\ngem, but it seems out-dated.","answer_text":"Using\n`ActiveSupport::Cache::Store`\n, you sho...
{"title":"Count all occurrences of a char within a string","tags":["scala"],"question_text":"Does Scala have a native way to count all occurrences of a character in a string?\nIf so, how do I do it?\nIf not, do I need to use Java? If so, how do I do that?\nThanks!","answer_text":"`\"hello\".count(_ == 'l') \/\/ returns...
{"title":"pushing object into array schema in Mongoose","tags":["mongodb","mongoose"],"question_text":"I have this mongoose schema\n`var mongoose = require('mongoose');\nvar ContactSchema = module.exports = new mongoose.Schema({\n name: {\n type: String,\n required: true\n },\n phone: {\n type: Number,\n required: true...
{"title":"Select text in javascript","tags":["javascript","selection","highlight"],"question_text":"Can we make that a text is highlighted. I tried\nhttp:\/\/jsfiddle.net\/WdeTM\/\nbut it doesn't work.","answer_text":"Ok, first of all the question should be - How can I select a piece of text using JS?\nHighlighting is ...
{"title":"git rebase fatal: Needed a single revision","tags":["git","github","rebase"],"question_text":"I have a branch of a public repository and I am trying to update my branch with the current commits from the original repository:\n`$ git fetch <remote>\nremote: Counting objects: 24, done.\nremote: Compressing objec...
{"title":"asp.net mvc authorization using roles","tags":["asp.net-mvc","authorization"],"question_text":"I'm creating an asp.net mvc application that has the concept of users. Each user is able to edit their own profile. For instance:\nPersonID=1 can edit their profile by going to\nhttp:\/\/localhost\/person\/edit\/1\n...
{"title":"PHP, MySQL error: Column count doesn't match value count at row 1","tags":["php","mysql"],"question_text":"I'm getting this error:\n`Column count doesn't match value count at row 1`\nFrom the following code:\n`$name = $_GET['name'];\n$description = $_GET['description'];\n$shortDescription = $_GET['shortDescri...
{"title":"What causes iOS linking errors?","tags":["ios","frameworks","linker"],"question_text":"I've been getting some strange linking errors in XCode. I understand more or less what linking errors are, just not why they are showing up in my situation.\nI have an app that started as iPhone only. When I adjusted it to ...
{"title":"How to convert week number and year into unix timestamp?","tags":["php","strtotime","strftime","mktime"],"question_text":"I'm trying to group together dates into a week number and year, and then I want to convert that week number back into a unix timestamp. How can I go about doing this? Thanks in advance for...
{"title":"Passing arguments by value or by reference in objective C","tags":["objective-c","pass-by-reference"],"question_text":"I'm kind of new with objective c and I'm trying to pass an argument by reference but is behaving like it were a value. Do you know why this doesn't work?\nThis is the function:\n`- (void) che...
{"title":"Cannot use a CONTAINS or FREETEXT predicate on table or indexed view because it is not full-text indexed","tags":["sql","sql-server","tsql","sql-server-2008","full-text-search"],"question_text":"I am getting following error in my SQL server 2008 R2 database:\nCannot use a\n`CONTAINS`\nor\n`FREETEXT`\npredicat...
{"title":"Remove portion of string in Javascript","tags":["javascript","string"],"question_text":"I have a String like this in Javascript:\n`string = '@usernameWhats on your mind?'`\nI need to get rid of\n`'Whats on your mind?'`\nfrom the string.\nHow would I do that?","answer_text":"`var new_string = string.replace('W...
{"title":"How to host a Node.Js application in shared hosting","tags":["node.js","web-hosting"],"question_text":"How to host a Node.Js application in shared hosting\nI want to host a node.js application in shared hosting. Does anyone have any reference or documentation to refer to.\nthanks in advance","answer_text":"Yo...
{"title":"Django, ModelChoiceField() and initial value","tags":["django","django-forms"],"question_text":"I'm using something like this:\n`field1 = forms.ModelChoiceField(queryset=...)`\nHow can I make my form show the a value as selected?","answer_text":"If you want to set the default initial value you should be defin...
{"title":"How to make an OpenGL rendering context with transparent background?","tags":["c","winapi","opengl","transparency"],"question_text":"Rendering contexts usually have a solid color on the background (black or whatever, see the image below):\nI'm wondering if it's possible to setup a window, with no decorations ...
{"title":"Easiest way to merge a release into one JAR file","tags":["java","jar","merge","restructuredtext","uberjar"],"question_text":"Is there a tool or script which easily merges a bunch of\nJAR\nfiles into one JAR file? A bonus would be to easily set the main-file manifest and make it executable.\nThe concrete case...
{"title":"Hide line in default state in Highcharts","tags":["javascript","charts","highcharts"],"question_text":"How to hide line in default state in Highcharts js-script?\nI have ~7 series on my canvas, 3-4 of them are optional and I want to make them hidden when the page is load, but also show them in legend, to info...
{"title":"Instancing a class with an internal constructor","tags":["c#",".net","reflection"],"question_text":"I have a class whose constructor is defined as internal, which means I cannot instantiate it. While that may make sense, I would still like to do it once for debugging and research purposes.\nIs it possible to ...
{"title":"What to name images for iPhone 5 screen size?","tags":["ios","iphone","cocoa-touch","ios6","ios7"],"question_text":"What is the new naming convention for images for the 4-inch retina display?\nFor an image named\n`background.png`\nyou add\n@2x\nto the name (\n`background@2x.png`\n) to tell iOS to use that one...
{"title":"Default values for Xmx, Xms, MaxPermSize on non-server-class machines","tags":["jvm","jvm-arguments"],"question_text":"What are the default values for the following options in Java 6 on a\nnon-server-class machine\n?\n-Xmx\n-XX:MaxPermSize\nOracle's\ndocumentation\nstates that:\nOn server-class machines runni...
{"title":"How can i remove a column from table using rails console","tags":["ruby-on-rails","activerecord","ruby-on-rails-3.2","rails-migrations"],"question_text":"It is easily possible to remove a column using rails migration.\n`class SomeClass < ActiveRecord::Migration\n def self.up\n remove_column :table_name, :colu...
{"title":"List all virtualenv","tags":["virtualenv","virtualenvwrapper","virtualenv-commands"],"question_text":"In virtualenvwrapper, is there a simple way to list all virtualenv on my machine?\n(like what yolk -l does to list all python packages in the current virtual environment?)\nCLARIFICATION:\n\"ls -la\" in my en...
{"title":"How to get the Servlet Context from ServletRequest in Servlet 2.5?","tags":["servlets"],"question_text":"I am using Tomcat 6 which uses Servlet 2.5. There is a method provided in Servlet 3.0 in the\n`ServletRequest`\nAPI which gives a handle to the\n`ServletContext`\nobject associated with the\n`ServletReques...
{"title":"How to round up integer division and have int result in Java?","tags":["java","math","types","formatting"],"question_text":"I just wrote a tiny method to count the number of pages for cell phone SMS. I didn't have the option to round up using\n`Math.ceil`\n, and honestly it seems to be very ugly.\nHere is my ...
{"title":"How can I compare a float to NaN if comparisons to NaN always return false?","tags":["c#"],"question_text":"I have a float value set to NaN (seen in the Watch Window), but I can't figure out how to detect that in code:\n`if (fValue == float.NaN) \/\/ returns false even though fValue is NaN\n{\n}`","answer_tex...
{"title":"Find Types in All Assemblies","tags":["c#",".net","asp.net","reflection","types"],"question_text":"I need to look for specific types in all assemblies in a web site or windows app, is there an easy way to do this? Like how the controller factory for ASP.NET MVC looks across all assemblies for controllers.\nTh...
{"title":"NGINX to reverse proxy websockets AND enable SSL (wss:\/\/)?","tags":["ssl","tcp","proxy","nginx","mod-proxy"],"question_text":"I'm so lost and new to building NGINX on my own but I want to be able to enable secure websockets without having an additional layer.\nI don't want to enable SSL on the websocket ser...
{"title":"How do you change Background for a Button MouseOver in WPF?","tags":["wpf","button","background","triggers","mouseover"],"question_text":"I have a button on my page with this XAML:\n`<Button Content=\"Button\" HorizontalAlignment=\"Left\" VerticalAlignment=\"Bottom\" \n Width=\"50\" Height=\"50\" HorizontalCo...
{"title":"How do I get a code window to split vertically in Visual Studio 2008? (not HTML mode)","tags":["visual-studio","visual-studio-2008","ide"],"question_text":"In Visual Studio 2008, it seems that\nWindow -> Split\nonly gives me a horizontal split, and\nWindow -> New horizontal tab group\ndoes not allow me to edi...
{"title":"Crontab run every 15 minutes except at 3AM?","tags":["linux","unix","cron"],"question_text":"Is it possible to have a cronjob run every 15 minutes (over every hour etc..) except for at 3AM?\nI have another special cronjob I want to run at 3AM, but I don't want the other one to run at the same time...","answer...
{"title":"How to run a jar file in a linux commandline","tags":["java"],"question_text":"How to set the classpath to the current directory and also run the jar file named\n`load.jar`\npresent in the current directory by providing the argument as\n`load=2`\nfrom a linux command line.\nI did try to run the jar as follows...
{"title":"Why should I ever overload methods?","tags":["java","function","oop","function-overloading"],"question_text":"I found two examples in my book of overloading methods, but it doesn't explain clearly exactly why it's useful:\n`package keepo;\npublic class Main{\n public static void main(String [] args)\n {\n int...
{"title":"Android: Setting Zoom Level in Google Maps to include all Marker points","tags":["android","google-maps","android-maps"],"question_text":"I am trying to set zoom level for Maps in android such that it includes all the points in my list. I am using following code.\n`int minLatitude = Integer.MAX_VALUE;\nint ma...
{"title":"Do Facebook Oauth 2.0 Access Tokens Expire?","tags":["facebook","oauth"],"question_text":"I am playing around with the Oauth 2.0 authorization in Facebook and was wondering if the access tokens Facebook passes out ever expire. If so, is there a way to request a long-life access token?","answer_text":"After di...
{"title":"Multiple columns index when using the declarative ORM extension of sqlalchemy","tags":["python","database","orm","indexing","sqlalchemy"],"question_text":"According to the documentation:\nhttp:\/\/docs.sqlalchemy.org\/en\/latest\/core\/constraints.html#indexes\nand the comments in the sqlalchemy.Column class,...
{"title":"jQuery call function after load","tags":["jquery"],"question_text":"Need to call a filter function on some options based on a radio selected\n(Link here)\n, How can I call this after the page is loaded? the radio is set from a DB call and I would like to filter the options","answer_text":"`$(document).ready(m...
{"title":"Order of the JSON objects, using jacksons ObjectMapper","tags":["java","json","jackson"],"question_text":"I'm using\nObjectMapper\nto do my java-json mapping.\n`ObjectWriter ow = new ObjectMapper().writer().withDefaultPrettyPrinter();\now.writeValue(new File( fileName +\".json\"), jsonObj);`\nthis is my java ...
{"title":"Unix command to find lines common in two files","tags":["unix","shell","command-line"],"question_text":"I'm sure I once found a unix command which could print the common lines from two or more files, does anyone know its name? It was much simpler than\n`diff`\n.","answer_text":"The command you are seeking is\...
{"title":"Get null == null in SQL","tags":["sql","oracle",null,"nullable"],"question_text":"I wish to search a database table on a nullable column. Sometimes the value I'm search for is itself NULL. Since Null is equal to nothing, even NULL, saying\n`where MYCOLUMN=SEARCHVALUE`\nwill fail. Right now I have to resort to...
{"title":"How can I auto-populate a PDF form in Django\/Python?","tags":["python","django"],"question_text":"I have PDF forms that I want to autopopulate with data from my Django web application and then offer to the user to download. What python library would let me easily pre-populate PDF forms? These forms are inten...
{"title":"How to sleep a C++ Boost Thread","tags":["c++","multithreading","boost","sleep"],"question_text":"Seems impossible to sleep a thread using boost::thread.\nMethod sleep requires a system_time but how can I build it?\nLooking inside libraries doesn't really help much...\nBasically I have a thread\ninside the fu...
{"title":"How do you find out the type of an object (in Swift)?","tags":["swift"],"question_text":"When trying to understand a program, or in some corner-cases it's useful to be able to actually find out what type something is. I know the debugger can show you some type information, and you can usually rely on type inf...
{"title":"How do I automatically delete tempfiles in c#?","tags":["c#",".net","temporary-files"],"question_text":"What are a good way to ensure that a tempfile is deleted if my application closes or crashes? Ideally I would like to obtain a tempfile, use it and then forget about it.\nRight now I keep a list of my tempf...
{"title":"python convert to binary and keep leading zeros","tags":["python","binary","formatting","bitwise-operators"],"question_text":"I'm trying to convert an int to binary using the bin() function in python. However, it always removes the leading zeros, which I actually need, such that the result is always 8-bit:\nE...
{"title":"Could not load file or assembly System.Net.Http.Primitives. Located assembly's manifest definition does not match the assembly reference","tags":["exception","google-api-dotnet-client"],"question_text":"I'm working on a program that uses the Google API. However every time I run my program, it I keeps getting ...
{"title":"How do I create a custom event in an AngularJs service","tags":["javascript","angularjs","events","custom-events"],"question_text":"I am working on an AngularJs project. I have a service which sets and removes events on some buttons. This service is utilized by another service which I do not want to interact ...
{"title":"Automatically implemented property in struct can not be assigned","tags":["c#",".net","constructor","automatic-properties"],"question_text":"I have a next code:\n`struct T \n{\n public T(int u) \n { \n this.U = 10; \/\/Errors are here\n }\n public int U { get; private set; }\n}`\nC# compiler give me a pair of...
{"title":"Override Default Constructor of Partial Class with Another Partial Class","tags":["c#","web-services","wsdl","override","partial-classes"],"question_text":"I don't think this is possible, but if is then I need it :)\nI have a auto-generated proxy file from the wsdl.exe command line tool by Visual Studio 2008....
{"title":"Group objects by property in javascript","tags":["javascript","underscore.js"],"question_text":"How to convert this:\n`[\n {food: 'apple', type: 'fruit'},\n {food: 'potato', type: 'vegetable'},\n {food: 'banana', type: 'fruit'},\n]`\ninto this:\n`[\n {type: 'fruit', foods: ['apple', 'banana']},\n {type: 'vege...
{"title":"Installing MySQL-python on mac","tags":["python","osx","python-2.7","mysql-python"],"question_text":"I am using OSX 10.8 and PyCharm to work on a Python development project. I have installed MySQL-python for the mac using the instructions on the website\nhttp:\/\/blog.infoentropy.com\/MySQL-python_Environment...
{"title":"CSS Page-Break Not Working in all Browsers","tags":["css","page-break"],"question_text":"I'm having trouble getting this working in most browsers, except for IE (it even works correctly in IE6) and Opera.\nFirefox separates the divs correctly but only prints the first page.\nChrome and Safari only applies the...
{"title":"What is the right approach when using STL container for median calculation?","tags":["c++","stl","containers","median"],"question_text":"Let's say I need to retrieve the median from a sequence of 1000000 random numeric values.\nIf using anything\nbut\nSTL::list, I have no (built-in) way to sort sequence for m...
{"title":"Extraneous Package when Installed Locally","tags":["node.js","twitter-bootstrap","npm"],"question_text":"I was trying to install\nphantomjs\nin order to\n`make test`\nTwitter Bootstrap\n. After I had installed it locally i.e.\n`npm install phantomjs`\n, it reported that the package was extraneous.\n`\u00e2\u0...
{"title":"How to set CommandTimeout for DbContext?","tags":["c#","entity-framework-4","dbcontext","command-timeout"],"question_text":"I am looking a way to set CommandTimeout for DbContext. After searching I found the way by casting DbContext into ObjectContext and setting value for CommandTimeout property of objectCon...
{"title":"In what way does denormalization improve database performance?","tags":["database","performance","database-design","normalization","denormalization"],"question_text":"I heard a lot about denormalization which was made to improve performance of certain application. But I've never tried to do anything related.\...
{"title":"Check if Local Notifications are enabled in IOS 8","tags":["notifications","ios8","localnotification"],"question_text":"I've looked all over the internet for how to create local notifications with IOS 8. I found many articles, but none explained how to determine if the user has set \"alerts\" on or off. Could...
{"title":"MVC5 (VS2012) Identity CreateIdentityAsync - Value cannot be null","tags":["asp.net","asp.net-mvc-5","asp.net-identity","identity","claims-based-identity"],"question_text":"I am trying to setup OAuth for a an MVC5 site (in VS2012).\nI am using Fluent NHibernate. I have setup my own Userstore and pass in a rep...
{"title":"Multiple transitions for Twitter bootstrap .transition?","tags":["css","css3","twitter-bootstrap","less","css-transitions"],"question_text":"I am wanting to animate two properties in Bootstrap v2.1.0,\nThe\n`opacity`\nand the\n`margin`\n.\nI have tried:\n`.transition(opacity 0.5s, margin 0.25s);`\n: No output...
{"title":"diff current working copy of a file with another branch's committed copy","tags":["git"],"question_text":"I have a repo with file\n`foo`\nin the master branch. I switched to bar branch and made some changes to\n`foo`\n. How can I now run a\n`git diff`\nbetween this copy (which isn't committed yet) and the cop...
{"title":"How to move all files including hidden files into parent directory via *","tags":["linux","bash","shell","command"],"question_text":"Its must be a popular question but I could not find an answer.\nHow to move all files via * including hidden files as well to parent directory like this:\n`mv \/path\/subfolder\...
{"title":"Cloning an object in javascript","tags":["javascript","jquery","arrays","object","clone"],"question_text":"The below first logs 0, and then logs 1. How do I store a copy of the object, rather than a reference to it?\n`debug.log(vi.details.segment);\nvi.nextSegment = vi.details;\nvi.nextSegment.segment++;\ndeb...
{"title":"Starting Tasks In foreach Loop Uses Value of Last Item","tags":["c#","multithreading","c#-4.0","task"],"question_text":"I am making a first attempt at playing with the new Tasks, but something is happening that I don't understand.\nFirst, the code, which is pretty straight-forward. I pass in a list of paths t...
{"title":"Android change SDK version in Eclipse? Unable to resolve target android-x","tags":["eclipse","android"],"question_text":"I developed an Android aplication against 2.1 SDK. Since then I have re-installed Eclipse\/Android SDK; with the new install, I want to 'upgrade' the dependancy of the Android application t...
{"title":"How to Re-run failed JUnit tests immediately?","tags":["java","testing","junit"],"question_text":"Is there a way to have an JUnit Rule or something similar that gives every failing test a second chance, just by trying to run it once again.\nBackground: I have a large Set of Selenium2-WebDriver tests written w...
{"title":"JavaScript Calculate brighter colour","tags":["javascript","colors","increment","brightness"],"question_text":"I have a colour value in JS as a string\n`#ff0000`\nHow would I go about programatically calculating a brighter\/lighter version of this colour, for example\n`#ff4848`\n, and be able to calculate the...
{"title":"Effective way to find any file's Encoding","tags":["c#","encoding"],"question_text":"Yes is a most frequent question, and this matter is vague for me and since i don't now much about it.\nBut i would like a very precise way to find a files Encoding.\nSo precise as Notepad++ is.\nThanks.","answer_text":"The\n`...
{"title":"initialize a vector to zeros C++\/C++11","tags":["c++","c++11"],"question_text":"I know in C++11 they added the feature to initialize a variable to zero as such\n`double number = {}; \/\/ number = 0\nint data{}; \/\/ data = 0`\nIs there a similar way to initialize a\n`std::vector`\nof a fixed length to all ze...
{"title":"Return number of rows affected by UPDATE statements","tags":["sql","sql-server"],"question_text":"How can I get the number of rows affected by an UPDATE query in a Stored Procedure (SQL Server 2005), as a resultset. e.g.\n`CREATE PROCEDURE UpdateTables\nAS\nBEGIN\n -- SET NOCOUNT ON added to prevent extra res...
{"title":"Can Android do peer-to-peer ad-hoc networking?","tags":["android","networking","wifi","p2p","adhoc"],"question_text":"Is it possible to set up Android in ad-hoc peer-to-peer wifi mode? For example, I would like to have one phone broadcast a message, and have all peers in the network receive the broadcast, wit...