text
stringlengths
74
309k
{"title":"Python regex - r prefix","tags":["python","regex","string","literals","prefix"],"question_text":"Can anyone explain why example 1 below works, when the r prefix is not used?\nI thought the r prefix must be used whenever escape sequences are used?\nExample 2 and example 3 demonstrates this..\n`# example 1\nimp...
{"title":"Error Executing security dump-trust-settings in Sublime Text 3","tags":["osx","sublimetext3","package-control"],"question_text":"When I open my Sublime Text I sometimes get the following error, especially in the last week.\n`Package Control\nError executing: \/usr\/bin\/security dump-trust-settings -d\nSecTru...
{"title":"topLayoutGuide in child view controller","tags":["ios","uiviewcontroller","ios7","autolayout","uipageviewcontroller"],"question_text":"I have a\n`UIPageViewController`\nwith translucent status bar and navigation bar. Its\n`topLayoutGuide`\nis 64 pixels, as expected.\nHowever, the child view controllers of the...
{"title":"NSURL URLWithString:relativeToURL: is clipping relative url","tags":["ios","url","nsurl"],"question_text":"I'm trying to implement an iOS app, which uses RestKit. In all examples I've seen so far the following code is used to create the URLs:\n`NSURL *baseURL = [NSURL URLWithString:@\"https:\/\/api.service.co...
{"title":"How do I return an exit code from a VBScript console application","tags":["vbscript"],"question_text":"I Have an old vbs script file being kicked off by an AutoSys job. Can I, and how do I, return an int return value to indicate success or failure?","answer_text":"Try:\n`WScript.Quit n`\nWhere n is the ERRORL...
{"title":"Eclipse Version","tags":["eclipse","osx","version"],"question_text":"How do you check the current version of eclipse that I am currently running? Is it possible to tell if it is aqua or carbon (I am running Mac OS X 10.5)?","answer_text":"My eclipse has a file\n`.eclipseproduct`\nin its' main folder which con...
{"title":"Do I need to `return` after `throw` in JavaScript?","tags":["javascript","exception","error-handling"],"question_text":"I'm throwing an\n`Error`\nfrom a method of mine that I want an early exit from, as below:\n`\/\/ No route found\nif(null === nextRoute) {\n throw new Error('BAD_ROUTE');\n}`\nDo I need to pu...
{"title":"How to create patch between two tags with multiple commits between them?","tags":["git","patch"],"question_text":"I have two tags in my git in same branch. There are at least 5-6 commits between them. How can I create a single patch between the two tags so that it can be applied to a GitHub repo?","answer_tex...
{"title":"How do I parse a data URL in Node?","tags":["node.js","url","base64"],"question_text":"I've got a data URL like this:\n`data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAA...`\nWhat's the easiest way to get this as binary data (say, a\n`Buffer`\n) so I can write it to a file?","answer_text":"Put the data into a B...
{"title":"My-Location Button of GoogleMaps v2 Android, not displayed","tags":["java","android","google-maps"],"question_text":"I'm doing an app, with google maps, but when I try to add \"my-location\" button, as the reference says doesn't work...\nthats how I do:\n`protected void onCreate(Bundle savedInstanceState) {\n...
{"title":"Store and Retrieve values from web.config","tags":["vb.net","web-config","asp.net-3.5"],"question_text":"I built a small website and there will be only one admin, so in the admin panel I am asking for a password with a value that I do not retrieve from a database, I just hard coded it in the function in code ...
{"title":"Android: How to get accurate altitude?","tags":["android","gps","location","altitude"],"question_text":"I need to get an accurate measurement of altitude using GPS only.\nI tried Location.getAltitude(), but that is terribly inaccurate.\nAny advice?","answer_text":"There are two issues with using altitude of a...
{"title":"error creating the web proxy specified in the 'system.net\/defaultproxy' configuration section","tags":["c#",".net"],"question_text":"I receive the error from a third party application exe.\nThe Application is only a exe, no config file or others.\n\"error creating the web proxy specified in the 'system.net\/...
{"title":"Are Delphi simple types thread safe?","tags":["multithreading","delphi","thread-safety"],"question_text":"I declared two global variables:\n`var\n gIsRunning: Boolean = False;\n gLogCounter: Integer = 0;`\nThese variables are written only in the main thread, and read in other threads. In this case, are these ...
{"title":"iPhone won't connect in Xcode 6 beta","tags":["ios","iphone","xcode","ios8"],"question_text":"I updated both iOS 8 and Xcode 6 beta. When I connect my phone, it shows up as \"\nineligible device\n\" where you select which platform you want to run on.\nWhen I try to run the project on my actual iPhone, an erro...
{"title":"Unquote string in C#","tags":["c#","string"],"question_text":"Please forgive my laziness. I could figure this out by reading up, I know, but I thought I'd give one of you C# geniuses the chance to win some rep.\nI have a data file in INI file like format that needs to be read by both some C code and some C# c...
{"title":"IE - hidden radio button not checked when the corresponding label is clicked","tags":["css","internet-explorer"],"question_text":"I just noticed a strange behaviour in IE7.\nI have radio buttons with associated labels as follows:\n`<input type=\"radio\" name=\"filter\" id=\"filter_1\" value=\"Activities\" che...
{"title":"Get Android shared preferences value in activity\/normal class","tags":["android","sharedpreferences"],"question_text":"I have made a shared preference activity that store the user settings, now i want to get values in a activity or normal java class.please provide a solution or example i have already tried t...
{"title":"maven in 5 min not working","tags":["maven-2","maven"],"question_text":"I have downloaded latest\nmaven 3.0.3, java version \"1.6.0_18\".\nmvn \u00e2\u0080\u0093version\n`Apache Maven 3.0.3 (r1075438; 2011-02-28 18:31:09+0100)\n Maven home: C:\\software\\apache-maven-3.0.3\n Java version: 1.5.0_05, vendor: Su...
{"title":"Getting NetworkCredential for current user (C#)","tags":["c#","web-services","authentication"],"question_text":"I'm trying to invoke a webservice from a console application, and I need to provide the client with a\n`System.Net.NetworkCredential`\nobject.\nIs it possible to create a\n`NetworkCredential`\nobjec...
{"title":"What is the best way to save datetime type in SQLite?","tags":["sqlite","datetime"],"question_text":"I\u00e2\u0080\u0099m creating Android apps and need to save date\/time of the creation record. What is the best way to do that? I will need to compare it later. For instance, in my apps I will show all record ...
{"title":"In MySQL, can I defer referential integrity checks until commit","tags":["mysql","referential-integrity"],"question_text":"As in\nthis question\n, I've been reading PoEAA and wondering if it's possible to defer referential integrity checks until commit in MySQL.\nI've run into this problem when wanting to ins...
{"title":"Amazon SES Email address is not verified","tags":["c#","asp.net","email","amazon-web-services","amazon-ses"],"question_text":"I'm starting with the amazon servers and started studying about SES. \nI am using asp.net C # and made \u00e2\u0080\u008b\u00e2\u0080\u008bmy code based tutorials. \nI already checked ...
{"title":"Recommended JSF 2.0 CRUD frameworks","tags":["java","jsf","jsf-2","crud"],"question_text":"Can somebody recommend any framework to facilitate CRUD development in JSF 2.0?\nAspects I value most:\nAs lightweight as possible;\nlimited\ndependencies on third party libraries\nSupport for an\nevolving\ndomain model...
{"title":"List view item swipe left and swipe right?","tags":["android","listview"],"question_text":"Can a List view item respond to swipe left and swipe right?\nIf so, how to apply android swipe left or right scrolling to open different intent? I want same like Call phone or message on contact view in android by defau...
{"title":"Is there an addon which you can test css selectors in firefox?","tags":["css","selenium","firefox-addon","css-selectors"],"question_text":"I was wondering if there is such an addon in firefox where you can test out css paths to check if they are finding the correct element? I was looking for something similar...
{"title":"Destroying all delayed job in rails","tags":["ruby-on-rails","ruby","delayed-job"],"question_text":"I am using collectiveidea for rails 2.3.8. I am creating array of delayed jobs to\n perform some tasks, after some time I want to destroy all the delayed jobs which are running.\n If anyone know the way to do t...
{"title":"Generating CSV file for Excel, how to have a newline inside a value","tags":["excel","csv","newline"],"question_text":"I need to generate a file for Excel, some of the values in this file contain multiple lines.\nthere's also non-English text in there, so the file has to be Unicode.\nThe file I'm generating n...
{"title":"The UAC prompt shows a temporary random Program Name for msi, can the correct name be displayed?","tags":["windows","certificate","uac","signtool"],"question_text":"I'm building an MSI installer for windows and sign the installer using signtool. When I run the .msi to test it, the UAC (User Account Control) p...
{"title":"How do I make Eclipse and mvn appengine:devserver talk to each other?","tags":["eclipse","google-app-engine","maven"],"question_text":"I am in the process of switching from\nGoogle Plugin for Eclipse\nto the official Google\nApp Engine Maven Plugin\n.\nThe last thing, I hope, that I cannot figure out is how t...
{"title":"Why to use returned instance after save() on Spring Data JPA Repository?","tags":["java","spring","jpa","spring-data","spring-data-jpa"],"question_text":"Here is the code:\n`@Repository\npublic interface AccountRepository extends JpaRepository<Account, Long> {}`\nJpaRepository\nfrom Spring Data JPA project.\n...
{"title":"Resetting form after submit in Angularjs","tags":["javascript","angularjs","angularjs-directive"],"question_text":"Hi I have a form which does update on button click.\n`$scope.action = \"Update\";\n var id = $routeParams.editId;\n scope.item = updateRecord.get({ id: id });`\nOnce the item is updated it doesn'...
{"title":"Algorithm to determine how positive or negative a statement\/text is","tags":["algorithm","nlp"],"question_text":"I need an algorithm to determine if a sentence, paragraph or article is negative or positive in tone... or better yet, how negative or positive.\nFor instance:\nJason is the worst SO user I have e...
{"title":"C, how to use POSIX semaphores on forked processes?","tags":["c","linux","fork","shared-memory","semaphore"],"question_text":"I want to fork multiple processes and then use a semaphore on them. Here is what I tried:\n`sem_init(&sem, 1, 1); \/* semaphore*, pshared, value *\/\n.\n.\n.\nif(pid != 0){ \/* parent ...
{"title":"Is relying on && short-circuiting safe in .NET?","tags":["c#",".net","operators","logical-operators","short-circuiting"],"question_text":"Assume myObj is null. Is it safe to write this?\n`if(myObj != null && myObj.SomeString != null)`\nI know some languages won't execute the second expression because the && e...
{"title":"What is 'cheaper' performance-wise $broadcast or $watch","tags":["angularjs"],"question_text":"I have a situation in my application where I need to reload the menu each time the role of the user changes(One user can have roles in several companies).\nI was wondering what is the best way to approach this issue...
{"title":"How does line spacing work in Core Text? (and why is it different from NSLayoutManager?)","tags":["objective-c","osx","nstextview","core-text","nslayoutmanager"],"question_text":"I'm trying to draw text using Core Text functions, with a line spacing that's as close as possible to what it would be if I used NS...
{"title":"Initializing member variables using the same name for constructor arguments as for the member variables allowed by the C++ standard?","tags":["c++"],"question_text":"I figured out that it's possible to initialize the member variables with a constructor argument of the same name as show in the example below.\n...
{"title":"Is no parentheses on a constructor with no arguments a language standard?","tags":["c++","constructor","standards"],"question_text":"I was compiling a C++ program in Cygwin using g++ and I had a class whose constructor had no arguments. I had the lines:\n`MyClass myObj();\nmyObj.function1();`\nAnd when trying...
{"title":"Combining TFS with Jira - any experiences or advice?","tags":["tfs","jira"],"question_text":"Ok, I'm a big fan of Jira particularly the later versions as a knowledge management system to use across stakeholders and development in a corporate setting.\nHowever, I'd like to marry it with the usage of TFS 2010 -...
{"title":"How to attach Android Source to Eclipse","tags":["android","eclipse"],"question_text":"I've previously had success attaching the Android Source to Eclipse by following Finn Johnsen's instructions\nhere\n.\nHowever this approach seems to have stopped working:\n`samuel-josephs-computer-4:android-sources samuelj...
{"title":"Can't downcast because class is not polymorphic?","tags":["c++","inheritance","polymorphism","vtable"],"question_text":"Is it possible to have inheritance with no virtual methods? The compiler is saying that the following code is not polymorphic.\nExample:\n`Class A(){\n int a;\n int getA(){return a;};\n}\nCl...
{"title":"How do threads work in Python, and what are common Python-threading specific pitfalls?","tags":["python","multithreading"],"question_text":"I've been trying to wrap my head around how threads work in Python, and it's hard to find good information on how they operate. I may just be missing a link or something,...
{"title":"Swift converting between UInt and Int","tags":["ios","swift"],"question_text":"I have the following methods\n`var photos = [MWPhoto] = [MWPhoto]()\nfunc numberOfPhotosInPhotoBrowser(photoBrowser: MWPhotoBrowser!) -> UInt {\n return self.photos.count\n}\nfunc photoBrowser(photoBrowser: MWPhotoBrowser!, photoAt...
{"title":"Is a C++ destructor guaranteed not to be called until the end of the block?","tags":["c++","raii"],"question_text":"In the C++ code below, am I guaranteed that the ~obj() destructor will be called\nafter\nthe \/\/ More code executes? Or is the compiler allowed to destruct the obj object earlier if it detects ...
{"title":"Measure a String without using a Graphics object?","tags":["c#","text","fonts","gdi+"],"question_text":"I am using pixels as the unit for my font. In one place, I am performing a hit test to check if the user has clicked within the bounding rectangle of some text on screen. I need to use something like\n`Meas...
{"title":"Saving multiple objects in a single call in rails","tags":["ruby-on-rails","activerecord","data-access"],"question_text":"I have a method in rails that is doing something like this:\n`a = Foo.new(\"bar\")\na.save\nb = Foo.new(\"baz\")\nb.save\n...\nx = Foo.new(\"123\", :parent_id => a.id)\nx.save\n...\nz = Fo...
{"title":"Return values from the row above to the current row","tags":["excel","excel-formula"],"question_text":"I am trying to do simple thing: I just need to set some cells to values that are on the previous rows.\nI have tried\n`=A(Row()-1)`\nbut it does not work.","answer_text":"To solve this problem in Excel, usua...
{"title":"mongodb print json without whitespace i.e. unpretty json","tags":["javascript","mongodb"],"question_text":"I'm using mongodb 2.2.0 and am trying to print json in a single line as opposed to \"pretty\" printing using\n`printjson()`\nor\n`find().pretty()`\n. i.e. I need the documents listed in json format as do...
{"title":"Multi-line strings in objective-c localized strings file","tags":["objective-c","iphone","localization","nslocalizedstring"],"question_text":"I have a template for an email that I've put in a localized strings file, and I'm loading the string with the\n`NSLocalizedString`\nmacro.\nI'd rather not make each lin...
{"title":"how to redirect to the same page in php","tags":["php","redirect"],"question_text":"How can i redirect to the same page using PHP. For example in local my web address is\n`http:\/\/localhost\/myweb\/index.php`\nHow can I redirect within my website to another page say\n`header(\"Location: clients.php\");`\nI k...
{"title":"Is CORBA legacy?","tags":["corba"],"question_text":"For a distributed computing project starting today, with 0 legacy components, are there any good reasons to look into CORBA?","answer_text":"There are still situations where CORBA could be a good answer:\nwhen you are building a distributed\nsystem involving...
{"title":"How to print R graphics to multiple pages of a PDF and multiple PDFs?","tags":["graphics","r","plot"],"question_text":"I know that\n`pdf(\"myOut.pdf\")`\nwill print to a PDF in R. What if I want to\nMake a loop that prints subsequent graphs on new pages of a PDF file (appending to the end)?\nMake a loop that ...
{"title":"not getting automatically web.xml file while creating servlet in eclipse juno 4.2","tags":["java","eclipse","servlets"],"question_text":"I am using\n`eclipse juno 4.2`\n,\n`java 1.7`\nand\n`tomcat 7`\n.But in my system when i create servlet the\n`web.xml`\nfile doesn't create automatically.but anothor system ...
{"title":"Parallelizing a for loop","tags":["java","multithreading"],"question_text":"I have a for loop where the computation at iteration i does not depend on the computations done in the previous iterations. I want to parallelize the for loop(my code is in java) so that the computation of multiple iterations can be r...
{"title":"What is the difference between OSGi Components and Services","tags":["osgi"],"question_text":"Under OSGi, what are the main differences between Components vs Services?\nAs I understand it, all Services must be Components, but not all Components must be services.\nWhat are the benefits of using one over the ot...
{"title":"Django: CharField with fixed length, how?","tags":["django","django-models"],"question_text":"I wold like to have in my model a CharField with fixed length. In other words I want that only a specified length is valid.\nI tried to do something like\n`volumenumber = models.CharField('Volume Number', max_length=...
{"title":"What is \"ANSI as UTF-8\" and how can I make fputcsv() generate UTF-8 w\/BOM?","tags":["php","utf-8","character-encoding","notepad++"],"question_text":"I made a PHP script that generates CSV files that were previously generated by another process.\nAnd then, the CSV files have to be imported by yet another pr...
{"title":"How does ApplicationContextAware work in Spring?","tags":["java","spring"],"question_text":"In spring, if a bean implements\n`ApplicationContextAware`\n, then it is able to access the\n`applicationContext`\n. Therefore it is able to get other beans.\ne.g.\n`public class SpringContextUtil implements Applicatio...
{"title":"Command for toggling line numbers in vi","tags":["vim","vi","line-numbers"],"question_text":"I know\n`:set number`\nand\n`:set nonumber`\nI want to know whether there is any command in vi\/vim\n`:set togglenumber`\nto display line number if the line numbers is not showing or hiding line numbers if line number...
{"title":"C#: How to convert BITMAP byte array to JPEG format?","tags":["c#",".net","jpeg","bmp"],"question_text":"How can I convert a BITMAP in byte array format to JPEG format using .net 2.0?","answer_text":"What type of\n`byte[]`\ndo you mean? The raw file-stream data? In which case, how about something like (using\...
{"title":"android.support.v7.widget.Toolbar icon alignment issue","tags":["android","android-5.0-lollipop","toolbar","appcompat","android-actionbar-compat"],"question_text":"Using the new Android 5.0 Toolbar approach, and following the Google IO example, I'm setting a navigation icon and a spinner in the toolbar.\nThe ...
{"title":"Rotating an image context (CGContextRotateCTM) causing it to become blank. Why?","tags":["iphone","objective-c","ios","core-graphics"],"question_text":"`#define radians(degrees) (degrees * M_PI\/180)\nUIImage *rotate(UIImage *image) {\n CGSize size = image.size;;\n UIGraphicsBeginImageContext(size);\n CGConte...
{"title":"Code to generate Gaussian (normally distributed) random numbers in Ruby","tags":["ruby","random","normal-distribution"],"question_text":"What is some code to generate normally distributed random numbers in ruby?\n(Note: I answered my own question, but I'll wait a few days before accepting to see if anyone has...
{"title":"What are unused\/undeclared dependencies in Maven? What to do with them?","tags":["maven","dependencies","maven-2"],"question_text":"Maven\n`dependency:analyze`\ncomplains about the dependencies in my project. How does it determine which are unused and which are undeclared? What should I do about them?\nExamp...
{"title":"Generate tail call opcode","tags":["c#","recursion","f#","tail-recursion","cil"],"question_text":"Out of curiosity I was trying to generate a tail call opcode using C#. Fibinacci is an easy one, so my c# example looks like this:\n`private static void Main(string[] args)\n {\n Console.WriteLine(Fib(int.MaxValu...
{"title":"What will happen if '&' is not put in a 'scanf' statement in C?","tags":["c","crash","scanf"],"question_text":"I had gone to an interview in which I was asked the question:\nWhat do you think about the following?\n`int i;\nscanf (\"%d\", i);\nprintf (\"i: %d\\n\", i);`\nI responded:\nThe program will compile ...
{"title":"Passing arrays and matrices to functions as pointers and pointers to pointers in C","tags":["c","pointers","parameters"],"question_text":"Given the following code:\n`void\nfoo( int* array ) \n{\n \/\/ ...\n}\nvoid\nbar( int** matrix ) \n{\n \/\/ ...\n}\nint\nmain( void ) {\n int array[ 10 ];\n int matrix[ 10 ...
{"title":"Python readlines() usage and efficient practice for reading","tags":["python","performance","memory","python-2.6","readlines"],"question_text":"I have a problem to parse 1000's of text files(around 3000 lines in each file of ~400KB size ) in a folder. I did read them using readlines,\n`for filename in os.list...
{"title":"Make: how to continue after a command fails?","tags":["makefile"],"question_text":"The command\n`$ make all`\ngives errors such as\n`rm: cannot remove '.lambda': No such file or directory`\nso it stops. I want it to ignore the rm-not-found-errors. How can I force-make?\nMakefile\n`all:\n make clean\n make .la...
{"title":"Using DateTime in a For loop, incrementing date Isn't working","tags":["c#","asp.net","datetime","for-loop"],"question_text":"I have this loop, its purpose is to loop through a range of dates and perform some logic to automate adding entries into the database. The issue is that the incrementing portion, date....
{"title":"Winforms c# - Set focus to first child control of TabPage","tags":["c#",".net","winforms","focus"],"question_text":"Say I have a\n`Textbox`\nnested within a\n`TabControl`\n.\nWhen the form loads, I would like to focus on that\n`Textbox`\n(by default the focus is set to the\n`TabControl`\n).\nSimply calling\n`...
{"title":"How to Uninstall RubyMine?","tags":["ruby","osx","rubymine"],"question_text":"How do you uninstall RubyMine (from Mac OSX or other systems)?\nIt doesn't come with an uninstaller (from what I can tell). There are no options to uninstall in the application itself.\nThere is no documentation (except a \"Thank yo...
{"title":"Is it OK to have one instance of SQLiteOpenHelper shared by all Activities in an Android application?","tags":["java","android","sqlite","android-cursor","android-loadermanager"],"question_text":"Would it be OK to have a single instance of SQLiteOpenHelper as a member of a subclassed Application, and have all...
{"title":"C#: easiest way to populate a ListBox from a List","tags":["c#","winforms","list","listbox"],"question_text":"If I have a list of strings, eg:\n`List<string> MyList = new List<string>();\nMyList.Add(\"HELLO\");\nMyList.Add(\"WORLD\");`\nIs there an easy way to populate a ListBox using the contents of MyList?"...
{"title":"Rendering a different Javascript file in respond_to","tags":["javascript","jquery","ruby-on-rails","ruby"],"question_text":"I am stuck in an (apparently) simple problem.\nIn my event_controller I have the i_like_it action:\n`def i_like_it\n @event = Event.find(params[:id])\n ... # logic\n respond_to do |forma...
{"title":"Java reflection - access protected field","tags":["java","reflection","field","protected"],"question_text":"How can I access an inherited protected field from an object by reflection?","answer_text":"Two issues you may be having issues with - the field might not be accessible normally (private), and it's not ...
{"title":"Fast way to dynamically fill table with data from JSON in JavaScript","tags":["javascript","jquery","html","json","dom"],"question_text":"I am experimenting with jQuery, JSON etc. and came across following task. I have a loader script on the server which returns table data in JSON format. When received the JS...
{"title":"Requested registry access is not allowed","tags":["c#",".net","security","uac","registry"],"question_text":"I'm writing a tweak utility that modifies some keys under\n`HKEY_CLASSES_ROOT`\n.\nAll works fine under Windows XP and so on. But I'm getting error\n`Requested registry access is not allowed`\nunder Win...
{"title":"Save object while orientation change","tags":["android","android-fragments"],"question_text":"How to save Object while orientation change, since\nonRetainNonConfigurationInstance\nand\ngetLastNonConfigurationInstance\nare deprecated. And which cannot me used with\n`compatibility package`\n`android-support-v4....
{"title":"await works but calling task.Result hangs\/deadlocks","tags":["c#","nunit","task","deadlock","async-await"],"question_text":"I have the following four tests and the last one hangs when I run it, my question is why this happens:\n`[Test]\npublic void CheckOnceResultTest()\n{\n Assert.IsTrue(CheckStatus().Resul...
{"title":"How to use ng-if to test if a variable is defined","tags":["angularjs"],"question_text":"Is there a way to use\n`ng-if`\nto test if a variable is defined, not just if it's truthy?\nIn the example below (\nlive demo\n), the HTML displays a shipping cost for the red item only, because\n`item.shipping`\nis both ...
{"title":"Which is the most clojuresque way to compare characters and string? (single char string)","tags":["string","clojure","character"],"question_text":"I was wondering about which is the best (clojuresque) way to compare a character and a string in Clojure.\nObviously something like that returns false:\n`(= (first...
{"title":"How can I do an OrderBy with a dynamic string parameter?","tags":["linq","sql-order-by"],"question_text":"I want to do this:\n`var orderBy = \"Nome, Cognome desc\";\nvar timb = time.Timbratures.Include(\"Anagrafica_Dipendente\")\n .Where(p => p.CodDipendente == 1);\nif(orderBy != \"\")\n timb = timb.OrderBy(o...
{"title":"Declarations in C++","tags":["c++","pointers","const","language-lawyer","declaration"],"question_text":"From what I have understood, declarations\/initializations in C++ are statements with 'base type' followed by a comma separated list of declarators.\nConsider the following declarations:\n`int i = 0, *const...
{"title":"How to solve this error in C#?","tags":["c#","linq","c#-4.0","linq-to-entities"],"question_text":"I'm getting an error when using the following code\n`var v1 = from P in db1.QuranWordsNews where P.Aye == perId select P;\nvar vv = v1.LastOrDefault(); \/\/ The error occurs here`\nThe message:\nLINQ to Entities ...
{"title":"Which boost libraries are header-only?","tags":["c++","boost"],"question_text":"Which boost libraries are header only? And which require building libs?\nDoes such a list exist?","answer_text":"The list of libraries that require building is\nhere\nfor Unix-like systems, and\nhere\nfor Windows.\nFor the current...
{"title":"MVC - Set selected value of SelectList","tags":["c#","asp.net-mvc"],"question_text":"How can I set the selectedvalue property of a SelectList after it was instantiated without a selectedvalue;\n`SelectList selectList = new SelectList(items, \"ID\", \"Name\");`\nI need to set the selected value after this stag...
{"title":"Video Game Bots?","tags":["c++","artificial-intelligence"],"question_text":"Something I've always wondered, especially since it inspired me to start programming when I was a kid, was how video game bots work? I'm sure there are a lot of different methods, but what about automation for MMORPGs? Or even FPS-typ...
{"title":"Number of attributes in key schema must match the number of attributes defined in attribute definitions","tags":["amazon-dynamodb","dynamo-local"],"question_text":"I\u00e2\u0080\u0099m trying to create a simple table using DynamoDB javascript shell and I\u00e2\u0080\u0099m getting this exception:\n`{ \n \"mes...
{"title":"How to resize and save an image which uploaded using file upload control in c#","tags":["c#","asp.net-mvc-4","file-upload","razor","image-resizing"],"question_text":"i have developed a web application using asp.net mvc4 and razor. in my application there's a file upload control to upload an image and save in ...
{"title":"Backup a single table with its data from a database in sql server 2008","tags":["sql","sql-server","sql-server-2008"],"question_text":"I want to get a backup of a single table with its data from a database in SQL Server using a script.\nHow can I do that?","answer_text":"`select * into mytable_backup from myt...
{"title":"pass parameter in table valued function using select statement","tags":["sql","sql-server","sql-server-2008","tsql","sql-function"],"question_text":"I have created a table valued return function which returns me a table . here is call of my function as follow\n`SELECT * FROM dbo.[StateFixedTaxesCalculation](3...
{"title":"How to stop a Vimeo video with JQuery","tags":["javascript","jquery","vimeo"],"question_text":"When I hide a youtube video, it stops playing. However, this is not the case for Vimeo videos. Is there another way to stop a Vimeo video?","answer_text":"First, add an ID to your iFrame. Then add this to your javas...
{"title":"How To Test BOOT_COMPLETED Broadcast Receiver In Emulator","tags":["android","android-emulator","broadcastreceiver"],"question_text":"I want to check the\n`BROADCAST RECEIVER`\nwith Action\n`BOOT_COMPLETED`\nin the\n`emulator`\n.\nIs there any way to check that broadcast receiver in emulator ? How can i resta...
{"title":"Visual Studio 2012 Error Reference.svcmap throwing Error","tags":["wcf","visual-studio-2012"],"question_text":"Started using Visual Studio 2012 RC since yesterday, We have one WCF solution. Whenever i try to use the \"add\/remove reference\" dialog in another solution, I get below error after adding the servi...
{"title":"What to use for login ID?","tags":["authentication","web-applications","account"],"question_text":"We are in the early design stages of a major rewrite of our product. Right now our customers are mostly businesses. We manage accounts. User names for an account are each on their own namespace but it means that...
{"title":"Write a file in hdfs with Java","tags":["java","hadoop","hdfs"],"question_text":"I want to create a file in HDFS and write data in that. I used this code:\n`Configuration config = new Configuration(); \nFileSystem fs = FileSystem.get(config); \nPath filenamePath = new Path(\"input.txt\"); \ntry {\n if (fs.exi...
{"title":"advantage of tap method in ruby","tags":["ruby"],"question_text":"I was just reading a blog article and noticed that the author used\n`tap`\nin a snippet something like:\n`user = User.new.tap do |u|\n u.username = \"foobar\"\n u.save!\nend`\nMy question is what exactly is the benefit or advantage of using\n`t...
{"title":"Help with basic shell script. \/bin\/sh: source: not found","tags":["bash","shell","cron"],"question_text":"My cron :\n`45 10 * * * source \/home\/ThinkCode\/Test\/hello.sh`\nhello.sh :\n`#!\/bin\/bash\necho \"helloworld\"`\nThe error it emails me :\n`\/bin\/sh: source: not found`\nWhat am I doing wrong? It i...