text
stringlengths
74
309k
{"title":"Why is \"array\" marked as a reserved word in Visual-C++?","tags":["arrays","visual-studio","visual-c++","c++-cli"],"question_text":"Visual Studio syntax highlighting colors this word blue as if it were a keyword or reserved word. I tried searching online for it but the word \"array\" throws the search off, I...
{"title":" How to use custom font with WebView","tags":["android","webview","custom-font"],"question_text":"Now I want to display some unicode characters and I have used tag:\n`<font face=\"\nArial\">something here<\/font>`\n. But it seems that\n`WebView`\ncan not find the Arial\nfont because I can only see UFO-charact...
{"title":"Select All as default value for Multivalue parameter","tags":["sql-server","visual-studio-2008","reporting-services","parameters"],"question_text":"I'm building a report in Visual Studio 2008 with a lot of\nmultivalue parameters\nand it's working great, but I would like to have have the \"(Select all)\" optio...
{"title":"Rails Observer Alternatives for 4.0","tags":["ruby-on-rails","ruby-on-rails-4"],"question_text":"With Observers officially\nremoved from Rails 4.0\n, I'm curious what other developers are using in their place. (Other than using the extracted gem.) While Observers were certainly abused and could easily become ...
{"title":"Full postback triggered by LinkButton inside GridView inside UpdatePanel","tags":["c#","asp.net","gridview","asp.net-ajax","updatepanel"],"question_text":"I have a GridView inside of a UpdatePanel. In a template field is a button I use for marking items. Functionally, this works fine, but the button always tr...
{"title":"IOError: [Errno 22] invalid mode ('r') or filename: 'c:\\\\Python27\\test.txt'","tags":["python","file-io"],"question_text":"What is wrong with the following:\n`test_file=open('c:\\\\Python27\\test.txt','r')`","answer_text":"`\\t`\nis a tab character. Use a raw string instead:\n`test_file=open(r'c:\\Python27\...
{"title":"Java8 streams sequential and parallel execution produce different results?","tags":["java","lambda","java-8","java-stream"],"question_text":"Running the following stream example in Java8:\n`System.out.println(Stream\n .of(\"a\", \"b\", \"c\", \"d\", \"e\", \"f\")\n .reduce(\"\", (s1, s2) -> s1 + \"\/\" + s2)\...
{"title":"Is version control (ie. Subversion) applicable in document tracking?","tags":["version-control","tracking"],"question_text":"I am in charge of about 100+ documents (word document, not source code) that needs revision by different people in my department. Currently all the documents are in a shared folder wher...
{"title":"Laravel 4 testing; 'phpunit' is not recognized?","tags":["php","phpunit","laravel"],"question_text":"http:\/\/four.laravel.com\/docs\/testing\nSays \"After installing a new Laravel application, simply run\n`phpunit`\non the command line to run your tests.\"\n`phpunit`\nisn't recognized, I also tried\n`php art...
{"title":"Execute Maven plugin goal on parent module, but not on children","tags":["version-control","maven-2","build-process","versioning"],"question_text":"We have a multi-module maven project that uses a profile that defines a\nbuildnumber-maven-plugin\nto increment a build number and then check it into source contr...
{"title":"javascript convert from epoch string to Date object","tags":["javascript","datetime"],"question_text":"`var myDate = new Date();\nvar epoch = myDate.getTime(); \/\/1318023197289 number of ms since epoch\nvar unixEpoch = Math.round(epoch\/1000)`\nHow do you convert\n`epoch`\nback to a Date object?\nCan you als...
{"title":"How to parse a URL?","tags":["javascript","regex"],"question_text":"If there is one thing I just cant get my head around, it's regex.\nSo after a lot of searching I finally found this one that suits my needs:\n`function get_domain_name()\n { \n aaaa=\"http:\/\/www.somesite.se\/blah\/sdgsdgsdgs\";\n \/\/aaaa=\...
{"title":"undefined method `user_path'","tags":["ruby-on-rails"],"question_text":"I am trying to construct a users model manually (without using 'resources :users' in the routes.rb file). My routes.rb file looks like this:\n`match '\/users\/:id', :to => 'users#show'\nmatch '\/all_users', :to => 'users#index'`\nThis is ...
{"title":"Convert RGBA color to RGB","tags":["image","colors","rgb"],"question_text":"How to convert a RGBA color tuple, example (96, 96, 96, 202), to corresponding RGB color tuple?\nEdit:\nWhat I want is to get a RGB value which is most similar to the RGBA tuple visually on white background.","answer_text":"I've upvot...
{"title":"Check if {{ path() }} is current {{ path() }} in Symfony2","tags":["php","symfony2","twig"],"question_text":"How do I check if the current page is this path:\n`{{ path('someNamePath') }}`\nI want to set a css class to the\n`<a>`\nelement or possible remove it altogether, e.g.\n`{% if isCurrentPath('someNamePa...
{"title":"Ideal method to truncate a string with ellipsis","tags":["java","ellipsis"],"question_text":"I'm sure all of us have seen ellipsis' on Facebook statuses (or elsewhere), and clicked \"Show more\" and there are only another 2 characters or so. I'd guess this is because of lazy programming, because surely there ...
{"title":"ASP.NET MVC Global Variables","tags":["c#",".net","asp.net","asp.net-mvc","global-variables"],"question_text":"How do you declare global variables in ASP.NET MVC?","answer_text":"Technically any static variable or Property on a class, anywhere in your project, will be a Global variable e.g.\n`public static cl...
{"title":"C Preprocessor testing definedness of multiple macros","tags":["c","c-preprocessor","logical-operators","preprocessor-directive"],"question_text":"I searched the site but did not find the answer I was looking for so here is a really quick question.\nI am trying to do something like that :\n`#ifdef _WIN32 || _...
{"title":"Examples of usage of Generics in .Net (C#\/VB.NET)","tags":["c#",".net","vb.net","generics"],"question_text":"What are some examples of where you would use generics in C#\/VB.NET and why would you want to use generics?","answer_text":"Simply, you declare a type or method with extra tags to indicate the generi...
{"title":"How to add two Google charts on the one page?","tags":["javascript","charts"],"question_text":"What I've done\nI've added Google chart to the head of my page. This returns an image of a chart.\nWhat I need to do\nI simply need to add a second chart to the same page.\nThe problem\nThe code for the second chart...
{"title":"Why does ANT tell me that JAVA_HOME is wrong when it is not?","tags":["ant","classpath","java-home"],"question_text":"I get the error:\nC:\\dev\\ws\\springapp\\build.xml:81: Unable to find a javac compiler;\ncom.sun.tools.javac.Main is not on the classpath.\nPerhaps JAVA_HOME does not point to the JDK.\nIt is...
{"title":"How do you configure WCF known types programmatically?","tags":[".net","wcf","wcf-configuration","known-types"],"question_text":"My client\/server application is using WCF for communication, which has been great. However one shortcoming of the current architecture is that I must use known type configuration f...
{"title":"jQuery and $ questions","tags":["jquery"],"question_text":"I am modifying some code that has a lot of jQuery but I am not sure what some of the jQuery statements are doing.\nAt the top of the jQuery code there is\n`jQuery.noConflict`\n*1. I understand that. But then there is a some code that has:\n`<script ty...
{"title":"How do I identify the part of speech of a word within a NSString?","tags":["iphone","objective-c","ios","linguistics"],"question_text":"The app I'm currently working on requires me to determine the part of speech of a word in\n`NSString`\n.\nSo basically is there a library\/database\/class which you can acces...
{"title":"Bash script looping through alphabet","tags":["bash"],"question_text":"I want to\n`mv`\nall the files starting with 'x' to directory 'x'; something like:\n`mv path1\/x*.ext path2\/x`\nand do it for all alphabet letters a, ..., z\nHow can I write a bash script which makes 'x' loops through the alphabet?","answ...
{"title":"android How to add view at start of layout?","tags":["android","view"],"question_text":"My question is simple. I have a linearlayout. It has some child views. Now I want to add a view at the start of the child. Means in normal addView(view), the view s added at the end of the layout. But I want to add it at s...
{"title":"How to pass in ID with Html.BeginForm()?","tags":["asp.net-mvc"],"question_text":"In\nASP.NET MVC\nI'm using the HTML helper\n`Html.BeginForm(\"ActionName\", \"Controller\", FormMethod.Post);`\nBut I need to post to: \/controller\/action\/23434\nHow do I pass in the ID?","answer_text":"Matt's should work fine...
{"title":"Converting SVG to PNG using C#","tags":["c#",".net","png","svg"],"question_text":"I've been trying to convert SVG images to PNG using C#, without having to write too much code. Can anyone recommend a library or example code for doing this?","answer_text":"You can call the command-line version of inkscape to d...
{"title":"java.lang.IndexOutOfBoundsException: Source does not fit in dest","tags":["java","arraylist","collections","indexoutofboundsexception"],"question_text":"On the following code:\n`static void findSubsets (ArrayList<Integer> numbers, int amount, int index)\n{\n ArrayList <Integer> numbersCopy = new ArrayList<Int...
{"title":"Button half width of screen","tags":["android","android-layout"],"question_text":"I have a single button in a linear layout. I want the button to take up half the width of its parent. Is there a way to do this in the layout xml.\n`<LinearLayout\n android:id=\"@+id\/linearLayout1\"\n android:layout_width=\"mat...
{"title":"Ipython no readline available and pip install readline error","tags":["python","readline","ipython","pip"],"question_text":"I installed ipython but it doesn't have the readline option. I first downloaded gnu readline and compiled and installed. DIdn't know whether it was a proper solution but was the first th...
{"title":"How to get complete current url for Cakephp","tags":["php","cakephp"],"question_text":"How do you echo out current URL in Cake's view?","answer_text":"You can do either\nFrom a view file:\n`<?php echo $this->here; ?>`\nWhich will give you the absolute url from the hostname i.e. \/controller\/action\/params\nO...
{"title":"Make the divider of an NSSplitView undraggable and don't show the dragging cursor","tags":["objective-c","cocoa","cursor","nssplitview"],"question_text":"I have an NSSplitView (\nNO UISplitView(Controller)!!\n) with three subviews. Now, for the last divider (index\n`1`\n), I want the divider to not show the d...
{"title":"Hiding NSTableView header?","tags":["objective-c","cocoa","nstableview"],"question_text":"How do I hide an NSTableView header completely, so that it does not take any space up?","answer_text":"In Interface Builder, select the table view, open the attributes inspector (alt-command-4), and uncheck the \"Headers...
{"title":"How to convert string to IP address and vice versa","tags":["c++","string","struct","ip-address","in-addr"],"question_text":"how can I convert a string ipAddress (struct in_addr) and vice versa?\nand how do I turn in unsigned long ipAddress?\nthanks","answer_text":"Use\n`inet_ntop()`\nand\n`inet_pton()`\nif y...
{"title":"Initializing a struct to 0","tags":["c","struct","initialization"],"question_text":"If I have a struct like this:\n`typedef struct\n{\n unsigned char c1;\n unsigned char c2;\n} myStruct;`\nWhat would be the easiest way to initialize this struct to 0?\nWould the following suffice?\n`myStruct _m1 = {0};`\nor Wo...
{"title":"Android: Detect if user touches and drags out of button region?","tags":["android","button","gestures"],"question_text":"In Android, how can we detect if a user touches on button and drags out of region of this button?","answer_text":"Check the MotionEvent.MOVE_OUTSIDE:\nCheck the MotionEvent.MOVE:\n`private ...
{"title":"How do I load external fonts into an HTML document?","tags":["html","fonts"],"question_text":"How do I load external font files into an HTML document.\nExample:\n Make the text \"blah blah blah blah blah blah blah\" a custom font from a TTF file in the same directory using HTML CSS and\/or JAVASCRIPT","answer...
{"title":"Max size of URL parameters in _GET","tags":["php"],"question_text":"I am accessing a PHP server using REST: all data is passed in a GET request as URL parameters. One of the parameters arrives at the server in the query_string, but it is not in the _GET global. But shortening the parameter (the cutoff seems t...
{"title":"Remove characters before character \".\"","tags":["c#"],"question_text":"How effectively remove all character in string that placed before character \".\"?\nInput:\nAmerika.USA\nOutput:\nUSA","answer_text":"You can use the\n`IndexOf`\nmethod\nand the\n`Substring`\nmethod\nlike so:\n`string output = input.Subs...
{"title":"Create session factory in Hibernate 4","tags":["java","hibernate"],"question_text":"I'm having trouble generating a session factory in Hibernate 4. In Hibernate 3 I simple did:\n`org.hibernate.cfg.Configuration conf= HibernateUtil\n .getLimsInitializedConfiguration(systemConfiguration\n.getHibernateconfFile()...
{"title":"Cannot call a class method with [self theMethod:]","tags":["objective-c","methods","class-method"],"question_text":"I am trying to write a class method in Objective C. The project builds fine when I declare the method. But the build fails whenever I try to call the method. Here is my code.\nHeader File\n`#imp...
{"title":"autostart mysql on boot from terminal","tags":["osx","terminal","homebrew","mysql"],"question_text":"I just installed mysql in terminal through homebrew.\nNow when I try to connect to mysql it fails, but after I run\n`mysqld`\nit works..\nSo what I need to do now is run mysqld when I boot my Mac.\nI've search...
{"title":"Responsive timeline UI with Bootstrap3","tags":["responsive-design","twitter-bootstrap-3","timeline"],"question_text":"How can I create a UI with a vertical timeline bar where on desktop it shows as timeline-bar in middle and event boxes on both sides. On smaller mobile screen, the timeline-bar on the left an...
{"title":"UIBarButtonItem with color?","tags":["iphone","cocoa-touch"],"question_text":"Is it possible to have a red UIBarButtonItem?","answer_text":"If anyone is looking for code to exactly duplicate a simple UIBarButtonItem:\n`UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];\n[button setBackgroundImag...
{"title":"Java toString() using reflection?","tags":["java","performance","reflection","tostring"],"question_text":"I was writing a toString() for a class in Java the other day by manually writing out each element of the class to a String and it occurred to me that using reflection it might be possible to create a gene...
{"title":"UICollectionView align logic missing in horizontal paging scrollview","tags":["iphone","ios","xcode","cocoa-touch","uicollectionview"],"question_text":"I've got a\n`UICollectionView`\n, which works ok, until I start scrolling.\nHere some pics first:\nAs you can see it's great. As I start scrolling (paging ena...
{"title":"How to change the size of a Switch Widget","tags":["android"],"question_text":"In Ice Cream Sandwich a\nSwitch\nWidget was introduced that displays an On Off Slider.\nI added the Switch like this:\n`<Switch \n android:layout_width=\"fill_parent\"\n android:layout_height=\"48dp\"\n android:textStyle=\"bold\"\n...
{"title":"Is it possible to write to the console in colour in .NET?","tags":["c#",".net","vb.net","colors"],"question_text":"Writing a small command line tool, it would be nice to output in different colours. Is this possible?","answer_text":"Yes. See this\narticle\n. Here's an example from there:\n`Console.BackgroundC...
{"title":"JDBC ResultSet getDate losing precision","tags":["java","oracle","date","jdbc","resultset"],"question_text":"I am losing precision in my ResultSet.getDate(x) calls. Basically:\n`rs = ps.executeQuery();\nrs.getDate(\"MODIFIED\");`\nis returning dates truncated to the day where MODIFIED is an Oracle TIMESTAMP f...
{"title":"What are the major differences between Objective-C, C, and C++?","tags":["c++","objective-c","c"],"question_text":"I'm just beginning to learn Objective-C, and am finding that a background in C (which I don't have) is a useful starting point. I've dabbled in C++ so have some understanding of basic C++ paradig...
{"title":"Weird Switch error in Obj-C","tags":["iphone","objective-c","switch-statement"],"question_text":"I have this switch statement in my code:\n`switch(buttonIndex){\n case 0:\n [actionSheet dismissWithClickedButtonIndex:buttonIndex animated:YES];\n break;\n case 1:\n UIImagePickerController *imagePicker = [[UIIma...
{"title":"Sieve of Eratosthenes - Finding Primes Python","tags":["python","math","primes","sieve-of-eratosthenes"],"question_text":"Just to clarify, this is not a homework problem :)\nI wanted to find primes for a math application I am building & came across\nSieve of Eratosthenes\napproach.\nI have written an implemen...
{"title":"Has anyone gotten HTML emails working with Twitter Bootstrap?","tags":["html","twitter-bootstrap","html-email"],"question_text":"I'm using the\n`premailer-rails3`\ngem which pulls styles inline for html emails, and I'm trying to get it working with Twitter bootstrap.\nhttps:\/\/github.com\/fphilipe\/premailer...
{"title":"How to use WebRequest to post data and get response from a webpage","tags":["c#","asp.net"],"question_text":"I need to implement an application to post request to a given url and get response.\nWhat are the best methods to post request to a given url and get response?\nPlease help.","answer_text":"How about t...
{"title":"How can I disable MongoDB log messages in console?","tags":["ruby","mongodb"],"question_text":"I have this little test script:\n`require 'mongo'\nmongo_client = Mongo::Client.new(['127.0.0.1:27017'], :database => 'test')\nmongo_client[:collection].insert_one({a: 1})`\nAn this is the console output:\n`$ ruby t...
{"title":"httpd Server not started: (13)Permission denied: make_sock: could not bind to address [::]:88","tags":["apache","centos"],"question_text":"I am trying to start httpd server on centos 6. It throws following error :\n`[root@machine ~]# service httpd start\nStarting httpd: (13)Permission denied: make_sock: could...
{"title":"How to pass a parameter to pathFor in Handlebars for Iron-Router with Meteorite?","tags":["meteor","meteorite","handlebars.js","iron-router"],"question_text":"I have a simple route with a parameter:\n`this.route('article', {\n path: '\/article\/:_id',\n data: function() { return Articles.findOne(this.params._...
{"title":"Code contracts - Assume vs Requires","tags":[".net-4.0","code-contracts"],"question_text":"What's the diference between these two statements ?\n`Contract.Requires(string.IsNullOrWhiteSpace(userName));\nContract.Assume(string.IsNullOrWhiteSpace(userName));`","answer_text":"Imagine you have a method like this:\...
{"title":"Bootstrap 2.3 CSS Responsive left with a white space on the right","tags":["css","twitter-bootstrap"],"question_text":"I'm creating a website (and I'm a noob at this). I'm working on the functionality portion of design and i'll have someone do graphics later.\nCurrently when it goes into responsive (mobile vi...
{"title":"Is returning void valid code?","tags":["c++","c","compiler-construction"],"question_text":"I found out that the following code gets accepted by Visual C++ 2008 and GCC 4.3 compilers:\n`void foo()\n{\n}\nvoid bar()\n{\n return foo();\n}`\nI am a bit surprised that it compiles. Is this a language feature or is ...
{"title":"getActionBar returns null","tags":["android","android-actionbar"],"question_text":"Calling\n`getActionBar`\nreturns\n`null`\n. This has been frequently reported so I've made sure to include the solutions others have used: My\n`minSdkVersion=11`\n, I do have a titlebar, and I'm calling\n`getActionBar`\nafter\n...
{"title":"reordering control in UITableView","tags":["iphone","uitableview"],"question_text":"I am developing a game in which I am using a\n`UITableView`\nwhich has custom cell (\n`UItableViewCell`\nsubclass).\nIn editing mode:\nOnly the reordering control of the\n`UITableView`\nshould show.\nRight now I am getting the...
{"title":"How to Wait in Objective-C","tags":["ios","objective-c","uilabel","wait","performselector"],"question_text":"I want to change my\n`UILabel`\n's text after 2 seconds.\nI tried setting my\n`UILabel`\n's text to\n\"A text\"\n, and use\n`sleep(2)`\nand finally changing the text to\n\"Another text\"\n.\nBut\n`slee...
{"title":"Eclipse WTP: How do I enable SSL on Tomcat?","tags":["java","eclipse","tomcat","eclipse-wtp"],"question_text":"Eclipse WTP creates its own server.xml file which it places in some folder which configures the tomcat instance you are running for your web project. If you double click on the server in the servers ...
{"title":"How to capture Tap gesture on MKMapView","tags":["ios4","mkmapview","mkoverlay","mkpinannotationview"],"question_text":"I am trying to capture tap event on my\n`MKMapView`\n, this way I can drop a\n`MKPinAnnotation`\non the point where user tapped. Basically I have a map overlayed with\n`MKOverlayViews`\n(an ...
{"title":"how to center and Crop an image to square with CSS","tags":["html","css"],"question_text":"I need to always crop a random-sized image to a square 160x160 using only CSS.\nThe images should stay centered when cropped.\nMy markup should be:\n`<a href=\"#\" class=\"cropper\">\n <img src=\"image\" alt=\"descripti...
{"title":"MySQL: Check if the user exists and drop it","tags":["mysql","database"],"question_text":"There\u00e2\u0080\u0099s not standard way to check if a MySQL user exists and based on that drop it. Are there any workarounds for this?\nEdit: I need a straight way to run this without throwing up an error\ne.g.\n`DROP ...
{"title":"Aborted old git rebase and lost commits since the rebase started","tags":["git","git-rebase"],"question_text":"Crap! About a week ago, I was rebasing some commits while trying to clean up my repository, and apparently I didn't actually finish it. Today, a week and several commits later, I went to rebase to re...
{"title":"add user control to a form","tags":["c#","winforms","user-controls"],"question_text":"I have created a user control with a TextBox and two Buttons, but I haven't created events, just I place them to user control. When I want to add the user control to my form it says:\nCannot move Task_control.cs. The destina...
{"title":"django: best practice way to get model from an instance of that model","tags":["django"],"question_text":"Say\n`my_instance`\nis of model\n`MyModel`\n.\nI'm looking for a good way to do:\n`my_model = get_model_for_instance(my_instance)`\nI have not found any really direct way to do this.\nSo far I have come u...
{"title":"Convert\/cast an stdClass object to another class","tags":["php","stdclass"],"question_text":"I'm using a third party storage system that only returns me stdClass objects no matter what I feed in for some obscure reason. So I'm curious to know if there is a way to cast\/convert an stdClass object into a full ...
{"title":"Static properties in Swift","tags":["ios","class","swift","static-methods","static-members"],"question_text":"I'm trying to convert the following Objective-C code to Swift. In my Objective-C code, there's a static variable and its accessed from a class method.\n`@implementation SomeClass\nstatic NSMutableArra...
{"title":"Where is Maven Installed on Ubuntu","tags":["ubuntu","maven"],"question_text":"I installed maven on my Ubuntu machine with the command\n`sudo apt-get install maven`\nNow I need to know where it is installed in order to configure the same in IntelliJ..","answer_text":"Ubuntu, which is a Debian derivative, foll...
{"title":"navigate route with querystring","tags":["backbone.js","backbone-routing"],"question_text":"Will\n`Backbone.Router.navigate`\nset\n`test`\nto\n`true`\n:\n`var test = false;\nvar Router = Backbone.Router.extend({\n routes: {\n 'posts': 'showPosts'\n },\n showPosts: function () {\n test = true;\n }\n});\nrouter...
{"title":"[] and {} vs list() and dict(), which is better?","tags":["python","performance","list","dictionary"],"question_text":"I understand that they are both essentially the same thing, but in terms of style, which is the better (more Pythonic) one to use to create an empty list or dict?","answer_text":"In terms of ...
{"title":"Is it possible to attach UITapGestureRecognizer to UILabel subclass","tags":["iphone","ios","xcode","ios4"],"question_text":"I'm trying to attach gesture recognizer to my own class which is subclass of UILabel, but it does not work. Can you help me to understand what's wrong in the code\n`@interface Card : UI...
{"title":"C# Cast Entire Array?","tags":["c#","arrays","casting"],"question_text":"I see this\n`Array.ConvertAll`\nmethod, but it requires a\n`Converter`\nas an argument. I don't see why I need a converter, when I've already defined an implicit one in my class:\n`public static implicit operator Vec2(PointF p)\n {\n ret...
{"title":"Executing Blocks From NSArray?","tags":["iphone","objective-c","cocoa-touch","nsarray","objective-c-blocks"],"question_text":"I was just thinking, as you can treat Blocks like objects if I create two of them and then add them to an NSArray is there a way to execute them from the array?\n`int (^Block_001)(void...
{"title":"How to delete all datastore in Google App Engine?","tags":["google-app-engine","google-cloud-datastore"],"question_text":"Does anyone know how to delete all datastore in\nGoogle App Engine\n?","answer_text":"If you're talking about the\nlive datastore\n, open the dashboard for your app (login on appengine) th...
{"title":"Installing Ruby 2.0 and Rails 4.0.0beta on AWS EC2","tags":["ruby-on-rails","amazon-web-services","amazon-ec2","ruby-on-rails-4","ruby-2.0"],"question_text":"Installing Ruby 2.0.0 and Rails 4.0.0beta1 on the default Amazon EC2 Linux install (Amazon Linux AMI 2012.09.1) goes smoothly.\nBut openssl gets in the ...
{"title":"Generate Unique Random String With Letters And Numbers In Lower Case","tags":["ruby","ruby-on-rails-3"],"question_text":"How can I fix this code so it generates unique random letters and numbers in lower case?\n`api_string = (0...32).map{65.+(rand(25)).chr}.join`\nAt the moment, it generates only letters.","a...
{"title":"Code completion to in Android Studio","tags":["android","intellij-idea","android-studio"],"question_text":"A question about the editor, I am not sure how to\nbriefly\nphrase the question so I could not find an answer\nI have just moved from Eclipse to Android Studio on the Mac.\nIf in a layout file, I start t...
{"title":"WCF named pipe minimal example","tags":["c#","wcf","named-pipes"],"question_text":"I'm looking for minimal example of WCF Named Pipes (I expect two minimal applications, server and client, which can communicate via a named pipe.)\nMicrosoft has the briliant article\nGetting Started Tutorial\nthat describes WC...
{"title":"More Elegant Exception Handling Than Multiple Catch Blocks?","tags":["c#",".net","exception","error-handling"],"question_text":"Using C#, is there a better way to handle multiple types of exceptions rather than a bunch of ugly catch blocks?\nWhat is considered best practice for this type of situation?\nFor ex...
{"title":"How do I add some inserts in rails migration?","tags":["ruby-on-rails","migration"],"question_text":"After creating a table (by migration), I want to insert some entries directly. How must I write a migration for this?\nthanks","answer_text":"Don't\n. If you're looking for seed data, you should use\n`db\/seed...
{"title":"Create a group box around certain controls on a web form using CSS","tags":["html","css"],"question_text":"I have three controls on my web form of three drop down lists.\nI want to create a graphical \"box\" around these controls. The reason for this is that selecting these controls would be \"STEP 1\" of my ...
{"title":"More fluent C# \/ .NET","tags":["c#"],"question_text":"A co-worker of mine came up with this and I wonder what others think? Personally, I find it interesting but wonder if it is too big a departure? Code examples below. Extension methods at the bottom.\nGeneral thoughts please. Other extension methods that c...
{"title":"Return errors from PHP run via. AJAX?","tags":["php","ajax","return"],"question_text":"Is there a way to get PHP to return an AJAX error code if the PHP script fails somewhere?\nI was following a tutorial and typed this in to my PHP:\n$return['error'] = true;\n$return['msg'] = \"Could not connect to DB\";\nAn...
{"title":"What is difference between monolithic and micro kernel?","tags":["language-agnostic","terminology","kernel"],"question_text":"Could anyone please explain with examples difference between monolithic and micro kernel? Also other classifications of the kernel?","answer_text":"Monolithic kernel is a single large ...
{"title":"iOS 8 removed \"minimal-ui\" viewport property, are there other \"soft fullscreen\" solutions?","tags":["javascript","ios","css","responsive-design","mobile-safari"],"question_text":"(This is a multi-part question, I will try my best to summarise the scenario.)\nWe are currently building a responsive web app ...
{"title":"Find Active Tab using jQuery and Twitter Bootstrap","tags":["jquery","tabs","twitter-bootstrap"],"question_text":"I've been racking my brain for a little while now, and I would like to know if anyone out there knows how I can find the active tab, using jQuery and Twitter's Bootstrap. Pulling the hash from the...
{"title":"iPhone - What are reuseIdentifiers (UITableViewCell)?","tags":["iphone","objective-c","uitableview","reuseidentifier"],"question_text":"From the official documentation:\nThe reuse identifier is associated with a UITableViewCell object that the table-view\u00e2\u0080\u0099s delegate creates with the intent to ...
{"title":"How to test AngularJS custom provider","tags":["unit-testing","angularjs","jasmine"],"question_text":"Does anyone have an example of how to unit test a provider?\nFor example:\nconfig.js\n`angular.module('app.config', [])\n .provider('config', function () {\n var config = {\n mode: 'distributed',\n api: 'path...
{"title":"jQuery \"hasParent\"","tags":["javascript","jquery"],"question_text":"The JQuery \"has\" method effectively selects all elements where they have particular descendants.\nI want to select elements based on the fact they have particular ancestors. I know about parent([selector]) and parents([selector]) but thes...
{"title":"How would you forget cached Eloquent models in Laravel?","tags":["php","caching","laravel","laravel-4"],"question_text":"Theoretical question on Laravel here.\nSo Example of the caching I'd do is:\n`Article::with('comments')->remember(5)->get();`\nIdeally I'd like to have an event for Article updates that whe...
{"title":"It is bad to put <span \/> tags inside <option \/> tags, only for string manipulation not styling?","tags":["tags","option","html"],"question_text":"I would like to make groups of the text content of an\n`<option \/>`\ntag. Say I have the following:\n`<option>8:00 (1 hour)<\/option>`\n, the time pattern\n`8:0...
{"title":"jQuery form validation on button click","tags":["jquery","jquery-validate"],"question_text":"I have a simple page with a form and a button outside the form. I am trying to validate the form on the button click.\nI have added the rules for validation of the form on the document.onready function. However the fo...
{"title":"Mocking WebResponse's from a WebRequest","tags":["xml","web-services","rest","webrequest","webresponse"],"question_text":"I have finally started messing around with creating some apps that work with RESTful web interfaces, however, I am concerned that I am hammering their servers every time I hit F5 to run a ...
{"title":"mysql2.so: libmysqlclient_r.so.15: cannot open shared object file: No such file or directory","tags":["mysql","ubuntu","mysql2","ruby-on-rails-2","libmysql"],"question_text":"I am trying to run a Rails two app with Ubuntu 10.04 server, sphinx, myql2 version 0.2.7 and percona server 5.5 (Myslql 5.5). mysql2 in...