text stringlengths 74 309k |
|---|
{"title":"How to wrap a function with variable length arguments?","tags":["c++","c","variadic-functions"],"question_text":"I am looking to do this in C\/C++.\nI came across\nVariable Length Arguments\nbut this suggests a solution with Python & C using\nlibffi\n.\nNow, if I want to wrap\n`printf`\nfunction with\n`myprin... |
{"title":"How do I close an Android alertdialog","tags":["android"],"question_text":"I am developing a quiz and I need the user to answer all the questions before proceeding. When the user has not answered all the questions I display a simple alertdialog informing him or her. The problem is whatever I do I can't get th... |
{"title":"when is static variable loaded in java, runtime or compile time?","tags":["java"],"question_text":"When is static variable loaded, runtime or compile time? Can someone please explain it.\nI would really appreciate the help.\nThank you.","answer_text":"The compiler optimizes inlineable\nstatic final\nfields by... |
{"title":"laravel No supported encrypter found. The cipher and \/ or key length are invalid","tags":["php","ssl","laravel-5"],"question_text":"I am building a project using Laravel. It was working fine on localhost, but when I upload it to the server (the server has comodo ssl installed), I receive the following error:... |
{"title":"How do Formtastic and simple_form compare?","tags":["ruby-on-rails","rubygems"],"question_text":"How do Formtastic and simple_form compare?\nWhat the benefits of each ?","answer_text":"Formtastic\nand\nsimple_form\nare very similar, the usage is also very similar.\nThe main difference is that the markup of\n`... |
{"title":"explicit specialization of template class member function","tags":["c++","templates","gcc","specialization"],"question_text":"I need to specialize template member function for some type (let's say\ndouble\n). It works fine while class\n`X`\nitself is not a template class, but when I make it template GCC start... |
{"title":"Autofac - InstancePerHttpRequest vs InstancePerLifetimeScope","tags":["c#","asp.net-mvc-3","dependency-injection","autofac"],"question_text":"What are the differences between the two scopes?\nI am building\n`Module`\n(s) in each layer (Repository, Service, MVC App), but in order to have\n`InstancePerHttpReque... |
{"title":"How do you export your finished application from Xcode?","tags":["xcode","compilation","finalize"],"question_text":"I feel silly for having to ask this. I've got an application to a point where I want to send someone a beta to test on their machine, but I don't know how to get Xcode to produce a\n`.app`\nfile... |
{"title":"Alert view in iphone","tags":["iphone","objective-c","cocoa-touch"],"question_text":"I am new to iPhone application development. I want to design an alert view with 2 buttons:\n`OK`\nand\n`Cancel`\n. When the user touches the\n`OK`\nbutton, then I will print a message that says\n`hello`\n. When they touch the... |
{"title":"Adding a new entry to the PATH variable in ZSH","tags":["linux","ubuntu","zsh"],"question_text":"I'm using zsh and I'm trying to add a new entry (\/home\/david\/pear\/bin) for the PATH variable but I don't know how.\nHere's my .zshrc file (Ubuntu 12.04)\n`# Set up the prompt\nautoload -Uz promptinit\npromptin... |
{"title":"How can I truncate my strings with a \"...\" if they are too long?","tags":["c#","string"],"question_text":"Possible Duplicate:\nindicate truncation in ToolTipStatusLabel automatically\nHope somebody has a good idea. I have strings like this:\n`abcdefg\nabcde\nabc`\nWhat I need is for them to be trucated to s... |
{"title":"How do I create a reusable block\/proc\/lambda in Ruby?","tags":["ruby"],"question_text":"I want to create a filter, and be able to apply it to an array or hash. For example:\n`def isodd(i)\n i % 2 == 1\nend`\nThe I want to be able to use it like so:\n`x = [1,2,3,4]\nputs x.select(isodd)\nx.delete_if(isodd)\n... |
{"title":"How to create a \"placeholder\" for DIV that act like textfield?","tags":["html","placeholder"],"question_text":"Div don't have a placeholder attribute\n`<div id=\"editable\" contentEditable=\"true\"><\/div>`\nI want\n`<Please your enter your Name>`\nto show in DIV when the User backspace the whole text in th... |
{"title":"CSS Scrollbar width","tags":["html","css"],"question_text":"Folks, is it possible to increase the width of a scrollbar on a\n`<div>`\nelement placed inside the\n`<body>`\n?\nI am not talking about the default scrollbar on the\nbrowser itself\n, this page runs in full screen mode and because the browser scroll... |
{"title":"How to detect USER INACTIVITY in android","tags":["android","user-interface","user-experience","user-inactivity"],"question_text":"User start MyAPP and logs in.\nSelects Session Timeout to be 5 mins.\nDoes some operations on the app.......(all in foreground)\nNow User bring Myapp to background and starts some... |
{"title":"Rails 3 Observer -- looking to learn how to implement an Observer for multiple models","tags":["ruby-on-rails","ruby-on-rails-3","observer-pattern"],"question_text":"I'd like to add an Auditor Observer which does an action anytime after_create for 3 models (books, characters, authors)...\nI recently heard of ... |
{"title":"Pros\/Cons of switching to twitter bootstrap","tags":["twitter-bootstrap"],"question_text":"I am working for an enterprise level SaaS company. The product is live and is about 6 months old in terms of development. Obvious we are still in our infancy as both a company and a product.\nOne of our project guys pu... |
{"title":"Do you debug C++ code in VIM? How?","tags":["c++","debugging","vim","gdb"],"question_text":"The question is to all you people, who use VIM to develop C++ apps.\nThere was a period in my life, which can be described as\n'I hate VIM!!!'..'VIM is nice!'\nHowever, having grown up mostly on MS Dev IDE, I've got us... |
{"title":"Drawing UIBezierPath on code generated UIView","tags":["ios","iphone","objective-c","uiview","uibezierpath"],"question_text":"I have a\n`UIView`\nadded in code at run time.\nI want to draw a\n`UIBezierPath`\nin it, but does this means i have to override the\n`drawRect`\nfor UIView?\nOr is there another way of... |
{"title":"How do annotations work internally","tags":["java","annotations"],"question_text":"Can anybody explain me how annotation work internally in java?\nI know that how we can create custom annotation by using java.lang.annotation library in java. But still i don't get enough idea how it's working internally like @... |
{"title":"try\/catch + using, right syntax","tags":["c#","try-catch","using-statement"],"question_text":"Which one:\n`using (var myObject = new MyClass())\n{\n try\n {\n \/\/ something here...\n }\n catch(Exception ex)\n {\n \/\/ Handle exception\n }\n}`\nOR\n`try\n{\n using (var myObject = new MyClass())\n {\n \/\/ so... |
{"title":"String to BigInteger java","tags":["java","string","parsing","biginteger"],"question_text":"I'm trying to read some really big numbers from stdin and adding them together.\nHowever, to add to BigInteger, i need to use\n`BigInteger.valueOf(long);`\n:\n`private BigInteger sum = BigInteger.valueOf(0);\nprivate v... |
{"title":"Getting NoSuchFieldError INSTANCE org\/apache\/http\/message\/BasicHeaderValueParser","tags":["android","apache-httpclient-4.x","androidhttpclient"],"question_text":"I'm working on an app on Android. I'm using httpcore 4.3.3. I get this when I try to use\n`ContentType.parse(string)`\n`java.lang.NoSuchFieldErr... |
{"title":"Visual Studio does not let me drag drop items into it?","tags":["visual-studio-2010","file","visual-studio-2012","drag-and-drop"],"question_text":"When using Visual studio 2010 I got problems that when dubble click for example a config file(*.config) Visual Studio would open but give me a error message about ... |
{"title":"Can someone break this lambda expression down for me?","tags":["c#",".net","regex","string"],"question_text":"I'm looking at the solution from\nToken Replacement and Identification\n:\n`string result = Regex.Replace(\n text,\n @\"\\[%RC:(\\d+)%\\]\",\n match => dict[int.Parse(match.Groups[1].Value)]);`\nAnd I... |
{"title":"Rails 4.0 Spork\/ActiveRecord exception","tags":["ruby-on-rails","railstutorial.org","spork"],"question_text":"I've been using Michael Hartl's\nRails Tutorial\nto pick up Ruby on Rails and have recently been going through the new Rails 4.0 version of the tutorial. I've encountered an issue with Spork; I know ... |
{"title":"How to act differently on first iteration in a Ruby loop?","tags":["ruby"],"question_text":"I always use a counter to check for the first item (\n`i==0`\n) in a loop:\n`i = 0\nmy_array.each do |item|\n if i==0\n # do something with the first item\n end\n # common stuff\n i += 1\nend`\nIs there a more elegant ... |
{"title":"Width and Height Equal to its superView using autolayout programmatically?","tags":["ios","dynamic","autolayout","nslayoutconstraint"],"question_text":"I've been looking for a lot of snippets in the net and I still can't find the answer to my problem. My question is I have a scrollView(SV) and I want to add a... |
{"title":"When to use std::begin and std::end instead of container specific versions","tags":["c++","c++11"],"question_text":"Are there any general preferences or rules that explain when container specific versions of begin and end should be used instead of free functions\n`std::begin`\nand\n`std::end`\n?\nIt is my und... |
{"title":"change sqlite file size after \"DELETE FROM table\"","tags":["sqlite"],"question_text":"I am working with sqlite3 file.\nFirst, I entered relatively big database, file size was about 100 mb.\nThan I made\n`$db->exec(\"DELETE FROM table\");`\nand entered just a small part of that database. But file size remain... |
{"title":"MySQL date formats - difficulty Inserting a date","tags":["mysql","date","insert","format"],"question_text":"I am trying to further a question I asked yesterday where I wanted to know how to query a date in a different format. But now I am trying to dao an insert using this method (see below) however I cant g... |
{"title":"Accurate timing of functions in python","tags":["python","testing","time","profiling"],"question_text":"I'm programming in python on windows and would like to accurately measure the time it takes for a function to run. I have written a function \"time_it\" that takes another function, runs it, and returns the... |
{"title":"How to sum the value of a key across all documents in a MongoDB collection","tags":["mongodb","nosql"],"question_text":"I have collection in MongoDB:\n`{ \"_id\" : ObjectId(\"4d2407265ff08824e3000001\"), \"subida\" : 3.95 }\n{ \"_id\" : ObjectId(\"4d2551b4ae9fa739640df821\"), \"subida\" : 6.03 }\n{ \"_id\" : ... |
{"title":"HTTP 404 Page Not Found in Web Api hosted in IIS 7.5","tags":["c#","asp.net-web-api","iis-7.5","http-status-code-404"],"question_text":"I have a Web Api application. It works perfectly well when I tested it using the VS 2010 debugging dev server. But I now deployed it to IIS 7.5 and I am getting a HTTP 404 er... |
{"title":"Shell\/Bash shortcut for bulk renaming of files in a folder","tags":["linux","bash","file-io","scripting"],"question_text":"Is there a shortcut in Shell\/Bash that can rename all the files in a folder based on a regex or some other criteria. What I am looking for here is in my folder documents, that has let's... |
{"title":"How to replace only part of the match with python re.sub","tags":["python","regex"],"question_text":"I need to match two cases by one reg expression and do replacement\n'long.file.name.jpg' -> 'long.file.name_\nsuff\n.jpg'\n'long.file.name_\na\n.jpg' -> 'long.file.name_\nsuff\n.jpg'\nI'm trying to do the foll... |
{"title":"How do you upload images to a gist?","tags":["github","gist"],"question_text":"How do you upload images to a gist?\nTake a look at this:\nhttps:\/\/gist.github.com\/mbostock\/5503544#file-thumbnail-png\nWhat I have tried is drag-and-drop the image file while in the edit mode of a gists. That didn't seem to wo... |
{"title":"can I change the font color of the datePicker in iOS7?","tags":["fonts","datepicker","ios7","xcode5"],"question_text":"just downloaded my copy of xcode 5 and was wondering if anyone knows how I can change the color or size of the font in the date picker?","answer_text":"I need similar for my app and have ende... |
{"title":"App_Code folder issues","tags":["c#","asp.net","visual-studio","app-code"],"question_text":"So I'm having a really weird issue with my App_Code folder on a new website I'm designing.\nI have a basic class inside of a namespace in the App_Code folder. Everything works fine in the IDE when I setup the namespace... |
{"title":"How to fold\/unfold HTML tags with Vim","tags":["html","vim","folding","fold"],"question_text":"Is there some plugin to fold HTML tags in Vim?\nOr there is another way to setup a shortcut to fold or unfold html tags?\nI would like to fold\/unfold html tags just like I do with indentation folding.","answer_tex... |
{"title":"How to set String Array in Java Annotation","tags":["java","annotations"],"question_text":"I have declared a annotation like this:\n`public @interface CustomAnnot \n{\n String[] author() default \"me\";\n String description() default \"\";\n}`\nA valid Annotation therefore would be\n`@CustomAnnot(author=\"aut... |
{"title":"why so red? intellij seems to think every declaration\/method cannot be found\/resolved","tags":["java","intellij-idea"],"question_text":"Just re-installed installed intellij, every java file is coming up RED. I checked the jsdk, it is at 1.6.##. The maven clean install worked just fine.\nHow do I fix these f... |
{"title":"Bundling data files with PyInstaller (--onefile)","tags":["python","pyinstaller"],"question_text":"I'm trying to build a one-file EXE with PyInstaller which is to include an image and an icon. I cannot for the life of me get it to work with\n`--onefile`\n.\nIf I do\n`--onedir`\nit works all works very well.\n... |
{"title":"Python - Differences between elements of a list","tags":["python","list"],"question_text":"Given a list of numbers how to find differences between every (\n`i`\n)-th and (\n`i+1`\n)-th of its elements? Should one better use lambda or maybe lists comprehension?\nExample:\nGiven a list\n`t=[1,3,6,...]`\nit is t... |
{"title":"Path to WordPress Template Directory inside jQuery?","tags":["javascript","jquery","wordpress","wordpress-theming"],"question_text":"My header is calling a javascript file which sends out an email:\n`<script type=\"text\/javascript\" src=\"<?php bloginfo('template_directory') ?>\/css\/effects.js\"><\/script>`... |
{"title":"Perform Trim() while using Split()","tags":["c#","string","trim"],"question_text":"today I was wondering if there is a better solution perform the following code sample.\n`string keyword = \" abc, foo , bar\";\nstring match = \"foo\";\nstring[] split= keyword.Split(new char[] { ',', ';' }, StringSplitOptions.... |
{"title":"Adding sub-directory to \"View\/Shared\" folder in ASP.Net MVC and calling the view","tags":["asp.net","asp.net-mvc","asp.net-mvc-2","asp.net-mvc-3","razor"],"question_text":"I'm currently developing a site using ASP.Net MVC3 with Razor. Inside the \"View\/Shared\" folder, I want to add a subfolder called \"P... |
{"title":"How do you find out about new Java technologies, tools and specifications?","tags":["java"],"question_text":"One of the major challenges for any java developer is try to keep in pace of development of the language and new tools. Java is evolving all the time and it happens often that I hear from a friend or c... |
{"title":"Pre & post increment operator behavior in C, C++, Java, & C#","tags":["c#","java","c++","c"],"question_text":"DISCLAIMER:\nThis is not a real-world example. It is just a theoretical question of how these languages work.\nWhat exactly are the differences between C\/C++, C#, and Java when it comes to post & pre... |
{"title":"How to find pg_config path","tags":["python","django","osx","postgresql"],"question_text":"Complete newbie here, trying to set up Django to work with ProstgreSQL.\nI'm using mac osx 10.6.8. I have also installed PostgreSQL 9.3\nWhen I run\n`pip install psycopg2`\nin terminal I get the following error\n`Downlo... |
{"title":"How to resolve $q.all promises in Jasmine unit tests?","tags":["angularjs","unit-testing","jasmine","karma-runner","jasmine-jquery"],"question_text":"My controller has code like below:\n`$q.all([qService.getData($scope.id), dService.getData(), qTService.get()])\n.then(function (allData) {\n $scope.data1 = all... |
{"title":"Responsive site is zoomed in when flipping between Portrait and Landscape on iPad\/iPhone","tags":["orientation","responsive-design","viewport","screen-orientation","device-orientation"],"question_text":"I've built a responsive site using Twitter Bootstrap here:\nhttp:\/\/zarin.me\/cce\/\nThe responsive desig... |
{"title":"Get the last day of the month?","tags":["php","datetime"],"question_text":"Possible Duplicate:\nPHP last day of the month\nIs there any function like\n`$date->getMonthDays()`\nor\n`$date->getLastDayOfMonth()`\nin PHP to get the number of days in a given month (or the last day number)?\n`$start = new DateTime(... |
{"title":"How can objdump emit intel syntax","tags":["linux","assembly","x86-64","objdump"],"question_text":"How can I tell\n`objdump`\nto emit assembly in Intel Syntax rather than the default AT&T syntax?","answer_text":"What you're looking for is\n`-M intel`\n. Use it as follows.\n`objdump -M intel -d program_name`",... |
{"title":"Angular JS: Full example of GET\/POST\/DELETE\/PUT client for a REST\/CRUD backend?","tags":["rest","angularjs"],"question_text":"I've implemented a REST\/CRUD backend by following this article as an example:\nhttp:\/\/coenraets.org\/blog\/2012\/10\/creating-a-rest-api-using-node-js-express-and-mongodb\/\n. I... |
{"title":"javascript date to string","tags":["javascript","string","date"],"question_text":"Here is what I need to do.\nGet Date, convert to string and pass it over to a third party utility. \nThe response from the library will have date in string format as I passed it. So, I need to convert the date to string like 201... |
{"title":"Position of DialogFragment in Android","tags":["android","android-layout","android-fragments","android-dialogfragment"],"question_text":"I have a\n`DialogFragment`\nto show a\n`View`\nlike a Popup screen.\nThe Window appears always in the middle of the screen.\nIs there a way to set the position of the\n`Dial... |
{"title":"Recommended JavaScript HTML template library for JQuery?","tags":["javascript","jquery","templates"],"question_text":"Any suggestions on which HTML template library would go well with JQuery? Googling turns up quite a number of libraries but I'm not sure whether there is a well recognized library that would s... |
{"title":"Bundle ID Suffix? What is it?","tags":["iphone","cocoa-touch","itunesconnect","ios"],"question_text":"I'm new to the iPhone submission process. Apple asks for the Bundle ID Suffix. What is this? Not sure what to put here and what the significance of it is.","answer_text":"If you don't have a company, leave yo... |
{"title":"Is there a free Visual Studio addin for Nunit?","tags":["visual-studio","unit-testing","nunit"],"question_text":"I'm cheap and don't want to pay for ReSharper or TestDriven.NET, is there a free visual Studio addin for NUnit?","answer_text":"You can create a blank project (Choose console application for exampl... |
{"title":"Generics in C# - how can I create an instance of a variable type with an argument?","tags":["c#","generics"],"question_text":"I've got a generics class, where I want to instantiate an object with the generic type. I want to use an argument for the constructor of the type.\nMy code:\n`public class GenericClass... |
{"title":"Unit Testing ASP.Net MVC 4 apps thoroughly","tags":["visual-studio-2010","visual-studio","unit-testing","asp.net-mvc-4","tdd"],"question_text":"I realize this is a duplicate of about 20 different posts, but none of them are specific to MVC4, and none that I've seen really answer all of my questions.\nSo far m... |
{"title":"Difference between JVM's LookupSwitch and TableSwitch?","tags":["java","bytecode","jasmin"],"question_text":"I have some difficulty to understand LookUpSwitch and TableSwitch in Java bytecode.\nIf I understand well, both LookUpSwitch and TableSwitch correspond to the\n`switch`\nstatement of Java source? Why o... |
{"title":"How to center an image horizontally and align it to the bottom of the container?","tags":["css","positioning"],"question_text":"How can I center an image horizontally and aligned to the bottom of the container at the same time?\nI have been able to center the image horizontally by its self. I have also been a... |
{"title":"Convert jquery element to html element","tags":["javascript","jquery","element"],"question_text":"I have a jQuery element but I have to send it to a function that only accepts HTML elements. How can I convert the jQuery element to an HTML element?","answer_text":"Try\n`myJQueryElement.get(0)`\nor\n`myJQueryEl... |
{"title":"Configuring an NSPredicate with multiple conditions","tags":["iphone","objective-c","xcode","ios","core-data"],"question_text":"I'm not certain how one would go about \"cascading\" several conditions into an NSPredicate.\nI'm fairly new to Core Data and not sure if that's the right way to achieve what I am lo... |
{"title":"Where I can find @Inject jar","tags":["java","spring","annotations"],"question_text":"I'm following the MVC unit test instructions from\nthis site\n,\nbut I cannot find the jar for the\n`@Inject`\nannotation. Does anybody know where the jar is?","answer_text":"Via Maven:\n`<dependency>\n <groupId>javax.inject... |
{"title":"How to implement an efficient infinite generator of prime numbers in Python?","tags":["python","generator","primes"],"question_text":"This is not a homework, I am just curious.\nINFINITE is the key word here.\nI wish to use it as for p in primes(). I believe that this is a built-in function in Haskell.\nSo, t... |
{"title":"What is the difference between getWidth\/Height() and getMeasuredWidth\/Height() in Android SDK?","tags":["android","android-layout","view","size","dimensions"],"question_text":"The\nAndroid Documentation says\nthat there is two sizes for a view, the\nmeasured dimensions\nand the\ndrawing dimensions\n. The me... |
{"title":"Can C# extension methods access private variables?","tags":["c#","extension-methods"],"question_text":"Is it possible to access an object's private variables using an extension method?","answer_text":"No. You can do the same in an extension method as in a \"normal\" static method in some utility class.\nSo th... |
{"title":"Currency Formatting MVC","tags":["asp.net-mvc-3","razor","string.format"],"question_text":"I'm trying to format an Html.EditorFor textbox to have currency formatting, I am trying to base it off of this thread\nString.Format for currency on a TextBoxFor\n. However, my text just still shows up as 0.00 with no c... |
{"title":"Mongoose populate after save","tags":["node.js","mongodb","mongoose","populate"],"question_text":"I cannot manually or automatically populate the creator field on a newly saved object ... the only way I can find is to re-query for the objects I already have which I would hate to do.\nThis is the setup:\n`var ... |
{"title":"How do you specifically order ggplot2 x axis instead of alphabetical order?","tags":["r","ggplot2","r-faq"],"question_text":"I'm trying to make a\n`heatmap`\nusing\n`ggplot2`\nusing the\n`geom_tiles`\nfunction\nhere is my code below:\n`p<-ggplot(data,aes(Treatment,organisms))+geom_tile(aes(fill=S))+\n scale_f... |
{"title":"Why do I always get the same sequence of random numbers with rand()?","tags":["c","random"],"question_text":"This is the first time I'm trying random numbers with C (I miss C#). Here is my code:\n`int i, j = 0;\nfor(i = 0; i <= 10; i++) {\n j = rand();\n printf(\"j = %d\\n\", j);\n}`\nwith this code, I get th... |
{"title":"ChoiceField in Django model","tags":["django"],"question_text":"Suppose I have choicefield in my django model which consist of several choices. Now in future if I changed the existing choice (option) with some other name (choice), then whether the existing records in model with that choice(option) will also c... |
{"title":"Undefined Method attr_accessible","tags":["ruby-on-rails","ruby"],"question_text":"I am somewhat new to rails and I am trying to create a User login. I went through the tutorial found\nhere\n. At the end it had me add \"attr_accessible\" for mass assignment. However when I did that I got the following error:\... |
{"title":"Are multiple self-types possible?","tags":["scala"],"question_text":"I want to do the following, but the self-type line just doesn't compile. Do I have this syntax wrong or is this just impossible?\n`trait A {\n def aValue = 1\n}\ntrait B {\n def bValue = 1\n}\ntrait C {\n a : A, b : B =>\n def total = a.aVal... |
{"title":"Cannot drop database because it is currently in use","tags":["c#","asp.net","sql-server"],"question_text":"I want to drop a database. I have used the following code, but to no avail.\n`public void DropDataBase(string DBName,SqlConnection scon)\n{\n try\n {\n SqlConnection.ClearAllPools();\n SqlCommand cmd = n... |
{"title":"Go to n-th symbol in line","tags":["vim"],"question_text":"How to move cursor to the n-th symbol from the left in Vim?\nOne of the solutions I see is press\n`0n<right-arrow>`\n, it will move to the n+1 position. Is there any more natural way to do it?","answer_text":"The pipe '|' character may be what you wan... |
{"title":"Emacs in Windows","tags":["windows","emacs"],"question_text":"How do you run Emacs in Windows?\nWhat is the best flavor of Emacs to use in Windows, and where can I download it? And where is the .emacs file located?","answer_text":"I use\nEmacsW32\n, it works great.\nEDIT: I now use regular GNU Emacs 24, see b... |
{"title":"How to change the link color of the current page with CSS","tags":["html","css","navigation"],"question_text":"How do I display the link for the current page different from the others? I would like to swap the colors of the text and background.\nThis is what I currently have:\nThe HTML:\n`<div id=\"header\"> ... |
{"title":"How to set Android camera orientation properly?","tags":["android","camera","orientation","surfaceview"],"question_text":"I want to set the camera orientation according to the device orientation in Android but nothing seems to be working. I tried to rotate the Surface as well as the camera parameters but the ... |
{"title":"Can I do STI and still use polymorphic path helpers?","tags":["ruby-on-rails","ruby"],"question_text":"I am using Single Table Inheritance and have comments on all the subclasses. I am only using 1 controller for all the different STI types. When the form_for helper generates a URL for a subtype it tries to u... |
{"title":"Equivalent of \"throw\" in R","tags":["r","error-handling"],"question_text":"How does one \"throw\" an error in R? I have a function that takes a data frame and some column names and does stuff with them. If the columns don't exist, I want the function to stop and to stop all functions depending on it.\nI hav... |
{"title":"Save Photos to Custom Album in iPhones Photo Library","tags":["iphone","objective-c","uiimage","uiimagepickercontroller","alassetslibrary"],"question_text":"I'm trying to create a custom album in the Photo Library of an iPhone and then save photos that I've taken with the camera, or chosen from the phones Cam... |
{"title":"get the event object in an event handling function without pass the event object as parameters? (with jquery)","tags":["javascript","jquery","events","object"],"question_text":"I have this:\n`<a href=\"#\" onclick=\"myFunc(1,2,3)\">click<\/a>`\nand the javascript also defines this:\n`function myFunc(p1,p2,p3)... |
{"title":"Unexpected operator error","tags":["bash","jar","find"],"question_text":"What is wrong in my code?\n`#!\/bin\/sh\nLOOK_FOR=\"$1\"\nfor i in `find $2 -name \"*jar\"`; do\n echo \"Looking in $i ...\"\n #jar tvf $i | grep $LOOK_FOR > \/dev\/null\n jar tvf \"$i\" | grep \"$LOOK_FOR\" \n if [ $? == 0 ] ; then\n ec... |
{"title":"Generating a unique machine id","tags":["windows","winapi","wmi","uniqueidentifier"],"question_text":"I need to write a function that generates an id that is unique for a given machine running a Windows OS.\nCurrently, I'm using WMI to query various hardware parameters and concatenate them together and hash t... |
{"title":"Why is the maximum value of an unsigned n-bit integer 2^n-1 and not 2^n?","tags":["integer","programming-languages","numeric-limits"],"question_text":"The maximum value of an\n`n`\n-bit integer is 2\nn\n-1. Why do we have the \"minus 1\"? Why isn't the maximum just 2\nn\n?","answer_text":"The\n`-1`\nis becaus... |
{"title":"HTTP Basic Authentication - what's the expected browser experience?","tags":["curl","http-basic-authentication"],"question_text":"When a server allows access via Basic HTTP Authentication, what is the experience expected to be on the browser?\nI typically just do this with curl:\n`curl -u myusername:mypasswor... |
{"title":"How serious is this new ASP.NET security vulnerability and how can I workaround it?","tags":["asp.net",".net","security","padding-oracle-attack"],"question_text":"I've just read on the net about a newly discovered security vulnerability in ASP.NET.\nYou can read the details here.\nThe problem lies in the way ... |
{"title":"Create Table from View","tags":["sql","tsql","view"],"question_text":"I have a view that I want to create a table from in SQL Enterprise Manager, but I always get an error when I run this query:\n`CREATE TABLE A \nAS\n(SELECT top 10 FROM dbo.myView)`\nSo far the error is: \"syntax error at 'as'\"\nView is too... |
{"title":"How to add padding-left on a UIButton created programmatically?","tags":["xcode","uibutton","padding","imageedgeinsets"],"question_text":"I am having a trouble adding left padding on a\n`UIButton`\n. I have a\n`UIButton`\nwith\n`UIControlContentHorizontalAlignmentLeft`\n. I want the text to be displayed on th... |
{"title":"How to generate gif from avi using ffmpeg?","tags":["ffmpeg"],"question_text":"I'm trying to extract a part of a video into an animated gif using the following command:\n`ffmpeg -i video.avi -t 5 out.gif`\nIt generates an animated gif but the quality is insane. However when I generate gif image using:\n`ffmpe... |
{"title":"libsqlite in simulator and iOS compiling","tags":["ios","compilation","sqlite3"],"question_text":"I'm having some issues when compiling my app to iOS.\nI'm using sqlite3 and imported as\n`#import <sqlite3.h>`\nWell, I only found a file named libsqlite3.0.dylib in my Mac and I copied it to my project.\nWhen I ... |
{"title":"MongoDB Many-to-Many Association","tags":["many-to-many","associations","mongodb"],"question_text":"How would you do a many-to-many association with MongoDB?\nFor example; let's say you have a Users table and a Roles table. Users have many roles, and roles have many users. In SQL land you would create a UserR... |
{"title":"Accessing HttpSession from HttpServletRequest in a Web Socket @ServerEndpoint","tags":["websocket","java-ee-7"],"question_text":"Is it possible to get the HttpServletRequest inside a @ServerEndpoint? Primarily I am trying to get it so I can access the HttpSession object.","answer_text":"The answer from Martin... |
{"title":"Git commit to common submodule (master branch)","tags":["git","commit","git-submodules"],"question_text":"I've two or more projects (let's call them\nProjectFoo\nand\nProjectBar\n) having some\ncommon code\nthat I put in a\nsubmodule\n.\nMy understanding is that if I commit changes to a submodule from within\... |
{"title":"BASH ^word^replacement^ on all matches?","tags":["bash","shell","scripting","sh"],"question_text":"To clarify, I am looking for a way to perform a\nglobal\nsearch and replace on the previous command used.\n`^word^replacement^`\nonly seems to replace the first match.\nIs there some\n`set`\noption that is eludi... |
{"title":"Converting a double to an int in Javascript without rounding","tags":["javascript","casting","floating-point","int"],"question_text":"In C# the following code returns 2:\n`double d = 2.9;\nint i = (int)d;\nDebug.WriteLine(i);`\nIn Javascript, however, the only way of converting a \"double\" to an \"int\" that... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.