text
stringlengths
74
309k
{"title":"POST Multipart Form Data using Retrofit 2.0 including image","tags":["android","retrofit","androidhttpclient","retrofit2"],"question_text":"I am trying to do a HTTP POST to server using\nRetrofit 2.0\n`MediaType MEDIA_TYPE_TEXT = MediaType.parse(\"text\/plain\");\n MediaType MEDIA_TYPE_IMAGE = MediaType.parse...
{"title":"How can I use the RelayCommand in wpf?","tags":["c#","wpf","relaycommand"],"question_text":"How can I use the\n`RelayCommand`\nin wpf?","answer_text":"Relay command doesn't exist in WPF, it is just a external class that raised to prominence after it was defined in\nthis MSDN article\n. You need to write it yo...
{"title":"How to execute tests that match a regular expression only?","tags":["scala","sbt"],"question_text":"In sbt 0.10.1, I frequently use\n`test-only`\nto narrow down the number of my tests.\n`sbt> test-only com.example.MySpec`\nHowever, I want to narrow down such that I only run tests whose name\/description match...
{"title":"How do you put a border around a UITableViewCell's contentView? (for testing)","tags":["iphone","ios","uitableview"],"question_text":"what's the code to put a border around a UITableViewCell's contentView? (for testing)\nIf not possible why is this? (for my learning)","answer_text":"Have you tried using\n`con...
{"title":"ActionView::Template::Error ( isn't precompiled):","tags":["ruby-on-rails","asset-pipeline"],"question_text":"In production (Heroku), I'm getting the following error:\n`Started GET \"\/articles\/1\" for 50.134.181.231 at 2012-06-17 00:37:35 +0000\n2012-06-17T00:37:35+00:00 app[web.1]: ActionView::Template::Er...
{"title":"How can I set the default timezone in node.js?","tags":["node.js","timezone"],"question_text":"How do I set the default timezone in node.js?","answer_text":"According to\nthis google group thread\n, you can set the TZ environment variable before calling any date functions. Just tested it and it works.\n`> pro...
{"title":"LinearLayout$LayoutParams cannot be cast to android.widget.FrameLayout$LayoutParams","tags":["android"],"question_text":"Explanation and solution at the bottom.\nI am development one slider layout animation, animation work fine but when all process end get next Exception.\nI guess\n`RelativeLayout`\nparent ha...
{"title":"jQuery How do you get an image to fade in on load?","tags":["jquery","onload","fadein"],"question_text":"All I want to do is fade my logo in on the page loading. I am new today to jQuery and I can't managed to fadeIn on load please help. Sorry if this question has already been answered I have had a look and t...
{"title":"Hashtable with MultiDimensional Key in C#","tags":["c#","dictionary","hashtable"],"question_text":"I'm basically looking for a way to access a hashtable value using a two-dimensional typed key in c#.\nEventually I would be able to do something like this\n`HashTable[1][false] = 5;\nint a = HashTable[1][false];...
{"title":"Is using a Mutex to prevent multiple instances of the same program from running safe?","tags":["c#","winforms","mutex","single-instance"],"question_text":"I'm using this code to prevent a second instance of my program from running at the same time, is it safe?\n`Mutex appSingleton = new System.Threading.Mutex...
{"title":"Yii2 : Active Record add Not In condition","tags":["activerecord","yii","yii2"],"question_text":"What is the active Record way of adding IN condition to an active Query\nin yii 1.x you could use CDbCriteria like this\n`$cr = new CDbCriteria();\n$cr->addNotInCondition('attribute', $array);`\nThere seem to be n...
{"title":"How to use fonts in Rails 4","tags":["fonts","asset-pipeline","ruby-on-rails-4"],"question_text":"I have a Rails 4 application and I am trying to use a custom font.\nI have followed many tutorials on this and somehow it's just not working for my application.\nI am using\n`application.css.less`\nand have the f...
{"title":"How to get all checked checkboxes","tags":["javascript","html"],"question_text":"I have a set of input checkboxes with same name\nand I would like determine which checkboxes have been checked using javascript, how can I achieve that?\nI know only how to get all the checkboxes as follows:\n`var checkboxes = do...
{"title":"UIBezierPath stroke 1px line and fill 1px width rectangle - different results.","tags":["ios","drawing","uibezierpath"],"question_text":"Here is a simple drawing\n`- (void)drawRect:(CGRect)rect\n{\n \/\/vertical line with 1 px stroking\n UIBezierPath *vertLine = [[UIBezierPath alloc] init];\n [vertLine moveTo...
{"title":"Objective-C - When to use 'self'","tags":["iphone","objective-c","cocoa-touch"],"question_text":"This is unmodified code from Apple's iPhone 'Utility Aplication' template:\n`- (void)applicationDidFinishLaunching:(UIApplication *)application {\n MainViewController *aController = [[MainViewController alloc] ini...
{"title":"C\/C++ global vs static global","tags":["c++","c","static","global-variables"],"question_text":"Possible Duplicate:\nStatic vs global\nI'm confused about the differences between global and static global variables. If static means that this variable is global only for the same file then why in two different fi...
{"title":"IntelliJ IDEA Report Highlighting error when using routes in Controller","tags":["intellij-idea","scala-2.10","playframework-2.2"],"question_text":"I have a Scala Play project. I'm using Play 2.2.1. I downloaded Scala, Play 2 supported and SBT plugins. Everything is OK, but When I call route on Action in the ...
{"title":"What does the @package directive do in Objective-C?","tags":["objective-c"],"question_text":"Does anyone know exactly what the @package directive is used for in Objective-C?\nThe only mention I could find of it in Programming in Objective-C 2.0 by Stephen Kochan was:\n@package - For 64 bit images, the instanc...
{"title":"Methods to convert C# code to a PowerShell Script?","tags":["c#","powershell","powershell-v2.0"],"question_text":"I regularly have to convert an existing C# code snippet\/.CS file to a PowerShell script. Can anyone offer any tools or methods that would allow some automation of this?\nNote, while I am aware th...
{"title":"What causes Android's ContentResolver.query() to return null?","tags":["android"],"question_text":"Under what conditions does\nContentResolver.query\n() return null instead of a cursor object? I've gotten empty cursors before but just realized that the method can also return null. I haven't been able to trace...
{"title":"Type 'ViewController' does not conform to protocol 'UITableViewDataSource'","tags":["ios","uitableview","swift"],"question_text":"Started practice swift. In singleViewController I am trying to make a\n`UITableView`\n. In storyboard I set the datasource and delegate. Here I am getting the error\n* 'ViewControl...
{"title":"how to reference a bean of another xml file in spring","tags":["java","spring","reference","javabeans"],"question_text":"I have a Spring bean defined in an xml file. I want to reference it from another xml file. How can I go about it?","answer_text":"You have a couple of options:\nImport\n`<import resource=\"...
{"title":"Winforms Double Buffering","tags":["c#","winforms","doublebuffered"],"question_text":"I added this to my form's constructor code:\n`this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.DoubleBuffer, true);`\nBut it still shows ugly artifacts when it loads the controls, wh...
{"title":"How to write file if parent folder doesn't exist?","tags":["node.js","file","file-io"],"question_text":"I need to write file to the following path:\n`fs.writeFile('\/folder1\/folder2\/file.txt', 'content', function () {\n });`\nBut\n`'\/folder1\/folder2'`\npath may not exists. So I get the following error:\n`...
{"title":"Set InnerException of .NET Exception object","tags":["c#","exception","reflection"],"question_text":"How can I set the\n`InnerException`\nproperty of an\n`Exception`\nobject, while I'm in the constructor of that object? This boils down to finding and setting the backing field of a property that has no setter....
{"title":"What can be the reasons of connection refused errors?","tags":["c","sockets"],"question_text":"I'm trying to write a server program in C, \nusing another client, I get this error when I try to connect through port 2080 for example.\n`connection refused`\nWhat can be the reasons of this error?","answer_text":"...
{"title":"C++ vs Java: endless loop creating objects only crashes C++","tags":["java","c++","pointers","memory-management"],"question_text":"This was a question in one of my books (with no answer attached to it), that I've been thinking about for a few days now. Is the answer simply that the C++ code will eventually cr...
{"title":"How to extract specific array keys and values to another array?","tags":["php","arrays"],"question_text":"I have an array of arrays like so:\n`array( array(), array(), array(), array() );`\nthe arrays inside the main array contain 4 keys and their values. The keys are the same among all arrays like this:\n`ar...
{"title":"AngularJS - How do I change the State from Inside the Controller","tags":["angularjs","url-routing","state"],"question_text":"I am new to AngularJS and would like to know how I change the State from within the Controller.\nFor example, I typically change the state on a button click:\n`<input type=\"submit\" c...
{"title":"Check if user is root in C?","tags":["c","unix","root"],"question_text":"How can I verify if the user is root?","answer_text":"Usually it's a mistake to test if the user is root. POSIX does not even require a root user, but leaves it to the implementation to determine how permissions work. Code such as:\n`if ...
{"title":"Django's ManyToMany Relationship with Additional Fields","tags":["database","django","model","many-to-many"],"question_text":"I want to store some additional information in that, automatically created, ManyToMany join-table. How would I do that in Django?\nIn my case I have two tables: \"Employees\" and \"Pro...
{"title":"What does the ++ (or --) operator return?","tags":["c#","operators"],"question_text":"While playing around with the\n`++`\noperator, I tried to write the following:\n`++i++;`\nI expected this to compile at first, but I got a compiler error:\nThe operand of an increment or decrement operator must be a variable...
{"title":"Java\/MongoDB query by date","tags":["java","datetime","mongodb"],"question_text":"I stored a value as a java.util.Date() in my collection, but when I query to get values between two specific dates, I end up getting values outside of the range. Here's my code:\nto insert\n`BasicDBObject object = new BasicDBOb...
{"title":"Eclipse Kepler - PHP Code completion not working","tags":["php","eclipse","project","aptana","code-completion"],"question_text":"Today i've downloaded Eclipse Kepler and i've noticed that PHP code completion is not working anymore.\nwhen i type the first letters of a standard php function then press CTRL+Spac...
{"title":"Why is splitting a string slower in C++ than Python?","tags":["c++","python","string","split","benchmarking"],"question_text":"I'm trying to convert some code from Python to C++ in an effort to gain a little bit of speed and sharpen my rusty C++ skills. Yesterday I was shocked when a naive implementation of r...
{"title":"xsl: how to split strings?","tags":["xml","xslt"],"question_text":"I want to split an address on semicolons (\n`;`\n) into rows separated by\n`<br \/>`\n:\ne.g. if\n`address`\n=\n`123 Elm Street`\n, I want to output\n`123 Elm Street`\n,\nbut if\n`address`\n=\n`123 Elm Street;PO Box 222`\n, I want to output\n`...
{"title":"How to find mongo documents with a same field","tags":["mongodb"],"question_text":"I have a mongo collection, and I need to find documents in this collection, in wich fields name and adrress are equal.\nI have searched a lot, I could only find\nMongoDb query condition on comparing 2 fields\nand\nMongoDB: Uniq...
{"title":"Got origin_mismatch error in Google+ share api","tags":["api","google-plus","share","mismatch"],"question_text":"I want to share some dynamic content on google+. For this I checked it\nhttps:\/\/developers.google.com\/+\/web\/share\/interactive#rendering_the_button_with_javascript\n`<head>\n<script type=\"tex...
{"title":"Python check that key is defined in dictionary","tags":["python","hash","dictionary"],"question_text":"How to check that the key is defined in dictionary in python?\n`a={}\n...\nif 'a contains key b':\n a[b] = a[b]+1\nelse\n a[b]=1`","answer_text":"Use the\n`in`\noperator:\n`if b in a:`\nDemo:\n`>>> a = {'foo...
{"title":"Difference between delete and remove method in $resource?","tags":["angularjs","angular-resource"],"question_text":"What is the difference between\n`delete`\nand\n`remove`\nmethods? Both of them use\n`DELETE`\nmethod of HTTP. I couldn't find any reasonable information.","answer_text":"I don't believe there is...
{"title":"What's the best way to trim whitespace from a string in Cocoa Touch?","tags":["cocoa-touch","string"],"question_text":"I'm looking to determine whether a string value from a user input (UITextField) is \"blank\" if it's not nil. Checking if\n`[textField.text isEqualToString:\"\"]`\nisn't quite enough because ...
{"title":"What is wrong with using arrays dynamically allocated in C++?","tags":["c++","dynamic-allocation"],"question_text":"Like the following code :\n`int size = myGetSize();\nstd::string* foo;\nfoo = new std::string[size];\n\/\/...\n\/\/ using the table\n\/\/...\ndelete[] foo;`\nI heard that such use (not this code...
{"title":"is there a method to get the Max and Min of an NSMutableArray","tags":["ios","nsmutablearray","max","min"],"question_text":"Is there a way in iOS for me to get the Max and Min values of an NSMutableArray of double numbers. I'm looking for an already existing method, not for me to sort the array my self. If th...
{"title":"When to use a Float","tags":["c#","types","floating-point"],"question_text":"Years ago I learned the hard way about precision problems with floats so I quit using them. However, I still run into code using floats and it make me cringe because I know some of the calculations will be inaccurate.\nSo, when is it...
{"title":"Is it possible to create desktop applications with node.js?","tags":["javascript","node.js","window"],"question_text":"I've created an application using node.js, and I'm interested to know if it's possible to pack the client side (js, html ,css) and the server side into a standalone application (that doesn't ...
{"title":"Angular ui-router scroll to top, not to ui-view","tags":["javascript","angularjs","angular-ui","angular-ui-router"],"question_text":"I've just upgraded to\n`ui-router 0.2.8`\nfrom\n`0.2.0`\nand I've noticed that when the state changes, the scroll position jumps to the top of te child\n`ui-view`\nthat is the s...
{"title":"cross compiler ldd","tags":["cross-compiling","ldd"],"question_text":"I have created a cross compiled arm executable. I want to find the library dependency of the executable. I am using ubuntu natty and installed arm-linux-gnueabi tool chain, which does not contain ldd. Is there a tool available to view arm e...
{"title":"Translating Perl to Python","tags":["python","perl","rewrite"],"question_text":"I found this Perl script while\nmigrating my SQLite database to mysql\nI was wondering (since I don't know Perl) how could one rewrite this in Python?\nBonus points for the shortest (code) answer :)\nedit\n: sorry I meant shortest...
{"title":"Android: How to get the time from a TimePicker when it is typed in","tags":["android","dialog","android-preferences","sharedpreferences","timepicker"],"question_text":"I've got a DialogPreference which implements a simple TimePicker.OnTimeChangedListener (see below). Setting the time by clicking the +\/- butt...
{"title":"how to stop Handler in Android?","tags":["android"],"question_text":"In My Application my handler doesn't stop. How can I stop the handler?\nIt continues to start after closing the activity. What can i do?\nthe code is :\n`handler = new Handler()\n {\n @Override\n public void handleMessage(Message msg) \n {\n...
{"title":"AngularJS + Jasmine: Comparing objects","tags":["javascript","unit-testing","angularjs","tdd","jasmine"],"question_text":"I'm just starting out writing tests for my AngularJS app and am doing so in Jasmine.\nHere are the relevant code snippets\nClientController:\n`'use strict';\nadminConsoleApp.controller('Cl...
{"title":"How to add imageview on right hand side of action bar?","tags":["android","android-layout","android-actionbar"],"question_text":"I want to add image view on action bar right hand side.I tried to do that but i couldn't.\nCan anyone help me?\nThis is my image view xml\n`<ImageView\n android:id=\"@+id\/imageView...
{"title":"How to check if a property has value in Ant","tags":["ant"],"question_text":"I have an Ant XML file which I use for build.\nI have 3 properties. I want to break the build if these properties does not contain any value. Also I want to break the build if the value is empty.\nHow can I do this in Ant?\nI a using...
{"title":"SQL performance on LEFT OUTER JOIN vs NOT EXISTS","tags":["sql","sql-server"],"question_text":"If I want to find a set of entries in table A but not in table B, I can use either LEFT OUTER JOIN or NOT EXISTS. I've heard SQL Server is geared towards ANSI and in some case LEFT OUTER JOINs are far more efficient...
{"title":"Is there any way to change android:windowSoftInputMode value from java class?","tags":["android","android-tabhost","android-softkeyboard"],"question_text":"I want to act my tabs to have different\n`windowSoftInputMode`\nproperties for each tab. How to access this property from java class when all handling of ...
{"title":"JSF + PrimeFaces: `update` attribute does not update component","tags":["jsf","jsf-2","primefaces"],"question_text":"Here is my layout\n`<div id=\"mainPanel\">\n <div id=\"padding\">\n <h:outputText id=\"text\" value=\"Personal Feed\" rendered=\"#{Profile.renderComment}\"\/>\n <\/div>\n <div id=\"right\">\n <...
{"title":"Where do I save partial (views) in Zend Framework, to be accessible for all Views in my App?","tags":["php","model-view-controller","zend-framework","zend-view"],"question_text":"I have several view Partials (like paginator partial) which I want them to be available\nTo all view scripts in my application.\nIs...
{"title":"Git: How to move back and forth between commits","tags":["git","reset","pull","git-pull"],"question_text":"I have a newbie question about Git:\nI need to move back and forth in a history of a branch.\nThat means, I need to get all the files to the state they were in in some old revision, and then I need to ge...
{"title":"Why am I getting \"Commit failed with error: pathspec ... did not match any file(s)\"?","tags":["git","git-commit"],"question_text":"I am having some issues with Git.\nI have a repository where I can commit any file to without problem. However, there is a single file 'Funder.php' which, when I try committing,...
{"title":"Rotate image with javascript","tags":["javascript","jquery"],"question_text":"I need to rotate an image with javascript in 90-degree intervals. I have tried a few libraries like\njQuery rotate\nand\nRapha\u00c3\u00abl\n, but they have the same problem - The image is rotated around its center. I have a bunch o...
{"title":"resValue gradle error: Unsupported type \"String\" in \"generated.xml\"","tags":["android","android-studio","android-gradle","build.gradle"],"question_text":"A few weeks ago I posted a question\nHow to override resources depending on buildType\n.\nAnd just yesterday there was a\ngradle plugin release for andr...
{"title":"How to create\/read\/write JSon files in Qt5","tags":["c++","json","qt","qt5"],"question_text":"Qt5 has a new JSon parser and I want to use it. The problem is that it isn't too clear about what the functions do in layman's terms and how to write code with it. That or I could be reading it wrong.\nI want to kn...
{"title":"What is your best list of 'must have' development tools?","tags":["windows-vista"],"question_text":"I recently burned up my development laptop (it literally emitted smoke from the vents). After pulling the hd I was unable to get it to spin with a USB device attached to a home tower. Since I was on a deadline ...
{"title":"Is there any publically accessible JSON data source to test with real world data?","tags":["javascript","json","testing","treeview"],"question_text":"I'm working on a JavaScript dynamically loaded tree view user control. I'd like to test it with real world data.\nDoes anybody know any public service with an A...
{"title":"Ruby on Rails vs Grails vs. Spring ROO vs. Spring App","tags":["java","ruby-on-rails","spring","grails","spring-roo"],"question_text":"I'm planning on writing a simple web application that will be used by lots of users (as complicated as a simple bookmarking app) and I'm trying to decide which framework\/lang...
{"title":"I don't understand Collation? (Mysql, RDBMS, Character sets)","tags":["sql","mysql","sql-server","oracle","rdbms"],"question_text":"I Understand Character sets but I don't understand Collation. I know you get a default collation with every Character set in Mysql or any RDBMS but I still don't get it! Can some...
{"title":"Converting a string to a class name","tags":["c#",".net"],"question_text":"I have a string variable that represents the name of a custom class. Example:\n`string s = \"Customer\";`\nI will need to create an arraylist of customers. So, the syntax needed is:\n`List<Customer> cust = new ..`\nHow do I convert the...
{"title":"Mongo \"prealloc\" files taking up room","tags":["mongodb","ubuntu"],"question_text":"I'm trying to free up some space on an Ubuntu server running Mongo. I've attached a new, empty 8GB volume, and have the room to move stuff around.\nI have several large (1GB) files in \/var\/lib\/mongodb\/journal\/prealloc, ...
{"title":"proper hibernate annotation for byte[]","tags":["java","database","hibernate","postgresql","blob"],"question_text":"I have an application using hibernate 3.1 and JPA annotations. It has a few objects with byte[] attributes (1k - 200k in size). It uses the JPA @Lob annotation, and hibernate 3.1 can read these ...
{"title":"unable to call firefox from selenium in python on AWS machine","tags":["python","selenium","amazon-web-services","screen-scraping","web-scraping"],"question_text":"I am trying to use selenium from python to scrape some dynamics pages with javascript. However, I cannot call firefox after I followed the instruc...
{"title":"What does \"*\" mean in CSS?","tags":["css"],"question_text":"I have been looking at the CSS files for many websites like Facebook and Youtube.\nIn almost all of them I see this code:\n`* {\nmargin: 0;\npadding: 0;\n}`\nIt is odd, as removing that block in chrome web developer tools doesn't affect the layout ...
{"title":"Using CSS to transition the fill property of an SVG path on hover","tags":["css","svg","hover","css-transitions"],"question_text":"I'm including an SVG image file on my page within an\n`object`\ntag, like this:\n`<object type=\"image\/svg+xml\" data=\"linkto\/image.svg\">\n <!-- fallback image in CSS -->\n<\/...
{"title":"installing mod_ssl amazon linux","tags":["linux","ssl","amazon-web-services","centos"],"question_text":"I'm simply trying to install\n`mod_ssl`\non a CentOS server. Doing a straightforward\n`sudo yum install mod_ssl`\nwould return an error:\nError: httpd24-tools conflicts with\n httpd-tools-2.2.25-1.0.amzn1.x...
{"title":"How do I scroll to an element using JavaScript?","tags":["javascript","html"],"question_text":"I am trying to move the page to a\n`<div>`\nelement.\nI have tried the next code to no avail:\n`document.getElementById(\"divFirst\").style.visibility = 'visible';\ndocument.getElementById(\"divFirst\").style.displa...
{"title":"Script all data from SQL Server database","tags":["sql","sql-server","tsql","sql-server-2008","ssms"],"question_text":"I have two databases with equivalent structure and I need to extract data from one of them in form of\n`INSERT`\nstatements (generate script to apply it on the other database).\nHow can I do ...
{"title":"\"Waiting for debugger to attach\" showing even when not running in debug mode","tags":["android","debugging"],"question_text":"My problem\n:\nI ran upon an awkward problem as I was developing my application. As mentioned in the title, every time I install my application (in run mode, not debug!) at start-up ...
{"title":"Removing\/undefining a class method","tags":["ruby","metaprogramming"],"question_text":"You can dynamically define a class method for a class like so:\n`class Foo\nend\nbar = %q{def bar() \"bar!\" end}\nFoo.instance_eval(bar)`\nBut how do you do the opposite:\nremove\/undefine\na class method? I suspect Modul...
{"title":"Android draw circle around Text","tags":["android","textview"],"question_text":"I have a textView with a single character in it (all single digit numbers 0 - 9). I'd like to draw a circle or a square around the number. I saw a thread mention using a nine-patch to style around it, but i'm unsrure of how to do ...
{"title":"Kill Thread in Pthread Library","tags":["c++","c","multithreading","pthreads"],"question_text":"I use\n`pthread_create(&thread1, &attrs, \/\/... , \/\/...);`\nand need if some condition occured need to kill this thread how to kill this ?","answer_text":"First store the thread id\n`pthread_create(&thr, ...)`\n...
{"title":"Why can't a class extend traits with method of the same signature?","tags":["scala","override","trait"],"question_text":"Why is the error below? How to workaround it?\nEDIT: I assumed that since A and B compile to (interface,class) pairs, it's a matter of choosing the right static method call to implement whe...
{"title":"The type 'x' in 'x.cs' conflicts with the imported type 'x'","tags":["c#"],"question_text":"What is causing this build error?\nThe type '\nAriaLibrary.AriaBL.Book\n' in\n'I:\\Programing\\MyProgram\\Library\\AriaNetDelijanCorporation\\AriaLibrary\\AriaBL\\AriaBL.cs'\nconflicts with the imported type\n'AriaLibr...
{"title":"Scoping in Python 'for' loops","tags":["python","scope"],"question_text":"I'm not asking about Python's scoping rules; I understand generally\nhow\nscoping works in Python for loops. My question is\nwhy\nthe design decisions were made in this way. For example (no pun intended):\n`for foo in xrange(10):\n bar ...
{"title":"How to disable Style Cop visual studio extension?","tags":["visual-studio","stylecop"],"question_text":"How to disable the Style Cop visual studio extension? It's not listed in Tools \/ Extensions or in Tools \/ Add-in manager","answer_text":"I had the same issue: I uninstalled it using\nAdd\/Remove programs\...
{"title":"Microsoft JScript runtime error: no such method 'select' for tabs widget instance","tags":["jquery","jquery-ui","jquery-tabs"],"question_text":"I need\nselect\nspecific tab functionality for the jquery tabs on clicking on the html buttons. I am using\n`jquery.1.9.1.js`\nand\n`jquery-ui-1.10.2.custom.js`\nfile...
{"title":"Measure time in Ruby","tags":["ruby-on-rails","ruby","time","interpreter"],"question_text":"How can i measure the time taken by a method and the individual statements in that method in Ruby. If you see the below method i want to measure the total time taken by the method and the time taken for database access...
{"title":"What is IDL?","tags":["idl"],"question_text":"What is meant by IDL? I have googled it, and found out it stands for Interface Definition Language, which is used for interface definition for components. But, in practice, what is the purpose of IDL? Does Microsoft use it?","answer_text":"An interface definition ...
{"title":"How do I choose between Semaphore and SemaphoreSlim?","tags":["c#","multithreading","semaphore"],"question_text":"Their public interfaces appear similar. The\ndocumentation\nstates that the SemaphoreSlim is a lightweight alternative and doesn't use Windows Kernel semaphores.\nThis resource\nstates that the Se...
{"title":"Convert all data frame character columns to factors","tags":["r","dataframe"],"question_text":"Given a (pre-existing) data frame that has columns of various types, what is the simplest way to convert all its character columns to factors, without affecting any columns of other types?\nHere's an example\n`data....
{"title":"setting content between div tags using javascript","tags":["javascript","html"],"question_text":"I'm trying to set some content in between some div tags on a JSP page using javascript.\ncurrently the div tag on the JSP page looks like this:\n`<div id=\"successAndErrorMessages\"><\/div>`\nI want to fill the co...
{"title":"How does RSpec's expect work in ROR","tags":["ruby-on-rails","ruby","rspec","capybara"],"question_text":"While going through Ruby On Rails Tutorial by Michael Hartl,in the section where the author writes integration test to validate his Signup page, he has used code spinet bellow. I got what the code does but...
{"title":"angular.js directives in different modules","tags":["angularjs"],"question_text":"I am confused. If I can use\n`ng-app`\nonly once per page how can I use directives that sit in different modules, in different .js files. Look:\n`<script src='mainModule.js'\/>\n<script src='secondModule.js'\/>\n<body ng-app='ma...
{"title":"No sound on iOS 6 Web Audio API","tags":["javascript","html5","mobile-safari","ios6","web-audio"],"question_text":"I was really excited to see iOS 6 supports the Web Audio API, since we make HTML5 games. However, I cannot get iOS 6 to play any sound at all using the Web Audio API with examples that work fine ...
{"title":"Fighting cartesian product (x-join) when using NHibernate 3.0.0","tags":["nhibernate","eager-loading","cartesian-product"],"question_text":"I'm bad at math but I kind get idea what\ncartesian product\nis.\nHere is my situation (simplified):\n`public class Project{\n public IList<Partner> Partners{get;set;}\n}...
{"title":"How can I get external SD card path for Android 4.0+?","tags":["android","android-sdcard"],"question_text":"Samsung Galaxy S3 has an extrenal SD card slot, which is mounted to\n`\/mnt\/extSdCard`\n.\nMy question is: how to get this path by something like\n`Environment.getExternalStorageDirectory()`\n? This wi...
{"title":"How to cleanly get (\"copy\") a remote git branch to local repository","tags":["git"],"question_text":"When using GIT, how would one \"get\" (fetch\/pull\/whatever...) a remote branch that someone else has committed to the remote repository to your own local repository in a way that does not try and perform a...
{"title":"PHP syntax highlighting","tags":["php","syntax-highlighting"],"question_text":"I'm searching for a\nPHP syntax highlighting engine\nthat can be customized (i.e. I can provide my\nown tokenizers\nfor new languages) and that can handle several languages\nsimultaneously\n(i.e. on the same output page). This engi...
{"title":"Why is File.Create needed to be closed?","tags":["c#",".net"],"question_text":"The following throws an exception \"\n`The process cannot access the file 'D:\\MyDir\\First.txt' because it is being used by another process.`\n\"\n`static void Main(string[] args)\n{\n Directory.CreateDirectory(@\"D:\\MyDir\");\n ...
{"title":"iOS 9 searchBar disappears from table header view when UISearchController is active","tags":["ios","swift","uisearchbar","ios9","uisearchcontroller"],"question_text":"The structure:\nView1 (click a button) -> present modally (MyModalView: UITableViewController)\nMyModalView has UISearchController embedded. Th...
{"title":"Detect if homebrew package is installed","tags":["bash","shell","homebrew"],"question_text":"I'm about to write a shell script to detect if several homebrew packages are installed in the system. Is there a way to use a brew command to achieve that?\nI tried using the exit code of\n`brew install <formula> --dr...
{"title":"Limiting double to 3 decimal places","tags":["c#","double","truncate"],"question_text":"This i what I am trying to achieve:\nIf a double has more than 3 decimal places, I want to truncate any decimal places beyond the third. (do not round.)\n`Eg.: 12.878999 -> 12.878`\nIf a double has less than 3 decimals, le...