text
stringlengths
74
309k
{"title":"Using normal-mode motions in command-line mode in Vim","tags":["vim","vi"],"question_text":"Is modal editing possible in command-line mode?\nSome examples:\nAfter writing\n`!ls ~\/foo\/bar`\nI want to\n`db`\nto delete\nbar\nI executed the above command and now I want to change\n`ls`\nto\n`mv`\nand jump back t...
{"title":"Access multiple elements of list knowing their index","tags":["python","list","indexing","elements"],"question_text":"I need to choose some elements from the given list, knowing their index. Let say I would like to create a new list, which contains element with index 1, 2, 5, from given list [-2, 1, 5, 3, 8, ...
{"title":"Asking questions in rake tasks","tags":["ruby","rake"],"question_text":"I have a rake task that is called from another rake task.\nIn this rake task I need to ask the user for some text input, and then, depending on the answer either continue, or stop everything from continuing (including the calling rake tas...
{"title":"Unsetting an enum flag","tags":["c#"],"question_text":"Consider\n`[Flags]\n public enum State\n {\n IsCool = 0x1,\n SomethingElse = 0x2\n }`\nI have a\n`State someState`\nand if some expression evaluates to true, I want to unset the\n`IsCool`\nflag of\n`someState`\nregardless\nof it being already set or unset...
{"title":"when is const reference better than pass-by-value in c++11","tags":["c++","c++11"],"question_text":"I have some pre-c++11 code in which I use\n`const`\nreferences to pass large parameters like\n`vector`\n's a lot. An example is as follows:\n`int hd(const vector<int>& a) {\n return a[0];\n}`\nI heard that with...
{"title":"Can I logically reorder columns in a table?","tags":["sql-server"],"question_text":"If I'm adding a column to a table in Microsoft SQL Server, can I control where the column is displayed logically in queries?\nI don't want to mess with the physical layout of columns on disk, but I would like to logically grou...
{"title":"Is there an easy way to make a Rails ActiveRecord model read-only?","tags":["ruby-on-rails","ruby-on-rails-3","activerecord"],"question_text":"I want to be able to create a record in the DB but then prevent Rails from making changes from that point on. I understand changes will still be possible at the DB lev...
{"title":"How can you display the Maven dependency tree for the *plugins* in your project?","tags":["java","plugins","maven"],"question_text":"A common Maven debugging technique is to use\nmvn dependency:tree\nto view the graph of project dependencies.\nHowever, this list shows the project dependencies, not the plugin ...
{"title":"Detect carrier connection type (3G \/ EDGE \/ GPRS)","tags":["iphone","objective-c","ios","network-programming","iphone-privateapi"],"question_text":"How can i get the type of connection of a carrier network?\nI'm able to get if connection is WIFI or WWAN using\n`Reachability`\nclass\nI'm able to get network ...
{"title":"Set position \/ size of UI element as percentage of screen size","tags":["android","android-layout"],"question_text":"I'm trying to work out if it's possible to use percentage positions\/sizes when creating a layout. What I want is something like this...\n`^\n|\n|\n| 68%\n|\n|\nv\nGallery (height equivalent o...
{"title":"ant jar error: Execute failed: java.io.IOException: Cannot run program...${aapt}\": error=2, No such file or directory","tags":["java","android","osx","unity3d","jar"],"question_text":"I'm trying to compile a simple Java library for Unity, and after running ant jar, I get the following message:\n`\/Applicatio...
{"title":"How to initialize an NSObject's subclass on iPhone?","tags":["iphone","initialization","class-design","subclass"],"question_text":"I want to write some methods in a class so that other classes can call these methods using\n`[instance methodName:Parameter]`\n.\nIf the class is a subclass of\n`UIViewController`...
{"title":"Large Object Heap Fragmentation","tags":["c#",".net","memory-management","memory-leaks","windbg"],"question_text":"The C#\/.NET application I am working on is suffering from a slow memory leak. I have used CDB with SOS to try to determine what is happening but the data does not seem to make any sense so I was...
{"title":"What does \"Unexpected precompiled header error\" mean?","tags":["c++","visual-studio-2008","compiler-errors"],"question_text":"I was trying to build a simple solution involving a Windows and a Console application. After using the wizard to generate the code skeleton for the projects, I didn't add any code an...
{"title":"How to install Nokogiri Ruby gem with mkmf.log saying libiconv not found?","tags":["ruby","gem","install","nokogiri"],"question_text":"I'm installing the Ruby Nokogiri gem and finding the error below.\nHow to diagnose this and solve it?\n`# gem install nokogiri\nBuilding native extensions. This could take a w...
{"title":"a script on this page is causing ie to run slowly","tags":["javascript","internet-explorer"],"question_text":"The problem is in the title - IE is misbehaving and is saying that there is a script running slowly - FF and Chrome don't have this problem.\nHow can I find the problem . .there's a lot of JS on that ...
{"title":"<script> tag vs <script type = 'text\/javascript'> tag","tags":["javascript","html"],"question_text":"Note: This is no duplicate. I asked if it is different from different webservers.\nI was just wondering, what is the difference between\n`<script>`\nand\n`<script type = 'text\/javascript'>`\nIs it different ...
{"title":"ANSI vs. non-ANSI SQL JOIN syntax","tags":["sql-server","tsql","join","sql"],"question_text":"I have my business-logic in ~7000 lines of T-SQL stored procedures, and most of them has next JOIN syntax:\n`SELECT A.A, B.B, C.C\nFROM aaa AS A, bbb AS B, ccc AS C\nWHERE\n A.B = B.ID\nAND B.C = C.ID\nAND C.ID = @pa...
{"title":"How can I test :inclusion validation in Rails using RSpec","tags":["ruby-on-rails-3","shoulda","rspec-rails"],"question_text":"I have the following validation in my ActiveRecord.\n`validates :active, :inclusion => {:in => ['Y', 'N']}`\nI am using the following to test my model validations.\n`should_not allow_...
{"title":"More Detailed Error From createFileAtPath?","tags":["objective-c"],"question_text":"Is there anyway to get more detailed error data back from \"createFileAtPath\" I was kind of expecting an NSError? Currently I am using the BOOL return value.\n`success = [fileMan createFileAtPath:fileOnDisk contents:dBuffer a...
{"title":"Converting HEX NSString To NSData","tags":["iphone","objective-c","ios","nsstring","nsdata"],"question_text":"I'm trying to convert a Hex\n`NSString`\nto\n`NSData`\n(I'm using the below attached code). The following is the output:\n`<00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000>`\nw...
{"title":"Any way to find number of days in month using Objective C?","tags":["objective-c","cocoa"],"question_text":"Instead of calculating the month and leap year to do this calculation. Is there any way to check using some Apple Internal APIs to do so?\nI found that the Java have something like this:\n`calendar.getA...
{"title":"Working example of CreateJobObject\/SetInformationJobObject pinvoke in .net?","tags":["c#",".net","winapi",".net-4.0","pinvoke"],"question_text":"I'm struggling to put together a working example of pinvoke'ing CreateJobObject and SetInformationJobObject. Through various google searches (including Russian and ...
{"title":"View entire dataframe when wrapped in tbl_df?","tags":["r","dplyr"],"question_text":"`tbl_df`\nis a command in the\n`dplyr`\ndata table management package in R. It prevents long table outputs when accidentally calling the data table or dataframe.\nOnce a dataframe has been wrapped by\n`tbl_df`\n, is there a c...
{"title":"Create Java console inside a GUI panel","tags":["java","user-interface","console","output","panel"],"question_text":"How can I create an instance of the Java console inside of a GUI panel?","answer_text":"Here's a functioning class. You can install an instance of this into the system out and err using:\n`Prin...
{"title":"Find the element repeated more than n\/2 times","tags":["arrays","algorithm"],"question_text":"There is an array (of size N) with an element repeated more than N\/2 number of time and the\nrest of the element in the array can also be repeated\nbut only one element is repeated more than N\/2 times. Find the nu...
{"title":"Constructor in Objective C","tags":["objective-c"],"question_text":"I am beginner in iPhone development.I was trying this sample program below.\nI'm not calling the +(void)initialise and -(id)init method in the class B.But its getting called automatically.\nIs the -(void)intialise is equal to the default cons...
{"title":"GCMRegistrar.onDestroy(context) crashing, Receiver not registered","tags":["android","google-cloud-messaging"],"question_text":"How should I call GCMRegistrar.onDestroy? Currently my main activity contains this:\n`protected void onDestroy() {\n GCMRegistrar.onDestroy(this);\n super.onDestroy();\n}`\nAnd after...
{"title":"Looking for a Command Line Argument Parser for .NET","tags":["c#",".net","command-line","arguments"],"question_text":"I'm looking for a command line argument parser, such as \"Command line parser\" from\nhttp:\/\/www.sellsbrothers.com\/tools\/Genghis\/\n.\nFeatures I'm looking for:\nAuto-generation of usage\n...
{"title":"Determining execution time of queries in SQLite","tags":["python","sql","sqlite","sqlite3"],"question_text":"I am creating a program for analyzing and generating queries. I was curious if there currently exists a method within SQLite such that I could query the time taken for a query to process? I am unable t...
{"title":"What is the use of BaseColumns in Android","tags":["java","android","database","sqlite"],"question_text":"What is the use of implementing a class from\n`BaseColumns`\nin Android?","answer_text":"The\n`BaseColumns`\ninterface provides names for the very common\n`_ID`\nand\n`_COUNT`\ncolumns.\nUsing common name...
{"title":"C# Getting Enum values ","tags":["c#",".net","string","enums"],"question_text":"I have a enum containing the following (for example):\nUnitedKingdom,\nUnitedStates,\nFrance,\nPortugal\nIn my code I use\nCountry.UnitedKingdom\nbut I want to have the value be\nUK\nif I assign it to a\nstring\nfor example.\nIs t...
{"title":"Can promises have multiple arguments to onFulfilled?","tags":["javascript","promise"],"question_text":"I'm following the spec\nhere\nand I'm not sure whether it allows onFulfilled to be called with multiple arguments. For example:\n`promise = new Promise(function(onFulfilled, onRejected){\n onFulfilled('arg1'...
{"title":"How to filter array in subdocument with MongoDB","tags":["mongodb","filter","aggregate"],"question_text":"I have array in subdocument like this\n`{\n \"_id\" : ObjectId(\"512e28984815cbfcb21646a7\"),\n \"list\" : [\n {\n \"a\" : 1\n },\n {\n \"a\" : 2\n },\n {\n \"a\" : 3\n },\n {\n \"a\" : 4\n },\n {\n \"a\"...
{"title":"Unit testing with Entity Framework","tags":["linq","unit-testing","entity-framework"],"question_text":"I want to test my Entities that are built using Entity Framework.\nMy concern is that using Entity Framework means directly working with data source.\nSo any ideas how to unit testing Entity Framework based ...
{"title":"Add text label to d3 node in Force directed Graph and resize on hover","tags":["javascript","svg","d3.js","label","force-layout"],"question_text":"I am trying to add text label to nodes in d3 Force Directed Graph, there seems to be an issue.\nThis is my\nFiddle\n:\nWhen I add the node name like this:\n`node.a...
{"title":"Start an Android app\/intent from an NFC tag?","tags":["android","nfc"],"question_text":"On an Android device equipped with NFC reader hardware, is there any in-built support to use the NFC tag contents to fire off an intent (e.g. starting an app)? I am asking whether the support is there by default, I know I...
{"title":"ASP.NET MVC Razor designer","tags":["asp.net-mvc","razor"],"question_text":"I am introducing ASP.NET MVC to a new team and one of the questions that comes up often is \"Is there a designer view\"\nEven if it's not for layout is there an IN visual studio design view for ASP.NET MVC3 using the razor view engine...
{"title":"Display an image or UIImage with a plain CALayer","tags":["ios","iphone","performance","uiimage","core-animation"],"question_text":"I've often read that using a\n`CALayer`\nrather than a\n`UIImageView`\nis an performance boost when it comes to heavy image usage. That makes sense, because\n`UIImageView`\ncause...
{"title":"How do I find the value of $CATALINA_HOME?","tags":["tomcat","tomcat7"],"question_text":"I have to copy\n`Connnector\/J`\nJAR in\n`$CATALINA_HOME\/lib`\nof Tomcat7 on\n`Amazon EC2`\n. How to find the full path of\n`$CATALINA_HOME\/lib`\non Amazon Linux in Amazon EC2?","answer_text":"Tomcat can tell you in sev...
{"title":"How to find duplicate values in SQL Server","tags":["sql-server","sql-server-2008","duplicates"],"question_text":"I'm using SQL Server 2008. I have a table\n`Customers\ncustomer_number int\nfield1 varchar\nfield2 varchar\nfield3 varchar\nfield4 varchar`\n... and a lot more columns, that don't matter for my qu...
{"title":"Are there any huge differences between objective-c and Java, or iPhone and Android?","tags":["java","iphone","objective-c","android","porting"],"question_text":"Edit: My bad, I meant objective-c, not c#. Some reason I got it into my head it was c# the iphone used. So the answers for c# were great, thanks, but...
{"title":"SQLite table disk usage","tags":["sqlite"],"question_text":"How can I find out the disk usage of a single table inside a SQLite database without copying it in a new empty database?","answer_text":"You can use sqlite_anlyzer from\nhttp:\/\/www.sqlite.org\/download.html\nIt's a really cool tool. Shows you the #...
{"title":"IntelliJ: how to open files in an existing IntelliJ from the command line","tags":["osx","command-line","intellij-idea"],"question_text":"I always have an IntelliJ running. Sometimes I want to open a file from outside IntelliJ. I can drag and drop a file to IntelliJ if am in the Finder, but if I am on the com...
{"title":"Storing messages using XMPPFramework for ios?","tags":["iphone","ios","core-data","storage","xmppframework"],"question_text":"I'm not sure how to use the XMPPFramework's core data to store incoming messages. Does anyone have any tutorials on how to do this? I see User objects, which in turn can have many \"re...
{"title":"In Java, what is a shallow copy?","tags":["java","clone","shallow-copy"],"question_text":"java.util.Calendar.clone() returns \"...a new Calendar with the same properties\" and returns \"a shallow copy of this Calendar\".\nThis does not appear to be a shallow copy as answered\nhere\non SO. That question is tag...
{"title":"MS Fakes unit tests failing after Visual Studio 2013 Update 4","tags":["unit-testing","visual-studio-2013","microsoft-fakes"],"question_text":"I have recently upgrade from Microsoft Visual Studio 2013 Update 3 (Premium edition) to Microsoft Visual Studio 2013 Update 4 (Premium edition) and now my existing uni...
{"title":"What is the shortest perceivable application response delay?","tags":["user-interface","response","research","perception"],"question_text":"A delay will always occur between a user action and an application response.\nIt is well known that the lower the response delay, the greater the feeling of the applicati...
{"title":"How does StringBuilder work?","tags":["c#",".net"],"question_text":"How does\n`StringBuilder`\nwork?\nWhat does it do\ninternally\n? Does it use unsafe code? \nAnd why is it so fast (compared to the\n`+`\noperator)?","answer_text":"When you use the + operator to build up a string:\n`string s = \"01\";\ns += \...
{"title":"Overview of all JSF-related web.xml context parameter names and values","tags":["jsf","web.xml","context-param"],"question_text":"There are several JavaServer Faces\n`<context-param>`\nin\n`web.xml`\n:\n`facelets.REFRESH_PERIOD`\n,\n`facelets.DEVELOPMENT`\n,\n`facelets.SKIP_COMMENTS`\netc. Where I can find a ...
{"title":"Testing $resource services in AngularJS","tags":["angularjs","angular-resource"],"question_text":"I am trying to begin writing unit tests for my angular application and hit a stopping block pretty quick as I am unsure of how exactly to mock my service in a testable way.\nIs there a way to mock the REST call o...
{"title":"Remove spacing between table cells and rows","tags":["html","css","table"],"question_text":"I'm designing an HTML email template, which\nforces me to use tables\n. In the code below, I'm having trouble (1) removing the spacing below the placeholder image and (2) removing the space between the image and the ca...
{"title":"How to redirect a user after registration when using Devise?","tags":["ruby-on-rails","ruby","devise"],"question_text":"I am using Rails 2.3 and Devise to handle user registration \/ authentication.\nI need to redirect a user to an external 3rd party website immediately after a user signs up for an account. B...
{"title":"How to view current database schema for Heroku app in Terminal?","tags":["ruby-on-rails","heroku","terminal","schema"],"question_text":"I am trying to view my Heroku app's schema in Terminal (Mac OS X Lion) and stumbled upon a command that does just that. In Terminal, I run\n`heroku run more db\/schema.rb`\nb...
{"title":"Best option for Session management in Java","tags":["java","session","servlets","cookies","url-rewriting"],"question_text":"Best way managing session in Java. I heard that cookies are not reliable option for this as they gets stored into browser and can be accessed later on? Is this correct? If possible pleas...
{"title":"Using *just* Bootstrap modal","tags":["css","twitter-bootstrap","bootstrap-modal"],"question_text":"I'm integrating my Modal from Bootstrap with another site that doesn't use it.\nI see that bootstrap lets you separate the Javascript for each component. But what about the CSS? If I link to bootstrap.css the w...
{"title":"Can I have a Django model that has a foreign key reference to itself?","tags":["django","django-models"],"question_text":"Okay, how would I do this?\n`class Example(models.Model):\n parent_example = models.ForeignKey(Example)`\nI want to have a model have a foreign key reference to itself. When I try to creat...
{"title":"ExecutorCompletionService? Why do need one if we have invokeAll?","tags":["java","multithreading","concurrency","executorservice","java.util.concurrent"],"question_text":"If we use an\nExecutorCompletionService\nwe can submit a series of tasks as\n`Callable`\ns and get the result interacting with the\n`Comple...
{"title":"Do you quote HTML5 attributes?","tags":["html","html5","performance","standards"],"question_text":"Attribute quotes are\noptional\nin HTML5.\nWhat are the pros\/cons to quoting them?\n`id=example <!--quotes optional-->\nhref=http:\/\/example.com <!--quotes optional-->\nclass=\"example example-1\" <!--quotes r...
{"title":"Syntax highlighting causes terrible lag in Vim","tags":["vim"],"question_text":"I love Vim. But its giving me hard times right now.\nI use a lot of plugins and during the last 6 months, I've found a lot of awesome ones. But my Vim got really sluggish too. I do constant cleanups, but it doesn't help much.\nI'm...
{"title":"Are H1,H2,H3,H4 tags block or inline elements?","tags":["html"],"question_text":"Is it correct HTML to change the color of text inside a H1, H2, H3 or H4 element? Are they block level?\nFor example\n`<h1><span style=\"color:#ABAB\">#500<\/span> Hello world<\/h1>`","answer_text":"They are block elements.\nIf y...
{"title":"How to unhide view with animations","tags":["iphone","xcode","cocoa-touch"],"question_text":"Say I have a hidden view in Xcode for iOS. Now, when I set the view to not hidden (view.hidden=NO), how can I make it so that it now appears, but with animations?","answer_text":"What you probably want is not to set\n...
{"title":"MySQL\/SQL retrieve first 40 characters of a text field?","tags":["php","sql","mysql","chop"],"question_text":"How can I retrieve a text field from mysql db table, but not the entire text, just the few 40 or so characters.\nCan this be done in sql or do I need to do it using php?\nbasically what I am trying t...
{"title":"How to change language settings in R","tags":["r"],"question_text":"My error messages are displayed in French. How can I change my system language setting so the error messages will be displayed in English?","answer_text":"You can set this using the\n`Sys.setenv()`\nfunction. My R session defaults to English,...
{"title":"How to debug ORA-01775: looping chain of synonyms?","tags":["sql","oracle","synonym"],"question_text":"I'm familiar with the issue behind ORA-01775: looping chain of synonyms, but is there any trick to debugging it, or do I just have to \"create or replace\" my way out of it?\nIs there a way to query the sche...
{"title":"Borderless NSButton turns gray when clicked","tags":["cocoa","user-interface","interface-builder","appkit","nsbutton"],"question_text":"I am making a little application with three NSButtons with an image set. These buttons have no border nor background. However, when I click a button it turns into a gray rect...
{"title":"Call a function in an ExtJS XTemplate","tags":["javascript","extjs"],"question_text":"I'm familiar with using a function to determine a specific condition using xtemplate but not sure how to directly call a function without the conditional if statement.\nMy code, for example, wants to append some characters t...
{"title":"How to add a title to a html select tag","tags":["html"],"question_text":"How would I go about setting a title in select tag? Here is my select box:\n`<select>\n <option value=\"sydney\">Sydney<\/option>\n <option value=\"melbourne\">Melbourne<\/option>\n <option value=\"cromwell\">Cromwell<\/option>\n <optio...
{"title":"Async, await and parallel in C#","tags":["asynchronous","async-await"],"question_text":"When should I use async\/await and when should I use parallel.foreach in C#? Are parallel and async\/await serve the same purpose? Can anybody help in clarifying this?","answer_text":"async\/await is about\nasynchrony\n, w...
{"title":"specify a different name for table|column name in EF4","tags":["entity-framework","entity-framework-4"],"question_text":"I'm using EF4 with CodeFirst\n`public class People : DbContext\n{\n public DbSet<Human> Humans { get; set; }\n public DbSet<Child> Children { get; set; }\n}`\nAt the moment, EF looks in the...
{"title":"How to use JQuery to select the nth option","tags":["javascript","jquery","html"],"question_text":"I have the following HTML\n`<select onchange=\"this.form.submit()\" name=\"name\">\n <option value=\"9995101E01#17201044055PM\">9995101E01#17201044055PM<\/option>\n <option value=\"GRR-Example\">GRR-Example<\/op...
{"title":"how to capture camera with UIImagePickerController in swift?","tags":["uiimagepickercontroller","swift","ios8","xcode6"],"question_text":"I'm trying use\n`UIImagePickerController`\nin swift but isn't work...\nmy ViewController:\n`class ViewController: UIViewController {\n@IBOutlet var imag : UIView = nil\n@IB...
{"title":"Difference between PCDATA and CDATA in DTD","tags":["xml","dtd"],"question_text":"What is the difference between\n`#PCDATA`\nand\n`#CDATA`\nin\nDTD\n?","answer_text":"PCDATA - Parsed Character Data\nXML parsers normally parse all the text in an XML document.\nCDATA - (Unparsed) Character Data\nThe term CDATA ...
{"title":"Why is it so easy to decompile Java Code?","tags":["java","decompiling"],"question_text":"So I've just realized how easy it is to decompile my Java code. I've been searching around the net and I can't seem to figure out\nWHY\nits so easy. Every time I google something like \"Why can I decomilple\n`.class`\nfi...
{"title":"File.createNewFile() thowing IOException No such file or directory","tags":["java","file-io"],"question_text":"I have a method that writes to a log file. If the file exists it should append to it, if not then I want it to create a new file.\n`if (!file.exists() && !file.createNewFile()) {\n System.err.println...
{"title":"How to output my ruby commandline text in different colours","tags":["ruby","command-line","colors"],"question_text":"How can I make the puts commands I output from a commandline based ruby program colour?\nI would appreciated any references to how I call each different colour also.\nLets say we start with th...
{"title":"How to find indexPath for tapped button in tableView Using Seque","tags":["ios","uitableview"],"question_text":"I have a\n`UITableView`\nusing prototype cell.\nThe cells have a\n`UIButton`\nthat show a\n`UIViewController`\n(Modal) using\n`Segue`\n.\nMy question is : How can i pass\n`IndexPath`\nof cell to sec...
{"title":"Is there a general string substitution function similar to sl4fj?","tags":["java"],"question_text":"With sl4fj if I want to construct a string message there is a nice approach which makes use of substitutions. For instance, it might be something like:\n`logger.info(\"Action {} occured on object {}.\", objectA...
{"title":"Appending items to a list of lists in python","tags":["python","list","csv","append"],"question_text":"I'm getting mad with list indexes, and can't explain what I'm doing wrong.\nI have this piece of code in which I want to create a list of lists, each one containing values of the same circuit parameter (volt...
{"title":"Mark parameters as NOT nullable in C#\/.NET?","tags":["c#",".net","parameters",null],"question_text":"Is there a simple attribute or data contract that I can assign to a function parameter that prevents\n`null`\nfrom being passed in C#\/.NET? Ideally this would also check at compile time to make sure the lite...
{"title":"Can I get the matrix determinant using Numpy?","tags":["python","numpy"],"question_text":"I read in the manual of Numpy that there is function\n`det(M)`\nthat can calculate the determinant. However, I can't find the\n`det()`\nmethod in Numpy.\nBy the way, I use Python 2.5. There should be no compatibility pro...
{"title":"Android TableLayout Width","tags":["android","layout","width","tablelayout"],"question_text":"I have a two column TableLayout as the only child of a scroll view. The first column contains TextViews ('labels') and the second column contains EditText\/Spinner\/DateWidget etc ('values'). Even though I have have ...
{"title":"Multiple database connections and Yii 2.0","tags":["yii2"],"question_text":"I have two databases, and every database has the same table with the same fields, but how do I get all records from all of two databases at the same time in\nYii\n2.0?","answer_text":"First you need to configure your databases like be...
{"title":"Generate temporary URL to reset password","tags":["url","passwords","reset"],"question_text":"I am looking to implement a Forgot Password feature on my website. I like the option where an email containing a temporary one-time use URL that expires after some time is sent to the user.\nI have looked at the foll...
{"title":"Can iterators be reset in Python?","tags":["python","iterator","generator"],"question_text":"Can I reset an iterator \/ generator in Python? I am using DictReader and would like to reset it (from the csv module) to the beginning of the file.","answer_text":"I see many answers suggesting\nitertools.tee\n, but ...
{"title":"Python glob multiple filetypes","tags":["python","glob"],"question_text":"Is there a better way to use glob.glob in python to get a list of multiple file types such as .txt, .mdown, and .markdown? Right now I have something like this:\n`projectFiles1 = glob.glob( os.path.join(projectDir, '*.txt') )\nprojectFi...
{"title":"Capture the close event of popup window in JavaScript","tags":["javascript","javascript-events"],"question_text":"I need to perform some action before a popup window(using\n`window.open`\n) closes.\nSomething like will be good:\n`var new_window = window.open('some url')\nnew_window.onBeforeUnload = function()...
{"title":"Python's __import__ doesn't work as expected","tags":["python","python-import"],"question_text":"When using\n`__import__`\nwith a dotted name, something like:\n`somepackage.somemodule`\n, the module returned isn't\n`somemodule`\n, whatever is returned seems to be mostly empty! what's going on here?","answer_t...
{"title":"What's the next step to learning Haskell after monads?","tags":["haskell"],"question_text":"I've been gradually learning Haskell, and even feel like I've got a hang of monads. However, there's still a lot of more exotic stuff that I barely understand, like Arrows, Applicative, etc. Although I'm picking up bit...
{"title":"IBOutlet link to embedded view controller","tags":["ios","storyboard","xcode4.5"],"question_text":"I have a complex iPad view that I manage by having several view controllers. I previously (before iOS6\/XCode 4.5) did this by allocating my view controllers in code, and hooked up the various views to them thou...
{"title":"What programming languages are good for statistics?","tags":["programming-languages","r","statistics","libraries"],"question_text":"I'm doing a bit more statistical analysis on some things lately, and I'm curious if there are any programming languages that are particularly good for this purpose. I know about\...
{"title":"What is the difference between H.264 video and MPEG-4 video?","tags":["video","video-encoding"],"question_text":"Are these both the same? Is H.264 codec of MPEG-4? What if I need to convert flv to high definition H.264 video format? I want make online tv streaming and want to use PHP or Python.","answer_text"...
{"title":"How to view GitHub Contributors Graph for branches other than master?","tags":["graph","github"],"question_text":"At\nhttps:\/\/github.com\/yourusername\/yourreponame\/graphs\nyou can find some nice graphs showing commits over time. However the information is only for the master branch.\nHow do I see the same...
{"title":"create a NSDate from a string","tags":["objective-c","ios","format","nsdate"],"question_text":"I have an\n`NSString`\nlike this:\n`@\"3\/15\/2012 9:15 PM\"`\nand I would like to convert it to\n`NSDate`\n, I have done like this:\n`NSString *str =@\"3\/15\/2012 9:15 PM\";\nNSDateFormatter *formatter = [[NSDateF...
{"title":"How to apply a function to a tuple?","tags":["scala"],"question_text":"This should be an easy one. How do I apply a function to a tuple in Scala? Viz:\nscala> def f (i : Int, j : Int) = i + j\nf: (Int,Int)Int\nscala> val p = (3,4)\np: (Int, Int) = (3,4)\nscala> f p\n:6: error: missing arguments for method f i...
{"title":"Python & MySql: Unicode and Encoding","tags":["python","mysql","unicode","utf-8","encode"],"question_text":"I am parsing json data and trying to store some of the json data into Mysql database. I am currently getting following unicode error. My question is how should I handle this.\nShould I handle it from th...
{"title":"Distinguish Java threads and OS threads?","tags":["java","linux","jvm","multithreading","posix"],"question_text":"In Production system,like Banking application running in Linux environment,\nHow do I distinguish running Java threads and native threads?\nIn Linux there will be Parent process for every child pr...
{"title":"Custom Classes and Formatting on Flash Messages for Twitter Bootstrap defaults","tags":["ruby-on-rails","ruby-on-rails-3","twitter-bootstrap"],"question_text":"I am integrating twitter bootstrap css into my application. Going along just fine,but I don't know how to customize the css and wrappers for my flash ...
{"title":"Bootstrap 3: how to make head of dropdown link clickable in navbar","tags":["javascript","css","twitter-bootstrap-3"],"question_text":"I'm using the default navbar and a couple of the list items are dropdowns. I'm not able to click the link that triggers the dropdown. I know that I could just add a duplicate ...
{"title":"AngularJS + sails.js","tags":["javascript","node.js","angularjs","yeoman","sails.js"],"question_text":"I am developing an app that can utilize sails.js for back-end and AngularJS for Front-end. I thought that I'll create an Angular App using Yeoman-angular generator\nhttps:\/\/github.com\/yeoman\/generator-an...