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
2,878,541
2,878,542
How do I get a date in UK local time using PHP?
<p>I'm using the <strong>unix timestamp</strong> to show when a message was posted in my project but when I came to displaying the exact time of the post I realized it was about 12 hours behind.</p> <p>I'm in the UK and my server is in the US (might be the problem).</p> <p>Is there a simple way of converting the unix timestamp into a readable British time?</p> <pre><code>$timestamp = time(); print date("F jS, Y", strtotime($timestamp)); </code></pre> <p>Any help would be great, Thanks!</p>
php
[2]
3,423,379
3,423,380
Does Response.Redirect() kill page functionality?
<p>I've got a simple question. If I'm using a Response.Redirect(), will that kill all page functionality assuming the user cancels the redirect?</p> <p>For example, pretend I have a page with a button that, when pressed, pops up a message that says "hi". Then, at some point in the code, the user encounters a Response.Redirect(). Before the page is cleared on the browser, they hit STOP in their browser. Then, they click the button. Will it still say "hi", or will the page be non-functional?</p> <p>EDIT FOR MORE INFORMATION: Maybe I am just not understanding the answers, but I still don't have an answer to my question. Let me rephrase to be more precise.</p> <p>I have two buttons that both execute a C# function when they are clicked. One of them executes a Response.Redirect() to a different page. The other prints out "Hi" in a message box. The user presses button 1. The response.redirect starts processing, but before the user is redirected they decided that they made a mistake and they hit the STOP button in their browser. The user is still looking at the same web page. They click on button #2. My question is, does the message "Hi" pop up? Does the C# function still work? Or would the code behind be inaccessible after the <em>attempted</em> redirect?</p>
asp.net
[9]
1,720,390
1,720,391
what's the meaning of "|=" in PHP
<p>I'm reading other's php code, and there's one line writes:</p> <pre><code> if ($isprivate) { $status |= STATUS_PRIVATE; } </code></pre> <p>I have no idea what does "|=" mean? Can anyone help on it?</p>
php
[2]
5,010,312
5,010,313
Checking if variable is Long or Double
<p>Is there any way to check if the varible is Double or Long before doing anything with it? Sometimes the Objects are Double and some they are Long. How can I check it before using it?</p>
java
[1]
5,898,348
5,898,349
htaccess.. SE freindly URLs
<p>Ok, I have read the other questions, and have tried the options provided, but none seem to work for me. so, here we go this is what I currently have</p> <p><a href="http://www.desmoinesdrinks.com/?view=ads&amp;catid=2&amp;subcatid=6&amp;cityid=1&amp;lang=en" rel="nofollow">http://www.desmoinesdrinks.com/?view=ads&amp;catid=2&amp;subcatid=6&amp;cityid=1&amp;lang=en</a></p> <p>and this is what I want</p> <p><a href="http://www.desmoinesdrinks.com/1/posts/2_Clive/6_Down_Under/" rel="nofollow">http://www.desmoinesdrinks.com/1/posts/2_Clive/6_Down_Under/</a></p> <p>my htaccess file is pretty big, but I can post it up if anyone wants to see it.</p>
php
[2]
3,123,253
3,123,254
AutoCompleteTextView hide and show dropdown on adapter change
<p>I have an AutoCompleteTextView that gets suggestion from an API with an AsyncTask. in onPostExecute i create a new adapter, set it to the AutoCompleteTextView and notify data set change to the adapter.</p> <p>in a TextWatcher I execute the AsyncTask.</p> <p>everything is working fine except that the dropdown is dismissed and shown every time the adapter is changed.</p> <p>how can I keep the dropdown open even while the data is changing ?</p> <pre><code>searchText.addTextChangedListener(new TextWatcher() { @Override public void onTextChanged(CharSequence s, int start, int before, int count) { // TODO Auto-generated method stub } @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { // TODO Auto-generated method stub } @Override public void afterTextChanged(Editable s) { if (s.length() &gt; 0) { searchPlacesTask.cancel(true); searchPlacesTask = new SearchPlacesTask(); searchPlacesTask.execute(s.toString().replace(" ", "-")); } else { searchPlacesTask.cancel(true); searchPlacesTask = new SearchPlacesTask(); searchPlacesTask.execute(); } } }); private class SearchPlacesTask extends AsyncTask&lt;String, Void, PlacesAPIResult&gt; { @Override protected PlacesAPIResult doInBackground(String... params) { PlacesAPIResult result = new PlacesAPIResult(); if (params.length &gt; 0) { places = PlacesAPIRestMethod.placeAutocomplete(params[0], currentLocation.getLatitude(), currentLocation.getLongitude(), 500, null, result); } else { places = PlacesAPIRestMethod.placeSearch(currentLocation.getLatitude(), currentLocation.getLongitude(), 0, true, result); } return result; } @Override protected void onPostExecute(PlacesAPIResult result) { if (result.getResult() == PlacesAPIResult.OK) { adapter = new PlaceAdapter(ChooseLocationActivity.this, R.layout.locationrow, places); searchText.setAdapter(adapter); adapter.notifyDataSetChanged(); } } } </code></pre>
android
[4]
2,894,808
2,894,809
How to save an instance of a custom class in onSaveInstanceState?
<p>I created an instance of a custom class RestaurantList to hold my data (a list of restaurant data received from a web service as json data).</p> <p>How can I save it in <code>onSaveInstanceState</code>?</p>
android
[4]
5,057,504
5,057,505
handling with sever side control button
<p>hi all i want to know that if in my login.aspx page there is two button <code>login</code> and <code>cancel</code></p> <p>now i press enter key of my keybord by default its select cancel button but i want to set it on login how i will do ?</p>
asp.net
[9]
3,179,812
3,179,813
How can I keep current screen (contentView) when l Iaunch a new Activity
<p>I have an NoContentViewActivity which has no Content View (i.e. I did not call setContentView() in the onCreate of my Activity). My question is how can I keep the content view of the launching activity on the screen? Right now, I am getting a blank screen whenever I launch NoContentViewActivity? I want the content view of the launching activity (the activity which start the NoContentViewActivity) to show on the screen.</p> <p>Thank you for any help.</p>
android
[4]
4,918,175
4,918,176
php find line number for a particular keyword
<p>say I have a paragraph of text, with some new lines/line breaks. I would like to find the occurance of a certain keyword, and return the line numbers of those keywords. How do I do that? Thanks!</p>
php
[2]
4,813,642
4,813,643
Difference between a custom AlertDialog and a custom Dialog
<p>I am wondering what is the difference of having a custom Dialog as opposed to a custom AlertDialog is? Is it the fact that they offer free functionality in the form of buttons, lists, checkboxes etc in the dialog?</p> <p>Secondly, I was wondering if the code fragment for custom AlertDialog available @ <a href="http://developer.android.com/guide/topics/ui/dialogs.html" rel="nofollow">http://developer.android.com/guide/topics/ui/dialogs.html</a> (code reproduced below) is complete. I tried using it and it crashes the moment I call dialog.show():</p> <pre><code>AlertDialog.Builder builder; AlertDialog alertDialog; Context mContext = getApplicationContext(); LayoutInflater inflater = (LayoutInflater) mContext.getSystemService( LAYOUT_INFLATER_SERVICE); View layout = inflater.inflate(R.layout.custom_dialog, (ViewGroup) findViewById(R.id.layout_root)); TextView text = (TextView) layout.findViewById(R.id.text); text.setText("Hello, this is a custom dialog!"); ImageView image = (ImageView) layout.findViewById(R.id.image); image.setImageResource(R.drawable.android); builder = new AlertDialog.Builder(mContext); builder.setView(layout); alertDialog = builder.create(); </code></pre> <p>While code for creating a custom dialog (which works) is much simpler:</p> <pre><code>Dialog dialog = new Dialog(MyActivity.this); dialog.setContentView(R.layout.dialog_custom); dialog.setTitle("Shopping List Name"); dialog.setCancelable(true); dialog.show(); </code></pre> <p>Thanks for you patience.</p> <p>M@nish</p> <p>Edit: I got it to work finally. I think I now understand the difference between Dialog and AlertDialog. I've documented this @ <a href="http://geekjamboree.wordpress.com/2011/11/19/dialog-vs-alertdialog/" rel="nofollow">http://geekjamboree.wordpress.com/2011/11/19/dialog-vs-alertdialog/</a></p>
android
[4]
537,744
537,745
using prepend and remove
<p>I am using <code>.prepend()</code> and <code>.remove()</code> to show menu items in the order a user clicks them.</p> <pre><code>$(document).ready(function() { $('#item1').click(function() { $('#item1_content').remove(); $('.menu_item_content').prepend('&lt;div id="item1_content"&gt;The Box For Menu Item One&lt;/div&gt;'); }); $('#item2').click(function() { $('#item2_content').remove(); $('.menu_item_content').prepend('&lt;div id="item2_content"&gt;The Box For Menu Item Two&lt;/div&gt;'); }); }); </code></pre> <p>I use <code>.remove()</code> to remove the item if it already exists and the <code>.prepend()</code> to put it at the top of the container <code>div</code> </p> <p>In this way the user can show as many or as few of the menu items as they want at once and in the order they click them but duplicates should not appear.</p> <p>For example. The user could click MenuItem3 then MenuItem1 Then MenuItem2 and the items would display below:</p> <p>Item2 Item1 Item3</p> <p>The first half of my script works #item1 but #item2 does not, it just keeps making duplicates.</p> <p>Also if I do #item1 then #item2 then #item1 again I get a duplicate.</p> <p>What am I doing wrong here? Is there a better way to do this?</p>
jquery
[5]
1,658,434
1,658,435
How can I use reversed tethering on apps and/or to log onto my Google account?
<p>There's no Wifi and I do not have my micro-SIM card yet, so I don't see any other way than using reversed tethering.</p> <p>My Nexus 4 is rooted and I used <a href="http://www.howtogeek.com/117118/how-to-connect-your-android-to-your-pcs-internet-connection-over-usb/">this guide</a> to setup the reversed tethering. It works for surfing, but not for logging onto my google account. If I try to log onto my Google account, it just opens up the wifi-panel.</p>
android
[4]
2,766,745
2,766,746
Formating columns in C++
<p>I have the following program that generates a multiplication table. A formating problem arises when the outputs reach the double digits. How do I straighten out the columns? </p> <pre><code>#include &lt;iostream&gt; using namespace std ; int main() { while (1 != 2) { int column, row, c, r, co, ro; cout &lt;&lt; endl ; cout &lt;&lt; "Enter the number of columns: " ; cin &gt;&gt; column ; cout &lt;&lt; endl ; cout &lt;&lt; "Enter the number of rows: " ; cin &gt;&gt; row ; cout &lt;&lt; endl ; int temp[column] ; c = 1 ; r = 1 ; for(ro = 1; ro &lt; row ; ro ++ ){ for(co = 1; co &lt; column ; co ++ ){ c = c ++ ; r = r ++ ; temp [c]= co * ro; cout &lt;&lt; temp[c] &lt;&lt; " "; } cout &lt;&lt; endl ; } system("pause"); } } </code></pre>
c++
[6]
3,135,187
3,135,188
Price Calculator using Javascript
<p>Im trying to recreate this page <a href="http://psdtowp.com/order-now" rel="nofollow">http://psdtowp.com/order-now</a> but for another purpose, Im very new to JS so what I was going to do was have a list of variables with undefined values, I then wanted to have my input fields which onkeyup would populate the variables with a value, would this be possible? </p> <p>My code at the moment is...</p> <pre><code>///////////////////////////////////////////////////////////////////// // Variables // Content/SLA var ContentMinutes = ''; var ContentMinutesSelector; // Switch Case var ServiceLevel = ''; var NoOfFrames = ''; // Render Time (Hairier the Better) var AvgFrameRenderTime = ''; var AvgFrameRenderTimeSelector; // Switch Case var CoresInTest = ''; // Cost Estimate var CostEstimate = ''; // Other var EstimatedCoreHours = ''; ///////////////////////////////////////////////////////////////////// // Functions function CalculateEstimate() { var EstimatedTotal = EstimatedCoreHours * ServiceLevel; document.getElementById("PriceEstimate").innerHTML=EstimatedTotal.toFixed(2); } </code></pre> <p>I have the onkeyup Calculate in my source only this JS isn't working...</p> <pre><code>///////////////////////////////////////////////////////////////////// // Variables // Content/SLA var ContentMinutes = ''; var ContentMinutesSelector; // Switch Case var ServiceLevel = 5; var NoOfFrames = ''; // Render Time (Hairier the Better) var AvgFrameRenderTime = ''; var AvgFrameRenderTimeSelector; // Switch Case var CoresInTest = ''; // Cost Estimate var CostEstimate = ServiceLevel * EstimatedCoreHours; // Other var EstimatedCoreHours = 10; ///////////////////////////////////////////////////////////////////// // Functions function CalculateEstimate() { document.getElementById("PriceEstimate").innerHTML=CostEstimate.toFixed(2); } </code></pre> <p>Is now returning NaN</p> <p>NVM, it seems my variables need to be set before the multiplication, I didnt realise JS read it line by line...</p>
javascript
[3]
92,934
92,935
Transparent images looks ugly in devices less than Android 2.3
<p>I've problem in showing transparent images in devices running less than Android 2.3. In 2.3 it looks good, but in 2.2 or 2.1 it is looking dark / shadowy. Any comments.. Thanks in advance.</p>
android
[4]
2,701,549
2,701,550
getting 24 hours difference in android
<p>I want to call an activity which downloads the data if the data has not been downloaded in last 24 hours.But I have no idea how to do this.Can some one help me out?</p>
android
[4]
5,843,073
5,843,074
show notification from google chat activity only when activity is in background
<p>This is a Google Chat application. When I get a message from Google Chat I want to show it in the status bar as a notification when the activity is in background.</p> <p>I tried setting boolean values in the <code>onPause()</code> method but it did not work.</p> <pre><code>public void addMessage(String chatid, String msg) { // I want to the execute this line only when the activity is in background notify.getCurrentActivity(getApplicationContext(), msg, fromName, chatid); } public void getCurrentActivity(Context context, String msg){ showNotification(context, msg, fromName, fromChatID); } </code></pre>
android
[4]
2,668,349
2,668,350
Problem in Pairing the Android device with other Device through Bluetooth
<p>I have a problem in pairing the android Device (Desire) with any other Device (e.g Nokia) through Bluetooth, and i am using the Application the (Bluetooth-Chat) provided in the samples of the SDK 2.2, the behavior of the Application is that it shows all the devices having bluetooth switched on, and also paired it but only android devices, so how can i connect the android device with any other device (e.g Nokia), what are the limitations, what needs to be change in the Code, i tried to debug the Code and find out where the problem exists but i do not found any reason. So kindly help me in this regard, i will be very thankful to you. </p>
android
[4]
3,055,880
3,055,881
Reachability method (startnotifier) is not calling
<p>Here is my reference code. I have put break point in startnotifier method but it is not being called.</p> <pre><code>[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(reachabilityChanged:) name: kReachabilityChangedNotification object: nil]; internetReach = [[Reachability reachabilityForInternetConnection] retain]; [internetReach startNotifier]; </code></pre> <p>I have written this part of code in appdelegate.m (didFinishLaunchingWithOptions).</p> <p>I have declared var in appdelegate.h like below....</p> <pre><code> @interface AppDelegate : UIResponder &lt; UIApplicationDelegate &gt; { Reachability *internetReach; Reachability *wifiReach; Reachability *hostReach; } </code></pre> <p>Why breakpoint in startnotifier is not being called and hence nsnotification is not calling observer function if I change the network.</p>
iphone
[8]
5,214,963
5,214,964
json index of property value
<p>I need to get the index of the json object in an array whose by the objects id </p> <p>here is the example code </p> <pre><code>var list = [ { _id: '4dd822c5e8a6c42aa70000ad', metadata: { album: 'American IV: Man Comes Around', song: 'Hurt', coverart: 'http://images.mndigital.com/albums/044/585/435/m.jpeg', artist: 'Johnny Cash', length: 216, mnid: '44585439' } }, { _id: '4dd80b16e8a6c428a900007d', metadata: { album: 'OK Computer (Collector\'s Edition)', song: 'Paranoid Android', coverart: 'http://images.mndigital.com/albums/026/832/735/m.jpeg', artist: 'Radiohead', length: 383, mnid: '26832739' } }, { _id: '4dd68694e8a6c42c80000479', metadata: { album: 'The Presidents Of The United States Of America: Ten Year Super Bonus Special Anniversary Edition', song: 'Lump', coverart: 'http://images.mndigital.com/albums/011/698/433/m.jpeg', artist: 'The Presidents Of The United States Of America', length: 134, mnid: '11698479' } } ] </code></pre> <p>then pseudo code</p> <pre><code> var index_of = list.inedexOf("4dd80b16e8a6c428a900007d"); </code></pre> <p>obviously that is not gonna work but I wonder if there is anyway to do this without looping to find the index ?</p>
javascript
[3]
1,970,673
1,970,674
replacing #define with static const with python
<p>I am a python newbie and would like help with the following task:</p> <p>Given a h/cpp file i would like to replace each #define line with static const. Of course the type of the variable should be correct (lets say only int or string).</p> <p>How can i do that?</p>
python
[7]
1,652,762
1,652,763
How to filter MotionEvent.getAction() on API level 3 (no ACTION_MASK present)
<p>Im writing an <code>OnTouchListener</code>. I found out that I can check for the ActionType by using bit-operations like</p> <pre class="lang-java prettyprint-override"><code>if ((event.getAction() &amp; MotionEvent.ACTION_MASK) == MotionEvent.ACTION_MOVE) </code></pre> <p>however <code>MotionEvent.ACTION_MASK</code> is not present in Android 1.5 (API level 3) How is/was it done there?</p>
android
[4]
5,203,270
5,203,271
Windows Form Application in C# Closes Immediately
<p>I just started programming with C# and I'm trying to get my windows form application to function properly. However, whenever I run it, it just opens up and closes immediately. Whenever I type similar code into Java, there's no problem with the GUI. Did I miss something small here? </p> <pre><code>using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace WindowsFormsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { Form1_FormClosing(); } private void Form1_FormClosing() { const string message = "There's an updated version of this program available. Would you like to download now?"; const string caption = "Please update"; var result = MessageBox.Show(message, caption, MessageBoxButtons.YesNo, MessageBoxIcon.Question); // If the no button was pressed ... if (result == DialogResult.No) { MessageBox.Show("Program will close now. If you want to use this program please update to the newest version.", "Please update"); this.Close(); } else if (result == DialogResult.Yes) { System.Diagnostics.Process.Start("http://www.google.com"); this.Close(); } } } } </code></pre>
c#
[0]
2,714,263
2,714,264
ImageView and draw image in precision coordinates
<p>I have a problem with drawing image. How I can draw image in precision coorinates. I want to draw image in place where I touch the screen. How I can do this? I implement onTouch method where i get coordinates, but I don;t know how I can draw image in this place.</p>
android
[4]
795,219
795,220
Unable to delete checked item in android
<p>I have one table names student, where ismarried one of the column. Where i have already did married or not, there are populated first all student, Then i try to marked married student only which has 5 of 25, which has listed Just Like this</p> <pre><code>String[] fields = new String[] { "substr(name,1,23)", "substr(address,1,35)" }; int[] views = new int[] { R.id.name, R.id.address, }; cursor = SQDatabase .rawQuery( "SELECT _id, substr(name,1,23),substr(address,1,35) FROM student WHERE ismarried=" + 1, null); adapter = new SimpleCursorAdapter(this, R.layout.student_list_item, cursor, fields, views); jokesList.setAdapter(adapter); </code></pre> <p><strong>Note:</strong> Here 1 is the married value where is 0 is unmarried. so only 5 student display .</p> <p>Now, My question , i have checked 3 among 5,and want to delete that 3 student from list not a database. How to get checked item id , i did not understand,</p> <p>"I culdnot get t that checked item id but this fired</p> <pre><code>//DBHelper.java public void removeMarried(int i) { myDataBase = this.getWritableDatabase(); String Query = "UPDATE student SET ismarried=0 WHERE _id = " + i; myDataBase.execSQL(Query); } </code></pre> <p>and checked listener</p> <pre><code>public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { if (buttonView.isChecked()) { Log.d(TAG, "Checked item "); } else { Log.d(TAG, "UnChecked item "); } } </code></pre> <p>And Finally on delete click</p> <pre><code>removeMarried(1); </code></pre> <p>Full Code : <a href="http://pastebin.com/Wc5XWvJG" rel="nofollow">http://pastebin.com/Wc5XWvJG</a></p> <p>Please give me suggestion.</p>
android
[4]
1,690,865
1,690,866
Issues in custom table view in iPhone
<p>I am implementing my custom table view controller. The issue I am facing is that when i select a particular cell in my table, the color of the cell does not changes and after i return back to this page, it does not show the selection user made earlier. Aslo, my scrollbar is not getting flashed for the first time. Any clue what is missing in my code?</p>
iphone
[8]
4,206,523
4,206,524
preg_match help
<p>I was just helped in <a href="http://stackoverflow.com/questions/3692580/how-can-i-use-regex-to-solve-this">another thread</a> with a regex that has been verified to work. I can see it actually working on Rubular but when I plug the regex into preg_match, I get absolutely nothing.</p> <p>Here is the regex with my preg_match function:</p> <pre><code> preg_match('/^!!([0-9]{5}) +.*? +[MF] ([0-9]{3})([0-9]{3})([A-Z]{3})([A-Z]{3}) + ([A-Z])[0-9]{3}([0-9]{4})([0-9]{2})([0-9]{2})/', $res, $matches); </code></pre> <p>All I am getting is an empty array returned. Can someone please help?</p>
php
[2]
1,637,880
1,637,881
how to handle http requests from a browser using c#
<p>Hello Everybody I have a windows application developed in c#.Net which is used as a website blocker for a network.I have done this by modifying the hosts file.It works fine when urls are blocked like "www.yahoo.com".Now my requirement is I have to block the urls based on the keywords.i.e when the user just types "yahoo" in the browser,I should verify the keyword and block a corresponding website.Now how can I track the website typed by the user in the browser and block or allow the user to particular site based on the url.I should not allow the user to view the page if the keyword is present.How to do this?Can some one help me to do this?</p> <p>Thanks &amp; Regards Chaithu</p>
c#
[0]
2,613,518
2,613,519
Communication problem in master page and content page
<p>I'm having a master page in my website and having some control on master page. I want to handle the master page controls event on content page.</p> <p>how can i do that ...?</p> <p>even i have used property like this for a dropdown control</p> <pre><code>public DropDownList propertymastercontrol { get { return cmbVendor; //drop down id } } </code></pre> <p>and given the reference of master page on content page like this...</p> <pre><code>&lt;%@ MasterType VirtualPath ="~/MasterPage.master" %&gt; </code></pre> <p>still after not able to get the any event of control on content page_load event..</p> <pre><code>protected void Page_Load(object sender, EventArgs e) { Master. } </code></pre> <p>what can be the problem..?</p>
asp.net
[9]
3,307,424
3,307,425
Get the output of a console program in my WinForms application (Specifically the output of C# complier - CSC.EXE)
<p>I decided to do something really simple -</p> <p>A WinForms application with a text box for C# code and a button. When the button is clicked, I save the content of the text box to a temp .cs file, invoke the csc.exe (Process.Start()) with the file name as parameter so that it is compiled. This is assuming I set the PATH variables and everything.</p> <p>When the csc.exe outputs syntax errors and stuff, how can I get it back and show it in another text box in my app?</p> <p><strong>NOTE</strong> My aim is not to just "complie C# code from within my app (in whichever way possible)".. it is to get the output of csc.exe</p>
c#
[0]
3,268,454
3,268,455
Configure path for win and linux
<p>A standalone application for windows and linux environment</p> <p>While i use the windows environment the file system will be like c:\file\abc\xyz\sample.txt In linux environment the file system will be /home/qa/file/abc/xyz/sample.txt</p> <p>abc and xyz are the name of the folders that depends on the user click. (abc is the country code folder) &amp; (xyz is language folders)</p> <p>To construct the path i use properties like </p> <p>base_path : /home/test/file/ or c:\test\file\ file_name : sample.txt</p> <p>in the program the construction of the path is :</p> <p>String path = base_path+country_code+"/"+language_name+"/"+file_name ("/" for Linux)<br> String path = base_path+country_code+"\"+language_name+"\"+file_name ( "\" for windows)</p> <p>Example for Linux: </p> <p>/home/test/file/spain/es/sample.txt</p> <p>Example for Windows:</p> <p>c:\test\file\Italy\it\sample.txt</p> <p>country_code and language_name will differ for each user click.</p> <p>Every time while i test the application with different environment im changing the file separator to "/" or "\" (windows and linux). How do i do the code without changing the file separator every time.</p> <p>(If I missed anything, tell me i will update the same) Thank u.</p>
java
[1]
2,622,431
2,622,432
If PHP's mt_rand() uses a faster algorithm than rand(), why not just change rand() to use the newer implementation?
<p>The purpose of a random number function is to get -- you guessed it -- a random number, something you cannot predict (or be very hard to predict with certainty). If the <code>mt_rand()</code> function is faster and less predictable (more "random") than the old <code>rand()</code>, why not just switch the underlying implementation to the new method? </p> <p>To put it another way, what kind of program that uses <code>rand()</code> would break in a later version of PHP if/because the underlying implementation changed?</p>
php
[2]
602,702
602,703
how do I generate unique ids for different component created at runtime as R.java create unique for all calsses
<p>I have to impliment the same logic to generate unique ids in my project for different component created at runtime as R.java does. Some one can help me</p>
android
[4]
786,760
786,761
Way to tell if a section of the page is visible to the user?
<p>So I have a JS function that displays a widget at the bottom of the page. The JS function makes a call to the server to get information to display but I have a theory that most of the people on certain pages never scroll down to even see the widget so i don't want to waste the bandwidth and cycles to render it if it's not going to be seen. Is there a way I can load it when it comes into view? As in, if the user scrolls down to Y then the JS function loads up?</p>
javascript
[3]
472,912
472,913
Get the Selected value from the Drop down box in PHP
<p>I am populating a Drop Down Box using the following code.</p> <pre><code>&lt;select id="select_catalog"&gt; &lt;?php $array_all_catalogs = $db-&gt;get_all_catalogs(); foreach($array_all_catalogs as $array_catalog){?&gt; &lt;option value="&lt;?= $array_catalog['catalog_key'] ?&gt;"&gt;&lt;?= array_catalog['catalog_name'] ?&gt;&lt;/option&gt; </code></pre> <p>Now how can I get the selected option value using PHP (I have the code to get the selected item using javascript and jquery) because I want the selected value to perform a query in database.</p> <p>Any help will be much appreciated. Thank you very much... </p>
php
[2]
2,154,364
2,154,365
Why does hashCode() return zero before items are added to HashMap?
<pre><code>Map map = new HashMap(); System.out.println("hashCode:"+map.hashCode()); //hashcode==0 why? map.put("test","test"); System.out.println("hashCode:"+map.hashCode()); //hashcode be okay here </code></pre> <p>How can I get hashCode after <code>Map map = new HashMap();</code> ? (like: <code>new Object().hashCode()</code>)</p>
java
[1]
2,261,655
2,261,656
Is it bad to run a thread for longer period (+30mins) in Android?
<p>I'm running a thread from a service where i'm listening for changers in the acceleronometer every 3 seconds. So i run the listener in a while loop with Thread.sleep(3000). But it tends to work with shorter duration. But in longer run it seems to get crash the whole application. </p> <p>Any suggestions?</p>
android
[4]
2,135,537
2,135,538
PHP developer looking for 2nd language (I want out of web development)
<p>I've been working with PHP for over a year now, and although I've learnt and worked with a lot of cool things I'm grateful for (OOP, working with a framework, learning some design patterns, theming and developing for Drupal/WP),...I've already made up my mind and I know I don't want to do web development forever. I really enjoy the programming, but I don't like having to deal with some "web-dev-related" things forever. I'm a freelancer, so 95% the jobs I get are websites. Designing websites and making them <em>pretty</em> is cool and rewarding... but the type of client that asks you for a website... well, let's just say they usually make me mad, I guess it would be easier if I just worked for a company, but since I'm currently traveling a lot, I actually <strong>need</strong> to be able to freelance. </p> <p>I tried learning C for a while, just as a hobbie, and I did enjoy my experience with it, but back then...didn't have the time to learn it (and I'm definitely going to go back to it when I'm actually settled somewhere)... So, what do you guys think? With my kind of background, and considering what I want and need at the moment is learning a language that's not gonna tie me to web development,...where should I start looking (python looks like a lot of fun, and I've played with it in the past, but languages like JAVA and Objective-C seem to be in higher demand)?</p>
php
[2]
821,758
821,759
Reading digit values from excel sheet
<p>In my excel sheet i have one column contain digits. Like: </p> <pre><code> 500 10,973.14 12,456.23 </code></pre> <p>when i read i got values like: </p> <p>500</p> <p>10,973.141</p> <p>12,456.2345</p> <p>Let me know how to read values what ever appearing in excel sheet.</p> <p>Output :</p> <p>500</p> <p>10,973.14</p> <p>12,456.23</p> <p>i used oledbconnect. code like ;`</p> <pre><code> for (i = 0; i &lt; accountcopytab.Rows.Count-2; i++) { currentRow = accountcopytab.Rows[i]; if (currentRow["Credit"].ToString().Length &gt; 0) { Creditvalue = Convert.ToDecimal(currentRow["Credit"]); ------------- --------------`` } } </code></pre>
c#
[0]
2,408,597
2,408,598
How to Make Android application not compatible with tablets?
<p>I am going to make a tablet specific version of my app and I want to stop my phone app being compatible with tablets.</p> <p>I have tried making my application with maxSdkVersion 10 and I have also tried support screens xlarge false etc...</p> <p>Could someone tell me how to make my application incompatible with tablets?</p>
android
[4]
5,395,033
5,395,034
Java EE versus Java SE for web application development
<p>What has me going is the degree of web application development we are talking about.</p> <p>There are different levels of web application development. For example, if I was asked to develop a web application to deal with housing customer information for a small mom and pop bakery (definitely not a enterprise situation), is there anything wrong with using Java EE as opposed to Java SE if I really want to.</p> <p>I know you might say that it would be overkill, and I can understand that, however, am I going to run into development issues that I would not run into using Java SE? In other words, I am trying to determine when does a small business web application turn into a enterprise web application. It seems to me that I should be able to use Java model that I want.</p> <p>Am I wrong in my thinking here?</p> <p>Need clarification here if you can help me.</p>
java
[1]
4,566,912
4,566,913
Programmatic way to collect comments for Android App
<p>I released and Android app, and I want to be able to collect comments in some sort of programmatic fashon. I've looked around the the web and can't seem to find any Google API or any 3rd party service. Does anyone have any suggestions or know something I don't?</p> <p>I was thinking about writing some sort of HTML scraper to just extract them from the developer console, but I wanted to get some feedback before I start that little adventure.</p> <p>Thanks</p>
android
[4]
5,842,180
5,842,181
tabBarController + changing orientation problem
<p>I have a TabBarController with 4 views, and one of them is a scrollView. If i load this view, and then change the orientation of my device from portrait to landscape, the scrollview responds to the touches only 'till the pixel 320.</p> <p>If later i go to another view, and then come back to the first, the scroll view works well even in landscape.</p> <p>How can i adjust this? </p>
iphone
[8]
2,189,378
2,189,379
static members behavior in java
<p>I am confused with be below behaviour in Java, I know that static inheritance is not possible Java then how I am able to call on B class static members of A?</p> <pre><code>public class A { static int staticVariable = 5; public static void staticMethod(){ System.out.println("A"); } } public class B extends A{} public class C { public static void main(String[] args) { A.staticMethod(); B.staticMethod(); System.out.printf("A's int value %d and B's int value is %d",A.staticVariable,B.staticVariable); } } </code></pre> <p>output:</p> <pre><code>A A A's int value 5 and B's int value is 5 </code></pre>
java
[1]
551,799
551,800
set rounding off for Double
<p>How to set rounding off with 1.5 , but I know we can do this using 1.6.Please give your guidance. I want to get double value without round off its decimal like this. I couldn't use the roundingmode with 1.5.</p> <pre><code> double d1 = 1234567812342134.45678567; DecimalFormat df = new DecimalFormat(".00000"); df.setMaximumFractionDigits(5); //df.setRoundingMode(RoundingMode.DOWN); System.out.println(df.format(d1)); </code></pre> <p><strong>Expected output :</strong> 1234567812342134.45678</p> <p><strong>Now output :</strong> 1234567812342134.50000</p>
java
[1]
174,365
174,366
Remote servicve
<p>I have preperd a remote service, i would like to know if it's possible somehow via this service to call another activities? coz usually what ive seen so far, is how external apps calling the remote service and using it's methods, but i want vice versa.. that the remote service will call an external app's activity,</p> <p>thanks,</p> <p>moshik.</p>
android
[4]
5,338,916
5,338,917
Landscape first time not load image but portrait do it why?
<p>Mainfest file has this code</p> <pre><code> android:configChanges="orientation" </code></pre> <p>My Activity also has </p> <pre><code> public void onConfigurationChanged(Configuration newConfig) { // TODO Auto-generated method stub super.onConfigurationChanged(newConfig); setContentView(R.layout.ticket_detail); } </code></pre> <p>Two xml for layout-land and layout. But landscape not load image, image size is 10kb, Is image problem?/</p>
android
[4]
129,926
129,927
How Yield works within a ForEach block?
<p>How Yield works within a <code>foreach</code> loop shown below? lstNumbers is of type <code>List&lt;int&gt;</code>.</p> <pre><code>foreach (int i in lstNumbers) { yield return i; } </code></pre> <p>Will it start returning as it receives the value or it returns the final list at the end?</p> <p>How is it different from:</p> <pre><code> foreach (int i in lstNumbers) { return i; } </code></pre>
c#
[0]
5,972,036
5,972,037
Need help in using getScrollY() of ListView
<p>I have the following code which recording the scroll Y position in my ListView whenever my activity is paused.</p> <pre><code>protected void onSaveInstanceState (Bundle outState) { super.onSaveInstanceState(outState); int scroll = mListView.getScrollY(); System.out.println (" scrollY" + scroll); } </code></pre> <p>But regardless where I scroll my ListView vertically, the value of getScrollY() always return 0. Can anyone please help me?</p> <p>Thank you.</p>
android
[4]
1,162,657
1,162,658
request for member view in something not a structure or union
<p>I have this error when i build my application iphone: request for member view in something not a structure or union on [CommuneSlider.view removeFromSuperview];</p> <p>the code: - (void) CommuneSelected {</p> <pre><code>CommuneDetailsViewController *com = [[CommuneDetailsViewController alloc] initWithNibName:@"CommuneDetailsViewController" bundle:nil]; UINavigationController *navig = [[UINavigationController alloc] initWithRootViewController:com]; [self setCommuneDetails:(CommuneDetailsViewController *) navig]; [navig setNavigationBarHidden:YES]; [com release]; [navig release]; [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:.8]; [UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:window cache:YES]; [CommuneSlider.view removeFromSuperview]; [self.window addSubview:[CommuneDetails view]]; [UIView commitAnimations]; </code></pre> <p>}</p> <p>need HELP</p>
iphone
[8]
3,521,627
3,521,628
Select from comma separated list
<p>So I'm working on a tags system, and I have a field that looks like this:</p> <pre><code>&lt;input name="tags" type="text" /&gt; </code></pre> <p>And I want a user to be able to type tags like (comma separated): "Tag one, Tag two, Tag Three" and so on, and then in the backend PHP, pull each tag by itself and put them all into an array, such as:</p> <pre><code>$tags = array("Tag one", "Tag two", "Tag three"); </code></pre> <p>And then I'm thinking using <code>foreach</code> to insert them into their own rows in a database, which I know how to do and all; but I digress. But how do I separate the tags in the string from the user's form input?</p>
php
[2]
3,396,999
3,397,000
How do I add a function to a collection?
<p>I have a class that manages keyboard input and fires off <em>KeyPressed</em>, <em>KeyReleased</em>, or <em>KeyHeld</em> events. It only fires off an event if the key exists in the KeyBindings collection of my Controller component. Now that I've got all of that working I'm stuck on a problem. What I want is the following:</p> <pre><code>Key pressed. if(Key bind exists) Fire key pressed event. foreach(function in keyBinds) { execute function, fire event, whatever... } </code></pre> <p>I just can't figure out how the foreach loop would work. Any ideas on how I could pull something like this off?</p> <hr> <p><strong>KeyboardController Component:</strong></p> <pre><code>public class KeyboardController : IComponent { //Fields private Dictionary&lt;Keys, HashSet&lt;Delegate&gt;&gt; m_keyBindings = new Dictionary&lt;Keys,HashSet&lt;Delegate&gt;&gt;(); //Properties public Dictionary&lt;Keys, HashSet&lt;Delegate&gt;&gt; KeyBindings { get { return m_keyBindings; } } } </code></pre> <p>This is the class that will contain the Keys and their function/delegate/event/whatever bindings. The code for events CANNOT be contained within this class because the class is meant only to store data. I need to pass a Key bind and an action or set of actions to perform when this bind is pressed.</p> <p><strong>Adding a bind:</strong></p> <pre><code>//Set key bindings KeyboardController kbController = entityManager.GetComponent&lt;KeyboardController&gt;(1); kbController.KeyBindings.Add(Keys.Up, new HashSet&lt;Delegate&gt;()); kbController.KeyBindings[Keys.Up].Add(function); </code></pre> <p>I don't know how to make the third line in "Adding a bind:" work.</p>
c#
[0]
5,066,601
5,066,602
store data into a text file using php?
<p>i am trying to store data in a text file, something like an array into a text file using php instead of storing into mysql database.</p> <p>for example here are the data to be stored in a text file</p> <pre><code>name=&gt;john age=&gt;25 location=&gt;australia </code></pre> <p>then after saving it to a text file , how can I get the contents out and parse it with php , for like php can find the name , age and location and echo it out(something like parsing an array)</p> <p>I need it for storing the data into a text file so it can be easily access from other domains without requiring to be on the same domain , connect to database , get the data from database. I am looking for a speedy solution. :)</p> <p>I'm not sure which direction should I look into for this kind of functionality , hoping someone can point me out.</p>
php
[2]
1,115,379
1,115,380
getting position in a list and then display a web view
<p>Hey I am trying to display a web view if someone clicks on the 5th item in a list. </p> <p>This is the code: </p> <pre><code> lv.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView&lt;?&gt; a, View v, int position, long id) { if (position == 5) { Intent intent = new Intent(Intent.ACTION_VIEW); Uri uri = Uri.parse(href2_final + "=service&amp;doc_library=ABN01&amp;doc_number=" + record_parsed_final + "&amp;line_number=0001&amp;func_code=WEB-FULL&amp;service_type=MEDIA"); intent.setData(uri); startActivity(intent); } } }); </code></pre> <p>What am I doing wrong? If I delete the IF statement then it will launch the web view when i press any item in the list. </p> <p>Thanks!</p>
android
[4]
2,584,840
2,584,841
how i could retrieve data from mysql using php code
<p>I'm still a beginner in the PHP so I need your help ... I have a small database Containing </p> <ul> <li>id &amp; content &amp; links</li> </ul> <p>I want to retrieve the content data using the id . so I need the php code which could help me</p>
php
[2]
5,881,056
5,881,057
Class cast exception when inflating a custom Relative Layout?
<p>I get this exception when I try to inflate</p> <p>07-22 19:15:39.903: ERROR/AndroidRuntime(3810): Caused by: java.lang.ClassCastException: android.widget.RelativeLayout</p> <p>I have a base class:</p> <pre><code>public class UIBase extends RelativeLayout {} </code></pre> <p>And a more specific class:</p> <pre><code>public class Countdown extends UIBase {} </code></pre> <p>Then I try to inflate and it exceptions:</p> <pre><code>UIBase newView = (UIBase) inflater.inflate(layoutId, parent, true); </code></pre> <p>Here's the XML file:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;com.Countdown xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/countdown" android:layout_alignParentTop="true" android:layout_alignParentRight="true" android:layout_width="wrap_content" android:layout_height="wrap_content" &gt; &lt;TextView android:id="@+id/countdownText" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" android:text="0" /&gt; &lt;/com.Countdown&gt; </code></pre> <p>Does anyone know what I'm doing wrong?</p>
android
[4]
4,794,291
4,794,292
UInavigation controller did not work
<p>I am making app like whenever the device change it's orientation mode it changes it's view.<br> At first when the view is portrait it shows perfect SearchViewController, then when i rotate to landscape it push to new view MapView in landscape ... now when i again change the view to portrait the map rotate to portrait... but it should be do to search view controller... and one more thing when i tapped detail disclosure button it should be go to back to search view controller... i think navigation controller not work in map view..</p> <p>this is my code part of searchViewController </p> <pre><code>- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { //return (interfaceOrientation == UIInterfaceOrientationPortrait); if(interfaceOrientation == UIInterfaceOrientationPortrait|| inte rfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) { } else { MapView *mapView = [[MapView alloc] initWithNibName:@"MapView" bundle:nil]; mapView.title = @"Map"; [self.navigationController pushViewController:mapView animated:YES]; return YES; } return YES; } </code></pre> <p>and this is my MapView code </p> <pre><code>- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations // return (interfaceOrientation == UIInterfaceOrientationLandscapeRight|| UIInterfaceOrientationLandscapeLeft); if(interfaceOrientation == UIInterfaceOrientationPortrait|| interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown) { NSLog(@"hi Potrait"); [self.navigationController popViewControllerAnimated:NO]; return YES; } else { } return YES; } </code></pre>
iphone
[8]
1,194,419
1,194,420
How to wrap my script into one function? The professional approach?
<p>right now I'm working on a little training-code. Trying to code a semi-fixed page-element. This is my result by now: </p> <pre><code>$(document).ready(function () { var elementPosition = $("#header").offset(); var elementHeight = $("#header").outerHeight(); $("#header").before("&lt;div id='placeholder' style='display:none; height:" + elementHeight + "px'&gt;&lt;/div&gt;"); $(window).scroll(function () { checkAttached("#header"); }); function checkAttached(element) { var windowDepth = $(window).scrollTop(); if (windowDepth &gt;= elementPosition.top) { $(element).addClass("attached"); $("#placeholder").css("display", "block"); } else { $(element).removeClass("attached"); $("#placeholder").css("display", "none"); }; }; }); </code></pre> <p><a href="http://jsfiddle.net/9xM3W/" rel="nofollow">http://jsfiddle.net/9xM3W/</a></p> <p>The thing is, I'm not quite happy with the solution. I would like it to be a little more flexible. My goal is an independent function that allows to address various page elements. Something like this:</p> <pre><code>attachThis(element); </code></pre> <p>Right now I'm having trouble with the scroll-event. I can't have this inside a function, can I? Further I don't know a good solution for not-overwriting "elementPosition". My current solution is to define it outside the function. Not very clean.</p> <p>Of course I'm not expecting you to deliver a better script, but maybe you can push me into the right direction and point out a suitable technique for me? I Would love to know how a professional would approach this task.</p>
jquery
[5]
4,689,609
4,689,610
How to parse atom feed using jquery
<p>I want to know how to parse atom feed using jquery.</p> <p>i had feed url like below</p> <pre><code>http://www.google.co.in/trends/hottrends/atom/hourly </code></pre> <p>Below is jsfiddle but it's not working</p> <p><a href="http://jsfiddle.net/sukumar/sWPkT/" rel="nofollow">http://jsfiddle.net/sukumar/sWPkT/</a></p>
jquery
[5]
3,267,195
3,267,196
I want to get the system keyEvent from java
<p>I am trying to build a program that will get all the system keyEvents when ever it is pressed (it may be on web browser or any key press for any other program ).Is there any function to retrive which key is pressed to do this job. Thanx in advance.</p>
java
[1]
4,199,562
4,199,563
C++ equivalent to the Sun Java Language Specification and JVM Specification?
<p>Does C++ have an "official" language specification document, similar to the Sun/Oracle:</p> <p><a href="http://docs.oracle.com/javase/specs/#6.6.1" rel="nofollow">http://docs.oracle.com/javase/specs/#6.6.1</a></p>
c++
[6]
2,107,313
2,107,314
implementing refresh-like button on android
<p>I'm developping an application in android which consumes a wcf web-service.</p> <p>What I currently want to do is implement a refresh button,</p> <p>In case the user exits the application and he is currently in an activity that may be projecting the "dirty" data from the service.</p> <p>I reload activity from a thread.</p> <p>The thread is also responsible for consuming the wcf and re-providing the data.</p> <p>So I start the new (same)activity from this separate thread and I finish the current activity from the ui-thread of the activity.</p> <p>The thing is that this doesn't work well all the time,meaning sometimes the ui-thread finishes first so I go one activity back before the same is reloaded.</p> <p>I tried to put a sleep but the thing is that it won't show the activity which is started from the separate thread before the time elapses.</p> <p>Also I don't want to try different time-periods since this is obviously depended on the data from the wcf so it won't work for every time.</p> <p>My question is how can I synchronize these actions?</p>
android
[4]
5,278,528
5,278,529
How to get the objects in an array based on particular string
<p>I am new to iphone.I have an array which contains the objects like below "04_Num",</p> <pre><code> "04_Num/04Num.m3u", "04_Num/04Num001.mp3", "04_Num/04Num002.mp3", "04_Num/04Num003.mp3", "04_Num/04Num004.mp3", "04_Num/04Num005.mp3", "04_Num/04Num006.mp3", "04_Num/04Num007.mp3", "04_Num/04Num008.mp3", "04_Num/04Num009.mp3", "04_Num/04Num010.mp3", "04_Num/04Num011.mp3", "04_Num/04Num012.mp3", "04_Num/04Num013.mp3", "04_Num/04Num014.mp3", "04_Num/04Num015.mp3", "04_Num/04Num016.mp3", "04_Num/04Num017.mp3", "04_Num/04Num018.mp3", "04_Num/04Num019.mp3", "04_Num/04Num020.mp3", "04_Num/04Num021.mp3", "04_Num/04Num022.mp3", "04_Num/04Num023.mp3", "04_Num/04Num024.mp3", "04_Num/04Num025.mp3", "04_Num/04Num026.mp3", "04_Num/04Num027.mp3", "04_Num/04Num028.mp3", "04_Num/04Num029.mp3", "04_Num/04Num030.mp3", "04_Num/04Num031.mp3", "04_Num/04Num032.mp3", "04_Num/04Num033.mp3", "04_Num/04Num034.mp3", "04_Num/04Num035.mp3", "04_Num/04Num036.mp3" </code></pre> <p>but here i want the objects only which contains .mp3 extension and then i have to place those objects into another array</p> <p>how it is possible if any body know this please help me... </p>
iphone
[8]
5,129,882
5,129,883
Object doesnt support this property or method in javascript
<pre><code>function add(id) { var tempid=document.getElementById(id); var patterm=/@/; var value=tempid.match(patterm); // This is where I'm getting the error if(value==null) { var length=document.getElementById(id).length(); tempid=tempid.setchatAt(length+1,'@messung.com'); } else { } } </code></pre>
javascript
[3]
4,881,033
4,881,034
java-jframe-drawline
<pre><code>public class FrameDemo extends JPanel { public void paintComponent(Graphics g) { Graphics2D g2 = (Graphics2D)g; String[] read file contents using FileArrayProvider for loop through above String array g2.draw(new Line2D.Double(...)); } public static void main(String[] args) { JFrame frame = new JFrame("JFrame Example"); frame.add(new FrameDemo()); frame.setSize(300, 150); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setLocationRelativeTo(null); frame.setVisible(true); } } class FileArrayProvider // taken from StackOverFlow { public String[] readLines(String filename) throws IOException { FileReader fileReader = new FileReader(filename); BufferedReader bufferedReader = new BufferedReader(fileReader); java.util.List&lt;String&gt; lines = new ArrayList&lt;String&gt;(); String line = null; while((line=bufferedReader.readLine())!=null) { lines.add(line); } bufferedReader.close(); return lines.toArray(new String[lines.size()]); } } </code></pre> <p>Hi, inside the paintComponent method where I read the file lines in order to drawlines, i get quite a bit of lines, sometimes like more than a few millions. As a consequence my frame freezes for a while... Is it the correct way of doing it? Is there any better way to do it? So that it does not freeze, and draws all the lines when it would display the frame?</p>
java
[1]
2,064,021
2,064,022
How do I refresh Activity like it is being loaded for first time?
<p>I am trying to figure out how, when a user lands on my activity screen, it is "reloaded" as if it were being loaded for the first time.</p> <p>I don't want my user hitting the back arrow and coming back to my activity with old information.</p> <p>As it is now, when a user "comes back" to my page, the database list isn't being repopulated, and information they typed into EditText fields remains there.</p> <p>I want the page, everytime the user comes to it, to be like it's their first time there.</p>
android
[4]
4,080,448
4,080,449
jquery $variableName vs $(variableName)
<pre><code>var $myDiv = $("div#myDiv");//example 1 $myDiv.val(); //example 1 var myDiv = $("div#myDiv"); //example 2 $(myDiv).val(); //example 2 </code></pre> <p>Is there any difference between example 1 and example 2 above? Are both same as far as performance is concerned?</p> <p>Thanks in advance</p>
jquery
[5]
2,754,269
2,754,270
.after needs to be changed with right
<p>I am using the following jQuery function to append an element just after an input:</p> <pre><code>var emailToVal = $("#nameFrom").val(); if(emailToVal == '') { $("#nameFrom").after('&lt;div class="error"&gt;Please enter your name.&lt;/div&gt;'); hasError = true; } </code></pre> <p>I need a way to append the element on the right of the input instead than after.</p> <p>Is there a way to do it?</p>
jquery
[5]
3,163,677
3,163,678
Does memory mapped file support concurrent get/put?
<p>My application requires concurrent access to a data file using memory mapping. My goal is to make it scalable in a shared memory system. After studied the source code of memory mapped file library implementation, I cannot figure out:</p> <ul> <li>Is it legal to read from a <code>MappedByteBuffer</code> in multiple threads? Does <code>get</code> block other <code>get</code> at OS (*nix) level?</li> <li>If a thread <code>put</code> into a <code>MappedByteBuffer</code>, is the content immediately visible to another thread calling <code>get</code>?</li> </ul> <p>Thank you.</p> <p>To clarify a point: The threads are using a single instance of <code>MappedByteBuffer</code>, not multiple instances.</p>
java
[1]
4,245,127
4,245,128
Why is this PHP code to sort an array not returning the correct value?
<p>I have an array of products that I'm pulling from the db. I've verified that these are correct, using the following code:</p> <pre><code>$unsorted_products = products::get( array( 'collection' =&gt; $collection-&gt;id ) ); die(print_r($unsorted_products)); </code></pre> <p>...and the results are as I expect. The thing is, I need the results to basically be grouped by a parent category and category. How they're sorted within each grouping, I don't care. Given that I don't have access to change the model that is retrieving the data via SQL, I need to sort this array via PHP. I'm using the following code:</p> <pre><code>$products = usort($unsorted_products, function ($a, $b) { return strcmp( $a-&gt;parentcategory.$a-&gt;categoryname, $b-&gt;parentcategory.$b-&gt;categoryname ); }); </code></pre> <p>...but dumping the <code>$products</code> array reveals that it is only holding the value 1. Any idea what I am doing wrong? I've verified that the properties I am attempting to access do exist in each object.</p> <p>Thanks.</p>
php
[2]
2,088,233
2,088,234
Compare part of the string with another string from STDLB
<p>I'm wondering if there is a function like <code>preg_match</code> in PHP where I can find or match a string with another string.</p> <pre><code> //In Array `word` // in array `part` "Backdoor", 0 "mark" 3 (matches "Market") "DVD", 1 "of" 2 (matches "Get off") "Get off", 2 "" -1 (no match) "Market", 3 "VD" 1 (matches "DVD") </code></pre> <p>I'm thinking that if there is a function that can match just part of the string it would be great, but as far as I know there is only <code>strcmp</code> but that will only compare if is match or not for the whole string in which my case will always be false.</p>
c++
[6]
1,412,155
1,412,156
Problem accessing variable[] from another class
<p>I know this a pretty basic question, and already found another ones like mine, but I honestly don't know what I'm doing wrong.</p> <pre><code>public class InteractiveArrayAdapter extends ArrayAdapter&lt;Model&gt; { private final List&lt;Model&gt; list; private final Activity context; public int teste; public InteractiveArrayAdapter(Activity context, List&lt;Model&gt; list) { super(context, R.layout.rowbuttonlayout, list); this.context = context; this.list = list; } public int getTest() { return teste; } static class ViewHolder { protected TextView text; protected CheckBox checkbox; } @Override public View getView(int position, View convertView, ViewGroup parent) { teste = 2; .... } } </code></pre> <p>and other class:</p> <pre><code>try{ InteractiveArrayAdapter adapt = new InteractiveArrayAdapter(this, getAPPS(0)); int test = adapt.getTest(); Toast.makeText(this, Integer.toString(test), Toast.LENGTH_LONG).show(); Log.v("TAG",Integer.toString(test)); }catch(Exception e) { Log.v("EXCEPTION",e.toString()); } </code></pre> <p>EDIT: I was getting null for a stupid mistake, and now I'm getting the primitive and expected 0 as most of you say.</p> <p>At some point of my app, everytime a checkboxes is clicked that method getView is executed. I want to store that to an array[] of strings progressively (i+1) (i just put int to be easier to understand - realize now it was a mistake), and then when users inputs ok I want to access the whole array. Wondering if it's possible the way I want.</p> <p>So when I do this</p> <pre><code>InteractiveArrayAdapter adapt = new InteractiveArrayAdapter(this, getAPPS(0)); </code></pre> <p>This is meaningless, because I don't need to execute anything again, I just want to retrieve the created array - if possible!</p>
java
[1]
4,581,775
4,581,776
Some questions about the 25 jquery tips
<p>I was just reading this: <a href="http://www.tvidesign.co.uk/blog/improve-your-jquery-25-excellent-tips.aspx" rel="nofollow">http://www.tvidesign.co.uk/blog/improve-your-jquery-25-excellent-tips.aspx</a></p> <p>And had some questions about some of the advocated tricks:</p> <p><strong>9 - Give your selectors a context:</strong></p> <p>What's the difference between using a context and using a more specific selector?</p> <p>Rather than doing</p> <pre><code>var selectedItem = $('#listItem' + i, $('.myList')); </code></pre> <p>What about</p> <pre><code>var selectedItem = $('.myList&gt;#listItem' + i); </code></pre> <p>Which one is faster/better, or is there no difference?</p> <p><strong>12 - Learn about event delegation:</strong></p> <p>I would imagine that at low handler counts event delegation is slower than normal binding. </p> <p>How many handlers is the time when you should start using event delegation?</p> <p>Also, what is the difference (in terms of how fast or how 'good' it is) between using delegation and creating a click target in dom, having the user click that click target, and then have the click target find the elements to manipulate. Is this method faster or is delegation faster?</p> <p>Edit: In addition, how many levels should you be delegating? Is it better to delegate something 10 levels away, or to simply bind 2 handlers.</p> <p><strong>13 - Use classes to store state</strong></p> <p><strong>14 - Even better, use jQuery's internal data() method to store state:</strong></p> <p>Why use data vs classes? Is data faster? I think I generally find classes to be easier to read, contradicting what it says in the blog entry, because I can see it in the DOM.</p> <p>Thanks!</p>
jquery
[5]
5,308,480
5,308,481
Android - Something Odd... Question
<p>Something odd is going on, I think...</p> <p>I have menu with sub-menu items. One sub-menu gets GPS location, does some calc's and updates two display fields. No problems.</p> <p>The other sub-menu takes user input and does calc's <strong>BUT</strong>, it uses the same display stuff as the fist sub-menu but, won't update the two fields with the new input for display. I have a second display just to see whats going on and this display does update the two fields correctly.</p> <p>There are no differences between these displays (declarations, parameters or values) <strong>HOWEVER</strong>, and here's the lead-up to the <strong>odd</strong> thing, I got a warning when setting the display for the two fields (for displaying in the second sub-menu) and used a suggestion from the pop-up.</p> <p>The suggestion was to make the TextView static. I clicked it for one (left the other as-is for trial and commented it). The warning went away but, <strong>crash!</strong> at run time.</p> <p>So, here's the <strong>odd</strong> thing: Nowhere do I see anything that makes this TextView static! All related declarations and ref's to it are identical to the one I didn't make static. In fact, I tried to manually make the second one static but couldn't. I also checked the R.java file but nothing related in there...</p> <p>Fortunately, I was able to use 'Undo' the Make-it-static.</p> <p>Any comment/clarification for my education? Thanks</p>
android
[4]
3,802,937
3,802,938
javascript: selecting the biggest value
<p>Very simple javascript question. </p> <p>I have two values <code>value1 = 20</code> and <code>value2 = 30</code></p> <p>how can I assign to <code>bigger_number</code> variable the value with the higher number?</p>
javascript
[3]
4,077,618
4,077,619
How to check whether a pointer is NULL before allocating more memory space?
<p>I'm using abstract factory design pattern for my project.</p> <pre><code>CPattern * CObjectA::Create(void) { CPattern *p = new CPattern; patternList.push_back (p); return *p; } //Member variable CPattern *pat = NULL; pat = Obj.Create(); </code></pre> <p>CObjectA will delete the space allocated during destructor. The problem is, if client do this again:</p> <pre><code>pat = Obj.Create(); </code></pre> <p>I would have allocated another space and pat points to it. If this is called a few hundred times, I will keep on creating space without disallocating it.</p> <p>Is there a way to check whether pat is empty before I allocate another space for it?</p> <p>Thank you for your help!</p>
c++
[6]
2,848,856
2,848,857
Getting iframe content with parseJSON
<pre><code>$("#x").load(function (){ var json = $.parseJSON($("#x").contents().text()); </code></pre> <p>I also have a form that can be processed multiple times. The above code gets the content of the iframe the first time the form is processed but any times after that will result in a NULL.</p> <p>I believe my problem is either the load function or the way I am setting the json variable from pulling the content out my iframe (#x).</p> <p>Any help?</p> <p>EDIT:</p> <pre><code>var json = $(document).find('#x').contents().text(); </code></pre> <p>The fix was to add $(document) to the string. However I'm not sure how to parseJSON it now?</p> <p>EDIT FINAL TIME:</p> <pre><code>var json = $(document).find('#x').contents().text(); var json = $.parseJSON( data ); </code></pre> <p>Have it working with the above code. Thanks all. :)</p>
jquery
[5]
5,646,675
5,646,676
Mp3 list as output table
<p>i have a question because i want to output my Datastruct like a Table and it shoult be sortable.</p> <p>It should look like this:</p> <pre><code>|Title|Artist|Album|Genre| |-----+------+-----+-----+ | xxx | xxxx + xxx + xxx | |________________________| </code></pre> <p>My Class:</p> <pre><code>class mp3{ public: mp3(std::string title, std::string artist, std::string album, std::string genre) :mTitle(title), mArtist(artist), mAlbum(album), mGenre(genre); ~mp3(); std::string getArtist() const; std::string getTitle() const; private: std::string mTitle; std::string mArtist; std::string mAlbum; std::string mGenre; </code></pre> <p>};</p> <p>My first thought was,to put the variables into a map and return it to my function,which will draw the table. My function would have a vector of map that i could sort it without a lot of work.</p> <p>For example:</p> <pre><code> myMap.insert(std::pair&lt;std::string,std::string&gt;("Artist","Jimmy Hendrix")); myMap.insert(std::pair&lt;std::string,std::string&gt;("Title","Foxy Lady")); </code></pre> <p>Is there a better solution?</p>
c++
[6]
4,661,473
4,661,474
how to fetch data in mobile application
<p>i want to make android application which will fetch data from my website website location is: localhost:1186/WebSite4 </p> <p>how to fetch data from website...</p> <p>which are the classes are required to do that</p> <p>website is in asp.net c sharp</p>
android
[4]
1,441,604
1,441,605
Using a Date as the hash table key
<p>How can I create a hash table object in JavaSript and use a date as the key? So far I've got this:</p> <pre><code>var eventHash = {}; for (var i = 0, l = events.length; i &lt; l; i += 1) { eventHash[events[i].date.getTime()] = events[i]; } </code></pre> <p>And then when I want to find the event associated with today I would use this:</p> <pre><code>var event = eventHash[(new Date(2011, 04, 26, 0, 0, 0, 0)).getTime()]; </code></pre> <p>Can anyone see any pitfalls with this solution, or have any suggestions for improvement?</p>
javascript
[3]
15,957
15,958
Same file two different results
<p>If I use this code </p> <pre><code>&lt;?php include $_SERVER['DOCUMENT_ROOT'] . '/includes/header.php'; ?&gt; </code></pre> <p>I get the functions of the file im calling but do not get the layout/format or file images.</p> <p>If I use this code</p> <pre><code>&lt;?php $includeFile = file_get_contents("http://www.YourDomain.com/includes/header.php"); echo $includeFile; ?&gt; </code></pre> <p>I get the formatted layout but the search field does not function. Is there a way to combine the two codes to get the layout and the functions?</p>
php
[2]
4,982,539
4,982,540
Print text from few div
<p>I see this <a href="http://stackoverflow.com/a/2255438/1511551">answer</a>, but how to proceed to print text from second, third div? This is what I want to:</p> <pre><code>&lt;script type="text/javascript"&gt; function PrintElem(elem) { Popup($(elem).text()); } function Popup(data) { var mywindow = window.open('', 'Coupon', 'height=300,width=710'); mywindow.document.write('&lt;html&gt;&lt;head&gt;&lt;title&gt;Coupon&lt;/title&gt;'); /*optional stylesheet*/ mywindow.document.write('&lt;link rel="stylesheet" href="cupon.css" type="text/css" /&gt;'); mywindow.document.write('&lt;/head&gt;&lt;body &gt;&lt;div class="coupon_logo"&gt;&lt;img src="discount.jpg"&gt;&lt;/div&gt;&lt;div class="coupon_conditions"&gt;'); mywindow.document.write(data); // text from first div mywindow.document.write('&lt;/div&gt;'); mywindow.document.write('&lt;div class="coupon_clinic_info"&gt;'); //text from second div mywindow.document.write('&lt;/div&gt;'); mywindow.document.write('&lt;/body&gt;&lt;/html&gt;'); mywindow.print(); mywindow.close(); return true; } </code></pre> <p></p>
jquery
[5]
602,267
602,268
form where i can get the script for adding bse(bombay stock exchange) realty stock chart
<p>I have to add BSE Realty stoock chart into my web site from where i can get this scripts.</p>
javascript
[3]
390,865
390,866
jQuery .appendTo or more general for loop not working as expected
<p>jQuery newbie here. I'm working through R Murphy's jQuery Fundamentals and am on the Manipulation exercises in the <a href="http://jqfundamentals.com/book/index.html#chapter-3" rel="nofollow">jQuery Basics</a> section.</p> <p>The first question in that section asks you to add five new list items to the end of the unordered list #myList. </p> <p>My approach was to do the following:</p> <pre><code>var $newItem = $('&lt;li&gt;New Item&lt;/li&gt;'); var $ul = $('#myList'); for (var i=0;i&lt;5;i++){ $newItem.appendTo($ul); }; </code></pre> <p>However this doesn't work as it only inserts one list item into the list, not 5.</p> <p>The solution provided by the author is very close to mine, the only difference being she doesn't store the new list item in a variable, but rather uses a literal:</p> <pre><code>var $ul = $('#myList'); for (i=0; i&lt;5; i++) { $('&lt;li&gt;List item ' + i + '&lt;/li&gt;').appendTo($ul); } </code></pre> <p>It seems like my approach should work also so I'm struggling to understand why it doesn't.</p> <p>Help?</p> <p>Thanks in advance, n</p>
jquery
[5]
2,516,695
2,516,696
Nested for loops - how to ignore certain combinations?
<p>I'm doing some kind of brute force attack to solve a problem. Theoratically it is a working solution, it also really is, but it takes rather long.</p> <p>I have 7 nested for loops within each other, but I only need the combinations of the 'for variables' in which none are repeated. So e.g. 1,2,3,4,5,6,7 is allowed, but 1,1,3,4,5,6,7 should be ignored. I'm currently using a function to check for duplicate items in an array:</p> <p><a href="http://www.groggyjava.tv/freebies/duplicates.html" rel="nofollow">http://www.groggyjava.tv/freebies/duplicates.html</a></p> <p>However I think I'd be better off if I could immediately ignore those combinations instead of using that function over and over for <em>every</em> single combination. Now I'm evaluating 14^7 = 105.413.504 combinations, but only 14 nPr 7 = 17.297.280 of them are necessary.</p> <p>My code currently is (in which hgd is the duplicate test function, with returns true if no duplicates):</p> <pre><code>for(var a=0;a&lt;14;a++) { for(var b=0;b&lt;14;b++) {if(hgd([a,b])) { for(var c=0;c&lt;14;c++) {if(hgd([a,b,c])) { for(var d=0;d&lt;14;d++) {if(hgd([a,b,c,d])) { for(var e=0;e&lt;14;e++) {if(hgd([a,b,c,d,e])) { for(var f=0;f&lt;14;f++) {if(hgd([a,b,c,d,e,f])) { for(var g=0;g&lt;14;g++) {if(hgd([a,b,c,d,e,f,g])) { check([a,b,c,d,e,f,g]); }} }} }} }} }} }} } </code></pre> <p>How could I make this faster, is there another solution instead of for loops perhaps?</p> <p>Thanks.</p>
javascript
[3]
5,464,379
5,464,380
How to customized news container in website
<p>I'm using code in an iFrame to embed news in a website. I am unable to customize the iFrame.</p> <pre><code>&lt;iframe src="http://www.google.com/uds/modules/elements/newsshow/iframe.html?topic=n,p,s,n&amp;rsz=small" frameborder="0" width="728" height="90" marginwidth="0" marginheight="0"&gt;&lt;/iframe&gt;here </code></pre>
javascript
[3]
4,679,086
4,679,087
What is the purpose of having a class member that is a ref type?
<p>I have this code, but it is not a practical example.</p> <p>Ex.</p> <pre><code>class Animal { int i; int&amp; ref; public: Animal() : ref(i) { } }; </code></pre> <p>Can anyone provide a real life example where ref is required as a class member so that I can understand it better?</p>
c++
[6]
3,147,364
3,147,365
webapi failes because $.getJSON adds the name of the original controller
<p>I am trying to load data from a web-api controller from within a razor page that was loaded by a standard controller.</p> <p>However, when I try to execute the $.getJSON() it fails because the getJSON method adds its original controller name in front of the call. How do I go around this?</p> <p>Example: a razor view gets loaded from controller MyController. I have a webapi controller called ExplorerApi where I wish to execute a method on. So from within the razor View I call </p> <p><code>$.getJSON("api/explorerapi/getavailablegroups?userid=marcel", function (data))</code> </p> <p>which fails because jQuery has added MyController in front and so converted it to:</p> <pre><code>$.getJSON("MyController/api/explorerapi/getavailablegroups?userid=marcel", function (data)) </code></pre> <p>EDIT - </p> <p>I can call the web api from the browser and it happily returns the json data by simply typing <code>http://localhost:59475/api/ExplorerApi/getavailablegroups?userid=marcel&amp;context=pf</code> in the browser! but using the code below it adds it originating controller name in front!</p> <pre><code>var uID = sessionStorage.getItem("symUserID"); var v = "userid=" + uID + "&amp;context=portfolio"; $.getJSON("api/explorerapi/GetAvailableGroups?" + v, null, function (data) { debugger; }) .fail( function (jqXHR, textStatus, err) { debugger; alert(err); }); </code></pre> <p>The alert message says: Not found - then if you look into the jqXHR.responseText loads of data there is the Error 404 and further down the statement it is trying to execute in which it has placed the name of the original controller!!</p> <p>Requested URL&nbsp;&nbsp;&nbsp;http://localhost:59475/MyController/api/explorerapi/GetAvailableGroups?userid=marcel&amp;context=portfolio&amp;_=1358064733267 </p>
jquery
[5]
3,854,636
3,854,637
How can I select only the anchors within a div by id in jQuery?
<p>Here is the code I'm using right now.</p> <pre><code>$(window).load(function () { $('.answer').hide(); }); $('.question').click(function () { var currentId = $(this).attr('id'); $("#a"+currentId.substr(1)).fadeToggle("fast", function () { }); });+ $('#show_hide').click(function () { $(".answer").fadeToggle("fast", function () { }); }); </code></pre> <p>The problem is that this code will be triggered if the user clicks anywhere on the same line as the link, and not just on the link itself. Help?</p>
jquery
[5]
4,482,814
4,482,815
how to get url string from browser
<p>can i get url what i write on android device browser..</p> <p>please tell me..</p> <p>thanks.</p>
android
[4]
947,792
947,793
Sort the unsorted text file and rewrite to same text file in sorted order
<p>I have a question. I am in process of learning how to read/write files, but having little trouble trying to do both at the same time in same php script. I have a text file with words like this,</p> <pre><code>Richmond,Virginia Seattle,Washington Los Angeles,California Dallas,Texas Jacksonville,Florida </code></pre> <p>I wrote a code to sort them in order and this will display in sort order by City.</p> <pre><code>&lt;?php $file = file("states.txt"); sort($file); for($i=0; $i&lt;count($file); $i++) { $states = explode(",", $file[$i]); echo $states[0], $states[1],"&lt;br /&gt;"; } ?&gt; </code></pre> <p>From this, how can I rewrite those sorted information back into the states.txt file?</p>
php
[2]
5,517,343
5,517,344
XMPP roster retrieving
<p>What is meant by this ?</p> <pre><code>for (RosterEntry r : entries) </code></pre> <p>here "entries" is collection of RosterEntrys like this,</p> <pre><code>Collection&lt;RosterEntry&gt; entries; </code></pre>
java
[1]
1,568,999
1,569,000
to check the end of arrays
<pre><code>main() { char buff[10]; int a; for(int i=0; i&lt;10;i++) { cin &gt;&gt; buff[i]; a=sizeof(buff[i]); if(a==10) cout &lt;&lt; "full"; } for(int i=0; i&lt;10;i++) cout &lt;&lt; buff[i]&lt;&lt;"\n"; } </code></pre> <p>why des the control never comes to cout &lt;&lt; "full"; i am new to coding...when i do dry run it works fine </p>
c++
[6]
2,067,706
2,067,707
opener.document() won't work on CHROME
<p>Following Script isn't working in CHROME browser, IE is Fine.</p> <p>I've changed <code>opener.document</code>... to <code>window.opener.document</code>.... but same situation.<br/> It's not closing windows and transfer data to parent page.</p> <pre><code>function mycoupon() { window.open("my_coupon3.jsp?amt=&lt;%=pay_price2%&gt;", 'coupon_win', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollb‌​ars=yes, resizable=no,width=780,height=540'); } function sel_coupon(c_id, amt) { var tot = opener.document.joinform.Org_totalprice.value; tot = String(Number(tot) - Number(amt)); opener.document.joinform.totalprice.value = tot; opener.document.joinform.coupon_id.value = c_id; opener.document.joinform.all["tot"].innerHTML = maskNum(opener.document.joinform.Org_totalprice.value) + "USD - " + maskNum(amt) + " USD &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;b&gt;&lt;font color='red'&gt;Total : " + maskNum(tot) + " USD&lt;/font&gt;&lt;/b&gt; "; opener.cal_payment_money(); self.close(); } </code></pre>
javascript
[3]
2,742,939
2,742,940
How do I get my slideshow to repeat?
<p>I have the following code:</p> <pre><code>&lt;script type="text/javascript"&gt; var image1=new Image() image1.src="images/natandadam.jpg" var image2=new Image() image2.src="images/gardaa.jpg" var image3=new Image() image3.src="images/marmaris.jpg" var image4=new Image() image4.src="images/gardab.jpg" var image5=new Image() image5.src="images/engagement.jpg" var image6=new Image() image6.src="images/gardac.jpg" var image7=new Image() image7.src="images/natandadamlake.jpg" //--&gt; &lt;/script&gt; &lt;script&gt; &lt;!-- //variable that will increment through the images var step=1 function slideit(){ //if browser does not support the image object, exit. if (!document.images) { return; } document.images.slide.src=eval("image"+step+".src"); if (step&lt;7) { step++; } else { step=1; } //call function "slideit()" every 2.5 seconds setTimeout("slideit()",2500); } slideit(); //--&gt; &lt;/script&gt; </code></pre> <p>...and this calls it:</p> <pre><code>&lt;img style="border:6px double #545565;" src="gardaa.jpg" name="slide" width=600 height=400&gt; </code></pre> <p>I want it to continue skipping through the images but it stops on the last one. It used to repeat when it only had three images; Now I've added more its stopped.</p> <p>what do I change to make them repeat?</p>
javascript
[3]
4,111,370
4,111,371
how to detect Android phone in a network using c# code?
<p>i am developing a desktop application in c# in which i want to detect whether there is any android phone in a network or not.Is this possible? if so tell me how to do it. thnx </p>
c#
[0]
2,528,555
2,528,556
How to make a day of the week as a variable
<p>I'm making an android app to display my school timetable and what I would like to do is make it so depending on the day it automatically tells me what subjects I want. I have made a base template however I have zero idea on how to make a variable based on what day it is. Any help is welcomed :)</p>
android
[4]
4,424,511
4,424,512
how to replace the all the occurence using php
<p>hi how to replace the all the occurrence of the spaces into <code>&amp;nbsp;</code>, I am tying to save my message from editor to my db , while i retrieving the message it shows �� instead of spaces please guide me</p>
php
[2]
2,133,418
2,133,419
I don't understand Python's main block. What is that thing?
<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="http://stackoverflow.com/questions/419163/what-does-if-name-main-do">What does &lt;if __name__==“__main__”:&gt; do?</a> </p> </blockquote> <p>So I start up pyscripter and I get a file with this in it:</p> <pre><code>def main(): pass if __name__ == '__main__': main() </code></pre> <p>What is that? Why does my program work without it as well? Whats the purpose for this anyway? Where would my code go? Lets say a a function that prints hello world. Where would that go? where would I call it?</p>
python
[7]