pid
int64
2.28k
41.1M
label
int64
0
1
text
stringlengths
1
28.3k
35,223,269
0
Multiple Fact Tables-Kylin <ol> <li><p>I am aware that Apache Kylin only allows one Fact Table per OLAP cube. </p></li> <li><p>Is there a way to analyse a database with multiple Fact Tables using OLAP?</p></li> <li><p>Alternatively, Can we query from multiple cubes simultaneously in a single job on Apache Kylin?</p></li> </ol> <p>Regards Anish Dhiman</p>
34,204,753
0
<p>You may need to decode the HTML string. Try this:</p> <pre><code>var decodedString = $("&lt;div /&gt;").html(text.substring(index, (index+speed))).html(); $("#console").append(decodedString); </code></pre> <p>This basically creates a div, parses and creates the html inside that div. Then we get the html from the div and append where we actually want it to be.</p> <p><strong>EDIT</strong>:</p> <p>So your issue is that you are breaking up <code>&lt;span&gt; This is a test &lt;/span&gt;</code> into smaller chunks. Appending any partial html will never work. jQuery can't properly parse it. <code>&lt;spa</code> + <code>n&gt;stuff</code> + <code>&lt;/sp</code> + <code>an&gt;</code> can not be individually inserted and expect it to be rendered correctly. Sometimes jQuery will try to fill in missing parts but don't rely on that. Instead break your text up into spans:</p> <pre><code>var decoded1 = $("&lt;div /&gt;").html("&lt;span&gt; Thi&lt;/span&gt;").html(); var decoded2 = $("&lt;div /&gt;").html("&lt;span&gt;s is a tes&lt;/span&gt;").html(); var decoded3 = $("&lt;div /&gt;").html("&lt;span&gt;t &lt;/span&gt;").html(); $("#console").append(decoded1); $("#console").append(decoded2); $("#console").append(decoded3); </code></pre> <p>And then of course you will no longer need to decode anything. You can just directly append those pieces and it will work.</p> <pre><code>$("#console").append("&lt;span&gt; Thi&lt;/span&gt;"); $("#console").append("&lt;span&gt;s is a tes&lt;/span&gt;"); $("#console").append("&lt;span&gt;t &lt;/span&gt;"); </code></pre>
32,302,123
0
<p>The script was all correct, my problem was that my parent "FPSController" object didn't have a Rigidbody applied to it and should be the only object (as opposed to the "FirstPersonCharacter" object I had nested inside of it) that the scripts are applied to. That seemed to fix the problem.</p> <p>The correct code is:</p> <pre><code>/* coincollect.cs */ using UnityEngine; using System.Collections; using UnityEngine.UI; public class coincollect : MonoBehaviour { private int _score; [SerializeField] private Text _text; void OnTriggerEnter ( Collider collision ){ if(collision.gameObject.tag == "coin"){ Destroy(collision.gameObject); _score++; _text.text = "Score: " + _score; } } } </code></pre> <p>and:</p> <pre><code>/* warp.js */ var warptarget001 : GameObject; var warptarget002 : GameObject; function OnTriggerEnter (col : Collider) { if (col.gameObject.tag == "warp001") { this.transform.position = warptarget002.transform.position; } if (col.gameObject.tag == "warp002") { this.transform.position = warptarget001.transform.position; } } </code></pre>
4,561,760
0
C++ : Can't pass generic function to another one as a parameter <p>I want to pass multiple compare functions to the selection sort function as shown below but i get the fallowing error : </p> <pre><code>Error 1 error C2664: 'sort' : cannot convert parameter 3 from 'bool (__cdecl *)(int,int)' to 'bool *(__cdecl *)(T,T)' c:\users\milad\documents\visual studio 2008\projects\functionpass\functionpass\passcompare.cpp 49 FunctionPass </code></pre> <p>Code :</p> <pre><code>bool integerCompare (int a , int b) { return(a&lt;b); } bool charCompare (char a , char b) { return(a&lt;b); } bool stringCompare (string a , string b) { if(a.compare(b)&lt;0) return true; else return false; } template &lt;class T&gt; void sort(T x[], int n , bool(*whichCompare(T,T))) // n=size of the array { for (int pass=0; pass&lt;n-1; pass++) { int potentialSmallest = pass; for (int i=pass+1; i&lt;n; i++) { if ((*whichCompare)(x[i],x[potentialSmallest])) { potentialSmallest = i; } } int temp = x[pass]; x[pass] = x[potentialSmallest]; x[potentialSmallest] = temp; } } template &lt;typename T&gt; void printArray(T a[], int size) { for(int i=0;i&lt;size;i++) cout&lt;&lt;" "&lt;&lt;a[i]; } int main() { int intArray[] = {1,7,-8,-14,46,33,4}; sort &lt;int&gt;(intArray , 7 , integerCompare); printArray&lt;int&gt;(intArray,7); } </code></pre>
30,850,179
0
<p>It was a very silly mistake. The code should be </p> <pre><code>CString strServerName = L"http://localhost"; ............. pFile = pServer-&gt;OpenRequest(CHttpConnection::HTTP_VERB_GET, L"/com.test.simpleServlet/api/customers"); </code></pre>
9,026,994
0
How do you select a rectangular region of cells in a Word Table <p>Given something like</p> <pre><code>Table table; Cell cell_1 = table.Cell(2,2); Cell cell_2 = table.Cell(4,4); </code></pre> <p>I want to select (or highlight) from cell_1 to cell_2 (like how you would if you were doing it by hand).</p> <p>I originally thought that doing the following would work:</p> <pre><code>Selection.MoveRight(wdUnits.wdCell, numCells, WdMovementType.wdExtend) </code></pre> <p>But according to <a href="http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.selection.moveright%28v=office.11%29.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.selection.moveright%28v=office.11%29.aspx</a> under remarks, using wdCells as the Unit will default the WdMovementType to wdMove, and I can't think of a workaround.</p>
21,353,953
0
Tab View in SWT <p>I have form created in SWT with many controls.Now,I have make those controls to appear in a tab.Grouping of all controls is not easy as each control defined in different java files with model,view and controller.All the controls appear now in single shell.Can I make it to appear in tab with all its controls active.</p> <p>I tried in using tab folder and make the controls come under tab but all the controls become inactive.</p> <p>So,please help me out to solve this problem</p>
14,453,247
0
<p>You need edit your appdelegate class and there itself you need to assign your view controller to navigation controller as a root class. Then it will automatically convert all yours view controller to navigation view. Try it out </p>
15,996,410
0
<p>I think the problem is how you are putting the origname and newname in the ajax request. Try this:</p> <pre><code>var origname = $('#NameDiv').find('input[name="myName"]').first().val(); var newname = $('#NameDiv').find('input[name="updatedName"]').first().val(); $.ajax({ url: 'Home/ChangeName', type: "POST", data: $("#form1").serialize() + "&amp;origname =" + origname + "&amp;newname =" + newname, success: function (result) { success(result); } }); </code></pre>
34,421,004
0
<p>It's <code>x = Foo.objects.get(bar__id=2)</code> with double underscore.</p> <p>django <a href="https://docs.djangoproject.com/en/1.9/topics/db/queries/#retrieving-specific-objects-with-filters" rel="nofollow">doc</a>.</p>
35,469,616
0
Back arrow does not work when UWP launched from WinForms app <p>So we are integrating the old with the new. I am launching my UWP app from within our WinForms app. When I navigate around the UWP app, the back button does not work. When launching the UWP app normally everything works fine.</p> <p>Here is my winforms launching code:</p> <pre class="lang-cs prettyprint-override"><code>Uri uri = new Uri($"companies:"); //see declarations in package.appxmanifest in winten app. string targetPackageFamilyName = "81e1fc62-68df-45f5-ac35-c86d1277e2db_2zt4j53vqbz02"; // see added protocol declaration in package.appxmanifest in win10 app var supportStatus = await Launcher.QueryUriSupportAsync( uri, LaunchQuerySupportType.Uri, targetPackageFamilyName); if (supportStatus != LaunchQuerySupportStatus.Available) { var msg = "Can't launch because the app we need is " + supportStatus.ToString(); } else { var options = new LauncherOptions { TargetApplicationPackageFamilyName = targetPackageFamilyName }; var success = await Launcher.LaunchUriAsync(uri, options); } </code></pre> <p>And here is the receiving code </p> <pre class="lang-cs prettyprint-override"><code>public override async Task OnStartAsync(StartKind startKind, IActivatedEventArgs args) { if (args.Kind == ActivationKind.Protocol) { ProtocolActivatedEventArgs eventArgs = args as ProtocolActivatedEventArgs; switch (eventArgs.Uri.Scheme) { case "companies": NavigationService.Navigate(typeof(Views.CompaniesPage)); break; case "company": NavigationService.Navigate(typeof(Views.CompanyEditPage), eventArgs.Uri.Query); break; case "query": NavigationService.Navigate(typeof(Views.QueryPage)); break; default: break; } } else { NavigationService.Navigate(typeof(Views.CompaniesPage)); await Task.Yield(); } } </code></pre>
4,964,224
0
<p>I can't promise it will be any better, but take a look at <a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextLineMetrics.html" rel="nofollow">TextLineMetrics</a> It gives you more information than anything else, so this is probably your best bet.</p>
4,169,038
0
<p>As mentioned by bosmacs, to accomplish this you need to let MonoTouch know that you need to link against the EventKit framework "weakly". Weak bindings ensure that the framework is only loaded on demand the first time a class from the framework is required.</p> <p>To do this you should take the following steps:</p> <ul> <li>Open your Project Options and navigate to the iPhone Build pane.</li> <li>Add '-gcc_flags "-weak_framework<br> iAd"' to the Extra Arguments for each configuration you wish to weakly link on</li> </ul> <p>In addition to this you will need to guard your usage of the types from running on older versions of iOS where they may not exist. There are several methods to accomplish this, but one of which is parsing UIDevice.CurrentDevice.SystemVersion.</p>
25,421,776
0
Java protected modifier accessible in another package having the same package name <p>I have programmed in Java for some time and I just realized that the <code>protected</code> access modifier allows members to be accessed also in the <em>same package</em>. So here is the situation and the question:</p> <p>I have a class having a <code>protected</code> method, and a test class using Mockito to stub that method. The two classes are located in different folders (a <em>src</em> and a <em>test</em>), but their package names are the same! The funny thing is, I can call the protected method in the test class! I would like to know how it is possible? Because their package names are the same? In this case the <code>protected</code> modifier does allow a very wide access!</p>
15,722,391
0
<p>Usually, I use this technique:</p> <p>1) each template generates specific class in the body or some enveloping DIV</p> <pre><code> &lt;body class="myTemplate"&gt;... &lt;body class="otherTemplate"&gt;... </code></pre> <p>2) I specify general style, like</p> <pre><code>h1 { color: red; } </code></pre> <p>3) then I specify special styles for specific templates, using context selectors:</p> <pre><code>.myTemplate h1 { color: green; } .otherTemplate h1 { color: blue; } </code></pre> <p>This way I avoid dynamic stylesheets, because that is usually a bad idea to introduce these to the project. It is a source of many errors and duynamic code tends to grow beyond controll.</p>
12,178,205
0
Grouping objecs in PostgreSQL database <p>I inherited a project with a large Postgres database (over 150 tables, over 200 custom types, almost 1000 functions, triggers, etc.) Unfortunately, everything is dumped into one schema (<code>public</code>). It works just fine from the point of view of the application, however it's a major nightmare to maintain.</p> <p>The obvious thing would be to split these objects into separate schemas by function (e.g. all supplier-related stuff goes into <code>supplier</code> schema, all admin related stuff into <code>admin</code> schema, etc.). Once this is done, of course, some changes (ok, a lot of changes) to the code would be required to refer to the new schemas. Considering that the web application contains about 2000 php files, it may be quite a task. Again, as every php in the system already starts with <code>require_once('controller/config.php');</code> I could add a call there to set search path to include all the new schemas: <code>SET search_path = 'public, supplier, admin, ...'</code>, yet somehow subconsciously I don't like this solution.</p> <p>Is there any other way to deal with issue? I don't want to spend more effort than absolutely necessary on reorganising the database. I also can barely incur any downtime on the main web site, as it's used by clients across the world (Australia, Europe, North America).</p> <p>What would your recommend I do? </p>
1,979,965
0
<p>If you set <code>cookieless="true"</code> (or <code>UseDeviceProfile</code> and browser has cookies disabled) in your <code>web.config</code> file, <a href="http://msdn.microsoft.com/en-us/library/aa480476.aspx" rel="nofollow noreferrer">authentication</a> information is appended to the URL and this url will be valid across other browsers. If you use cookies to identify users, then only the current browser will have the user authenticated.</p>
3,500,246
0
<p>To capture images you can use the <a href="http://developer.apple.com/iphone/library/documentation/uikit/reference/UIImagePickerController_Class/UIImagePickerController/UIImagePickerController.html" rel="nofollow noreferrer">UIImagePickerController</a> To up- and download images to/from a web server you can use <a href="http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/URLLoadingSystem/URLLoadingSystem.html#//apple_ref/doc/uid/10000165i" rel="nofollow noreferrer">NSURLConnection</a> and it's companion.</p> <p>And it's always a good start to look into some apple sample codes. They're on the related classes documentation at the top under "Related sample code".</p>
18,625,274
0
<p>I was in the same boat you were. What I found most helpful was to slightly change the bundle identifier. </p> <p>Example: Your bundle identifier is com.company.app. If you need to test enabling push notifications change the identifier to com.company.app1. It will install as a new app and have new push notification permission settings.</p> <p>Just make sure to change it back when you're done testing.</p>
117,534
0
<p>LINQ requires .NET v3.5</p> <p>An excellent tool for getting to know and practice LINQ is <a href="http://www.linqpad.net/" rel="nofollow noreferrer">Joseph Albahari's LINQPad</a></p>
6,857,457
0
<p>I think this is a job for a modular approach: <a href="https://bitbucket.org/wiredesignz/codeigniter-modular-extensions-hmvc/wiki/Home" rel="nofollow">https://bitbucket.org/wiredesignz/codeigniter-modular-extensions-hmvc/wiki/Home</a></p> <blockquote> <p><strong>Q. What is Modular HMVC, why should I use it?</strong></p> <p><strong>A.</strong> Modular HMVC = Multiple MVC triads</p> <p>This is most useful when you need to load a view and its data within a view. Think about adding a shopping cart to a page. The shopping cart needs its own controller which may call a model to get cart data. Then the controller needs to load the data into a view. So instead of the main controller handling the page and the shopping cart, the shopping cart MVC can be loaded directly in the page. The main controller doesn’t need to know about it, and is totally isolated from it.</p> <p>In CI we can’t call more than 1 controller per request. Therefore, to achieve HMVC, we have to simulate controllers. It can be done with libraries, or with this “Modular Extensions HMVC” contribution.</p> <p>The differences between using a library and a “Modular HMVC” HMVC class is: 1) No need to get and use the CI instance within an HMVC class 2) HMVC classes are stored in a modules directory as opposed to the libraries directory.</p> </blockquote> <p><a href="http://www.cibonfire.com" rel="nofollow">Bonfire</a> also uses HMVC.</p>
23,491,713
0
How to send video file via MMS using MFMessageComposeViewController in iOS <p>I use <code>MFMessageComposeViewControoler</code> to send the video via MMS. Video duration is 1 second and size is 30KB. But it shows that video size is too long. Give any Ideas if we have rights to send video file through <code>MFMessageComposeViewController</code>. I searched a lot in google, but i can't get correct link for this issue.</p> <p><img src="https://i.stack.imgur.com/xbpA5.png" alt="enter image description here"></p> <p><img src="https://i.stack.imgur.com/x6bJx.png" alt="enter image description here"></p>
18,792,486
0
<p>Empty list evaluates to <code>False</code> and non-empty list evaluates to <code>True</code>.</p> <p><code>if list1 and list2:</code></p> <p>is equivalent to:</p> <p><code>if list1 is not empty and list2 is not empty</code>:</p> <hr> <h2><a href="http://docs.python.org/2/library/stdtypes.html#truth-value-testing" rel="nofollow">List of falsy values in python</a>:</h2> <ul> <li><p>None</p></li> <li><p>False</p></li> <li><p>zero of any numeric type, for example, <code>0</code>, <code>0L</code>, <code>0.0</code>, <code>0j</code>.</p></li> <li><p>any empty sequence, for example, <code>''</code>, <code>()</code>, <code>[]</code>.</p></li> <li><p>any empty mapping, for example, <code>{}</code>.</p></li> <li><p>instances of user-defined classes, if the class defines a <code>__nonzero__()</code> or <code>__len__()</code> method, when that method returns the integer zero or bool value False. </p></li> </ul> <p>All other values are considered true — so objects of many types are always true.</p>
12,664,452
0
Strange css position issue <p>I'm using <a href="http://harvesthq.github.com/chosen/" rel="nofollow noreferrer">Choosen</a> and <a href="http://twitter.github.com/bootstrap/" rel="nofollow noreferrer">Twitter Bootstrap</a> in my project. What I want to get is, to get choosen's dropdown over collapsible divs but it goes under other content. Here is jsfiddle</p> <p><a href="http://jsfiddle.net/tt13/CFbpt/5/" rel="nofollow noreferrer">http://jsfiddle.net/tt13/CFbpt/5/</a> </p> <p>What am I missing? how to fix this problem?</p> <p><img src="https://i.stack.imgur.com/FN1wW.png" alt="enter image description here"></p>
14,880,691
0
<pre><code>RewriteEngine On RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d [OR] RewriteCond %{REQUEST_URI} !^blog.*$ RewriteRule ^.*$ - [NC,L] RewriteRule ^.*$ index.php [NC,L] </code></pre>
4,890,953
0
<p>No, there isn't. That kind of control is on Android's end, not the web page it's displaying.</p>
21,583,212
0
<p>FIrst thing first don't use <code>http://htaccess.madewithlove.be/</code> test as that is very reliable. Better to test on your localhost.</p> <p>Now your rules also need correction. Try this code:</p> <pre><code>RewriteEngine On RewriteBase / # match the subdomain RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{HTTP_HOST} ^fr\.example\.com$ [NC] # Make sure I don't already have a "lang" in the query string RewriteCond %{QUERY_STRING} !(^|&amp;)lang= [NC] RewriteRule ^(.*)$ $1?lang=fr [L,QSA] # match the subdomain RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC] # Make sure I don't already have a "lang" in the query string RewriteCond %{QUERY_STRING} !(^|&amp;)lang= [NC] RewriteRule ^(.*)$ $1?lang=en [L,QSA] </code></pre>
13,735,521
0
How can I find the index of an array element? <p>I have this class and it displays the value of arrays after preferred input:</p> <pre><code>class MyArrayList { private int [] myArray; private int size; public MyArrayList (int value, int seed, int inc){ myArray = new int [value]; size = value; for (int i = 0; i &lt; size; i++) { myArray [i] = seed; seed += inc; } } } public class JavaApp1 { public static void main(String[] args) { MyArrayList a = new MyArrayList(5, 2, 1); a.printList(); } } </code></pre> <p>this program displays an output of: 2 3 4 5 6 now I want to find the index of 4 so that would be 2 but how can I put it into program?</p>
5,845,023
0
One action reused in multiple applications <p>I have a symfony application with two different applications (frontend, backend) but there is one action in common. Now I have duplicated its code in both apps but I don't like that at all.</p> <p>Is there a way to reuse an action in multiple symfony applications?</p>
36,046,979
0
<p>Do it whit PL/SQL, something like this:</p> <ol> <li>Create the table with data if you don't have it:</li> </ol> <p><a href="https://i.stack.imgur.com/PNo3t.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PNo3t.png" alt="enter image description here"></a></p> <ol start="2"> <li>Create a temporary function that help with returning the latest flag:</li> </ol> <p><a href="https://i.stack.imgur.com/XI5HK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XI5HK.png" alt="enter image description here"></a></p> <ol start="3"> <li>Make a group query that call the temporary function to get the data:</li> </ol> <p><a href="https://i.stack.imgur.com/mt3Cf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mt3Cf.png" alt="enter image description here"></a></p>
3,447,843
0
<p>With a list it is linear to length of the list, so Θ(n), while direct access, like an array is Θ(1).</p>
8,529,431
0
EXEC_BAD_ACCESS when releasing a copied object <p>This has been killing me.. Because its a memory management issue...</p> <p>I have a NSArray created like so in say Class 2</p> <pre><code>@property (nonatomic, copy) NSArray * sourceArray; </code></pre> <p>I set this array from another class say Class 1 like ...</p> <pre><code>Class2 = [[Class2 alloc] initWithFrame:self.bounds]; [Class2 setSourceArray:self.namesArray]; </code></pre> <p>Where I am sure that self.namesArray contains objects.</p> <p>When I release Class 1, it releases Class 2 since Class 2 is a subview in Class 1 which is expected, but I get an EXEC_BAD_ACCESS when Class 2 releases sourceArray in dealloc like so...</p> <pre><code>[sourceArray release]; </code></pre> <p>I DO NOT get this error if I do not release namesArray in Class 1.. Which doesn't make sense because I am using I declared sourceArray as COPY which to my knowledge gives Class 2 its own version of the array...</p> <p>Can anyone help me here? Its killing me!</p> <p>More info: The reference count right before I try to release sourcearray is 1... So Why would a release not work?!</p>
23,373,813
0
convert multiple unix timestamps to dd/mm/yyyy from a data dump <p>I have a dump of members list in which there are 7000 users with joining date and subscription date in unix timestamp format . The thing is i need to import these members to a new membership software and it has dates in dd/mm/yyyy format . Now if have done such conversion for a single value coming from mysql database using </p> <pre><code>$datetime = strtotime($row-&gt;createdate); $mysqldate = date("m/d/y g:i A", $datetime); </code></pre> <p>But how to convert almost 14000 such timestamps which are in between of strings of words ? is there anything that i can do or some way ?</p> <p>Part of Dump </p> <pre><code>memberid,"identid","loginid","networkid","refurl_lookup_id","status","trial","joined","expired","last_login","stamp","siteid","username","password","cryptpass","ip","email","session","mailok","flat_price","first_login","third_party_partner_id","cascadeid","cascade_item_id","token","original_username","renamed","marked","token_hash","firstname","lastname","address1","address2","zip","city","country","state","shipping_firstname","shipping_lastname","shipping_address1","shipping_address2","shipping_zip","shipping_city","shipping_country","shipping_state","phone","xsell_success","xsell_message","custom1","custom2","custom3","custom4","custom5","last_modified","member_subscription_id","memberidx","billerid","statid","cost","cost_charge","spent","refunded","charges","next_rebill","optionid","rebills","active","upgradeid","expires","nats_expires","biller_expires","original_optionid","created_date","loginid_assigned","identid_assigned","gateway_token","campaignid","programid","tourid","adtoolid","subid1","subid2","countryid","promotionalid","loginid_nice" 7719,"26","0","0","27426","1","0","1398029330","0","1398797388","1398029330","1","torsten55","netsrot55","9dlO.AEZY3LpY","44776524","[email protected]","79ab391dc0873b7e18c63637d10d4a41","1","0","1398029433","0","1","1","0","sdsd","0","0","fb1d7da87c445cdfb59f241bd7e29dfe","dsd","Dietz","Karl-Liebknecht-Ring 22","","01612","Nuenchritz","DE","XX","","","","","","","","","","0","","","","","","","0","9866","CCBILL:02141107010sdsd","1","553543b62e8977","0","571","3938","0","1","1400707730","2","0","1","","1400707730","1400707730","0","2","1398029154","0","0","","0","0","1","0","0","0","0","0","Type-In" 7816,"45","0","0","30667","1","0","1398609314","0","1398797233","1398609314","1","Phantom183","MXU146","ac7Jo.tfvdJ5o","1573202729","[email protected]","c29c6032ed3867b70ec7ec25749a1fde","1","0","1398609530","0","1","1","0","rolex","0","0","9446bf3e08c2e628cf449756ba92a9cb","sddso","Nasdal","BAhnhofstra&amp;#195;&amp;#159;e","","03046","Cottbus","DE","XX","","","","","","","","","","0","","","","","","","0","10043","CCBILL:021411770100000sd","1","5535d1545cd3f9","0","380","2627","0","1","1401287714","1","0","1","","1401287714","1401287714","0","4","1398609221","0","0","","0","0","4","0","0","0","0","0","Type-In" </code></pre>
1,794,379
0
<p>I usually use a rel="" for some extra data i might need attached to the button or whatnot.</p> <p>for example</p> <pre><code>&lt;input class="btnDelete" rel="34" value="Delete" /&gt; </code></pre> <p>then in jquery</p> <pre><code>$('.btnDelete').click(function() { DeleteMethod($(this).attr("rel")); }); </code></pre>
36,523,864
0
Has anyone heard about a replacement for the Concept Expansion service? <p>I have been learning about the IBM Watson services and Bluemix over the last few months. I had previously looked at the Concept Expansion service but when I returned to the <a href="http://www.ibm.com/smarterplanet/us/en/ibmwatson/developercloud/concept-expansion.html" rel="nofollow noreferrer">page</a> where this service is described, I found the message from IBM that this service was being withdrawn: <a href="https://i.stack.imgur.com/7XOFe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7XOFe.png" alt="Announcement that the Concept Expansion Service is being withdrawn"></a> Has anyone seen or heard of an alternative or replacement being suggested or offered by IBM?</p>
10,335,729
0
<p>You don't need the curly braces around the ID. The curly braces indicate that you're going to put a variable there. Try:</p> <pre><code>http://api.linkedin.com/v1/groups/{2139884}/posts:(creation-timestamp,title,summary,creator:(first-name,last-name,picture-url,headline),likes,attachment:(image-url,content-domain,content-url,title,summary),relation-to-viewer)?category=discussion&amp;order=recency&amp;modified-since=1302727083000&amp;count=5 </code></pre>
20,414,997
0
<p>This is because AngularJS escape HTML tags in string (replace them with HTML entities) by default to save you from XSS and some other security problems as well. To display trusted content un-escaped you could use <code>ngBindHTMLUnsafe</code> (in older AngularJS version), or the the <code>ngBindHTML</code> ans SCE in 1.2 and newer. For example:</p> <pre><code>&lt;div&gt;{{sometext|newline2br}}&lt;/div&gt; </code></pre> <p>Would be rewritten as (below 1.2):</p> <pre><code>&lt;div ng-bind-html-unsafe="sometext|newline2br"&gt;&lt;/div&gt; </code></pre> <p>With 1.2 and above:</p> <pre><code>&lt;div ng-bind-html="sometext|newline2br|trusted"&gt;&lt;/div&gt; </code></pre> <p>with the trusted filter:</p> <pre><code>app .filter('trusted', function($sce) { // You can use this one as `value|newline2br|trusted`, // but I don't recommend it return function(input) { return $sce.trustAsHtml(input) } }) </code></pre> <p>Or better with:</p> <pre><code>&lt;div ng-bind-html="sometext|newline2br"&gt;&lt;/div&gt; </code></pre> <p>and:</p> <pre><code>app .filter('newline2br', function($sce) { // This is my preferred way return function(input) { return $sce.trustAsHtml(input.replace(/\n/g, "&lt;br&gt;")) } }) </code></pre> <p>Plunker: <a href="http://plnkr.co/LIxFVpi6ChtTLEni11qy" rel="nofollow">http://plnkr.co/LIxFVpi6ChtTLEni11qy</a></p>
5,475,245
0
<p>With the default options, it will not delete tables <code>A</code>, <code>B</code> and <code>C</code>. It will however overwrite (delete current data that is not in the backup) tables <code>D</code>, <code>E</code> and <code>F</code>.</p> <p>To see the list of available options <a href="http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html">see here</a>.</p>
5,177,376
0
<p>To Solve this Problem in MS Visual studio 2008. </p> <ol> <li>Goto Menu Project->Properties (Alt+F7) </li> <li>Configuration Properties</li> <li>Linker -> General -> additional Library Directories -> C:\Program Files\Microsoft Visual Studio 9.0\VC\lib</li> </ol> <p>....do the above steps and enjoy</p>
33,641,001
0
Animation array ending on first image <p>So for a load animation I have an image view looping through a bunch of images. The thing is that when it's done looping through it returns to the first image of the array even though I want it to finish on the last one. I try to set it to the last image in the completion block (I currently commented out the line) but it doesn't work. Any suggestions? Thank you!</p> <pre><code>import UIKit class ViewController: UIViewController { var logoImageView = UIImageView() var labelImageView = UIImageView() override func viewDidLoad() { super.viewDidLoad() self.navigationController?.navigationBarHidden = true self.view.backgroundColor = UIColor(red: (253/255), green: (78/255), blue: (23/255), alpha: 1) //sets up logo logoImageView = UIImageView(frame: CGRectMake(self.view.frame.size.width / 2 - 65, self.view.frame.size.height / 2 - 165, 0, 0)) logoImageView.image = UIImage(named: "00") logoImageView.backgroundColor = UIColor.clearColor() self.view.addSubview(logoImageView) //sets up ilmatic text label labelImageView = UIImageView(frame: CGRectMake(self.view.frame.size.width / 2 - 70, self.view.frame.size.height / 2 - 7, 140, 14)) labelImageView.image = UIImage(named: "00_word_mark") labelImageView.backgroundColor = UIColor.clearColor() labelImageView.alpha = 0 self.view.addSubview(labelImageView) //get bigger animation self.getBigger() } func getBigger(){ UIView.animateWithDuration(2, animations: { () -&gt; Void in self.logoImageView.frame = CGRectMake(self.view.frame.size.width / 2 - 65, self.view.frame.size.height / 2 - 165, 130, 130) }) { (completion) -&gt; Void in self.performSelector("animate", withObject: self, afterDelay: 0.5) } } func animate() { UIView.animateWithDuration(2, animations: { () -&gt; Void in let animationImages:[UIImage] = [UIImage(named: "00")!, UIImage(named: "02")!, UIImage(named: "03")!, UIImage(named: "04")!, UIImage(named: "05")!, UIImage(named: "06")!, UIImage(named: "07")!, UIImage(named: "08")!, UIImage(named: "09")!, UIImage(named: "10")!, UIImage(named: "11")!, UIImage(named: "12")!, UIImage(named: "13")!, UIImage(named: "14")!, UIImage(named: "15")!, UIImage(named: "16")!, UIImage(named: "17")!, UIImage(named: "18")!, UIImage(named: "19")!, UIImage(named: "20")!, UIImage(named: "21")!, UIImage(named: "22")!, UIImage(named: "23")!, UIImage(named: "24")!, UIImage(named: "25")!, UIImage(named: "26")!] self.logoImageView.animationImages = animationImages self.logoImageView.animationRepeatCount = 1 self.logoImageView.animationDuration = 2 self.logoImageView.startAnimating() }) { (completion) -&gt; Void in UIView.animateWithDuration(4, animations: { () -&gt; Void in // self.logoImageView.image = UIImage(named: "26") ^^^THE ABOVE LINE DOESN T SET THE IMAGE BACK FOR SOME REASON self.labelImageView.alpha = 0 self.labelImageView.alpha = 1 }, completion: { (completion) -&gt; Void in self.performSelector("pushToCreateVC", withObject: self, afterDelay: 2) }) } } func pushToCreateVC() { let createVC = CreateAccountViewController() self.navigationController?.pushViewController(createVC, animated: true) } } </code></pre>
8,505,255
0
<p>Look at the root cause:</p> <pre><code>java.lang.RuntimeException: IteratedExpression.getItem: Index out of Bounds at javax.servlet.jsp.jstl.core.IteratedExpression.getItem(IteratedExpression.java:75) at javax.servlet.jsp.jstl.core.IteratedValueExpression.getValue(IteratedValueExpression.java:60) at org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:64) at org.apache.el.parser.AstValue.getValue(AstValue.java:112) at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186) at org.apache.jasper.el.JspValueExpression.getValue(JspValueExpression.java:101) at javax.faces.component.UIData.getValue(UIData.java:1081) at org.ajax4jsf.component.UIDataAdaptor.getValue(UIDataAdaptor.java:1624) at org.ajax4jsf.component.SequenceDataAdaptor.getDataModel(SequenceDataAdaptor.java:65) at org.ajax4jsf.component.SequenceDataAdaptor.createDataModel(SequenceDataAdaptor.java:59) at org.richfaces.component.UIDataTable.createDataModel(UIDataTable.java:120) ... </code></pre> <p>This is absolutely not related to filters. The request just happens to being passed through a filter. If the filter would have caused any problem, you would have seen it in the 1st line of the stacktrace.</p> <p>Your concrete problem is most likely caused by not preserving the proper data model for the data table in the subsequent request. The managed bean is apparently in the request scope instead of the view scope. To fix this, you need to put the bean in the view scope and if necessary review your data model preserving/preloading logic. This should take place in (post)constructor and/or (action)listener methods, but for sure not in the getter method. The getter method should <strong>only</strong> return the data model, nothing more.</p> <p>If you are still on JSF 1.x which doesn't have the new JSF 2.x view scope, you need to add an <code>&lt;a4j:keepAlive&gt;</code> to the page which references the request scoped managed bean.</p>
26,067,489
0
send html form with php can't solve <p>I have big problem with sending easy html form with php. My problem is when all fields are empty it still send message. I don't why this code still send empty form??</p> <pre><code> &lt;form id="form1" name="form1" method="post" action="forma.php"&gt; &lt;p&gt; &lt;label for="ime"&gt;Ime:&lt;/label&gt; &lt;input type="text" name="ime" id="ime" /&gt; &lt;/p&gt; &lt;p&gt; &lt;label for="prezime"&gt;Prezime:&lt;/label&gt; &lt;input type="text" name="prezime" id="prezime" /&gt; &lt;/p&gt; &lt;p&gt; &lt;label for="email"&gt;e-mail:&lt;/label&gt; &lt;input type="text" name="email" id="email" /&gt; &lt;/p&gt; &lt;p&gt; &lt;label for="poruka"&gt;Poruka:&lt;/label&gt; &lt;textarea name="poruka" cols="40" rows="10" id="poruka"&gt;&lt;/textarea&gt; &lt;/p&gt; &lt;p&gt; &lt;input type="submit" name="submit" value="submit" /&gt; &lt;/p&gt; &lt;/form&gt; </code></pre> <p>My php code:</p> <pre><code>&lt;?php if (isset($_POST['submit'])) { $ime= $_POST['ime']; $prezime= $_POST['prezime']; $email= $_POST['email']; $poruka= $_POST['poruka']; $email_from = '[email protected]'; $email_subject = "forma sa sajta"; $email_body = "Ime: $ime. \n". "Prezime: $prezime \n". "email: $email \n". "poruka: $poruka" ; $to = "[email protected]"; mail ($to, $email_subject, $email_body); echo "Message is sent"; } else { echo "Message is not sent"; } ?&gt; </code></pre> <p>So again, when i fill fields message is sent. It is ok, i received email. But when i just click submit (without filling fields) it still send message to my email.</p> <p>What is wrong with this code? I try everything i know, but without success. </p> <p>Thank you.</p>
8,170,150
0
Http redirect in Tomcat or web service proxy <p>I got a web service running on <em>127.0.0.1:8080/test/mywebservice</em></p> <p>This web service (port:8080) is created dynamically by another web service (port:80) that is hosted in Tomcat. All web services that are created by Tomcat directly can use port 80, however, not those that are created dynamically.<br></p> <p>I have to do this since I need to share objects between these two web services.<br></p> <p>The problem is that the client can only make requests to port 80, and I can't host my web service on port 80.<br></p> <p>Does anyone know how to redirect requests to<br> &nbsp;&nbsp;&nbsp;&nbsp;<em>127.0.0.1:<strong>80</strong>/test/mywebservice</em><br> &nbsp;&nbsp;to<br> &nbsp;&nbsp;&nbsp;&nbsp;<em>127.0.0.1:<strong>8080</strong>/test/mywebservice</em></p>
21,694,091
0
<p>If somehow you can store the socektID of the sender in a variable, then you can emit to that particular client in app.post method. Do something like this:</p> <pre><code>var id; io.sockets.on('connection', function(socket){ socket.on('some event'){ id = socket.id; } }); </code></pre> <p>and do this in app.post method:</p> <pre><code>app.post('/room', function(req, res) { io.sockets.socket(socketid).emit('event name', {data: yourData}); }); </code></pre> <p>Though I've proposed this solution but your approach doesn't seem too convincing.</p>
15,473,349
0
<p>Save all first page post values in to session as like $_SESSION['page']=$_POST when clicking secon page,and store second page post values also when clicking third page ,save all the third page post values in session,Finally you get all values from session.</p>
18,521,628
0
Can the server get a long-lived access token with the code in `signedRequest`? <p>Is the <code>code</code> property of <code>authResponse.signedRequest</code> (in the Facebook JavaScript API) useful? I'm generating one like this:</p> <pre class="lang-js prettyprint-override"><code>FB.login({ scope: "email" }, function(r) { console.log([ function(d){ return d.split('.')[1]; }, function(d){ return atob(d.replace('-', '+').replace('_', '/')); }, JSON.parse, function(d){ return d.code; } ].reduce( function(acc, f) { return f(acc); }, r.authResponse.signedRequest )); }); </code></pre> <p><a href="https://developers.facebook.com/docs/reference/login/signed-request/" rel="nofollow">The docs</a> say this:</p> <blockquote> <p><code>code</code>: an OAuth Code which can be exchanged for a valid user access token via a <a href="https://developers.facebook.com/docs/authentication/" rel="nofollow">subsequent server-side request</a></p> </blockquote> <p>…but that link redirects to Facebook Login home page. I found the <code>/oauth/access_token</code> endpoint documented <a href="https://developers.facebook.com/docs/facebook-login/access-tokens/" rel="nofollow">here</a>, but it requires a <code>redirect_uri</code> parameter, and there isn't one in this case.</p>
41,031,231
0
IOS swift can I eliminate unused rows in a TableView <p>I am using swift 3.0 and have a TableView in it everything is working great except that I only have 2 rows returning for now but the TableView is showing additional blank rows. I was wondering if there was any way to eliminate those rows for example this is how my simple app looks right now (Below) as you can see I have 2 rows and I want to eliminate the other rows because they do not need to be there . I am new to TableViews and thought that this piece of code controlled how many rows appear</p> <pre><code> func tableView(_ tableView:UITableView, numberOfRowsInSection section:Int) -&gt; Int { return 2 } </code></pre> <p>any suggestions would be great</p> <p><a href="https://i.stack.imgur.com/vFwXY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vFwXY.png" alt="My TableView"></a></p>
21,209,154
0
<p>Arena software is used for modeling and simulation discrete event systems. It can be used in business process modeling, electronics systems design, modeling concurrent systems and is sometimes used in University level courses on concurrency and systems modeling. </p> <p>It is available commercially from <a href="http://www.arenasimulation.com" rel="nofollow">Rockwell Automation</a>.</p>
23,214,841
0
<p>You guessed it right when you thought <code>temp[0]</code> equals <code>a</code> and <code>temp[1]</code> equals <code>b</code>. But wait why are you going beyond that like you are trying to dereference something like <code>temp[2]</code>? You did not initialize this thing right!</p> <p>Your program causes <code>undefined behaviour</code> by accessing memory past the end of the array. The compiler is not always obliged to give you an error message. Check <a href="http://stackoverflow.com/questions/9137157/c-no-out-of-bounds-error">this</a> question.</p>
25,018,410
0
batch size of prepared statement in spring data cassandra <p>I'm getting this warning in the log:</p> <p>WARN [Native-Transport-Requests:17058] 2014-07-29 13:58:33,776 BatchStatement.java (line 223) Batch of prepared statements for [keyspace.tablex] is of size 10924, exceeding specified threshold of 5120 by 5804.</p> <p>Is there a way in spring data cassandra to specify the size?</p> <p>Cassandra 2.0.9 and spring data cassandra 1.0.0-RELEASE</p>
40,205,008
0
Known 2 collided input value for sha1 that gives same hash? <p>Is there any 2 known valued of input for sha1 which gives the same hash?</p> <p>since sh1 takes the any length input and output 128/256/512 , so it is possible to find any 2 string of any known length which can produce same hash .</p>
23,751,532
0
Get Data from Google Form Spreadsheet (Android App Development) <p>I'm using Eclipse to develop an app. </p> <p>I used this code to submit data from my app to the Google Form. <a href="https://www.youtube.com/watch?v=GyuJ2GtpZd0" rel="nofollow">https://www.youtube.com/watch?v=GyuJ2GtpZd0</a></p> <p>I was wondering if you can help me with this: I need my app to read a column of data from the Google Form spreadsheet. I've tried looking everywhere for the code, but I can't seem to find it. Do you have any ideas how to implement this?</p> <p>The column I want to read is a list of e-mails submitted from my app, and I just don't want the user to submit to my Google form multiple times!!! So, I need want to know how to read the list of emails from my Google Form.</p> <p>I'm aware there is a Google Document API, but I'm not sure which part should I look at: <a href="https://developers.google.com/google-apps/documents-list/?csw=1" rel="nofollow">https://developers.google.com/google-apps/documents-list/?csw=1</a></p>
31,040,205
0
how to find a path visit as much as possible vertices? <p>Given a square grid (undirected graph), is there any way to find a path which will visit as much as possible vertices.</p> <p>each vertex can be visit only once. It means that the path will be Hamilton tour if exist, or be a longest path.</p> <p>The graph has some walls. Wall is a vertex has no edge connect to neighbors.</p> <p>I has a solution (in mind), but it's very similar to find all path and chose the first one has most vertices visited.</p> <blockquote> <ol> <li><p>Find a path will visit all neighbors from given start vertex to the end (no way can go).</p></li> <li><p>look back to the current path until the starting vertex, if there is any vertex has neighbors outside of the current path, process like step 1 from the found vertex and its new neighbors.</p></li> <li><p>analysis and choose the longest path (has most vertices).</p></li> </ol> </blockquote> <p>I found <a href="http://cs.stackexchange.com/questions/14390/find-a-simple-path-visiting-all-marked-vertices">similar problem</a>, cannot understand what does @Juho mean: </p> <blockquote> <p>Choose a successor si to top(S), and try to find a path si−1⇝si avoiding vertices in F. If a path is found, insert the vertices on the path si−1⇝si to F.</p> </blockquote> <p>I don't have enough reputation to add a comment there.</p> <p>my solution get performance trouble, I guess. Any suggestion?</p>
876,656
0
Difference between Dictionary and Hashtable <blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/301371/why-dictionary-is-preferred-over-hashtable-in-c">Why Dictionary is preferred over hashtable in C#?</a> </p> </blockquote> <p>What is the difference between Dictionary and Hashtable. How to decide which one to use?</p>
10,949,892
0
android How to deactivate an app from taskmanager <p>My app has an Alarm Manager, so I suppose that it is still active on Task Manager. Is there any way to deactivate the App from TaskManager while alarm is sleeping? </p> <p>Thanks for your answers in advance.</p> <p>Taziano</p>
18,842,936
1
Qt Pyside displaying results in widgets <p>I am going through a lot of data in a loop, and updating status into a textedit widget on my mainwindow. The thing is, the textedit widget only gets update, after all my data in the loop is processed. I want to display it in the textedit widget as its processing.</p> <pre><code>for i in data: ... textedit.settext(i) &lt;&lt;---- this part is not updated "fast" enough to textedit widget .. </code></pre> <p>what can i do about this? Do i have to look in the direction of some form of multithreading? thanks</p> <p>Update: Actually the whole scenario is i am doing some file operations, going through directories, connecting to databases, selecting stuff and then displaying to GUI. While my code runs in the background, i would also like to display results found to the QT textedit widget in "realtime". Right now, my widget shows the result after my file operations are done. And the GUI "hangs" while the file operations are being done. thanks</p>
27,510,000
0
<p>Within a <code>Tasklet</code>, the responsibility for exception handling is on the implementation of the <code>Tasklet</code>. The skip logic available in chunk oriented processing is due to the exception handling provided by the <code>ChunkOrientedTasklet</code>. If you want to skip exceptions in your own <code>Tasklet</code> implementation, you need to write the code to do so in within your own implementation.</p>
35,092,693
0
Return a reference on a string using an iterator <p>I have a vector containing strings, an iterator (<code>_it</code>) on this vector, and I would like to return a reference on one of the string using this iterator.</p> <p>For now, the return is made by copy:</p> <pre><code>std::string myClass::next_token() { std::vector&lt;std::string&gt;::const_iterator old_it = _it++; return *old_it; } </code></pre> <p>I would like to do this (note the <code>&amp;</code> on return-type)</p> <pre><code>std::string&amp; myClass::next_token() { //... } </code></pre> <p>But I get the following error :</p> <blockquote> <p>invalid initialization of reference of type <code>‘std::string&amp; {aka std::basic_string&lt;char&gt;&amp;}’</code> from expression of type <code>‘const std::basic_string&lt;char&gt;’ std::string&amp; token = *old_it</code>;</p> </blockquote>
570,446
0
<p>First, I would like to clarify something. Is this a post back (trip back to server) never occur, or is it the post back occurs, but it never gets into the ddlCountry_SelectedIndexChanged event handler?</p> <p>I am not sure which case you are having, but if it is the second case, I can offer some suggestion. If it is the first case, then the following is FYI.</p> <p>For the second case (event handler never fires even though request made), you may want to try the following suggestions:</p> <ol> <li>Query the Request.Params[ddlCountries.UniqueID] and see if it has value. If it has, manually fire the event handler.</li> <li>As long as view state is on, only bind the list data when it is not a post back.</li> <li>If view state has to be off, then put the list data bind in OnInit instead of OnLoad.</li> </ol> <p>Beware that when calling Control.DataBind(), view state and post back information would no longer be available from the control. In the case of view state is on, between post back, values of the DropDownList would be kept intact (the list does not to be rebound). If you issue another DataBind in OnLoad, it would clear out its view state data, and the SelectedIndexChanged event would never be fired.</p> <p>In the case of view state is turned off, you have no choice but to rebind the list every time. When a post back occurs, there are internal ASP.NET calls to populate the value from Request.Params to the appropriate controls, and I suspect happen at the time between OnInit and OnLoad. In this case, restoring the list values in OnInit will enable the system to fire events correctly.</p> <p>Thanks for your time reading this, and welcome everyone to correct if I am wrong.</p>
15,387,981
0
<p>You mention that somebody else encountered the problem and didn't receive a response, however the linked forum thread does contain a response and an answer to this issue. In that particular case a Javascript error had occurred on the page which prevented the dropdown from initializing correctly and I believe this is also the case for yourself. </p> <p>Although not completely working because there isn't a valid datasource, I took your example code and dumped it into a <a href="http://jsfiddle.net/nukefusion/BXxGS/" rel="nofollow">jsFiddle</a> and (after fixing some JS errors) you can see that the dropdown appears absolutely fine.</p> <p>In particular, there were errors regarding <code>grid</code> and <code>sitePath</code> not being defined that prevented the dropdown from initializing.</p> <pre><code> var grid; var sitePath = ''; $().ready(function () { grid = $('#listDiv').kendoGrid({ dataSource: { type: 'json', serverPaging: true, pageSize: 10, transport: { read: { url: '', data: { ignore: Math.random() } } }, schema: { model: { id: 'Id', fields: { Id: { type: 'number' }, Name: { type: 'string' }, Ex: { type: 'string' }, Date: { type: 'string' }, Check1: { type: 'string' }, Check2: { type: 'string' }, Check3: { type: 'string' }, Check4: { type: 'string' }, Check5: { type: 'string' }, Edit: { type: 'string' } } }, data: "Data", total: "Count" } }, scrollable: false, toolbar: kendo.template($("#template").html()), columns: [ { field: 'Name' }, { field: 'Ex' }, { field: 'Date' }, { template: '#=Template1#' + sitePath + '#=Patient1#', field: 'Patient1', title: 'Patient 1', width: 50 }, { template: '#=Template2#' + sitePath + '#=Patient2#', field: 'Patient2', title: 'Patient 2', width: 50 }, { template: '#=Template3#' + sitePath + '#=Patient3#', field: 'Patient3', title: 'Patient 3', width: 50 }, { template: '#=Template4#' + sitePath + '#=Patient4#', field: 'Patient4', title: 'Patient 4', width: 50 }, { template: '#=Template5#' + sitePath + '#=Patient5#', field: 'Patient5', title: 'Patient 5', width: 50 } ], pageable: true }); var dropDown = grid.find("#external").kendoDropDownList({ dataTextField: "ExName", dataValueField: "ExId", autoBind: false, optionLabel: "All", dataSource: { type: "json", severFiltering: true, transport: { url: '@Url.Action("_Ex", "Entry")', data: { ignore: Math.random() } } }, change: function () { var value = this.value(); if (value) { grid.data("kendoGrid").dataSource.filter({ field: "ExId", operator: "eq", value: parseString(value) }); } else { grid.data("kendoGrid").dataSource.filter({}); } } }); theGrid = $('#listDiv').data('kendoGrid'); }); </code></pre>
11,743,723
0
Separate NSData objects <p>I am using an NSURLConnection to receive a stream of tweets through Twitter. Each tweet that I receive is an NSData object. After the connection receives data and is appended, the log looks like this for the NSData object:</p> <pre><code>Data that is received: &lt;3c68746d 6c3e0a3c 68656164 3e0a3c6d 65746120 68747470 2d657175 69763d22 436f6e74 656e742d 54797065 2220636f 6e74656e 743d2274 6578742f 68746d6c 3b206368 61727365 743d7574 662d3822 2f3e0a3c 7469746c 653e4572 726f7220 34303120 556e6175 74686f72 697a6564 3c2f7469 746c653e 0a3c2f68 6561643e 0a3c626f 64793e0a 3c68323e 48545450 20455252 4f523a20 3430313c 2f68323e 0a3c703e 50726f62 6c656d20 61636365 7373696e 6720272f 312f7374 61747573 65732f66 696c7465 722e6a73 6f6e272e 20526561 736f6e3a 0a3c7072 653e2020 2020556e 61757468 6f72697a 65643c2f 7072653e 0a202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 200a2020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20200a20 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 2020200a 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 20202020 0a3c2f62 6f64793e 0a3c2f68 746d6c3e 0a&gt; </code></pre> <p>Now my question is, how do I separate those so each is their own NSData object? I cannot parse it using NSJSONSerialization until I am able to do that. I assume each of those addresses is a tweet that needs parsed.</p> <p>Thanks!</p>
7,665,529
0
Error in passing the hidden values to JavaScript in asp.net <p>Problem with passing values to Javascript, am I going wrong in passing the value pls help.</p> <pre><code>var percentage= parseInt(document.getElementById("&lt;%=hid_Percentage.ClientID%&gt;").value); var color = document.getElementById("&lt;%=hid_Color.ClientID%&gt;").value; var progress1 = new RGraph.VProgress('progress1', percentage, 100); progress1.Set('chart.colors', [color]); progress1.Set('chart.tickmarks', false); progress1.Draw(); </code></pre> <p>I have 2 hidden fields</p> <pre><code> &lt;asp:HiddenField ID="hid_Percentage" runat="server" /&gt; &lt;asp:HiddenField ID="hid_Color" runat="server" /&gt; </code></pre> <p>And this is how I pass value to the hidden field in code behind in asp.net</p> <pre><code> double value = (read * 100 / count); string vProgressColor = "'#e01600'"; hid_Percentage.Value = Convert.ToString(value); hid_Color.Value = vProgressColor; </code></pre> <p>The value for percentage is passed correclty as the graph is drawn using that value. But the color is emply. it is not getting the color.,</p>
35,555,549
0
Store Swift Type in variable <p>I have a data model for a <code>UITableViewCell</code> that looks like this:</p> <pre><code>class SettingsContentRow { var title: String var cellType: Type // How do i do this? var action:((sender: UITableViewCell.Type) -&gt; ())? var identifier: String { get { return NSStringFromClass(cellType) } } init(title: String, cellType: Type) { self.title = title self.cellType= cellType } } </code></pre> <p>The idea is to put these in an array to facilitate building a settings view using a <code>UITableViewController</code>, and when requesting a cell i can just query the model for both the identifier and the cell <code>Type</code>. But i cannot figure out what keyword to use instead of <code>Type</code>. I have tried <code>Type</code>, <code>AnyClass</code>, <code>UITableViewCell.Type</code> and they all give rise to type assignment errors when i try to instantiate the model class.</p>
37,550,861
0
<p>The dynamic and staging are both likely to be in system memory, but their is good chance that your issue, is write combined memory. It is a cache mode where single writes are coalesced together, but if you attempt to read, because it is un-cached, each load pay the price of a full memory access. You even have to be very careful, because a c++ <code>*data=something;</code> may sometime also leads to unwanted reads.</p> <p>There is nothing wrong with a dynamic texture, the GPU can read system memory, but you need to be careful, create a few of them, and cycle each frame with a map_nooverwrite, to inhibit the costly driver buffer renaming of the discard. Of course, never do a map in read and write, only write, or you will introduce gpu/cpu sync and kill the parallelism.</p> <p>Last, if you want a persistent surface and only a few putpixel a frame (or even a lot of them), i would go with an unordered access view and a compute shader that consume a buffer of pixel position with colors to update. That buffer would be a dynamic buffer with nooverwrite mapping, once again. With that solution, the main surface will reside in video memory.</p> <p>On a personal note, i would not even bother to teach cpu surface manipulation, this is almost always a bad practice and a performance killer, and not the way to go in a modern gpu architecture. This was not a fundamental graphic concept a decade ago already.</p>
29,626,518
0
Why does Control.Invoke() calls PostMessage() instead of SendMessage()? <p><code>Control.Invoke()</code> calls <code>PostMessage()</code> and then waits until the UI thread finishes processing the message. So why it does not calls <code>SendMessage()</code> instead (which by default waits until the UI thread finishes processing the message).</p>
38,441,263
0
<p>Try this</p> <pre><code> var query = context.Products .Where(a =&gt; request.SearchTerm == null || a.Name.Contains(request.SearchTerm)) .Where(a =&gt; (a.OrderType == "X" &amp;&amp; request.isTypeA) || (a.OrderType == "R" &amp;&amp; request.typeB) || (a.OrderType == "D" &amp;&amp; request.typeC)) .Where (a=&gt; a.OrderType != "U") .Where(a =&gt; a.IsInactiveFlag == false ) .OrderBy(a =&gt; a.OrderType) .Select(c =&gt; new ProductType { ProductTypeId = c.ProductTypeId, IsSelected = false, OrderType = c.OrderType, Name = c.Name, IsInactiveFlag = c.IsInactiveFlag }); </code></pre>
6,187,053
0
<p>You can:</p> <ul> <li>At Page level set the page directive like &lt;%Page smartNavigation="True" %> </li> <li>At Application level set smartNavigation="true" in web.config </li> </ul>
21,817,593
0
Fiddler Auto Responder + Regular Expression <p>I know that the title is not very descriptive but here's what I just cant figure out!! Okay so I have something like the following URL:</p> <pre><code>http://realsite.com/Stuff/start.ashx?blah=blah1&amp;RandomStuffHere&amp;blah=false </code></pre> <p>So I need to either redirect it or supply it with my site:</p> <pre><code>http://My_Site.com/Stuff/newstart.ashx?blah=blah1&amp;RandomStuffHere&amp;blah=true </code></pre> <p>Realize how I kept everything the same except for the domain which I changed to mine, and the bool value at the end. I have searched, and searched and still cant find anything that works.</p> <p>I currently am trying a REGEX solution but it wont let me change the bool at end. <code>REGEX:.*/Stuff/start.ashx(.*)</code></p> <p>So if anyone can provide something like this that lets me redirect to my site with everything the same as the New url except for changing the bool at end, I will be forever in your debt! :D</p> <p>Thank you in advance :)</p>
6,627,922
0
500 Internal Server Error when trying to access .ashx file <p>I have recently ran into a problem that would not allow me to use DELETE and PUT requests into my .ashx file, so I added the proper verbs in order to allow that access. Now I am getting a 500 Internal Server Error. Here is my web.config for the handlers:</p> <pre><code>&lt;handlers&gt; &lt;remove name="OPTIONSVerbHandler" /&gt; &lt;remove name="WebServiceHandlerFactory-Integrated" /&gt; &lt;remove name="svc-Integrated" /&gt; &lt;remove name="WebDAV" /&gt; &lt;add name="svc-Integrated" path="*.svc" verb="*" type="System.ServiceModel.Activation.HttpHandler, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="integratedMode" /&gt; &lt;add name="OwssvrHandler" scriptProcessor="C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\isapi\owssvr.dll" path="/_vti_bin/owssvr.dll" verb="*" modules="IsapiModule" preCondition="integratedMode" /&gt; &lt;add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /&gt; &lt;add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /&gt; &lt;add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /&gt; &lt;add name="JSONHandlerFactory" path="*.json" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" resourceType="Unspecified" preCondition="integratedMode" /&gt; &lt;add name="ReportViewerWebPart" verb="*" path="Reserved.ReportViewerWebPart.axd" type="Microsoft.ReportingServices.SharePoint.UI.WebParts.WebPartHttpHandler, Microsoft.ReportingServices.SharePoint.UI.WebParts, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" /&gt; &lt;add name="ReportViewerWebControl" verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /&gt; &lt;add name="ashxhandler" path="*.ashx" verb="*" type="System.Web.UI.SimpleHandlerFactory" validate="True" /&gt; &lt;/handlers&gt; </code></pre> <p>Here is the httpHandlers:</p> <pre><code>&lt;httpHandlers&gt; &lt;add path="*.ashx" verb="*" type="System.Web.UI.SimpleHandlerFactory" validate="True" /&gt; &lt;/httpHandlers&gt; </code></pre> <p>Any ideas? I already went to IIS 7, went to Request Filtering, added .ashx file extension, set it to true and then in the HTTP Verbs section I added DELETE, POST, GET, HEADER, PUT.</p> <p>EDIT:</p> <p>Here is my .ashx file:</p> <pre><code>&lt;%@ WebHandler Language="C#" Class="jQueryUploadTest.Upload" %&gt; using System; using System.Collections.Generic; using System.IO; using System.Security.AccessControl; using System.Web; using System.Web.Script.Serialization; namespace jQueryUploadTest { public class Upload : IHttpHandler { public class FilesStatus {/* public string thumbnail_url { get; set; } public string name { get; set; } public string url { get; set; } public int size { get; set; } public string type { get; set; } public string delete_url { get; set; } public string delete_type { get; set; } public string error { get; set; } public string progress { get; set; } */ private string m_thumbnail_url; private string m_name; private string m_url; private int m_size; private string m_type; private string m_delete_url; private string m_delete_type; private string m_error; private string m_progress; public string thumbnail_url { get { return m_thumbnail_url; } set { m_thumbnail_url = value; } } public string name { get { return m_name; } set { m_name = value; } } public string url { get { return m_url; } set { m_url = value; } } public int size { get { return m_size; } set { m_size = value; } } public string type { get { return m_type; } set { m_type = value; } } public string delete_url { get { return m_delete_url; } set { m_delete_url = value; } } public string delete_type { get { return m_delete_type; } set { m_delete_type = value; } } public string error { get { return m_error; } set { m_error = value; } } public string progress { get { return m_progress; } set { m_progress = value; } } } private readonly JavaScriptSerializer js = new JavaScriptSerializer(); private string ingestPath; public bool IsReusable { get { return false; } } public void ProcessRequest (HttpContext context) { //var r = context.Response; ingestPath = @"C:\temp\ingest\"; context.Response.AddHeader("Pragma", "no-cache"); context.Response.AddHeader("Cache-Control", "private, no-cache"); HandleMethod(context); } private void HandleMethod (HttpContext context) { switch (context.Request.HttpMethod) { case "HEAD": case "GET": ServeFile(context); break; case "POST": UploadFile(context); break; case "DELETE": DeleteFile(context); break; default: context.Response.ClearHeaders(); context.Response.StatusCode = 405; break; } } private void DeleteFile (HttpContext context) { string filePath = ingestPath + context.Request["f"]; if (File.Exists(filePath)) { File.Delete(filePath); } } private void UploadFile (HttpContext context) { List&lt;FilesStatus&gt; statuses = new List&lt;FilesStatus&gt;(); System.Collections.Specialized.NameValueCollection headers = context.Request.Headers; if (string.IsNullOrEmpty(headers["X-File-Name"])) { UploadWholeFile(context, statuses); } else { UploadPartialFile(headers["X-File-Name"], context, statuses); } WriteJsonIframeSafe(context, statuses); } private void UploadPartialFile (string fileName, HttpContext context, List&lt;FilesStatus&gt; statuses) { if (context.Request.Files.Count != 1) throw new HttpRequestValidationException("Attempt to upload chunked file containing more than one fragment per request"); Stream inputStream = context.Request.Files[0].InputStream; string fullName = ingestPath + Path.GetFileName(fileName); using (FileStream fs = new FileStream(fullName, FileMode.Append, FileAccess.Write)) { byte[] buffer = new byte[1024]; int l = inputStream.Read(buffer, 0, 1024); while (l &gt; 0) { fs.Write(buffer,0,l); l = inputStream.Read(buffer, 0, 1024); } fs.Flush(); fs.Close(); } FilesStatus MyFileStatus = new FilesStatus(); MyFileStatus.thumbnail_url = "Thumbnail.ashx?f=" + fileName; MyFileStatus.url = "Upload.ashx?f=" + fileName; MyFileStatus.name = fileName; MyFileStatus.size = (int)(new FileInfo(fullName)).Length; MyFileStatus.type = "image/png"; MyFileStatus.delete_url = "Upload.ashx?f=" + fileName; MyFileStatus.delete_type = "DELETE"; MyFileStatus.progress = "1.0"; /* { thumbnail_url = "Thumbnail.ashx?f=" + fileName, url = "Upload.ashx?f=" + fileName, name = fileName, size = (int)(new FileInfo(fullName)).Length, type = "image/png", delete_url = "Upload.ashx?f=" + fileName, delete_type = "DELETE", progress = "1.0" }; */ statuses.Add(MyFileStatus); } private void UploadWholeFile(HttpContext context, List&lt;FilesStatus&gt; statuses) { for (int i = 0; i &lt; context.Request.Files.Count; i++) { HttpPostedFile file = context.Request.Files[i]; file.SaveAs(ingestPath + Path.GetFileName(file.FileName)); string fileName = Path.GetFileName(file.FileName); FilesStatus MyFileStatus = new FilesStatus(); MyFileStatus.thumbnail_url = "Thumbnail.ashx?f=" + fileName; MyFileStatus.url = "Upload.ashx?f=" + fileName; MyFileStatus.name = fileName; MyFileStatus.size = file.ContentLength; MyFileStatus.type = "image/png"; MyFileStatus.delete_url = "Upload.ashx?f=" + fileName; MyFileStatus.delete_type = "DELETE"; MyFileStatus.progress = "1.0"; statuses.Add(MyFileStatus); } } private void WriteJsonIframeSafe(HttpContext context, List&lt;FilesStatus&gt; statuses) { context.Response.AddHeader("Vary", "Accept"); try { if (context.Request["HTTP_ACCEPT"].Contains("application/json")) { context.Response.ContentType = "application/json"; } else { context.Response.ContentType = "text/plain"; } } catch { context.Response.ContentType = "text/plain"; } string jsonObj = js.Serialize(statuses.ToArray()); context.Response.Write(jsonObj); } private void ServeFile (HttpContext context) { if (string.IsNullOrEmpty(context.Request["f"])) ListCurrentFiles(context); else DeliverFile(context); } private void DeliverFile (HttpContext context) { string filePath = ingestPath + context.Request["f"]; if (File.Exists(filePath)) { context.Response.ContentType = "application/octet-stream"; context.Response.WriteFile(filePath); context.Response.AddHeader("Content-Disposition", "attachment, filename=\"" + context.Request["f"] + "\""); } else { context.Response.StatusCode = 404; } } private void ListCurrentFiles (HttpContext context) { List&lt;FilesStatus&gt; files = new List&lt;FilesStatus&gt;(); string[] names = Directory.GetFiles(@"C:\temp\ingest", "*", SearchOption.TopDirectoryOnly); foreach (string name in names) { FileInfo f = new FileInfo(name); FilesStatus MyFileStatus = new FilesStatus(); MyFileStatus.thumbnail_url = "Thumbnail.ashx?f=" + f.Name; MyFileStatus.url = "Upload.ashx?f=" + f.Name; MyFileStatus.name = f.Name; MyFileStatus.size = (int)f.Length; MyFileStatus.type = "image/png"; MyFileStatus.delete_url = "Upload.ashx?f=" + f.Name; MyFileStatus.delete_type = "DELETE"; files.Add(MyFileStatus); /*files.Add(new FilesStatus { thumbnail_url = "Thumbnail.ashx?f=" + f.Name, url = "Upload.ashx?f=" + f.Name, name = f.Name, size = (int)f.Length, type = "image/png", delete_url = "Upload.ashx?f=" + f.Name, delete_type = "DELETE" });*/ } context.Response.AddHeader("Content-Disposition", "inline, filename=\"files.json\""); string jsonObj = js.Serialize(files.ToArray()); context.Response.Write(jsonObj); context.Response.ContentType = "application/json"; } } } </code></pre> <p>The error:</p> <pre><code>XML Parsing Error: no element found Location: http://nbcddmsps01:87/_layouts/IrvineCompany.SharePoint.CLM/aspx/Upload.ashx?f=test.txt Line Number 1, Column 1: </code></pre> <p>I ONLY got this error AFTER i added verbs to my web.config so I could call DELETE and PUT requests into the httphandler</p>
28,883,190
0
<p>I think you can use a sub report, I know that you need a HashMap to build a sub report, then I propose the following:</p> <p>1.- Create three classes:</p> <pre><code>public class RowEmployee { private int sno; private String supervisor; private int [] machines; private String [] employees; // getters and setters } public class RowMachinesDetails { private int sno; private int machine; private int workMins; private int productinKg; // getters and setters } public class Shift { private Date dateShift; private List&lt;TableEmployee&gt; listTableEmployee; private List&lt;TableMachinesDetails&gt; listTableMachinesDetails; // getters and setters } </code></pre> <p>The RowEmployee class is for the first table, the RowMachinesDetails is for the second table and the Shift class is for each shift of your report. As you can see, the Shift class has a list of RowEmployee and a list of RowMachinesDetails, because these lists correspond to each table, also it has a date which corresponds to date of the shift.</p> <p>2.- Fill your lists with data of employee and data of production</p> <pre><code>List&lt;TableEmployee&gt; listTableEmployee = new ArrayList&lt;TableEmployee&gt;(); List&lt;TableMachinesDetails&gt; listTableMachinesDetails = new ArrayList&lt;TableMachinesDetails&gt;(); //Create instances of TableEmployee and TableMachinesDetails, and fill your lists listTableEmployee.add(TableEmployee); listTableMachinesDetails(TableMachinesDetails); </code></pre> <p>3.- Create instances of Shift and fill your HashMap with these instances, put the number of shift as key in the HashMap.</p> <pre><code>//Create instances of Shift Shift shift = new Shift(); shift.setDateShitf (dateShift); shift.setListTableEmployee(listTableEmployee); shift.setListTableMachinesDetails(listTableMachinesDetails); //Fill the HashMap hashMapShift.add("I", shift); </code></pre> <p>4.- Finally, create your datasource as HashMap in iReport and use hashMapShift to fill your datasource.</p> <p>NOTE: Maybe the type of variables aren't appropiate, the most important is the concept of the solution.</p> <p>I hope this helps you.</p> <p>Good Luck.</p>
27,486,189
0
<p>Let me first warn you that long ternary operations like this is usually not prescribed as it's only going to cause problems in the future if there's any modifications. Nevertheless, the following will do the required:</p> <pre><code>int x = 600000; x = (x &gt; 250000 &amp;&amp; x &lt; 500000) ? ((x / 100) * 10): ((x &gt; 500000 &amp;&amp; x &lt; 1000000) ? ((x / 100) * 20): (x &gt; 1000000) ? ((x / 100) * 30):x); </code></pre>
8,938,852
0
Loading "window.open" command on IOS devices only.....? <p>my first endeavor at building a site to accomodate IOS, and it's not going well.</p> <p>embedding a flickr slideshow as an object on the page. works fine on regular browsers, not so much on iPad (obviously, because it's flash.) - nothing loads but the background image.</p> <p>have a decent workaround, which is to make the cell itself a link, that opens a new browser window with the flickr page itself. perfect on the iPad. But on regular browsers clicking on the flickr object produces both actions - slideshow AND new window with flickr page.</p> <p>what i need is to script it in such a way that <strong>only</strong> the IOS will see this instruction:</p> <pre><code>onclick="window.open('http://www.flickr.com//photos/72076640@N04/sets/72157628873638463/show/');" </code></pre> <p>here's the page in question:</p> <pre><code>http://creyoncafe.com/pages/galeria2.html </code></pre> <p>Can anybody help? </p> <p>(Hope I was clear. Sorry if i went on too long... was following the edict to be as specific as possible. )</p> <p><strong>Thanks.</strong></p>
16,534,013
0
Using Db::getInstance() in a CLI script <p>I've been wanting to create a add-on cron script that utilises Prestashop's DB class instead of instantiating the database handle directly, but I can't seem to figure out where did the "Db" class commonly referenced by "Db::getInstance()" calls get defined.</p> <p>classes/Db.php defines an abstract DbCore class. MySQLCore extends Db as you can see, however Db is never defined anywhere:</p> <pre><code>[/home/xxxx/www/shop/classes]# grep -r "extends Db" ../ ../classes/MySQL.php:class MySQLCore extends Db </code></pre> <p>According to another thread on Prestashop forums, the abstract DbCore class is implemented in a class located in override/classes/db, however that directory does not exist.</p> <pre><code>[/home/xxxx/www/shop/override]# cd ../override/ [/home/xxxx/www/shop/override]# ls ./ ../ classes/ controllers/ [/home/xxxx/www/shop/override]# cd classes/ [/home/xxxx/www/shop/override/classes]# ls ./ ../ _FrontController.php* _Module.php* _MySQL.php* </code></pre> <p>Our shop is working, so obviously I am missing something. We are running Prestashop 1.4.1, so perhaps the docs are no longer applicable.</p> <p>Quite clearly in many places in the code base functions from the Db class are being used, but this last grep through the code found nothing:</p> <pre><code>grep -rwI "Db" . | grep -v "::" ./modules/productcomments/productcommentscriterion.php:require_once(dirname(__FILE__).'/../../classes/Db.php'); ./classes/MySQL.php:class MySQLCore extends Db ./classes/Db.php: * Get Db object instance (Singleton) ./classes/Db.php: * @return object Db instance ./classes/Db.php: * Build a Db object </code></pre> <p>Is there something I am missing? Where did this magical Db class come from?</p>
21,141,842
0
A query to get me specifique alphabetic order <p>I have a table called <code>telephone_contacts</code> that contain two columns:</p> <pre><code>telephone_contacts ( Name varchar(100) Numbers number(20) ) </code></pre> <p>the column <code>name</code> contains about 20,000 rows.</p> <p>I want to filter the name by alphabetic , example:</p> <p>I want a query that get me only the first 6 alphabetic <code>(A , B, C , D ,E ,F G)</code> </p> <p>Then, a query that get me the last 6 alphabetic <code>(U,V,W,X,Y,Z)</code></p> <p>Edit:</p> <p>example: the column name contains the following data:<br/> <b>Abe, car, night, range, chicken, zoo, whatsapp,facebook, viber Adu , aramt, Bike, Male, dog,egg</b> <br/>I want a query that get me only <code>(A , B, C , D ,E ,F G)</code> so the results will be <br/>abe ,care ,chicken facebook,adu,aramt,bike, dog, egg <br/> the rest are ignored </p>
8,132,550
0
<p>I did a similar thing for a service I created that ran periodically to download a file if it changed but found it was being killed by the OS after several hours. Since using <code>startForeground</code>, the problem has gone away. </p> <p>I don't think there'd be a difference between my service that does minimal work and your empty one.</p>
1,507,632
0
<p>This has regular expression checking to make sure your data is formatted well.</p> <pre> fid = fopen('data.txt','rt'); %these will be your 8 value arrays val1 = []; val2 = []; val3 = []; val4 = []; val5 = []; val6 = []; val7 = []; val8 = []; linenum = 0; % line number in file valnum = 0; % number of value (1-8) while 1 line = fgetl(fid); linenum = linenum+1; if valnum == 8 valnum = 1; else valnum = valnum+1; end %-- if reached end of file, end if isempty(line) | line == -1 fclose(fid); break; end switch valnum case 1 pat = '(?\d{4})-(?\d{2})-(?\d{2})'; % val1 (e.g. 1999-01-04) case 2 pat = '(?\d*[,]*\d*[,]*\d*[.]\d{2})'; % val2 (e.g. 1,100.00) [valid up to 1billion-1] case 3 pat = '(?\d*[,]*\d*[,]*\d*[.]\d{2})'; % val3 (e.g. 1,060.00) [valid up to 1billion-1] case 4 pat = '(?\d*[,]*\d*[,]*\d*[.]\d{2})'; % val4 (e.g. 1,092.50) [valid up to 1billion-1] case 5 pat = '(?\d+)'; % val5 (e.g. 0) case 6 pat = '(?\d*[,]*\d*[,]*\d+)'; % val6 (e.g. 6,225) [valid up to 1billion-1] case 7 pat = '(?\d*[,]*\d*[,]*\d+)'; % val7 (e.g. 1,336,605) [valid up to 1billion-1] case 8 pat = '(?\d+)'; % val8 (e.g. 37) otherwise error('bad linenum') end l = regexp(line,pat,'names'); % l is for line if length(l) == 1 % match if valnum == 1 serialtime = datenum(str2num(l.yr),str2num(l.mo),str2num(l.dy)); % convert to matlab serial date val1 = [val1;serialtime]; else this_val = strrep(l.val,',',''); % strip out comma and convert to number eval(['val',num2str(valnum),' = [val',num2str(valnum),';',this_val,'];']) % save this value into appropriate array end else warning(['line number ',num2str(linenum),' skipped! [didnt pass regexp]: ',line]); end end </pre>
6,295,851
0
Parsing PCAP file into XML file using Perl <p>I'm trying to get Perl to read an offline pcap file and save the output into XML file so I can work with it in PHP.</p> <p>I can't use PHP because its not my server but I can Perl. So my aim is to convert the PCAP file into XML so I have fun with it.</p> <p>I have no idea where to start and have looked at the Perl Net::Pcap but I just don't understand the language.</p> <p>Any ideas on what I should do? Thank-you Paul</p>
31,091,868
0
<p>you are not supposed to use the method what you had followed in your query when you assign a value to a variable.</p> <pre><code>DECLARE @price_base NVARCHAR(50) = (SELECT tbl_model2.price_base FROM tbl_model2) </code></pre> <p>This select statement within bracket returns a resultset, not a single value, which cannot be stored into a variable (except table data typed variable). Don't practice this method, this will always end up with errors.</p> <p>You should always use</p> <pre><code>select top 1 @price_base = price_base FROM tbl_model2 </code></pre> <p>when you insert multiple rows, assigning values into a variable inside a trigger, will lead you to lose data. </p>
2,519,566
0
<p>See my answer to your other question <a href="http://stackoverflow.com/questions/2503639/how-do-you-make-a-netbeans-form-automatically-populate-fields-in-a-class/2519515#2519515">here</a>. (In short: using beans binding would help a bit I hope)</p>
21,559,305
0
<p>I'm reasonably certain nothing built into iostreams supports this directly.</p> <p>I think the cleanest way to handle it is to round the number before passing it to an iostream to be printed out:</p> <pre><code>#include &lt;iostream&gt; #include &lt;vector&gt; #include &lt;cmath&gt; double rounded(double in, int places) { double factor = std::pow(10, places); return std::round(in * factor) / factor; } int main() { std::vector&lt;double&gt; values{ 0.000000095123, 0.0095123, 0.95, 0.95123 }; for (auto i : values) std::cout &lt;&lt; "value = " &lt;&lt; 100. * rounded(i, 5) &lt;&lt; "%\n"; } </code></pre> <p>Due to the way it does rounding, this has a limitation on the magnitude of numbers it can work with. For percentages this probably isn't an issue, but <em>if</em> you were working with a number close to the largest that can be represented in the type in question (<code>double</code> in this case) the multiplication by <code>pow(10, places)</code> could/would overflow and produce bad results.</p> <p>Though I can't be <em>absolutely</em> certain, it doesn't seem like this would be likely to cause an issue for the problem you seem to be trying to solve.</p>
14,982,389
1
How to organise specially formatted text to a list (on python) <p>I've got data with flight routing codes. It has lot's of strings like this:</p> <pre><code>routing = 'PBI-FLL/FMY/JAX/MIA/ORL-PNS/TPA-SRQ-CLE/CHI/HOU/WAS-DEN-ELP' </code></pre> <p>I need to get lists with this strings like this: </p> <pre><code>routinglist = [['PBI'], ['FLL','FMY','JAX','MIA','ORL'], ['PNS','TPA'], ['SRQ'], ['CLE','CHI','HOU','WAS'], ['DEN']] </code></pre> <p>I wrote this code but it is to complicated and doesn't work as needed</p> <pre><code>routingrules = 'PBI-FLL/FMY/JAX/MIA/ORL-PNS/TPA-SRQ-CLE/CHI/HOU/WAS-DEN-ELP' airports = [] nn = 0 few = '' airportcount = 0 for simvol in routingrules: if (nn) % 4 == 0: previous = routingrules[nn:nn+3] if routingrules[nn+3:nn+4] == '/': few = few + previous + "1,2" elif routingrules[nn+3:nn+4] == '-': if few != '': airports.append([few + previous]) airportcount = airportcount+1 few = '' else: airports.append([previous]) airportcount = airportcount+1 else: if few != '': airports.append([few + previous]) airportcount = airportcount+1 few = '' nn = nn+1 nn = nn+1 print airports </code></pre> <p>it prints </p> <pre><code>[['PBI'], ['FLL1,2FMY1,2JAX1,2MIA1,2ORL'], ['PNS1,2TPA'], ['SRQ'], ['CLE1,2CHI1,2HOU1,2WAS'], ['DEN']] </code></pre>
4,429,256
0
What's the name of jQuery plugin which auto arranges div/image elements on page? <p>That plugin was able to arrange elements to remove empty spaces between them. </p> <p>Example:</p> <p><img src="https://i.stack.imgur.com/y1KUJ.jpg" alt="http://imgur.com/pUR0Z.jpg"></p>
873,995
0
ASP.NET downloading large files of unknown size <p>I want to use <a href="http://en.wikipedia.org/wiki/ASP.NET" rel="nofollow noreferrer">ASP.NET</a> and <a href="http://en.wikipedia.org/wiki/Internet_Information_Services" rel="nofollow noreferrer">IIS</a> to download dynamically generated files to the browser to be saved. I don't know the size of the file that will be generated.</p> <p>In the current form, my code generates data and uses HttpResponse.Write() to send to the client. But the client sees no activity for about a minute, before finally showing the save file dialog.</p> <p>By default, IIS buffers the output to be sent to the client. It is possible to turn this off, but that doesn't help in my case. The problem seems to be the way IIS chooses to format the packets.</p> <p>If the file size is known ahead of time, then I could set the Content-length in the header. If I turned off output buffering, then presumably, IIS can start sending to the client right away.</p> <p>But since I don't know the file size, IIS seems to be buffering the output until a certain limit is reached (packet size or time, I don't know), then sends a packet with Transfer-encoding set to chunked.</p> <p>I could try chunking the data myself, but is there a way to get IIS to perform the chunking, but with a smaller packet size so that the dialog shows sooner?</p>
37,642,748
0
<p>Another approach is by using <code>FormBody.Builder()</code>.<br> Here's an example of callback:</p> <pre><code>Callback loginCallback = new Callback() { @Override public void onFailure(Call call, IOException e) { try { Log.i(TAG, "login failed: " + call.execute().code()); } catch (IOException e1) { e1.printStackTrace(); } } @Override public void onResponse(Call call, Response response) throws IOException { // String loginResponseString = response.body().string(); try { JSONObject responseObj = new JSONObject(response.body().string()); Log.i(TAG, "responseObj: " + responseObj); } catch (JSONException e) { e.printStackTrace(); } // Log.i(TAG, "loginResponseString: " + loginResponseString); } }; </code></pre> <p>Then, we create our own body:</p> <pre><code>RequestBody formBody = new FormBody.Builder() .add("username", userName) .add("password", password) .add("customCredential", "") .add("isPersistent", "true") .add("setCookie", "true") .build(); OkHttpClient client = new OkHttpClient.Builder() .addInterceptor(this) .build(); Request request = new Request.Builder() .url(loginUrl) .post(formBody) .build(); </code></pre> <p>Finally, we call the server:</p> <pre><code>client.newCall(request).enqueue(loginCallback); </code></pre>
3,509,650
0
<p>Like most (all, maybe) C compilers, the size of an enumerated type can vary. Here's an example program and its output:</p> <pre><code>#include &lt;stdio.h&gt; typedef enum { val1 = 0x12 } type1; typedef enum { val2 = 0x123456789 } type2; int main(int argc, char **argv) { printf("1: %zu\n2: %zu\n", sizeof(type1), sizeof(type2)); return 0; } </code></pre> <p>Output:</p> <pre><code>1: 4 2: 8 </code></pre> <p>All that the standard requires is:</p> <blockquote> <p>The choice of type is implementation-defined, but shall be capable of representing the values of all the members of the enumeration.</p> </blockquote> <p>A quick web search didn't turn up a clang manual that specified its behaviour, but one is almost certainly out there somewhere.</p>
33,937,106
0
Web Components ready flag <p>We are using Web Components and Polymer on our site, and have quite a few bits of Javascript which wait for the <code>"WebComponentsReady"</code> event to be fired before executing. However, we have some asynchronous JS files which occasionally add an event listener for the event <em>after</em> it has been fired, meaning the script we want to run is never run.</p> <p>Does anyone know if there is a flag for Web Components being ready which can be checked?</p> <p>Something like this is what we would need:</p> <pre><code>if(WebComponents.ready) { // Does this flag, or something similar, exist?? // do stuff } else { document.addEventListener('WebComponentsReady', function() { // do stuff } } </code></pre> <p>Any help appreciated.</p>
24,741,710
0
date picker undefined is not a function <p>IM using the following code and I got error is the console undifinnd is not a function,what am I doing wrong here ?</p> <pre><code>&lt;script src="~/Scripts/jquery-2.1.1.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(function () { $('#datetime').datepicker(); }); &lt;/script&gt; </code></pre> <p>I've also try with and I got the same error...</p> <pre><code>$('#datetime')..datetimepicker(); </code></pre>
18,080,801
0
how to use LEFT JOIN in mysql? <p>sorry for this question </p> <p>sorry for this question sorry for this question </p>
23,199,426
0
<p>You have an extra "," after Description. </p> <p>Just remove that comma and add ")" and a space.</p>
32,721,853
0
How to read .csv file from a different location in MATLAB? <p>I'm new to MATLAB, I've been fiddling around to import a .csv file which is on my desktop to MATLAB. I've already tried <code>csvread()</code> function as shown,</p> <pre><code>M = csvread(C:/Users/XYZ/Desktop/train.csv) </code></pre> <p>Please help. Thanks in advance.</p> <p><strong>EDIT:</strong></p> <p>My data is in the following format:</p> <pre><code>Id DV T1 T2 1 1 15 3 2 4 16 14 3 1 10 10 4 1 18 18 </code></pre>
40,711,410
0
SpamCop is blocking the emails sent through sparkpost <p>I am using laravel with the famous and popular laravel framework. </p> <p>I sent a couple emails to my gmail address and a clients email address, I received all of them. A client complaint that he didn't receive them, so I looked it up and saw this in </p> <p>550-"JunkMail rejected - mta65a.sparkpostmail.com [54.244.48.142]:58459 is in 550 an RBL, see Blocked - see <a href="http://www.spamcop.net/bl.shtml?54.244.48.142" rel="nofollow noreferrer">http://www.spamcop.net/bl.shtml?54.244.48.142</a>"</p> <blockquote> <p>SpamCop's blocking list works on a mail-server level. If your mail was blocked incorrectly it may be due to the actions of other users or technical flaws with the mail system you use. If you are not the administrator of your email system, please forward this information to them.</p> </blockquote> <p>I opened the detailed message and it said it is in the process of getting unblocked.</p> <p>When i checked again to write this post it stated that sparkpost was not any more blocked, but before it stated it was reported as spam 10 times in the last 8 or 80 days, something like that</p> <p>Now: what can I do about this? stop using sparkpost? I guess all mail services have the exact same problem</p> <p>what can my client do about this?</p>
20,303,592
0
<p>With a RMI remote object you can't cast to the concrete class. You have to cast to the remote interface.</p>
27,994,558
0
GML -> check for a colliding instance's variable, then do action <p>I've been trying to do some GML scripting but got totally stuck at some point. I want enemies to attack my main character but without overlapping. So, I would say.</p> <pre><code>//enemy is moving left-to-right... if place_meeting(x+1, y, enemy){ //if there's a collision with another enemy if (other enemy).is_attacking{ // ??? // checks if the colliding enemy is attacking, if true, it should attack as well... is_attacking=true; }else{ //walks } </code></pre> <p>This is an image that describes what I'm trying to get (note that enemies know they should be attacking even though they're not in direct contact with the main character, just because an enemy besides is attacking)</p> <p><img src="https://i.stack.imgur.com/cZhpY.png" alt="What I&#39;m trying to get..."></p>
2,779,147
0
<p>With a <strong>big assumption</strong> that <code>Value</code> only increases as the <code>Date</code> increases...</p> <pre><code>SELECT Symbol, MAX(Date) AS Date, MAX(Value) AS Value FROM YourTable GROUP BY Symbol </code></pre> <p>If that assumption can't be made, then there's a problem as you have no way to uniquely identify a row. If you have an IDENTITY column for example, you would find the record for each symbol with the latest Date, and the highest ID. Without the ID field, you don't actually know which record was the latest to be inserted (if there are 2 with the same Date), so have to do something like above.</p> <p><strong>If</strong> you will never have the same Date value for a given symbol (i.e. the symbol + Date together are unique) then you can do:</p> <pre><code>SELECT s.Symbol, s.Date, s.Value FROM YourTable s JOIN ( SELECT Symbol, MAX(Date) AS LatestDate FROM YourTable GROUP BY Symbol ) s2 ON s.Symbol = s2.Symbol AND s.Date = s2.LatestDate </code></pre> <p>That will then not matter if Value only ever increases over time.</p>
3,004,901
0
<p>With just mod_rewrite you can't request files outside the document root. So the only solution is to use symlink located in document root directory and pointing to the modules directory.</p>
30,356,368
0
<p>I think it is working as it is supposed to. </p> <p>In the mentioned case, event is directly attached to the button, hence currentTarget and target will always be the same. </p> <blockquote> <p><code>$('.container').on('click', '.myButton', function(event) {});</code> does not mean that the event is attached to the div. It is just delegating the event. Meaning, the event will bubble up only till <code>.container</code> and the event is still attached ONLY to <code>.myButton</code></p> </blockquote> <p><strong>Case 1:</strong> If an event is attached to the div </p> <ol> <li>if the button is clicked then the currentTarget would be button and target would be the div.</li> <li>if div is clicked currentTarget would be div and target would also be div</li> </ol> <p><strong>Example</strong></p> <p><div class="snippet" data-lang="js" data-hide="true"> <div class="snippet-code snippet-currently-hidden"> <pre class="snippet-code-js lang-js prettyprint-override"><code>$('.container').on('click', function(event) { console.log(event.currentTarget); console.log(event.target); });</code></pre> <pre class="snippet-code-css lang-css prettyprint-override"><code>div{ border: 1px solid; width: 150px; height: 150px; }</code></pre> <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"&gt;&lt;/script&gt; &lt;div class="container"&gt; &lt;button class="myButton"&gt;Click Me&lt;/button&gt; Click me &lt;/div&gt;</code></pre> </div> </div> </p> <p><strong>Case 2: (Your case)</strong> If event is attached to button then currentTarget and target would be button always</p> <p><div class="snippet" data-lang="js" data-hide="true"> <div class="snippet-code snippet-currently-hidden"> <pre class="snippet-code-js lang-js prettyprint-override"><code>$('.container').on('click','.myButton', function(event) { console.log(event.currentTarget); console.log(event.target); });</code></pre> <pre class="snippet-code-css lang-css prettyprint-override"><code>div{ border: 1px solid; width: 150px; height: 150px; }</code></pre> <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"&gt;&lt;/script&gt; &lt;div class="container"&gt; &lt;button class="myButton"&gt;Click Me&lt;/button&gt; Click me &lt;/div&gt;</code></pre> </div> </div> </p>
36,170,983
1
Using global variables in python in a function <pre><code>def foo(): global a a = 10 </code></pre> <p>vs</p> <pre><code>a = 0 def foo(): a = 10 </code></pre> <p>What is the use of declaring global in a function instead of declaring variables right at the top. It should be cleaner this way ?</p>
25,860,889
0
<p>When you initially set up your controller, you should populate the labels and button text in a method that you call from viewDidLoad. When you want to "refresh" your view, to make it look like the initial condition, just call this method again. You don't need to reload the storyboard to do that.</p>
40,187,357
0
<p>You seem to be asking if there is a better way to do this. Check out check_output. I have always found it much more convenient and fool proof compared to the lower level stuff in subprocess.</p>
33,047,013
0
<p>Ksh93 doesn't have such expressions, so it's better to make it explicit. But you can bundle multiple variables (with their initial values) in a single <code>export</code> phrase:</p> <pre><code>export A=1 B=2 C=3 </code></pre> <p>Testing:</p> <pre><code>$ (export A=1 B=2 C=3 &amp;&amp; ksh -c 'echo A=$A B=$B C=$C D=$D') A=1 B=2 C=3 D= </code></pre> <p>There is no C-like shortcut, unless you want this ugly thing:</p> <pre><code>A=${B:=${C:=1}}; echo $A $B $C 1 1 1 </code></pre> <p>... which does not work with <code>export</code>, nor does it work when B or C are empty or non-existent.</p> <p><strong>Edit</strong></p> <p>Ksh93 <em>arithmetic</em> notation <strong>does</strong> actually support C-style chained assignments, but for obvious reasons, this only works with numbers, and you'll then have to do the <code>export</code> separately:</p> <pre><code>$ ((a=b=c=d=1234)) &amp;&amp; echo $a $b $c $d 1234 1234 1234 1234 $ export a b d $ ksh -c 'echo $a $b $c $d' 1234 1234 1234 </code></pre> <p>Note how we do not export <code>c</code>, and its value in the child shell is indeed empty.</p>