Unnamed: 0
int64
65
6.03M
Id
int64
66
6.03M
Title
stringlengths
10
191
input
stringlengths
23
4.18k
output
stringclasses
10 values
Tag_Number
stringclasses
10 values
1,068,131
1,068,132
Comparing timestamp to current time from database
<p>I need to test current time against a datetime from database, if it has been 30 mins then execute code, if not then dont. This is where I am at and I am stuck:</p> <pre><code>$link = mysqli_connect("hostname", "username", "password", "database"); $q = "SELECT id FROM dwCache ORDER BY id DESC LIMIT 1"; $qu = mysqli_...
php
[2]
5,006,650
5,006,651
How to implement infinite scrolling in table data?
<p>How to implement infinite scrolling in table data by using php and jquery?</p>
jquery
[5]
2,958,231
2,958,232
how to create application(exe) from python script for linux
<p>i'm newbie for python programming, i'm having a .py file, now what shall i do so i can create an application from .py file and it can be istall and run in any linux pc, i try to packaging it but its just create .tar file where i need python to run it, is it any to do so,</p> <p>thanks</p>
python
[7]
1,174,890
1,174,891
truncate text with double quotes in javascript
<p>I am using the below snippet to truncate text and it is working fine, except in cases where the text contains double quotes.</p> <pre><code>function truncateText(str, len) { return (str.length &gt; len ? $.trim(str).substring(0, len).split(" ").slice(0,-1).join("") :str); } </code></pre> <p>for example: len = ...
javascript
[3]
4,917,615
4,917,616
I can't set a value in a class
<p>I made two classes. The first one is the <code>Player</code> class and the second the <code>Bag</code>. What I want is to print the score of the player in <code>main()</code>. In <code>Bag</code>, I count the score and I want to set it in <code>Player</code>. This is a part of the <code>Bag</code> class </p> <pre>...
java
[1]
2,504,732
2,504,733
How to "negate"(?) a list - Python
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/12887398/python-takes-list-and-returns-only-if-negative-value-also-exists-using-set">python takes list and returns only if negative value also exists using set</a> </p> </blockquote> <p>I'm having problems with ...
python
[7]
1,671,090
1,671,091
What is event bubbling and capturing
<p>What is the difference between event bubbling and capturing? Which is the faster and better model to use?</p>
javascript
[3]
5,307,330
5,307,331
Change Call Settings Programmatically
<p>I understand that it is currently possible to change Android system settings via the <a href="http://developer.android.com/reference/android/provider/Settings.System.html" rel="nofollow">Settings.System</a> class and its <code>putString</code> method.</p> <p>However, the setting I wish to change programmatically (T...
android
[4]
13,197
13,198
animate UIImageView with flip animation
<p>I'm a noob in objective-c and cocoa, and I would like to implement a simple animation of UIImageView with flipping animation. But I'm having a hard time doing it. Below are my snippets:</p> <pre><code>UIView *containerView = [[UIView alloc] initWithFrame:CGRectMake(0,0,33,33)]; UIImageView *img1 = [[UIImageView all...
iphone
[8]
4,335,440
4,335,441
How to make advertising script be the latest element loaded?
<p>I want to make ads to load last.so,after all the website's page elements are loaded,what code do i need to make an ad load last ?</p> <p>thank you</p>
javascript
[3]
4,172,136
4,172,137
if "word" text will say "wrong" (iPhone SDK)
<p>I would like to change this code so that if the textName.text contains the word "Blue" it will say @"Wrong color"</p> <p>This code implies only that if the word has no letters it will say "Wrong color". How can I change it to a specific word (blue) instead of "length] == 0)"?</p> <pre><code>if([textName.text lengt...
iphone
[8]
778,530
778,531
JQuery rollover state and "Current" items
<p>I have a simple JQuery rollover. The problem is, there is always one "current" item and I am using Jquery to change that current item accordingly. I am using the .hover function to change the hover colors based on page name. Right now, everything works fine, except that as soon as you roll over the current item, it ...
jquery
[5]
5,681,590
5,681,591
My Acitivty not reading data
<p>Android 2.1 update 1 Eclipse 3.5</p> <p>I have a problem reading data from my 2nd activity that is called from the 1st activity using intent. I have androidmanifest.xml setup correctly. </p> <p>My First Activity has the following code:</p> <p><code> Intent myIntent = new Intent(MainMenu.this, Testmenu.class); myI...
android
[4]
4,387,934
4,387,935
Javascript function returns before its subroutine finishes
<p>I'm trying to test if urls dynamically passed to image tags would resolve or not. I'm using the following javascript function: </p> <pre><code> testImageUri = function(src) { var img = new Image(); var imgStatus = false; var goodUri = function() { imgStatus = true; };...
javascript
[3]
5,828,416
5,828,417
Retrieve Button value with jQuery
<p>A simple one, I'm trying to retrieve the value attribute of a button when its been pressed using jQuery, here's what I have:</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function() { $('.my_button').click(function() { alert($(this).val()); }); }); &lt;/s...
jquery
[5]
5,757,469
5,757,470
How to set this cases depends on if rule
<p>if i've the following</p> <pre><code>$x = "go"; $y = "went"; $z "gone"; </code></pre> <p>and i need to set title where title will be </p> <pre><code>$title = $x; //only if "y" empty no care about "z" if empty or not $title = $x . " - " . $y; // if "y" not empty and "z" is empty $title = $y . " - " . ...
php
[2]
5,950,675
5,950,676
C++ Dynamic memory allocation
<p>I'm just learning about dynamic memory allocation, but there is one thing i'd like to be explained.</p> <p>One use for dynamic allocation is for dynamic sized arrays, and thats clear to me. Another use is for normal objects.</p> <p>What is a situation one should use it? Is it because normally objects are pushed on...
c++
[6]
3,000,135
3,000,136
Adding an integer number to a Unicode character - What does this do?
<p>I am learning C# in the beginners level. I do not understand what adding an integer number to a Unicode character does. What does the addition do in the example below?</p> <pre><code>int amount = int.Parse(number.Text); steps.Text = ""; string current = ""; do { int nextDigit = amount % 8; amount /= 8; ...
c#
[0]
4,841,877
4,841,878
Remove values from array
<p>I have array:</p> <pre><code>$array = array('aaa', 'bbb', 333, 'ddd', 555, '666'); </code></pre> <p>I would like remove all values where key is > 3; </p> <p>How is the best way for this?</p>
php
[2]
107,013
107,014
how to customize subview that supports only landscape mode
<p>i have one view with 4 subviews.</p> <p>my application will supports both portrayed and landscape modes.</p> <p>Among the 4 subviews,one of the view is support only for portrayed.</p> <p>how can i done this.</p> <p>Thank u in advance. </p>
iphone
[8]
1,471,857
1,471,858
how to add select option to datagrid control in asp.net
<pre><code>&lt;asp:DataGrid runat="Server" id="dg"&gt;&lt;/asp:DataGrid&gt; </code></pre>
asp.net
[9]
4,754,733
4,754,734
how to change [1,2,3,4] to '1234' using python
<p>I want to get a string from a list.</p>
python
[7]
4,726,099
4,726,100
2 iPhone apps messed up when deploy to iPhone
<p>I have 2 iPhone apps and want to deploy to iphone and somehow the second app rewrote the first app on my iPhone. </p> <p>The second app project was copied from the first app and I made some changes including renaming the app name etc.</p> <p>I believe there might be some files messed up due to the shared path. Can...
iphone
[8]
4,790,920
4,790,921
How can i make a message pop up every 12 hrs?
<p>How can i make a message pop up every 12 hrs in c#?</p> <p>I'm just using a message as an example, thanks.</p>
c#
[0]
503,231
503,232
JavaScript dateFormat error?
<p>I am trying to get a field named <code>BASVURUTARIHI(Date)</code> from DataSet. But if I only bind it with Eval, it shows <code>dd/mm/yyyy HH/MM/SS</code>. I don't want the hours and minutes. So, I am trying to change the dateformat but it gives me the error:</p> <blockquote> <p>CS0103: The name 'dateFormat' does...
asp.net
[9]
2,200,236
2,200,237
how to separate numbers string to send bulk sms
<p>i need to send sms to multiple numbers at a time.</p> <p>to send sms i am using MFMessageComposeViewController.</p> <p>i place a text field and pass that textfield text as recipients.</p> <p>now i need to send it to multiple numbers at a time.</p> <p>for that i think by placing the , as separator for mobile numb...
iphone
[8]
4,759,995
4,759,996
Android String.equals doesn't work when I trying to match from httpresponse
<pre><code>RestClient.post("auth/login/", loginparam, new AsyncHttpResponseHandler() { @Override public void onSuccess(String s) { Toast.makeText(getApplicationContext(), String.valueOf(s.toLowerCase().equals("ok")), Toast.LENGTH_LONG).show(); if (s.equals("ok")) { ...
android
[4]
538,312
538,313
what is the meaning of Broken pipe Exception?
<p>what is the meaning of broken pipe exception and when it will come, please tell me</p> <p>Thanks,</p> <p>varakumar.pjd</p>
java
[1]
2,859,560
2,859,561
Where to keep simple counter value (except DB and File) [PHP]
<p>I have a counter which I increment every page visit. I do not want to keep this value in DB or in plain file. Is there any other approach to keep it?</p> <p>I need keep it for next visit. In the next visit I want to read it, increase and keep again.</p> <p>Why I do not want to use DB? Because in whole project I...
php
[2]
3,664,310
3,664,311
Pointers to two different types of nodes
<p>I am coding a hash tree in C++, where I need two different types of nodes i.e. one for non leaf that will simply point to its children and other for leaf node which contains the required information. </p> <p>The problem I am facing is that how can I declare pointers in non leaf node. Because some non leaf nodes are...
c++
[6]
5,290,987
5,290,988
Does the GPLv2 preclude me from using KLone for my website?
<p>I recently discovered <a href="http://koanlogic.com/klone/features.html" rel="nofollow">Klone</a>. Being a C++ developer, I'm fascinated by the idea of getting to use C++ for my web development work (I know, I'm a glutton for punishment!)... Anyhow, it looks like the open source version of KLone is licensed under GP...
c++
[6]
1,881,715
1,881,716
SurfaceView keeps overdrawing the menu
<p>When I create a SurfaceView and then try to open the menu, the menu is stuck under the SurfaceView. When I set the surfaceView to be transparant, this works when the SurfaceView is empty, but once it's filled, it will not allow anything to be in front of it.</p> <p>Does anyone know how to solve this? This is my ini...
android
[4]
3,512,344
3,512,345
automatic way to detect objects passed by value to functions in c++
<p>I and my co-coder often forget to pass (large) objects by reference and instead pass by value. This might be hurting performance. Is it possible to configure the compiler to warn me in such cases? Is it possible to detect it automatically in a bunch of c++ source files ... maybe a regex that someone has already writ...
c++
[6]
4,875,554
4,875,555
Show how many times values are in an array
<p>The php code below displays the country location of the IPs stored in a database and outputs it in an HTML table. As is, it creates a long list of the country code for each individual IP.</p> <p>For example...</p> <p>US<br>US<br>MX<br>US</p> <p>What I would like to do is, rather than create a long list of each in...
php
[2]
5,422,981
5,422,982
What's the difference between these two object instantiation approaches?
<p>Suppose I have a class named A:</p> <pre><code>Class A { ... } </code></pre> <p>And what's the difference between the following 2 approaches to instanciate an object:</p> <pre><code>void main(void) { A a; // 1 A *pa=new A(); // 2 } </code></pre> <p>As my current understanding (not sure about this yet):...
c++
[6]
5,387,056
5,387,057
bad_alloc when allocating array
<p>I have this code on the constructor of a class:</p> <pre><code>verts=new GLfloat[nVerts]; </code></pre> <p>verts is a member variable of the class (GLfloat *) and nVerts is 4. Is something wrong with that code? I get the same error If i try to do malloc(sizeof(GLfloat)*nVerts) I think I'm not running out of memory...
c++
[6]
5,867,458
5,867,459
Is it possible to get the caller context in javascript?
<pre><code>var test = { demo: function(){ //get the caller context here } } //when this gets called, the caller context should be window. test.demo(); </code></pre> <p>I tried <code>arguments.callee</code> and <code>arguments.callee.caller</code>,and no luck...</p>
javascript
[3]
455,472
455,473
How to build knob like spinner in iOS sdk?
<p>I want to build a spinner for menu selection like the one in where to? IPhone app as shown in image below. Any hints?</p> <p><img src="http://i.stack.imgur.com/RPRVZ.jpg" alt="alt text"></p>
iphone
[8]
3,429,776
3,429,777
How-to init a ListPreference to one of its values
<p>I'm trying to set a defaultValue to a ListPreference item.</p> <p>Here is an sample of my preference.xml file:</p> <pre><code>&lt;ListPreference android:key="notification_delay" android:title="@string/settings_push_delay" android:entries="@array/settings_push_delay_human_value" android:entryValues="@ar...
android
[4]
4,711,818
4,711,819
PHP class_exists acting case sensitive
<p>According to PHP's documentation <a href="http://php.net/manual/en/function.class-exists.php" rel="nofollow"><code>class_exists()</code></a> is not case sensitive. However, I'm experiencing that it is. For example, <code>class_exists("\\My\\Class")</code> returns true but <code>class_exists("\\My\\class")</code> ret...
php
[2]
2,304,639
2,304,640
PHP Headers - Content & Location
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/4373440/download-a-file-and-redirect-or-alternative">Download a file and redirect&hellip;or alternative</a> </p> </blockquote> <p>Basically, we have a PHP file which outputs a file type using PHP headers.</p> <...
php
[2]
3,938,555
3,938,556
store datagridview column value in a variable
<p>I want to store the column values (to be precise two column values in two variables). How this can be achieved. Any sample code will be of great help. Thanks.</p>
c#
[0]
1,274,748
1,274,749
User Control In Asp.net
<p>I created a user control. It contains one textbox. can I control this from parent web page. </p>
asp.net
[9]
2,700,303
2,700,304
Element in a form
<p>How to check if an html element [textbox, select, radiobutton etc] is in a form via Jquery?</p>
jquery
[5]
241,871
241,872
‘strcasecmp’ was not declared in this scope
<p>I am trying to build a source code called lipiTk</p> <p>I have lots of errors like this:</p> <pre><code>Documents/lipi/lipi/src/reco/shaperec/activedtw/ActiveDTWShapeRecognizer.cpp:1222:78: error: ‘strcasecmp’ was not declared in this scope </code></pre> <p>What should I do, there is too many cpp file in the co...
c++
[6]
5,343,988
5,343,989
How to implement weather functionality in iphone?
<p>I am implementing weather applciation for iphone but dont know which api i have to used. And how to implement this things.</p> <p>Please give me some advice for this.</p> <p>Thanks in advance</p>
iphone
[8]
2,900,968
2,900,969
looking for something like "array_and"
<p>I'm want to check an array like this, if every value is "true"</p> <pre><code>$arr = array(true, true, true) // would be true $arr = array(true, true, false) // would be false $arr = array(false, true, false) // would be false </code></pre> <p>PHP provides a funcion "array_sum()". Is there a short function like...
php
[2]
4,539,038
4,539,039
PHP—"Defined or Exit" at the beginning of many files?
<p>I have been inspecting some PHP source codes and I more often than not find files starting with</p> <pre><code>defined('__someconstant__') or exit(); </code></pre> <p>I know that this prevents the file to be accessed directly if a previous file defining <code>__someconstant__</code>, but then I wonder if this is r...
php
[2]
4,034,240
4,034,241
How to implement Mobile express checkout using php
<p>I have created one php page and upon click of "Checkpres checkout" just redirecting into paypal sandbox url, however it's not working. We are using the php url in android webview to do payment everything. So i need your help to solve the problem. What are the information i need to POST to mobile paypal express check...
php
[2]
761,920
761,921
Multiple timer with different interval in C#.net
<p>I want different timer with different interval that i input.For example, if I input 4, 4 timer create and show time in 4 label, where 1st timer's time change in 1sec,2nd timer's time change in 2sec,3rd timer's time change in 3sec and 4tn timer's time change in 4sec.Here is my code,</p> <pre><code> string inp...
c#
[0]
2,563,285
2,563,286
Algorithmic analysis:Random Number
<p>Am building Software for a clinic using VS2010 Pro.<br> Among the requirements are: </p> <ol> <li>It should generate patient Number based on the date of enrollment. </li> <li><p>Middle two digits for Male patient is 11. </p></li> <li><p>Middle two digits for Female patient is 22</p></li> <li><p>The Final two di...
c#
[0]
1,172,720
1,172,721
Android. Dynamic class loading and Java interfaces
<p>I've almost finished my first real Android project, a taxi ordering application, only some little usability concerns are left. For future releases we plan to implement built-in automatic updates of programming code and resources like some good programs do. I managed to run a simple example, based on <a href="http://...
android
[4]
5,579,225
5,579,226
Access array element from function call in php
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/1769020/how-to-avoid-temporary-variables-in-php-when-using-an-array-returned-from-a-func">How to avoid temporary variables in PHP when using an array returned from a function</a> </p> </blockquote> <pre><code>fu...
php
[2]
1,410,992
1,410,993
iphone unit testing
<p>is it possible to make unit test using iphone simulator?</p> <p>Thanks.....</p>
iphone
[8]
5,129,579
5,129,580
Dynamically add TableRow to TableLayout
<p>When a button is clicked, the following method is run:</p> <pre><code>public void createTableRow(View v) { TableLayout tl = (TableLayout) findViewById(R.id.spreadsheet); TableRow tr = new TableRow(this); LayoutParams lp = new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT); tr.setLayoutPar...
android
[4]
5,581,244
5,581,245
Delete local cookies in php
<p>How can I delete the cookies of a specific domain from php (ran on my computer)?</p> <p>It would be the same as the js function but in php.</p>
php
[2]
3,854,423
3,854,424
tkinter create labels and entrys dynamically
<p>Hello guys i need some ideas for my python script.</p> <p>i want to create a simple gui where i can enter some values. a label before and at the and an button to start the script.</p> <p>i was using something like this:</p> <pre><code>w = Label(master, text="weight:") w.grid(sticky=E) w = Label(root, text="bodyfa...
python
[7]
2,952,977
2,952,978
EVO 3D screen size/DPI issue
<p>One of my beta testers has an EVO 3D and reported that my app draws things (some custom widgets) too small. Upon further inspection of both my app's log data and the output from the <code>glInfo</code> app, I realized why: the phone is reporting an incorrect DPI. Here's some of the output from glInfo:</p> <pre><cod...
android
[4]
1,710,315
1,710,316
How to get Ellipse2d boundary points in java?
<p>I am using Ellipse2d in java i want to get all its boundary points or pixels. I already have done that if a point lies into an ellipse using <code>.contains()</code> method but is there anyway to get its boundary pixels.</p>
java
[1]
1,039,645
1,039,646
Implement a Back Button on Navigation Bar in iPhone App
<p>Just recently took over a project from my developer. I'm a noob to coding, but can figure things out pretty well. I'm just trying to implement Back button on one of my screens. It already has the navigation Bar, but no back button, just the title. </p> <p>Is there a guide on how to get this implemented? Any help wo...
iphone
[8]
2,123,759
2,123,760
Does it make sense to define a static final variable in Java?
<p>Does this definition make sense ?</p> <pre><code>private static final String string = "Constant string"; </code></pre> <p>I'm a beginner and I don't understand the difference between final and static...</p>
java
[1]
5,411,131
5,411,132
How to insert tags with JavaScript?
<p>I would like to insert in an aspx page the following code:</p> <pre><code>&lt;/ul&gt; &lt;/li&gt; &lt;li class="xxx" style="width: 650px; float: left; list-style: none outside none;"&gt; &lt;ul class="yyy"&gt; </code></pre> <p>The problem is that, serverside, it raises a problem (sharepoint...)</p> <p>What I wo...
javascript
[3]
2,320,287
2,320,288
Disable mouse double click using class(es) with pure JavaScript
<p>I want to disable double click for some elements and the best way would be to use a special class for that. </p> <p>I found <a href="http://stackoverflow.com/questions/5241981/disable-mouse-double-click-using-javascript-or-jquery">this</a> simple and short jQuery solution that is exactly what I want, but I need pur...
javascript
[3]
5,711,485
5,711,486
Why does this compile on Ideone?
<p>Ok so I was messing around on <a href="http://ideone.com">Ideone</a> and accidentally submitted this piece of code, however to my surprise it actually compiled and ran outputting a value of 0, <a href="http://ideone.com/Lkbjo">here</a>.</p> <pre><code>#include &lt;iostream&gt; using namespace std; const int five(...
c++
[6]
4,443,180
4,443,181
What is the explanation for these bizarre JavaScript behaviours mentioned in the 'Wat' talk for CodeMash 2012?
<p>The <em><a href="https://www.destroyallsoftware.com/talks/wat">'Wat' talk for CodeMash 2012</a></em> basically points out a few bizarre quirks with Ruby and JavaScript.</p> <p>I have made a JSFiddle of the results at <a href="http://jsfiddle.net/fe479/1/">http://jsfiddle.net/fe479/1/</a>.</p> <p>The behaviours spe...
javascript
[3]
3,635,018
3,635,019
Is there a function like the magic method __call() for global scope in php?
<p>If a call is made to an undefined method in a class, the magic method __call can intercept the call, so I could handle the situation as I see fit: <a href="http://www.php.net/manual/en/language.oop5.overloading.php#language.oop5.overloading.methods" rel="nofollow">http://www.php.net/manual/en/language.oop5.overloadi...
php
[2]
5,739,473
5,739,474
plot data from a txt file
<p>hi i want to plot this from txt file to a graph</p> <pre><code>13/7/2009 12:50:50 147425826 0 4716298 36645030 3757926 228230 13/7/2009 13:5:1 147517368 0 4717954 36687455 3761270 228375 13/7/2009 13:10:0 147550312 0 4718599 36701448 3762634 228437 </code></pre> <p>the date will be the x axis and the othe...
python
[7]
3,272,941
3,272,942
Scanning duplicate file names
<p>Imagine several folders such as</p> <pre><code>d:\myfolder\abc d:\myfolder\ard d:\myfolder\kjes ... </code></pre> <p>And in each folder, there are files such as </p> <pre><code>0023.txt, 0025.txt, 9932.txt in d:\myfolder\abc 2763.txt, 1872.txt, 0023.txt, 7623.txt in d:\myfolder\ard 2763.txt, 2873.txt, 0023.txt i...
python
[7]
4,240,673
4,240,674
Easiest way to substitute characters in the string
<p>Suppose I have a main form named "<code>main_form</code>" and I have few more forms name like "<code>w_main_form</code>","<code>g_main_form</code>" etc etc which are based on "<code>main_form</code>" and they vary according to the '<code>category</code>'.</p> <p>Now is there any easy way to <em>generate</em> names ...
python
[7]
5,910,157
5,910,158
where to post C++ related article?
<p>I usually write lots of C++ stuff at home just for me. Now I wrote something which I would like to publish as an article/blog. COdeProject is nice but its more in the style "here is some nice tool ready to use". My article has a more wider scope (sure some of the code might be even of use :) ). Its about compiler pe...
c++
[6]
4,218,120
4,218,121
Object serialization and deserialization when class field changed
<p>I have a question about Object serialization and deserialization when class field changed.</p> <p>If an object with type MyClass</p> <pre><code>MyClass { String str1; LinkedList mylist = new LinkedList(); String str2; </code></pre> <p>}</p> <p>has been serialized to file.</p> <p>Then I changed the c...
java
[1]
223,075
223,076
how to repeat the animation in jquery
<p>i am playing with the animate of jquery here's what i have</p> <pre><code> $('p:first').animate({ 'paddingLeft':'+=300px','opacity':'-=1' },10000,'swing',function(){ $(this).fadeOut('fast',function(){ $('&lt;p&gt;test&lt;/p&gt;').insertBefore($('p#2nd')); }); }); </code></pre> <p>...
jquery
[5]
413,885
413,886
Get plain text from PDF file
<p>I know that there was a few questions about this topic.</p> <p>I need an framework / script / solution to <strong>get plain text from PDF file by php</strong>.</p> <p>Does exist a solution how to get plain text from PDF file?</p> <p>(And yes, I searched for this hours. This is the last chance).</p>
php
[2]
470,676
470,677
find the frequency of elements in a java array
<p>I have an int array:</p> <pre><code>{1,2,4,2,3,5,6,4,3} </code></pre> <p>How can I find frequencies of array elements like <code>1=1,2=2,3=2,4=4..</code>. I need a class which I can pass my array to and return an array which gives the count of array elements. ex:- <code>array{[0]=1,[1]=2,[2]=3,[3]=4..}</code> (for...
java
[1]
4,736,889
4,736,890
Want to optimize my android app performance
<p>I am developing an android app with an edittext which enables users to search songs. I want to incorporate an instant search in it. I mean I want the search results in my listview of my app to appear instantly as the user types in the edittext box in order of most visited songs . I am using a DB of songs containing ...
android
[4]
3,763,920
3,763,921
Customize Status/Action bar
<p>I'm in need of customizing the default status/action bar into my custom status/action bar, where I can list only display notification and hide settings up on pull down status bar need to hide default settings menu. In simple I override an default home screen into custom home screen hide recent app activity along wit...
android
[4]
3,917,535
3,917,536
Random number generation in c++ using GMP
<p>In java random number can get like</p> <pre><code>protected final static Random RANDOM = new Random(System.currentTimeMillis()); </code></pre> <p>In c++ using GMP Library how it possible to generate random number?</p> <p>I used code like</p> <pre><code> gmp_randstate_t s; unsigned long seed; seed = time(NULL...
c++
[6]
2,182,334
2,182,335
categorize uploaded files
<p>I have a webapplication for uploading and showing files(Image and video).The administrator can upload files and the users can view this files.Now i am inserting the details of file to the sqlserver and populating links for the corresponding file in the user's form.There may have images and videos.</p> <blockquote> ...
asp.net
[9]
5,896,043
5,896,044
determine height and width of dynamic html element by jquery
<p>suppose i have one js variable and my html data is stored into it like</p> <pre><code>var data = '&lt;div id="tst"&gt;here will be my othere html&lt;/div&gt;' </code></pre> <p>in this case can i determine that what would be height &amp; width of div tst using jquery?</p> <p>one guy give me solution like</p> <pre...
jquery
[5]
5,572,040
5,572,041
How do i replicate 10060 ( WSAETIMEDOUT ) error in c++ socket programming?
<p>In Socket programming, i am getting an error 10060 while sending data using <strong>WSASend</strong>, Can anyone help to replicate the error in code.This error occurs after 3 or more hours of continuous sending of data.</p>
c++
[6]
1,630,432
1,630,433
I'd like my private virtuals now, please
<p>What is the reasoning behind disallowing private virtual functions? </p> <p>Empty private virtuals would have enabled low friction pure customization points.</p> <p>Abstract functions have high friction and protected virtuals cause confusion and noise.</p> <p><strong>Some further explanation:</strong></p> <p>The...
c#
[0]
1,885,155
1,885,156
Prog error: for replacing spaces with "%20"
<p>below is the prog i am compiling for replacing spaces with "%20" but when I run it output window shows blank and a message "arrays5.exe has occurred a prob"</p> <pre><code>#include &lt;iostream&gt; #include&lt;cstring&gt; using namespace std; void method(char str[], int len) //replaces spaces with "...
c++
[6]
4,448,082
4,448,083
Android link in dialog
<p>How can I add a link to a dialog message?</p> <p>I tried the following code, but the link doesn't do anything on onclick:</p> <pre><code>builder.setMessage(Html.fromHtml( "Click on the " + "&lt;a href=\"http:\\www.google.com\"&gt;link&lt;/a&gt; " + "to download.")); </code></pre> <p>It didn't ...
android
[4]
501,566
501,567
Android Camera App-Intents
<p>I want to develop an Android app which Captures an image on click of button and then directs me to a page where I can write the name of image and have an option to save or discard it. I have made 2 classes one(Photo.java) for capturing image and other(Capture.java) for renaming and saving image. I don't know how to ...
android
[4]
2,399,785
2,399,786
Relationship between layout() and onLayout()
<p>I've a custom linearlayout which calls <code>layout()</code> on each child in its <code>onLayout()</code> function. My custom child (extended from <code>MapView</code>) receives in its <code>onLayout()</code> function completely different numbers than I passed in the layout function.</p> <p>What's the relation betw...
android
[4]
1,017,565
1,017,566
Implement onScrollChanged Event
<p>I have an <code>AbsoluteLayout</code> xml:</p> <pre><code>&lt;AbsoluteLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/MeasureAbsLayout" android:layout_width="fill_parent" android:layout_height="fill_parent"&gt; &lt;ImageView android:id="@+id/MeasureImageView" ...
android
[4]
946,089
946,090
What is special about android:inputType="textPersonName" for EditText
<p>I tried</p> <pre><code> &lt;EditText android:id="@+id/editText1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:ems="10" android:inputType="textPersonName" &gt; </code></pre> <p>I realize it can accept any characte...
android
[4]
1,035,031
1,035,032
LNK 2019 C++ Error
<p>I have a NewTree class that's been defined in NewTree.h. When I make a new instance of NewTree in my main method, it throws an LNK 2019 error.</p> <p>NewTree.h:</p> <pre><code>template &lt;class T&gt; class NewTree { public: treeNode&lt;T&gt; *current; treeNode&lt;T&gt; *root; NewTree(); ~NewTree(); bool insert(...
c++
[6]
5,089,398
5,089,399
Accessing the associated string of a stringstream object
<p>I am trying to access the associated string of a stringstream object and keep iterators to it, but am not able to know whether this would be safe. Here is the code :</p> <pre><code> stringstream HTMLss; // string stream of HTML document // ... (load up HTMLss with HTML) const string &amp; HTMLstr = HTMLss...
c++
[6]
4,783,293
4,783,294
Adding my first view to a window based application
<p>I'm beginner with iPhone and want to know how to add a view in a window based application.</p> <p>I crate the application, then I added the ViewControler+XIB to my project. I include the .h file in both AppDelegate-Files.</p> <p>Then I create a object of the View "StartViewController" with</p> <pre><code>StartVie...
iphone
[8]
224,065
224,066
PHP && switch and case statement
<p>I'm not to keen on PHP and as such don't spend much time learning the Syntax, I was just wondering if this switch and case operator would be grammatically correct, speaking in PHP terms.</p> <pre><code>case "msg" &amp;&amp; "username": /* enter the functions here */ break; </code></pre>
php
[2]
5,796,781
5,796,782
php string replace/insert
<pre><code>$example="this is an example of [link](http://webpage.com)" </code></pre> <p>this is an example of <a href="http://webpage.com" rel="nofollow">link</a></p> <p>how to do make this happen using php functions?</p> <p>many thanks</p>
php
[2]
4,254,239
4,254,240
Dropdownlist Error
<p>In .net win form application. I load dropdownlist like this.</p> <pre><code> private void loadChannelCombo() { string sql = "select channelID,channelName from rechannel where isActive=1 order by channelName"; DataTable dt = DBHandler.GetData(sql); ddlChannel.DataSource = ...
c#
[0]
676,584
676,585
Initializing collections that contain nested collections
<p>How do I initialize a collection of 'Quote' objects based on the class shown below where 'Quote' would contain a collection of at least 5 'Rate' objects.</p> <pre><code> List&lt;Quote&gt; quotes = new List&lt;Quote&gt; {new Quote { Id = 1, (need 5 Rate objects in here) } } public class Quote { public int Id...
c#
[0]
404,452
404,453
datetime comparison
<p>The following code must be wrong (the relevant date time rows in the mysql table are 0000-00-00 00:00:00) as the if statement is not being read as true. Just wondered if i am making a blatant error?</p> <p>Never done a datetime like this before:</p> <pre><code>if($datetimecheck != "0000-00-00 00:00:00"); { //do ...
php
[2]
137,472
137,473
MFMailComposeViewController adds null Content-Id
<p>This is my first post to the group so please be kind :)</p> <p>I am sending a couple of audio attachments from my app as follows:</p> <pre><code> MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init]; picker.mailComposeDelegate = self; picker.modalPresentationStyle = UIModalPresentatio...
iphone
[8]
696,232
696,233
jquery maphilight plugin - disable an area and prevent click
<p>I'm making a clickable map of post (zip) codes and want certain <code>&lt;area&gt;</code>s to be disabled for certain reasons. I need those particular areas to be, by default, filled with a certain colour (to indicate that they are disabled) and for the click on those areas to do nothing. The other areas will behave...
jquery
[5]
2,537,117
2,537,118
javascript create url from form elements handling checkboxes
<p>So I had been using this generic code to create a URL from the form elements</p> <pre><code>function submiturl() { url="Search.do?call=JS"; var elem = document.getElementById('searchInput').elements; for(var i = 0; i &lt; elem.length; i++) { url = url + "&amp;" + escape(elem[i].name) + "=" + es...
javascript
[3]
148,173
148,174
How is it that if statements check types?
<p>I come from a C# background and need to become more familiar with JS. I'm reading a book and in this example:</p> <pre><code>var as = document.getElementsByTagName('a'); for(var i=0;i&lt;as.length;i++){ t=as[i].className; //Check if a link has a class and if the class is the right one if(t &amp;&amp; t...
javascript
[3]
280,601
280,602
jQuery watermark StackOverflow like?
<p>I'm trying to implement something like StackOverflow's watermark functionality.</p> <p>I'm using <a href="http://code.google.com/p/jquery-watermark/" rel="nofollow">jquery-watermark</a> for this. The problem I'm having is namely that the watermark text disappears as the input element gains focus, which doesn't happ...
javascript
[3]