pid int64 2.28k 41.1M | label int64 0 1 | text stringlengths 1 28.3k |
|---|---|---|
31,804,966 | 0 | Running NodeJs http-server forever with PM2 <p>My question is about running HTTP-server in combination with PM2. </p> <p>The problem i face is that:</p> <ol> <li>HTTP-server requires as input a folder which is the root of the website and a port number to run the website on.</li> <li>PM2 doesn't recognize the HTTP-serve... |
13,706,289 | 0 | how to set a base url with sammy? <p>i'm looking around for javascript routing libraries and i come to Sammy, so i'm learning it.</p> <p>All examples that i've seen so far show hot to proceed routing based from a domain as a base url, like www.mydomain.com/# and then all routes goes on</p> <p>but i'm doing some trials ... |
38,233,127 | 0 | Angular - Bootstrap: Page navigation (Next and back button) using Angular UI-route not working when changing the state from controller <p>I am trying to achieve page navigation (Next and back button) using Angular UI-route. I am changing the state from controller and it is getting changed on view as well but is not red... |
27,226,330 | 0 | <pre><code>SELECT CASE WHEN ((SELECT Count(*) FROM table) >= '100') THEN 'ALERT' ELSE null END </code></pre> <p>Create a job that runs every 10 seconds/5 seconds or what ever and put in the above query and get it to email if there are results.</p> |
1,308,103 | 0 | <p>There's already a browser-based system that uses keys to secure data transfer. It's called SSL.</p> |
16,278,639 | 0 | <p>There is difference between 1 and 0.1: your first case shows whole number while second case shows fractional.</p> <p>So if you test 10-20 range with value of 9.9 you may get error of data type (fractional instead of whole, or float instead of byte). By doing that, instead of testing range you test data type. This t... |
12,287,876 | 0 | <p>No. I looked in the documentation, and it looks like HighCharts.js only supports <code>renderTo</code> to a single HTML element. <a href="http://api.highcharts.com/highcharts#chart.renderTo" rel="nofollow">http://api.highcharts.com/highcharts#chart.renderTo</a></p> <p>I would assume that you have 5 pie charts that ... |
29,099,545 | 0 | <p>Why not just set the value to <code>true</code> inside the <code>else</code> block?</p> <pre><code>@if (hasMoreThanOnePerson) { <td> @Html.CheckBoxFor(m => m.People[i].IsSelected) </td> } else { @{ Model.People[i].IsSelected = true; } @Html.HiddenFor(m => m.People[i].IsSelected) // Set TRUE always... |
23,949,998 | 0 | What effect does a space have before the class name? <p>My aim is to have this class apply only when set on <code><img></code> tags. It only works when there is no space between the tag name and the class name, but doesn't when there is. I have seen style sheets with spaces in the signature, so I'm sure it must b... |
36,369,339 | 0 | Cannot compare elements of type 'System.Linq.IQueryable`1'. Only primitive types, enumeration types and entity types are supported <p>i have this code in my controller</p> <pre><code>[HttpGet] public ActionResult Nabipour() { string name = "Nabipour"; var username = (from T in _db.tbl_teacher where T.Page==name select ... |
3,522,842 | 0 | <p>Here's a binary search algorithm I just wrote for you that does the trick:</p> <pre><code>import java.util.Random; public class RangeFinder { private void find(double query, double[] data) { if (data == null || data.length == 0) { throw new IllegalArgumentException("No data"); } System.out.print("query " + query + ... |
9,001,115 | 0 | Save banking account data secure <p>I need to save banking account data in a web project. The project is asp.net mvc 3 and the database is MSSQL 2008 R2.</p> <p>But how should I do that secure?</p> <p>My solutions are:</p> <ol> <li><p>Solution: Encrypt the Data with TripleDESCryptoServiceProvider and save them to the D... |
41,023,266 | 0 | Is there an OData dependency graph somewhere? <p>I'm following <a href="http://lightswitchhelpwebsite.com/Blog/tabid/61/EntryId/3292/A-OData-4-AngularJs-TypeScript-Sample-Application.aspx" rel="nofollow noreferrer">this guide</a> to migrate an app I developed to an open framework. I get to the part where I'm supposed t... |
3,188,353 | 0 | <p>Every environment is slightly different. In comparison, you have to decide what works for you. Amazon for example makes their developers own their own code, which some developers hate, but it is a feature of that environment that keeps bug counts low (when was the last time you saw a bug on amazon.com?). </p> <p>Ot... |
16,618,756 | 0 | <p>Since you're using Windows, <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms683197.aspx" rel="nofollow">GetModuleFileName</a> should do the trick. Just pass <code>NULL</code> for the <code>hModule</code> parameter. Be sure to read the documentation carefully if you want to handle long file names ... |
20,944,063 | 0 | <p>I dont understand you question.</p> <p>You say you want to add a <code>TextureView</code> to your activity_main.xml layout. but it is already there.</p> <p>Obviously if you use <code>setContentView(mTextureView);</code> after <code>setContentView(R.layout.activity_main);</code> the entire layout will be gone. You a... |
32,283,313 | 0 | C# Node pointer issue <p>I am having some trouble setting child nodes using C#. I am trying to build a tree of nodes where each node holds an int value and can have up to a number of children equal to it's value.</p> <p>My issue appears when I iterate in a node looking for empty(null) children so that I may add a new n... |
3,841,110 | 0 | <p>It's probably worth just testing if the following works:</p> <pre><code>SqlConnection con = new SqlConnection("Data Source=server;Initial Catalog=Invoicing;Persist Security Info=True;ID=id;Password=pw"); </code></pre> <p>To me it looks like your connection string is probably not right - there's no user provided. I ... |
11,754,070 | 0 | Editing Dynamically Generated Telerikmvc3 Grid <p>I have a dynamically generated MVC3 grid that is populated from a ViewModel. I need to add editing to the grid and cant get it to even go into edit mode.</p> <p>Also I need to be able to make some of the columns readonly.</p> <p>My code is below:</p> <pre><code>@(Html.T... |
14,361,227 | 0 | <p>This will do the trick:</p> <pre><code>if($_SERVER['REMOTE_ADDR'] === '127.0.0.1') { // do something } </code></pre> <p>Be careful you don't rely on X_FORWARDED_FOR as this header can be easily (and accidentally) spoofed.</p> <p>The correct way to do this would be to set an environmental variable in your server con... |
15,601,937 | 0 | Zebra printer serbian latin characters <p>I have a problem with Zebra printer RW220 not printing serbian latin characters, like čćžšđ. I developed an android app which uses the printer. The printing part is based on Zebra SDK. Here's the part of the code:</p> <pre><code>private byte[] getConfigLabel() { PrinterLanguage... |
38,632,937 | 0 | <p>You can put these variables in an interface. That way, you will make these "public static final".</p> <p>Ideally you can even put these into properties file. In that case, these should be config properties of your application which may control a feature or anything that could've been changed from outside(e.g. an ur... |
34,423,220 | 0 | <p>Just to add to the accepted answer (not enough rep to comment), I had this issue arise when blocking using <code>task.Result</code>, event though every <code>await</code> below it had <code>ConfigureAwait(false)</code>, as in this example:</p> <pre><code>public Foo GetFooSynchronous() { var foo = new Foo(); foo.Inf... |
25,530,556 | 0 | <p>Having the triggers activate when the application is not running at all (not even in background) isn't supported through the Worklight APIs. You could try and use Worklight Android Native SDK together with cmarcelk's suggestions. Or you could use the Worklight Android triggers within a native service, together with... |
4,157,941 | 0 | <p>I think the loop is just fine, but if you want to keep track,</p> <pre><code>var winList = new Array(); var count = 10; for(var i=0; i < count; i++){ winList[i] = window.open("http://www.test.com"); } </code></pre> <p>This way, you can keep references to your windows.</p> <p>hth</p> |
34,894,906 | 0 | <p>I don't have enough rep to post this as a comment to the question.</p> <p>Maybe your PowerBuilder source control methodology is holding you back. Do you control the PB objects inside of the PBLs? Or do you control *.sr? (PB Export) files, maybe using PowerGen to synchronize them into the PBLs?</p> <p>At work, a set... |
20,698,101 | 0 | After manually rebalancing hadoop hdfs disks DataNode won't restart <p>I use Hadoop hadoop-2.0.0-mr1-cdh4.1.2 in a cluster of 40 machines. Each machine has 12 disks used by hadoop. Some disks in one machine were unbalanced, and I decided to re-balance manually as mentioned in this post: <a href="http://stackoverflow.co... |
14,026,722 | 0 | <p>The background is relative to your div, not to margins, use paddings instead.</p> |
4,995,708 | 0 | <p>It's like "normal" fields. So before the static constructor. You can check with a very simple program.</p> <p>The order is:</p> <ul> <li>static fields</li> <li>static constructor</li> <li>"normal" fields</li> <li>"normal" constructor</li> </ul> <p>A sample program:</p> <pre><code>class Program { static void Main(st... |
38,536,136 | 0 | Unique methods for use through the class rather than an object <p>So, I'm beginning to learn Java and I think it's an awesome programming language, however I've come across the <code>static</code> keyword which, to my understanding, makes sure a given method or member variable is accessible through the class (e.g. <cod... |
2,811,457 | 0 | <p>Safe from what? If an attacker has root, they can subvert system calls and spy on memory buffers before encryption and after decryption, and nothing you can do is safe.</p> <p>If an attacker does not have root, they can't see this information even if you don't encrypt it.</p> <p>So I don't see a point to this.</p> |
23,189,974 | 0 | <p>Your production environment has the <code>short_open_tag</code> setting disabled. For full compatibility its recommended that you do not turn it on and instance use the full php tag <code><?php</code> instead of <code><?</code></p> |
40,185,920 | 0 | custom vertex color with threejs LineSegments() <p>I am struggling with threejs to use a shaderMaterial on a THREE.LineSegments my goal is to have per vertex color, on a bunch of line segments:</p> <p>I have a vertex and a fragment shader :</p> <pre><code> <script type="x-shader/x-vertex" id="vertexshader"> varyi... |
28,625,148 | 0 | Adding icons to tabs using Easy Responsive Tabs from WP <p>I cant find anything to answer me this. How can I add icons to the title of my ERT tabs? ERT generates a shortcode which I have added to home php file and it works beautifully but how can I edit the shortcode so that the title tab includes an icon? code looks l... |
14,450,658 | 0 | <p>Does this work?</p> <pre><code>def json = request.JSON try { def context = json.optJSONObject("context") userService.updateContext(context) }catch(e) { log.error json.toString() } </code></pre> |
22,184,715 | 0 | <p>There are two (or more) problems. The first: you are using <code>typedef</code> when you are trying to declare an array of structs. Don't. Instead of</p> <pre><code>typedef struct Symbles symbles_arr[MAX_SYMBOLS_ENTRIES_EXTERNALS]; </code></pre> <p>use</p> <pre><code>struct Symbles symbles_arr[MAX_SYMBOLS_ENTRIES_E... |
19,801,904 | 0 | I have a website and when I put one page in the root it works fine but within a folder I get an error? <p>I have uploaded the same file on to the website. The php code in it looks like this <code> <pre>$f = fopen("http://thefreetechhelp.com/testsrc/top.txt", "r"); while(!feof($f)) { echo fgets($f); } fclose($f); ?> ... |
28,257,088 | 0 | <p>One way to go about it is to create a view with your basic logic:</p> <pre><code>CREATE VIEW myview AS SELECT * FROM mytable WHERE column_b = 'X' AND column_c = 'Y' </code></pre> <p>Now, this logic can be reused:</p> <pre><code>SELECT * FROM myview WHERE column_a NOT IN (SELECT column_k FROM myview) </code></pre> |
19,320,850 | 1 | Error with my Python File Search Algorithm <p>I have a problem with my python code.When my search code encounters an error it terminates the search it is conducting even when it has not yet finish searching a specific location. This mostly happens when it encounters a write protected folder or file.I am using <code>os.... |
30,943,140 | 0 | <p>By using <code>add</code>, you are effectively getting a calendar instance that is 2015 years, 6 months, 20 days, and 19 hours <em>later</em> than now. Instead use the <a href="http://docs.oracle.com/javase/8/docs/api/java/util/GregorianCalendar.html#GregorianCalendar-int-int-int-int-int-" rel="nofollow">constructo... |
21,524,234 | 0 | <p>I think that the only way is to grab widget with QPixmap::grabWidget(). And to use this image in delegate. Seems, that it is not possible to do because of <a href="http://stackoverflow.com/questions/19138100/how-to-draw-control-with-qstyle-and-with-specified-qss">QSS limitation</a></p> |
33,167,029 | 0 | <p>Going along with Charles Ward's answer, the following worked for me: <code>com.leapmotion.leap.LeapJNI.Controller_setPolicy(Controller.getCPtr(controller), controller, 1 << 15);</code></p> |
2,154,512 | 0 | <p>Java uses <a href="http://en.wikipedia.org/wiki/IEEE_754" rel="nofollow noreferrer">IEEE 754</a> for its floating point numbers and therefore follows their rules.</p> <p>According to the <a href="http://en.wikipedia.org/wiki/NaN" rel="nofollow noreferrer">Wikipedia page on NaN</a> it is defined like this:</p> <bloc... |
17,083,428 | 0 | MSSQL merge with distributed transaction alternative <p>I have a distributed transaction where I need to merge into the target remote table. Now MERGE INTO isn't allowed according to MSDN: “target_table cannot be a remote table”.</p> <p>So my workaround goes as follows: 0. begin distributed transaction 1. define a curs... |
33,234,754 | 0 | <p>Like adeneo said: dataType: 'array' is invalid and probably jquery will trigger the .fail() instead of .done(). </p> <p><a href="https://api.jquery.com/deferred.fail/" rel="nofollow">https://api.jquery.com/deferred.fail/</a></p> |
9,089,647 | 0 | css to format line 1 and 2 of my h1 differently? & change position of line break <p>Hi I am using a featured post widget in wordpress and its is displaying my h1 heading over 2 lines. However I want to change the margin or line breaks so that instead of saying "Workplace Injury" on the first line and "Prevention" on th... |
20,930,988 | 0 | <p>It is because the callback is being run on a thread.</p> <p>Why?</p> <p>The Console application.</p> <p>According to the <code>Progress</code> class MSDN documentation:</p> <blockquote> <p>Any handler provided to the constructor or event handlers registered with the ProgressChanged event are invoked through a Synch... |
7,044,505 | 0 | <p>If both scripts have been included in the same HTML file, sure, it will work out of the box. Best way to know is to try it.</p> |
2,588,472 | 0 | 32 bit operation vs 64 bit operation on a 64bit machine/OS <p>Which operation i.e a 32 bit operation or a 64 bit operation (like masking a 32 bit flag or a 64 bit flag), would be cheaper on a 64 bit machine?</p> |
28,912,282 | 0 | Trying to write "<<<" in ksh <p>I am having trouble with the code below:</p> <pre><code>IFS=: read c1 c2 c3 c4 rest <<< "$line" </code></pre> <p>Don't get me wrong this code works good but it doesn't seem to be used for ksh. I basically need to write the same code without the "<<<". There is not much ... |
2,355,399 | 0 | Creating a "skeleton" of an existing database <p>I have a huge database in production environment which I need to take a copy off, but the problem is that the data is over 100Gb's and downloading a backup off it is out of the question. I need to get a "skeleton" image of the database. What I mean by "skeleton" is, I ne... |
11,653,985 | 0 | <p>An IMHO improved way based upon ZZ Coder's solution is to use a ResponseInterceptor to simply track the last redirect location. That way you don't lose information e.g. after an hashtag. Without the response interceptor you lose the hashtag. Example: <a href="http://j.mp/OxbI23" rel="nofollow">http://j.mp/OxbI23</a... |
21,815,567 | 0 | Button is not moving when I change its coordinates <p>Given this code : </p> <pre><code><style type="text/css"> #button{ width: 5em; height: 2em; background-color:#62B1F6; font-size:20px; position:static; left: 400px; top:485px; z-index: 1;} </style> </code></pre> <p>When I change the parameters of <code>le... |
9,175,243 | 0 | <p>Force, I must tell you that an <strong>Android Service do not require root access</strong> instead some actions(i.e. Access, Read, Write system resources) requires Root Permissions. Every Android Service provided in Android SDK can be run without ROOT ACCESS. </p> <p>You can make the actions to execute with root pe... |
14,663,745 | 0 | <p>Sadly a bit redundant due to MySQL's lack of a <code>WITH</code> statement, but this should do what you want. In case of a tie, it will return the higher answer.</p> <pre><code>SELECT s1.question_id, MAX(s1.answer) answer, MAX(s1.c) occurrences FROM (SELECT question_id, answer, COUNT(*) c FROM survey_result GROUP B... |
40,110,658 | 0 | <p>One reason why your application might be getting slower is the way you treat the onBackPressed() event. Every time you hit the back press button anywhere in the app you are creating a new MainActivity, but you never finish the previous one and since that's your MainActivity you are pretty much recreating your whole... |
6,185,321 | 0 | <p>Two possible answers:</p> <p>1) The traditional way to check for a file on an FTP server is the SIZE command - if you get a size, the file exists, otherwise you get an error and you know it doesn't exist.</p> <p>2) Found some code that demonstrates a possible way to do this:</p> <p><a href="http://stackoverflow.com... |
10,562,314 | 0 | google checkout call back function doesn't work <p>I have problem in google checkout. I have set my googleCallBack url "https://www.mysite.com/orders/googleCallBack" but it gives error </p> <pre><code>We encountered an error trying to access your server at https://www.mysite.com/orders/googleCallBack -- the error we go... |
3,370,656 | 0 | C++ Boost multi-index type identification <p>In boost multi-index, can I verify whether a particular index type is ordered/not through meta programming? There are the ordered indexes, hash indexes, sequence indexes etc. Can I find them out through meta programming?</p> <p>Suppose there is a index like:</p> <pre><code> ... |
1,425,784 | 0 | <p>One thing I always do (if possible) I run the DB Tuning Advisor.</p> <p>Don't get me wrong - I don't follow all his rules and suggestions, but it is an easy way to see what's going on, how often what occures and so on. Some hours of (typical!!!) workload are good to get some basic "feeling" what's going on.</p> <p>... |
1,815,095 | 0 | <blockquote> <p>do all JVMs optimize the usage of Strings in a way such that when the same string is used several times, it will always be the same physical instance?</p> </blockquote> <p>I doubt that very much. In the same class file, when definined like:</p> <pre><code>String s1 = "Yes"; String s2 = "Yes"; </code></... |
25,747,172 | 0 | JSON Request displaying console issue <p>I am trying to get the console.log to work with the 'interests' information using the following JSON request but I get the following error message in the console.</p> <blockquote> <p>XMLHttpRequest cannot load <a href="https://app.citizenspace.com/api/2.3/json_consultation_detai... |
10,854,304 | 0 | <pre><code>select * from log_metrics a inner join (select session_id from log_metrics group by session_id having count(*) > 10) b on a.session_id = b.session_id </code></pre> <p>Here's a SQL fiddle: <a href="http://sqlfiddle.com/#!2/7bed6/3" rel="nofollow">http://sqlfiddle.com/#!2/7bed6/3</a></p> |
33,642,859 | 0 | <p>-eq is similar to == operator which will compare the address for Objects not values. You must use Array or other collection utilities to compare two Objects.</p> |
10,081,699 | 0 | <p>It great that you have started learning Ruby! But Ruby in it self is simply a programming language. I think you wan't to check out Rails!</p> <p><a href="http://guides.rubyonrails.org/getting_started.html" rel="nofollow">http://guides.rubyonrails.org/getting_started.html</a></p> <p>Rails is written in Ruby and a lo... |
17,656,342 | 0 | <p>Would something like this work?</p> <pre><code>SELECT max(a.field_date_and_time_value2) as last_time , b.uid FROM field_data_field_date_and_time a INNER JOIN node b ON /* this piece might be wrong. what is the relationship between the first table and the second one? */ b.nid = '".$node->nid."' where a.field_date... |
20,382,511 | 0 | <p>This one works fine:</p> <pre><code>; 0_9.asm ; assemble with "nasm -f bin -o 0_9.com 0_9.asm" org 0x100 ; .com files always start 256 bytes into the segment mov cx, 9 ; counter mov dl, "0" ; 0 top: push dx push cx mov ah, 2 int 21h mov dl, "_" ; display underscore mov ah, 2 int 21h pop cx pop dx inc dl loop top mo... |
35,565,770 | 0 | Difference between service and container in docker compose <p>I was going through <code>volumes_from</code> option in docker compose. Apparently you can import a volumes from either a container or a service. From the docker compose documentation it is:</p> <blockquote> <p><strong>volumes_from</strong></p> <p>Mount all ... |
1,552,913 | 0 | <p>You say it works if you use the full path to <code>tclsh84.exe</code>. So, a solution might be to find out that full path and use it in your call to <a href="http://php.net/proc_open" rel="nofollow noreferrer">proc_open</a>.</p> <p><br> If you know your <code>tclsh84.exe</code> is in the directory in which your PHP... |
21,768,982 | 0 | <p>You can use get_permalink the way you use get_post: <a href="http://codex.wordpress.org/Function_Reference/get_permalink" rel="nofollow">http://codex.wordpress.org/Function_Reference/get_permalink</a></p> <pre><code>$post_id = 105; $queried_post = get_post($post_id); $title = $queried_post->post_title; $permalin... |
6,204,109 | 0 | Regex get content between two pipes AND return a space where two pipes are next to each other with no spaces <p>How can I get all content between pipes and return a space where it comes across two pipes next to each other? </p> <p>An example string and desired output is:</p> <pre><code>|test1| test2|test3 || test 4 | R... |
33,445,762 | 0 | Increment %z hex numbers with VIM? <p>Is there a way to increment <code>%z</code> hex numbers with VIM? Typically I can do this by just doing <code>ctrl + a</code> for normal numbers. But unfortunately I am using a old school system that uses <code>%z</code> rather than <code>0x</code> to denote hexadecimal numbers. I'... |
3,310,015 | 0 | <p>How about changing that <code>Action</code> delegate to <code>Action<T></code>.</p> <pre><code>public static class Tools { public static void RunAsync<T>(Action<T> function, Action callback, T parameter) { BackgroundWorker worker = new BackgroundWorker(); worker.RunWorkerCompleted += delegate(obje... |
40,404,458 | 0 | <p>Unless <code>startActivityForResult(audioIntent,1)</code> has options to disable the popup, no. It's an activity that someone else has written. The way you want it, you will need to write your own activity with (probably) google's speech recognition plugged into that. Good luck & have fun!</p> |
18,403,604 | 0 | Boot AngularJS + Cloud Endpoints <p>Is there a way to initialize angular and endpoints without manual boot of angular?</p> <p>I thought I'd found an elegant solution <a href="https://cloud.google.com/resources/articles/angularjs-cloud-endpoints-recipe-for-building-modern-web-applications" rel="nofollow">here</a>.</p> <... |
32,769,097 | 0 | <p>When you do <code>String y = in.nextLine()</code>, the next token is the leftover newline from the previous <code>nextInt()</code> call, so <code>y</code> ends up being equal to <code>\n</code>.</p> <p>Place a call to <code>nextLine()</code> after you use <code>nextInt()</code>:</p> <pre><code>int x = in.nextInt();... |
7,474,364 | 0 | Ambiguity with inheriting an optional-parameter base method <p>I have a base class with one optional default parameter, which a child class automatically provides a value for:</p> <pre><code>public class Merchant { public string WriteResults(List<string> moreFields = null) { List<string> ListOfObjects = new... |
6,660,701 | 0 | <p>There are too many ways that you can do it. Please check <a href="http://stackoverflow.com/questions/564650/convert-html-to-pdf-in-net">this</a> topic. If you want to use free library or tool you can use <a href="http://itextsharp.com/" rel="nofollow">iTextSharp</a>, but free version doesn't cover all requirement. ... |
19,290,759 | 0 | MVVM Light - Changing the startup URI <p>Having created a new WPF 4.5 MVVM Light Application, I wanted to change the startup URI so that I could do some checks before the app starts. I made the following change to App.xaml:</p> <pre><code><Application x:Class="MvvmLight1.App" xmlns="http://schemas.microsoft.com/winf... |
26,882,164 | 0 | <p>For MySQL and SQLite,ejabberd provides a way to store messages in a very simple way.</p> |
2,631,205 | 0 | <p>Well, certainly leave off the '/src/' portion of the package listing for that invocation. Either way, the easiest and most flexible way to run your tests this is to make sure all your tests are in a subpackage of where AllTests is (e.g. com.app.myapp.test.tests) and use this for the suite:</p> <pre><code>public sta... |
13,455,460 | 0 | <p>I guess eval will work:</p> <pre><code>var str = eval("[['Row1 of first array', 'Row2 of first array'],['Row1 of 2nd array', 'Row2 of 2nd array']]"); console.log(str); </code></pre> <p></p> |
388,175 | 0 | <p>I like to cache in the model or data layer as well. This isolates everything to do with retrieving data from the controller/presentation. You can access the ASP.NET cache from <code>System.Web.HttpContext.Current.Cache</code> or use the Caching Application Block from the Enterprise Library. Create your key for the ... |
29,927,728 | 0 | <p>Reversibly encoding the hash doesn't impact collision rate... Unless your encoding causes some loss of data (then it isn't reversible any more).</p> <p>Base64 and other <a href="http://en.wikipedia.org/wiki/Binary-to-text_encoding" rel="nofollow">binary-to-text encoding schemes</a> are all reversible. Your first ou... |
7,679,474 | 0 | <p>If I may suggest an alternative approach - which is to use an array. You shouldn't try to dynamically create variable names. For that purpose, good engineers from a long, long time ago in a year far far away invented an array.</p> <p>So, to solve your problems from now and the whole eternity - rewrite your code to ... |
11,941,693 | 0 | running a job in unix <p>I have the following small script - myjob.qsub: </p> <pre><code>#!/bin/sh -login #PBS -l walltime=00:15:00 #PBS -l nodes=1:ppn=1 #PBS -l mem=2gb #PBS -N myrun05168 /myexecutable >mylog.log </code></pre> <p>I did make it executable by:</p> <pre><code>chmod u+x myexecutable </code></pre> <p>Wh... |
24,409,698 | 1 | Django view function not being called <p>Ths is the function in question. The problem is that it does not seem to do be called. User can download any files on the server, regardless of whether <code>pk</code> matches <code>request.user.id</code> or not.</p> <pre><code>def permit(request, pk): # First I sanitize system_... |
15,707,497 | 0 | HttpOnly settings can be done in application having servlet api-2.5 and web.xml 2.5 version? <p>wanna enable httpOnly attribute to session cookie for our application. we are using servlet-api 2.5 version and web.xml as 2.5 .. now i have tried adding below code in web.xml </p> <pre><code><cookie-config> <http-o... |
35,057,284 | 0 | simple "Up a directory" button in htaccess? <p>a while ago i was using htaccess to display some files, and recently i started that project again and found i had somehow deleted the "go up a level" button back then. </p> <p>Can anyone tell me what the code line in htaccess looks like to get this button back? Should be r... |
2,986,167 | 0 | Best way to store configuration settings outside of web.config <p>I'm starting to consider creating a class library that I want to make generic so others can use it. While planning it out, I came to thinking about the various configuration settings that I would need. Since the idea is to make it open/shared, I wanted t... |
6,835,427 | 0 | <p>If you do not mind additional statements (while loop) the following will work in c99</p> <pre><code>#define NBITS_32(n,out_len) 0; while (n && !(0x80000000 >> out_len & n)) out_len++; out_len = n ? abs(out_len - 32) : n uint8_t len1 = NBITS_32(0x0F000000, len1); uint8_t len2 = NBITS_32(0x00008000,... |
16,705,516 | 0 | <p>It seems like <code>buffer</code> is probably set to <code>NULL</code> or some other invalid pointer and probably segfaults when you dereference it. It could also be your first call to <code>free</code> if the pointer is invalid. Ideally you need to show us the code that calls this function.</p> <p>Also keep in min... |
28,157,759 | 0 | <p>In order to Updateupdate the data on the database your SqlDataAdapter need to have its InsertCommand, UpdateCommand, DeleteCommand properties set.</p> <p>So, try the below code:</p> <pre><code> ds.Tables[0].Rows.Add(newRow); SqlCommandBuilder commandBuilder = new SqlCommandBuilder(adp); adp.DeleteCommand = commandB... |
1,287,691 | 0 | <p>Futures are also used in certain design patterns, particularly for real time patterns, for example, the ActiveObject pattern, which seperates method invocation from method execution. The future is setup to wait for the completed execution. I tend to see it when you need to move from a multithreaded enviroment to co... |
25,316,922 | 0 | How do I find f3dynamics library? <p>I have a workbook in a machine that contains a macro that works with the f3dynamics library, it is not listed in the references box. I have looked up everywhere and I cannot find the F3dynamics library.</p> <p>I need to move it to another machine so the macro runs in the new machine... |
32,013,312 | 0 | <p><strong>You can't resize an array.</strong></p> <p><a href="https://msdn.microsoft.com/en-us/library/9b9dty7d.aspx" rel="nofollow">To quote MSDN:</a></p> <blockquote> <p>The number of dimensions and the length of each dimension are established when the array instance is created. These values can't be changed during... |
13,145,156 | 0 | <p><a href="http://deftjs.org/" rel="nofollow">http://deftjs.org/</a></p> <p>Essential extensions for enterprise web and mobile application development with Ext JS and Sencha Touch</p> <p>DeftJS enhances Ext JS and Sencha Touch’s APIs with additional building blocks that enable large development teams to rapidly build... |
24,130,603 | 0 | <p>I think the method should look like this </p> <pre><code>- (IBAction)ChangeSeg:(UISegmentedControl *)sender { if(sender.selectedSegmentIndex == 0){ UpperLower=0; } else if(sender.selectedSegmentIndex == 1){ UpperLower=1; } } </code></pre> <p>The sender will have the selectedSegmentIndex that was chosen.</p> |
9,170,096 | 0 | <p>This works for me. </p> <p><strong>ASPX :</strong> </p> <pre><code><iframe id="ContentIframe" runat="server"></iframe> </code></pre> <p>I can access the iframe directly via id.</p> <p><strong>Code Behind :</strong> </p> <pre><code>ContentIframe.Attributes["src"] = "stackoverflow.com"; </code></pre> |
6,720,268 | 0 | <p>I wrote a server side script that shows the output of headers from both examples and APIKEY was set identically in both cases. There were some differences in HTTP_ACCEPT / HTTP_ACCEPT_ENCODING and WWW::Mechanize adds some additional headers:</p> <pre><code>'downgrade-1.0' => '1' 'force-response-1.0' => '1' 'n... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.