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 |
---|---|---|---|---|---|
3,534,773 | 3,534,774 |
how to write a random code in c#
|
<p>… I'm working on random in C# . I want to use a random to view string move in random & this is the code which i write but it dosen't work
i want to know what wrong i do </p>
<pre><code>using system ;
namespace work
{
static random random =new random();
static int max_X=console.windowwidth;
static int max_Y=console.windowheight;
static void main(string[] args)
{
int x=random.next(max_X);
int y=random.next(max_Y);
console.setcursorposition(x,y);
console.write("walaa");
}
}
}
</code></pre>
|
c#
|
[0]
|
5,473,311 | 5,473,312 |
here im getting Uncaught SyntaxError: Unexpected token <.why is it so
|
<pre><code>$.ajax({
url: "https://foursquare.com/oauth2/authenticate",
dataType: 'jsonp',
data: {
client_id: 'PWWWDURZZ33QK15R5YA3POXMQS0E22CX4QUX2OXAQVYQYN44',
response_type: 'code',
redirect_uri: "http://192.168.10.12:9000/mobile",
jsonp: 'parseResponse'
},
success: function(data) {
//console.log(data);
}
});
</code></pre>
|
javascript
|
[3]
|
1,406,194 | 1,406,195 |
Is there any server configuration or anything that make __DIR__ failed
|
<p>I have develop a framework where most of its path depend on <code>__DIR__</code>. Is there any server configuration or anything that would make <code>__DIR__</code> unreliable?</p>
|
php
|
[2]
|
1,484,146 | 1,484,147 |
External table is not in the expected format thrown only in certain situations
|
<p>I am trying to open an xlsx file and I get the External table is not in the expected format only when I open from a certain area of my app. So it works just fine if I call it from 1 area, but then I do the same thing from a different part of the app, calling the same code block, and it throws that exception. Same code block. Same excel file.</p>
<pre><code>string connectionString = "Provider="+ GetProvider(fileName) +"; data source=" + fileName + "; " + GetExtendedProperties(fileName);
using (var connection = new OleDbConnection(connectionString))
{
connection.Open();
using (DataTable schemaTable = connection.GetOleDbSchemaTable(OleDbSchemaGuid.Tables,
new object[] { null, null, null, "TABLE" }))
{
if (schemaTable != null && schemaTable.Rows != null)
{
List<string> validTables = schemaTable.Rows.OfType<DataRow>().Select(row => (string)row["TABLE_NAME"]).ToList();
validTables.ForEach(table =>
{
if (table.Contains('$'))
{
results.WorkSheets.Add(table.Trim('\'', '$'));
}
else
{
results.NamedRanges.Add(table);
}
});
}
}
}
</code></pre>
<p>My connection string:</p>
<p>Provider=Microsoft.ACE.OLEDB.12.0; data source=C:\moses\BLANKTest\Table.xlsx; Extended Properties="Excel 12.0 Xml";</p>
<p>Also tried the connection string taking out the "Xml" at the end. No luck.</p>
<p>Not sure what is going on here.</p>
|
c#
|
[0]
|
4,529,104 | 4,529,105 |
Unable to change anchor.text
|
<p>I'm trying to change the text in the anchors as follows:</p>
<pre><code>for (var i = 0; i < anchors.length; i++) {
...
anchors[i].text = anchors[i].text + "+";
}
</code></pre>
<p>I tried alternative methods like <code>concat</code> and <code>append</code> but nothing works.</p>
<p><code>anchors[i].innerHTML</code> helped but the code is called on DOMContentLoaded and I want to add only "+" string, instead of it I'm adding unpredictable sequence of "+"* e.g. "++++++++"</p>
<p>thank you for help</p>
|
javascript
|
[3]
|
4,786,999 | 4,787,000 |
how to install and use Code Contracts?
|
<p>I have a basic question, might be it is so obvious but for some reason i can't seem to be successful with installing and using Code Contracts.</p>
<p>I've downloaded the package from MSDN, installed it following the online documentation but i still get an IDE warning for the below code statement:</p>
<p><code>Contract.Requires(inputParameter != "");</code></p>
<p>the IDE warning is:</p>
<p><em>"Method invocation is skipped. Compiler will not generate method invocation because the method is conditional, or it is partial method without implementation"</em></p>
<p>Anything I'm missing in the process of enabling Code Contracts? I'm using VS2010 Ultimate SP1</p>
|
c#
|
[0]
|
569,531 | 569,532 |
Synchronizing android with the web
|
<p>I was wondering if there are some commonly used techniques for synchronizing an app with a server? I have looked at the socket-framework and maybe some http? I am thinking for instance when making a game or a grocery list, any developers out there who want to share?</p>
|
android
|
[4]
|
2,581,057 | 2,581,058 |
Google Maps outside of Activity
|
<p>I have been playing with Google Maps V2 for a few weeks now. I tinker more than anything and when I have an App/Game that I enjoy I like to learn how they work. I have recently been playing Ingress which got me into playing with how Maps can be interacted with and used.</p>
<p>One thing I cannot figure out is how to use Google Maps outside of an Activity. There has to be some sort of game loop but I don't know how this would work inside of an Activity or how to use Google Maps outside of one due to some of the methods that are required to get a user's location.</p>
<p>Answers or being pointed in the right direction would be appreciated.</p>
|
android
|
[4]
|
5,891,900 | 5,891,901 |
Unable to execute dex: Cannot merge new index 66713 into a non-jumbo instruction
|
<p>When i try to run my project then console displays this type of message:
Unable to execute dex: Cannot merge new index 66713 into a non-jumbo instruction</p>
|
android
|
[4]
|
145,757 | 145,758 |
Can I copy debug.keystore from one PC to another?
|
<p>Can I copy the debug.keystore in My home directory to another PC's home directory? Does it have to be Linux on Linux, and Windows and Windows? Can I copy Linux keystores to Windows, and vice-versa?</p>
|
android
|
[4]
|
1,963,278 | 1,963,279 |
how to get around UnboundLocalError?
|
<p>I just started programming and tried to write something but (of course) it failed. After I while I got to the real problem: The <code>UnboundLocalError</code>. So to save you from all the rubble around I stripped the code down to this:</p>
<pre><code>def test():
try:
i1 = int(i1)
i2 = int(i2)
except ValueError:
print "you failed in typing a number"
def input():
i1 = raw_input('please type a number \n >')
i2 = raw_input('please type a number \n >')
</code></pre>
<p>Then I wrote down:</p>
<pre><code>>>>input()
please insert a number
> 3
please insert a number
> 2
>>>test()
</code></pre>
<p>And then I got:</p>
<pre><code>that was not a number
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 7, in test
UnboundLocalError: local variable 'i1' referenced before assignment
</code></pre>
<p>How can I solve this in a Pythonic way? Or should I take a whole different way?</p>
|
python
|
[7]
|
5,209,080 | 5,209,081 |
Android WebView, how to handle redirects in app instead of opening a browser
|
<p>So right now in my app the URL I'm accessing has a redirect, and when this happens the WebView will open a new browser, instead of staying in my app. Is there a way I can change the settings so the View will redirect to the URL like normal, but stay in my app instead of opening a new browser?</p>
<p>Edit:</p>
<p>I want the redirecting URL, I just don't know how to create it, so the only way to get to that URL is through one that will cause a redirect to the one I want. </p>
<p>For example: When you go here: <a href="http://www.amazon.com/gp/aw/s/ref=is_box_/k=9780735622777">http://www.amazon.com/gp/aw/s/ref=is_box_/k=9780735622777</a> notice how it will redirect the URL to the actual product. In my app, if I open it in a new browser, it will do that just fine, however if I keep it in my app with a WebView, it will show up as though it's doing a search for k=9780735622777, like this: <a href="http://www.amazon.com/gp/aw/s/ref=is_s_?k=k%3D9780735622777&x=0&y=0">http://www.amazon.com/gp/aw/s/ref=is_s_?k=k%3D9780735622777&x=0&y=0</a> . OR, it will open the view in the browser and show what is appropriate. However, I want to keep everything in my app.</p>
|
android
|
[4]
|
652,240 | 652,241 |
Why can't I assign a variable inside a function in Javascript?
|
<p>Very new to JS here. When I write PHP I have no problem assigning variables inside a function, but inside a JavaScript function it doesn't work. Why?</p>
<p>example:</p>
<pre><code>function hello() {
var animal = 'Dog';
document.write(animal);
}
</code></pre>
|
javascript
|
[3]
|
2,863,188 | 2,863,189 |
Replace Button Text during .click() Function
|
<p>I have a hidden Textbox. If I click a button, the content of a div appears. If I click the Buutton again, the content disappears (.slideToggle()): I would like to replace the text of my button, if the content of the div is visible and change it back, if the button gets clicked again and the content of the DIV, better: the DIV gets hidden.
That is my current Coce:</p>
<pre><code>function show_content(){
jQuery('.single_content').hide();
jQuery('.css_hide').show();
jQuery('.show_content').click(function(){
jQuery('.single_content').slideToggle();
var text = jQuery(this).html();
if ( jQuery('.single_content').is(':visible') ) {
jQuery(this).html('abc');
}
});
}
</code></pre>
<p>What did I do wrong?</p>
<p>Many Thanks</p>
|
jquery
|
[5]
|
3,717,547 | 3,717,548 |
alternative for Jquery scrollto
|
<p>I'm searching a way to have a horizontal scroller on hyperlinks and I have been taking a look on the scrollto plugin but as it seems is really outdated. Is it possible to achive the same results just with simple jquery?</p>
|
jquery
|
[5]
|
5,299,827 | 5,299,828 |
Searching all locations in google maps
|
<p>I am doing the simple application on the google map but i am not able to search all locations in the google map, can any one help me in the coding.</p>
|
android
|
[4]
|
5,947,297 | 5,947,298 |
Find the number in line. Javascript
|
<p>How do I find the number in line number may not be in the beginning. For example: "d: \ \ 1.jpg"</p>
<p>Thank you.</p>
|
javascript
|
[3]
|
3,751,326 | 3,751,327 |
Xcode 4.5 Video ibrary
|
<p>Good day </p>
<p>I was try to find any licture it explain to me how do i make vedio library like the newsstand or the ibook ,stream it from the youtube and display on the board horizontal and vertical </p>
<p>Kindly if any one can assist me </p>
<p>Thank y</p>
|
iphone
|
[8]
|
2,580,592 | 2,580,593 |
jQuery text match
|
<p>I have an anchor tag with text and I want to check if the given var matches the string exactly.</p>
<p>This works, but I would like to use something other than contains, since it will match two elements if the contain the given string. I want it to match exactly.</p>
<p>Any ideas ?</p>
<pre><code>function test(submenu){
$('a:contains("' + submenu + '")', 'ul.subMenu li').css('font-weight', 'bold');
}
</code></pre>
|
jquery
|
[5]
|
2,876,880 | 2,876,881 |
Does object store variables sequentially?
|
<p>Could you use a pointer over class member variables to increment or decrement over any variable? Or why not?</p>
<p>For example, a struct or class</p>
<pre><code>struct MyStruct {
int x;
int y;
int z;
};
int main()
{
MyStruct Obj;
int *p = &Obj.x;
cout << *p << endl;
cout << p++ << endl;
cout << p++ << endl;
}
</code></pre>
<p>I also noted the address of Obj and its variable is same.</p>
|
c++
|
[6]
|
769,828 | 769,829 |
android-sdk-linux_86/platforms/android-4/tools/dx: line 77: exec: java: not found
|
<p>android-sdk-linux_86/platforms/android-4/tools/dx: line 77: exec: java: not found</p>
<p>I configured Android plateform on netbeans6.8 and created an android project, getting compile time error: android-sdk-linux_86/platforms/android-4/tools/dx: line 77: exec: java: not found</p>
<p>Please any solution?.</p>
|
android
|
[4]
|
843,870 | 843,871 |
Control scrolling DIV with keyboard
|
<p>I have a div that contains a table that has many rows in it. The scrollbar displays correctly and works correctly when using the mouse. However, in an effort to make it keyboard driven I have made the div have focus and then being able to use the arrow keys (via a onKeyPress event I am able to move up and down the div. </p>
<p>This works except for a little quirk... When the div gains focus and I press the down arrow key, the scrollbar also moves down (effectively hiding the row I'm now currently focused on). So my question is, is there any way to avoid this from happening?</p>
<p>I was looking at the following commands: doScroll(), or scrollTo(), or scroll()</p>
<p>Would any of those work or is there something else I could do to correct the behavior of the scroll bar?</p>
|
javascript
|
[3]
|
4,666,267 | 4,666,268 |
Making website simmilar to Youtube in Asp.Net 2005
|
<p>well friends..I'm a college student & i got a project to built a website similar to youtube.</p>
<p>In my Website i want that User can Upload their own Videos of any format & can View it Online.</p>
<p>I know for this :
- I need a "Flash player" to play the video.
- A converter to convert the video to a common format of .flv
- Database to store the videos.</p>
<p>Frankly telling u all that i am totally new to coding .. so i have a very little knowledge.
So please help me step by step to how to built the website.</p>
<p>yeah.. i'm Using Visual Studio 2005, SQL Database. </p>
<p>what else i need do tel me.</p>
<p>waiting for ur replies & suggestions. Thank you.</p>
|
asp.net
|
[9]
|
3,496,750 | 3,496,751 |
how to add 4 image view to flipper in android?
|
<p>i want to add 4 imageviews to flipper at a time.Please provide some sample code</p>
<p>my code is</p>
<pre><code> final ImageView imageview=new ImageView(this);
imageview.setBackgroundResource(R.drawable.img1);
final ImageView imageview1=new ImageView(this);
imageview.setBackgroundResource(R.drawable.img2);
final ImageView imageview2=new ImageView(this);
imageview.setBackgroundResource(R.drawable.img3);
final ImageView imageview3=new ImageView(this);
imageview.setBackgroundResource(R.drawable.img4);
</code></pre>
<p>I want to add these images to flipper on by one.</p>
|
android
|
[4]
|
929,985 | 929,986 |
My while loop won't work
|
<p>In this script, I basically want to echo out data from a mysql table when the certain row record matches the name in browser address bar. But for some reason, no data is echoed. Any reason my while loop doesn't work?</p>
<pre><code> $users = $_GET['username'];
$other_friend_query = mysql_query("SELECT * FROM friend WHERE RelatingUser='$users'");
$other_friend_assoc = mysql_fetch_assoc($other_friend_query);
while ($other_friend_assoc = mysql_fetch_assoc($other_friend_query)) {
$friend_related = $other_friend_assoc['RelatedUser'];
echo $friend_related;
}
</code></pre>
|
php
|
[2]
|
4,411,551 | 4,411,552 |
Removing the last occurance of a string in javascript
|
<p>I have several paragraphs of text that are being stripped of all of their formatting by a javascript function.</p>
<p>I have the function doing 99% of what I need it to do already, with one minor problem.</p>
<p>At the very end of the text it is putting two <br><br> tags that I do not want as it just adds blank white space at the end. In other areas of the text there are double <br> tags I want to leave in place.</p>
<p>So my question is how do I take the entire block of text and only remove the very last <br><br> tags?</p>
|
javascript
|
[3]
|
1,055,094 | 1,055,095 |
Caching the return results of a function from John Resig's Learning Advanced JavaScript
|
<p>I have a few questions about this function from John Resig's exercise #19 in <a href="http://ejohn.org/apps/learn/#19" rel="nofollow">http://ejohn.org/apps/learn/#19</a></p>
<ol>
<li><p>what is the purpose of the second last line <code>getElements.cache = {};</code> Is it storing <code>return results</code> in an array? </p></li>
<li><p>If my guess in (1) is correct, is it only catching <code>return results</code> because, in the "else" section of the function, <code>getElements.cache[name] = results;</code>?</p></li>
<li><p>when I played with the code in the console in the tutorial, I removed the line <code>getElements.cache[name] = results</code> from the "else" section, but still got the same result, as when it was there--namely, it told me that there were 76 elements. What, therefore, is the purpose of this line <code>getElements.cache[name] = results</code> if it`s not necessary to get the result?</p></li>
<li><p>is there any significance to the fact that, in the "else" section of the function, the order of the line <code>getElements.cache[name] = results;</code> is reversed from the <code>if</code> section of the code, where it says <code>results = getElements.cache[name]</code></p></li>
<li><p>finally, is <code>cache</code> a pre-defined function in JavaScript? I can't find it in the documentation. </p></li>
</ol>
<pre><code>function getElements( name ) {
var results;
if ( getElements.cache[name] ) {
results = getElements.cache[name];
} else {
results = document.getElementsByTagName(name);
getElements.cache[name] = results;
}
return results;
}
getElements.cache = {};
log( "Elements found: ", getElements("pre").length );
</code></pre>
|
javascript
|
[3]
|
1,318,522 | 1,318,523 |
What are the latitude and longitude of a circle?
|
<p>In Android, if I have a circle's radius and center value, how could I measure the latitude and longitude of about 1 km periphery of that circle?</p>
|
android
|
[4]
|
725,933 | 725,934 |
Core Location - Get distance Range
|
<p>I need to identify coordinates for the range selected by User. I can get users current coordinates by coreLocation but I need to pick places of interest in user selected value range say 1 mile within his current location. Essentially I want to circle around 1 mile coordinates.
Any help/lead would really be appreciated, I am new to iPhone programming. </p>
|
iphone
|
[8]
|
1,390,063 | 1,390,064 |
Copying Bytes to Bytes Array?
|
<p>I am learning and I'd like to know the best way how to do the following array copy, Consider this code:</p>
<pre><code>void Cast1LineSpell(UINT Serial, char *chant)
{
byte packet[] = { 0x0F, 0x03,
(Serial >> 24) & 0xFF, (Serial >> 16) & 0xFF,(Serial >> 8) & 0xFF, Serial & 0xFF,
0x9A, 0x92, 0x00, 0x00, 0x00, 0x1A };
byte prepareSpell[2] = { 0x4D, 0x01 };
byte chant_length = sizeof(chant) / sizeof(chant[0]);
byte chant_name[] = { 0x4E, chant_length, }; // <= how can i put the bytes in chant* into the rest of this array, and then append bytes 0x00 and 0x4E on to the end of it?
}
</code></pre>
<p>how can i put the bytes that are inside of <code>*chant</code>, and then put them into the end of <code>chant[]</code> and then append bytes <code>0x00</code> and <code>0x4E</code> on to the end of it?</p>
<p>Can anybody provide a solution?
Much Appreciated.</p>
|
c++
|
[6]
|
462,905 | 462,906 |
Best way to launch a process and block until it is finished
|
<p>I'm told subprocess.Popen does not block, so the process runs in the background and your python program does not wait until it has finished. However, this is not what I want.</p>
<p>I'm having my program call into an external python program, which I have no control over. It does not return any return codes, just runs, operates on files, and finishes. I want to call this and only continue my python program when that call has completed. How do I do this?</p>
|
python
|
[7]
|
2,152,318 | 2,152,319 |
How to attach image in email from drawable in android
|
<p>I am attaching an image from drawable folder and sending it in a email.
when I send it from default email client.Image extension(.png) is missing in attachment
and and also the file name is changed itself.
I want t send image with default name(as in drawable) and with .png extension.</p>
<p>this is my code.</p>
<pre><code> Intent email = new Intent(Intent.ACTION_SEND);
email.setType("image/png");
email.putExtra(Intent.EXTRA_EMAIL, new String[] { to });
email.putExtra(Intent.EXTRA_SUBJECT, "Hey! ");
email.putExtra(Intent.EXTRA_STREAM, Uri.parse("android.resource://"+ getPackageName() + "/" + R.drawable.ic_launcher));
startActivity(Intent.createChooser(email, "Sending........"));
</code></pre>
<p>Please suggest me what is worng in this code
thanks.</p>
|
android
|
[4]
|
5,837,562 | 5,837,563 |
sip do not talk
|
<p>I use <strong><code>sipdemo.register</code></strong> and invite sucess,but can not talk with <code>peer.trace startaudio</code>,<br>i can see <strong><code>audiogroup.setmode(MODE_NORMAL)</code></strong> .
all permissions is seted,epscial <strong><code>MODIFY_AUDIO_SETTINGS</code></strong> is seted. what are settings elso?
when invite peer,peer is handle on.<br>we can not listen echo other.</p>
<p>how process it?</p>
|
android
|
[4]
|
5,525,572 | 5,525,573 |
Invalid command line parameter when Android executes
|
<p>When I click the 'run as Android application' option, it shows the following error:</p>
<pre><code>[2010-08-16 16:56:35 - Emulator] invalid command-line parameter: http://hostname:port.
[2010-08-16 16:56:35 - Emulator] Hint: use '@foo' to launch a virtual device named 'foo'.
[2010-08-16 16:56:35 - Emulator] please use -help for more information
</code></pre>
|
android
|
[4]
|
2,178,809 | 2,178,810 |
How to if a given type implements some interface
|
<p>I've got an IModelElement interface, and several classes implementing that interface. Somewhere in my code there's the following statement:</p>
<pre><code>Object childClass = request.getNewObjectType();
</code></pre>
<p>Here getNewObjectType() returns a Class object. I need to check if that Class objects represents a class which implements the IModelElement interface, anyone knows how is this achieved?</p>
|
java
|
[1]
|
5,228,251 | 5,228,252 |
What does -XX:+UseGetTimeOfDay as a parameter do?
|
<p>Whilst working on a Java application I've come across the <code>-XX:+UseGetTimeOfDay</code> parameter on a java command, I can't find much information about it.</p>
<p>Firstly, what does the -XX mean, and what would the UseGetTimeOfDay provide? I haven't seen these before and I'm wondering what they do, could it be something specific to my application or are these standard Java parameters?</p>
|
java
|
[1]
|
1,106,159 | 1,106,160 |
"arguments" property in Chrome has functionality changed?
|
<p>Here is my case:</p>
<pre><code>function x(a) {
console.log(a + '=' + arguments[1]);
}
x('arg0', 'arg1');
</code></pre>
<p>In Firefox 4 and not so long ago in Chrome, this was the content of 'arguments':</p>
<pre><code>arguments[0] = 'arg0';
arguments[1] = 'arg1';
</code></pre>
<p>In Chrome, now only the named arguments are in the <code>arguments</code> array. So it's only 1 long, instead of 2.</p>
<p>So my questions:</p>
<ol>
<li>When and how did this change?</li>
<li>How can I make this work again?</li>
</ol>
|
javascript
|
[3]
|
2,644,872 | 2,644,873 |
Inlining Functions
|
<p>What is inline? </p>
<p>What is it used for? </p>
<p>Can you inline something in C#?</p>
|
c#
|
[0]
|
5,256,967 | 5,256,968 |
Exposing Member Functions in a Custom Class through WCF
|
<p>I have some member functions in three custom classes already created in my service. My objective is to use these custom classes on the client side to access the the member fuctions in the service. How do I expose these classes with all the member methods in them to the client?</p>
<p>I created these three classes in my service and marked them as "DataContract", and the member fuctions as "OperationContract". I created an Interface that defines these custom classes as OperationContracts returning an object of each of the classes through implementing them on a separate class.</p>
<p>Unfortunately, I couldn't achieve my objective because two of the classes have a contructor that takes some parameters, whereas the class with no contructor was accessible on the cliet side but I couldn't see the member methods in the class.</p>
<p>please I need your hints on what to do. Thank you.</p>
|
c#
|
[0]
|
1,447,996 | 1,447,997 |
How to get notified when "Add account " Activity has finished
|
<p>I'm developing an application that uses google push c2dm.
When I start my application I check to see whatever the phone has a Google account registered or not.
If there is no account I use startActivity to start the "Add account" activity</p>
<pre><code>Intent addAccountIntent = new Intent(android.provider.Settings.ACTION_ADD_ACCOUNT).setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(addAccountIntent); </code></pre>
<p>Is there a way to get notified when this activity has finished, so that I can confirm that there is a Google account active on the phone.</p>
|
android
|
[4]
|
257,603 | 257,604 |
Flight board effect using jquery
|
<p>I am trying to build a flight board effect using jquery.</p>
<p>So far i have been able to create an effect that rotates characters. Here's what I have achieved so far: <a href="http://www.jaspreetkaur.com/chatter/" rel="nofollow">http://www.jaspreetkaur.com/chatter/</a></p>
<p>See the text "get to the chatter that matters"</p>
<p>However O do not feel this effect is realistic. I want the text flip to be like <a href="http://nolanow.cacno.org/" rel="nofollow">http://nolanow.cacno.org/</a> (see the word NOW in logo) This effect is created with help of images.</p>
<p>I do not want to use images to keep the effect reusable, so how can i create the effect without use of images?</p>
|
jquery
|
[5]
|
313,996 | 313,997 |
How to add builtin functions
|
<p>I am new to python programming. How can I add new built-in functions and keywords to python interpreter using C or C++?</p>
|
python
|
[7]
|
4,719,579 | 4,719,580 |
Is it possible to open PDF files in Turbo C++ and if so, how?
|
<p>I am doing a project in C++ and I want to open PDF files. How can I do it in turbo c++? Do I have to switch to another IDE?</p>
<p>Edited:
I am doing an "E-book management" in c++. After managing the software i wanted to open pdf file through my program and do no access adobe reader or aome other. Sorry for incomplete question.</p>
|
c++
|
[6]
|
3,738,512 | 3,738,513 |
how to select a point on the curve GraphViewData with finger pressure?
|
<p>I use the library graphView in my Android App, I wish I could get the event when I press a point on the curve.
But I do not see how this library and I have not found anything on the internet.</p>
<p><a href="http://www.jjoe64.com/p/graphview-library.html" rel="nofollow">http://www.jjoe64.com/p/graphview-library.html</a></p>
|
android
|
[4]
|
1,153,806 | 1,153,807 |
Trying to delete files after concatenation with java
|
<p>here is a code to concatenate all files from a folder.
it works well but i modified it to delete files after concatenation and this function is not working coze i don't know how to declare in main method</p>
<p>Any help will be appreciated thank you very much.</p>
<pre><code>import java.io.*;
import java.io.File.*;
public class ConcatenatedFiles {
static public void main(String arg[]) throws java.io.IOException {
PrintWriter pw = new PrintWriter(new FileOutputStream("C:/Concatenated-file/concat.txt"));
File file = new File("C:/Target");
File[] files = file.listFiles();
for (int i = 0; i < files.length; i++) {
System.out.println("Processing " + files[i].getPath() + "... ");
BufferedReader br = new BufferedReader(new FileReader(files[i]
.getPath()));
String line = br.readLine();
while (line != null) {
pw.println(line);
line = br.readLine();
}
br.close();
}
pw.close();
System.out.println("All files have been concatenated into concat.txt");
File directory = new File("C:/Target");
// Get all files in directory
File[] files = directory.listFiles();
for (File file : files)
{
// Delete each file
if (!file.delete())
{
// Failed to delete file
System.out.println("Failed to delete "+file);
}
}
}
}
</code></pre>
|
java
|
[1]
|
5,782,846 | 5,782,847 |
Global pointer to object causes access violation?
|
<p>Maybe you will be able to clear something for me, because I don't know exactly where my thinking is flawed. First some code:</p>
<p>Talker.h: </p>
<pre><code>class talker
{
public:
talker();
void sayHello() {cout << "Hello";} ;
};
</code></pre>
<p>anotherClass.h:</p>
<pre><code>class anotherClass
{
public:
anotherClass();
void doSomethingYourself() { cout << "will do"; };
void askHimToSayHello() { pointerToTalker->sayHello; };
//Access violation, bad pointer(?)
};
</code></pre>
<p>common.h:</p>
<pre><code> static talker *pointerToTalker;
// if I add here "= new talker", code works fine
</code></pre>
<p>main.cpp:</p>
<pre><code>#include "common.h"
int main()
{
pointerToTalker = new talker; // Here is the bug, but why?
pointerToTalker -> sayHello; // says Hello alright
anotherClass *pointerToAnotherClass = new anotherClass;
pointerToAnotherClass -> doSomething (); //Does something OK
pointerToAnotherClass -> askHimToSayHello(); // Causes access violation
}
</code></pre>
<p>Of course functions are a bit more complex, and each is implemeted in coresponding .cpp including "common.h". My question is - why pointerToTalker, if initialized inside main() does not work inside anotherClass::AskHimToSayHello()? It should pointing to valid memory by the time it is used there.
It is my "Hello world, OOP!" btw, so please be gentle if there is no hope for me :)</p>
<p>Sorry for the childish style btw. It helps me cut down the code I have to something more compact without me loosing the big picture :).</p>
|
c++
|
[6]
|
323,890 | 323,891 |
open source php hotel booking system
|
<p>Anyone recommend a good open source hotel booking system built for a LAMP stack?</p>
|
php
|
[2]
|
4,790,090 | 4,790,091 |
why using javascript in the click event?
|
<p>I see a line like the following, but i don't know what's the aim of the onclick event?</p>
<pre><code><a href="#comment-form" onclick="javascript:jQuery('#shop_tab').click()">post a comment</a>
</span>
</code></pre>
|
javascript
|
[3]
|
4,661,146 | 4,661,147 |
Make a writable dir in php?
|
<pre><code>mkdir('..'.$this->path.$user, 0777);
</code></pre>
<p>I'm trying to make a dir on my server with write permission so images uploaded can be written to it.</p>
<p>I do the above but when I check the write permission on the folder created it is 755.</p>
<p>Anyone know why?</p>
|
php
|
[2]
|
2,717,535 | 2,717,536 |
Extracting Geometry from IFC File
|
<p>I have to extract the geometry of a ifc file in JAVA. My problem is, that i don't know how to do it.</p>
<p>I tried to use <a href="http://www.openifctools.org/" rel="nofollow">openifctools</a> but the documentation is really bad. For now i have the ifc file loaded, but i cannot get the geometry out of the model. </p>
<p>Does anyone have experience with ifc model loading?</p>
<p>Thanks in advance.</p>
<p>EDIT: This is what I've done so far</p>
<pre><code>try {
IfcModel ifcModel = new IfcModel();
ifcModel.readStepFile(new File("my-project.ifc"));
Collection<IfcClass> ifcObjects = ifcModel.getIfcObjects();
System.out.println(ifcObjects.iterator().next());
} catch (Exception e) {
e.printStackTrace();
}
</code></pre>
<p>This correctly loads the ifc file. But I don't know what to do with this information. </p>
<p>I also tried to use <a href="http://ifcopenshell.org/index.html" rel="nofollow">IfcOpenShell</a> but the provided jar container hadn't worked either. At the moment I try to build IfcOpenShell by myself.</p>
<p>I'm kinda desperate because everything is very undocumented and I really need to load and parse the ifc geometry.</p>
|
java
|
[1]
|
2,190,405 | 2,190,406 |
Android ACTION_SEND Intent not populating the To field
|
<p>Im trying to send an email in Android on 2.1 and I have two problems.</p>
<p>1) firstly, to To field does not populate</p>
<p>2) the type message/rfc822 creates an error: "no applications can perform this action"</p>
<pre><code> Intent msg = new Intent(Intent.ACTION_SEND);
//Two types, rfc822 doesnt seem to work in the emulator
msg.setType("text/plain");
//msg.setType("message/rfc822");
//To:
msg.putExtra(Intent.EXTRA_EMAIL, mEmailAddress);
//Body:
//msg.putExtra(Intent.EXTRA_TEXT, "");
//Subject
//msg.putExtra(Intent.EXTRA_SUBJECT, "");
mActivity.startActivity(Intent.createChooser(msg, "chooser title"));
</code></pre>
<p>I am running this code sample in the emulator</p>
<p>Thanks
Mark</p>
|
android
|
[4]
|
34,203 | 34,204 |
Some basic c# programs that you recommend for a beginner
|
<p>As i am new to programming... What are the basic c# programs that i should go through to know about c# programming.... Any sample programs...</p>
|
c#
|
[0]
|
4,500,939 | 4,500,940 |
Image.FromFile starts 'skipping' files
|
<p>I'm loading a bunch of files into a <code>ListView</code>, and I use <code>Image.FromFile()</code> and <code>.Width</code> and <code>.Height</code> to display the the resolution of each file in a designated column. However, whenever I load more than a handful of files, this method starts skipping files. The first, say 50 files are all loaded properly but after that more and more files are skipped.</p>
<p>What could cause this problem, and are any better alternative methods available? This method also slows down the loading process considerably, so hopefully this process can be sped up a little bit.</p>
<p>EDIT: Sorry... Here's the relevant code:</p>
<pre><code>private void AddItem(string file)
{
FileInfo fi = new FileInfo(file);
ListViewItem item = new ListViewItem(fi.FullName);
try
{
Image img = Image.FromFile(fi.FullName);
item.SubItems.Add(string.Format("{0} x {1}", img.Width, img.Height));
}
catch { }
((ListView)sender).Items.Add(item);
</code></pre>
<p>}</p>
<p>The try/catch methods are meant to prevent errors for non-image files. However, they also seem to be 'responsible' for the skipping issue. When I disable them I get an 'out of memory' error, which seems to be the real cause here.</p>
|
c#
|
[0]
|
269,283 | 269,284 |
Running Timer in iPhone Sleep mode (with no javascript)?
|
<p>So as I have learned today, if I put a phone in sleep mode that is running a javascript timer function, it will become paused.</p>
<p>As I need a timer for a certain application - that needs to continue to record the time and display it, updating the innerHTML of an element ever second: how do you think I should go about getting this timer to work?</p>
<p>Thanks for the grand help!</p>
|
iphone
|
[8]
|
3,987,407 | 3,987,408 |
jQuery: something is wrong with how this loop is being done
|
<pre><code>function appendRefToLinks(ref){
alert("hi");
$j('a').each(function(i){
alert('hello');
$j(this).attr('href',$j(this).attr('href') + "?ref=" + $j.cookie.get("tb_ref"));
});
}
</code></pre>
<p>I see the hi alert, but I have to links on my page, and I never see hello.... what am I doing wrong?</p>
|
jquery
|
[5]
|
4,884,732 | 4,884,733 |
better writing style for the following code
|
<p>I was wondering if someone could tell me the pythonic way to check out the following.</p>
<p>I have a 6 bit binary number and want to check with its decimal values. Using mathematical function is one way but still it would require that I write around 2**6 if constructs.</p>
<p>So I wanted to know if there's an easier statement to write it. </p>
<p>Also assume that lets say it's not binary then what's the better way to check for 2**6 values in python.</p>
<pre><code>if(a==1):
....
else:
if(a==2)
.....
</code></pre>
<p>One way is saving it in a list and checking it with the indexes but still that would require that many if-else I guess.....</p>
<p>Thanks ....</p>
|
python
|
[7]
|
4,048,593 | 4,048,594 |
saving button state in jquery
|
<p>I am using a few custom jquery buttons with <code>datatables</code> to do some sorting. Unfortunately when I leave the page and come back, <code>datatables</code> remembers its state, but the toggle button doesnt. So I am trying to set a cookie when the button is toggled so I can read it later, but I cant seem to get it working.</p>
<p>Here is my button code with the cookie creation:</p>
<pre><code>$('#completed_button').bind('change', function(){
if($(this).is(':checked')){
$(this).button('option', 'label', 'Hide Completed');
oTable.fnFilter('Completed',6,false);
$.cookie('showCompletedState', 'checked');
} else {
$(this).button('option', 'label', 'Show Completed');
oTable.fnFilter('',6,false);
$.cookie('showCompletedState', 'unchecked');
}
});
</code></pre>
<p>Now here is my attempt at reading the cookie and setting the button state:</p>
<pre><code>var showCompletedState = $.cookie('showCompletedState');
if (showCompletedState == 'checked') {
<-- need something here to actually change button state -->
$('#completed_button').button('option', 'label', 'Hide Completed');
oTable.fnFilter('Completed',6,false);
} else if (showCompletedState == 'unchecked') {
<-- need something here to actually change button state -->
$('#completed_button').button('option', 'label', 'Show Completed');
oTable.fnFilter('',6,false);
}
</code></pre>
|
jquery
|
[5]
|
2,515,602 | 2,515,603 |
How to check number?
|
<p>Could anyone please tell me how to check what number I've got from a * b? Which is I would like to know every part of this number so for example if the result from this expression would be 25 I would like to know that first digit is two and second digit is five.</p>
|
c++
|
[6]
|
1,728,204 | 1,728,205 |
javascript prev next fuction
|
<p>I have asp.net code as</p>
<pre><code><div class='OuterDiv'>
<div class='InnerDiv' id='product_827'>
<a onclick="javascript:ajaxLightboxPopup(827,'', this)" href="javascript:void(0);"
style='text-decoration: none;'>
<img width='85' height='85' src='pngs/100942644.jpg' /><div class='product-code'
style='text-decoration: none;' width='120px'>
KWD 1.75
</div>
</a>
</div>
<div class='InnerDiv' id='product_828'>
<a onclick="javascript:ajaxLightboxPopup(828,'', this)" href="javascript:void(0);"
style='text-decoration: none;'>
<img width='85' height='85' src='pngs/101255432.jpg' /><div class='product-code'
style='text-decoration: none;' width='120px'>
KWD 2.25
</div>
</a>
</div>
</div>
</code></pre>
<p>and I have javascript function as </p>
<pre><code>function ajaxLightboxPopup(productId, page, cntrl) {
var pref = 'product_';
var prevElement = jQuery('#' + pref + productId).prev();
var prevElemHTML = prevElement.html();
}
</code></pre>
<p>here the requirement,
My page containing 3 Outer Div
and each outer div containing 5 innerDiv.
The same inner div with same id will be repeated in more than outer div.
When I var prevElement = jQuery('#' + pref + productId).prev(); statement to get previous element of innerdiv from 2 or 3 outer div its
always points to Previous of inner div present in 1 outer div.
How to solve this..</p>
|
javascript
|
[3]
|
2,561,433 | 2,561,434 |
Can you see what's wrong with my simple php code?
|
<p>I just can't figure out why I am getting this error:</p>
<blockquote>
<p>Warning: Cannot modify header
information - headers already sent by
(output started at
C:\Users\Gateway\Documents\xampp\htdocs\login.php:3)
in
C:\Users\Gateway\Documents\xampp\htdocs\login.php
on line 14</p>
</blockquote>
<p>Here's the code:</p>
<pre><code>if (isset($_POST['submit'])) {
$username = sanitize($_POST['username']);
$password = sanitize($_POST['password']);
if ($username) {
if ($password) {
$query = mysql_query(" SELECT * FROM users WHERE username = '$username' && password = '$password' ");
if (mysql_num_rows($query) == 1) {
$setCookie = setcookie('loggedIn', 1, time()+3600);
echo 'user found';
} else {
$error = 'The username and/or password you entered is incorrect';
}
} else {
$error = 'Please enter a password';
}
} else {
$error = 'Please enter a username';
}
}
</code></pre>
<p>I am entering the username 'admin' and the password '123', a record for this exists in my database inside the users table. And the "user found" message I'm echoing works when the correct username/password combo is entered. </p>
<p>Problem is, the cookie called "loggedIn" doesn't set and I get that can't modify header error.</p>
<p>Why?</p>
|
php
|
[2]
|
1,832,195 | 1,832,196 |
When i try to use Javaanpr Jar in android. VM gets disconnected while creating object for the class in the Jar
|
<pre><code>public static Intelligence systemLogic;
/**
* @param args
*/
public String getNumber(String filepath) throws Exception{
String number1 = null;
Intelligence grabNumber = null;
grabNumber = new Intelligence(false);
number1 = grabNumber.recognize(new CarSnapshot(filepath));
}
</code></pre>
<p>It is failing while create instance itself</p>
|
android
|
[4]
|
5,540,774 | 5,540,775 |
PHP: Its 20 minutes past midnight and somehow on refresh the php date doesnt change. Why is the php god angry on me?
|
<p>As i said before, its 20 min past midnight, and when i do check the date using php</p>
<p>as date("Y-m-d");
and date("Y-m-d",strtotime("now"));</p>
<p>i still get the previous days' date. I expected a lot of things to go wrong while coding but definitely not this. I wouldnt even have it in the list of potential-things-that-could-go-wrong. I have refereshed the browser, using SHift + refresh and have also gone to the extent of restarting the system.</p>
<p>What went wrong?</p>
|
php
|
[2]
|
2,463,516 | 2,463,517 |
UITabViewController includes UINavigationController
|
<p>I have an app which is a UITabViewController in root, include 2 UIViewControllers and 1 UIavigationController. The UINavigationController includes another UIViewController (the third).</p>
<p>The app works well on iPhone.</p>
<p>When I migrate it to iPad, when I set the breakpoint on viewDidLoad of the third UIViewController, I found that it was not being triggered.</p>
<p>Welcome any comment</p>
|
iphone
|
[8]
|
3,783,110 | 3,783,111 |
How can I set the disabled and readonly properties of a <select> and <input> element with jQuery?
|
<p>How can I set the disabled and readonly properties of a <code><select></code> and <code><input></code> element with jQuery? Also can someone please explain the difference. It seems to me that both properties would do the same thing.</p>
|
jquery
|
[5]
|
151,858 | 151,859 |
Why does Int32.MaxValue * Int32.MaxValue == 1?
|
<p>OK, I know, Int32.MaxValue * Int32.MaxValue will yield a number larger than Int32 BUT, shouldn't this statement raise some kind of an exception?</p>
<p>I ran across this when doing something like IF (X * Y > Z) where all are Int32. in X and Y are sufficiently large enough, you get a bogus value from X*Y</p>
<p>Why is this so and how to get around this? besides casting everything to int64</p>
|
c#
|
[0]
|
4,065,174 | 4,065,175 |
How to get class name only, not full path?
|
<p>I am aware that using <code>Context</code> and a method <code>getClass().getName()</code> I can get a string which represent full class name, like <code>com.package1.package2.MainActivity</code>. </p>
<p>How can I get only the last part, class name only? In this case it would be <code>MainActivity</code> string. </p>
<p>I can do it with a simple <code>split()</code> method, but maybe there is a better way, more reliable. </p>
|
android
|
[4]
|
1,646,512 | 1,646,513 |
What is the correct way of stopping an object in a method that was created in another?
|
<p>I have a form that has a button which creates a new object and calls it's <code>start()</code> method.</p>
<p>The program works fine, however, I now want to create a stop button. I obviously cannot call the object's <code>stop()</code> method as it is elsewhere, but, I just can't think of the correct way of changing my code.</p>
<p>As I write this, the best thing I can think of is to take the <code>MyObject myo = new MyObject("test");</code> and place <code>MyObject myo;</code> at the top of the class, outside methods and then try to set it from within the class.</p>
<p>What would you do in this situation?</p>
|
c#
|
[0]
|
947,024 | 947,025 |
Alarm doesn't ring if program force-stopped
|
<p>I have an alarm app which I think was programmed in the standard way using an <code>AlarmManager</code> and <code>BroadcastReceiver</code>. I have even added code so that the alarm stays active after a reboot. I have been using the program without problem for weeks now.</p>
<p>I had been led to believe that doing things this way meant that it was not essential to keep my alarm program running the whole time, but to my horror I have just found that if I set an alarm and then do a force stop of my alarm app, then the alarm never rings.</p>
<p>I'm not sure that this means I made a mistake in my coding, or I was misled into believing that it is possible to keep the alarm set despite the app being stopped.</p>
<p>Maybe the OS somehow detects that my alarm app has an alarm running and therefore avoids shutting it down? So as long as the user doesn't <em>manually</em> do a force stop then all should be well.</p>
<p>Any ideas?</p>
<p><strong>EDIT:</strong> I just tested "Alarm Clock Xtreme". I set an alarm. Then did a force stop... the alarm never rang. </p>
|
android
|
[4]
|
4,203,206 | 4,203,207 |
Best way to convert int[][] to int**?
|
<p>This is kind of a curiosity question. I do have an existing solution, but I wonder if people know of a better approach.</p>
<p>My callers want to call me with int[][]. I have a routine that needs to process an int**. What's the best way to do this conversion? In other words:</p>
<pre><code>public static void Func1(int[][] data) {
Func2(data); //how to do this?
}
private unsafe static void Func2(int** data) {
//process data
}
</code></pre>
<p>Following is the best approach I could come up with. It works fine, but I can't say I'm 100% happy with the recursive approach (and the O(data.Length) stack space it requires)</p>
<pre><code>public static void Main() {
var test=new[] {
new [] {10},
new [] {20,30},
new [] {40,50,60},
new [] {70,80,90,100},
};
MySolution_Func1(test);
}
public unsafe static void MySolution_Func1(int[][] data) {
var items=new int*[data.Length];
Recurse(0, data, items);
}
public unsafe static void Recurse(int index, int[][] data, int*[] build) {
if(index==data.Length) {
fixed(int** finalp=build) {
Func2(finalp);
}
} else {
fixed(int* nextp=data[index]) {
build[index]=nextp;
Recurse(index+1, data, build);
}
}
}
private unsafe static void Func2(int** data) {
for(var j=0; j<4; ++j) {
for(var i=0; i<j+1; ++i) {
Debug.WriteLine("{0},{1}: {2}", j, i, data[j][i]);
}
}
}
</code></pre>
|
c#
|
[0]
|
2,077,791 | 2,077,792 |
Java mistakes with numbers
|
<p>I am trying to fix the following Java code,</p>
<p>I cannot figure out why the printout is still 5.</p>
<pre><code>public class simpleMath
{
public static void main(String[] args)
{
int number=5;
half(number);
System.out.println("5 divided by 2 is: " + number);
}
private static double half(int number) {
number = number/2;
return number;
}
}
</code></pre>
|
java
|
[1]
|
1,211,244 | 1,211,245 |
JavaScript learning resources
|
<p>I am a programmer and I want to learn JavaScript. What are the best resources, and where I can learn from?</p>
|
javascript
|
[3]
|
4,236,688 | 4,236,689 |
Get and set specific height of elements
|
<p>I'm a little bit new to JavaScript, but I hope someone can help me.</p>
<p>How can I get the height of a paragraph element or div? By height I don't mean how high it is, but how many pixels it is sitting from the very top of the page. Is there any way to get this value?</p>
<p>And to the 2nd part of my question: how can I set this specific value to another element?</p>
<p>Thank you!</p>
|
javascript
|
[3]
|
3,684,599 | 3,684,600 |
Changing header button image and header text at runtime
|
<p>I have a header common in all activities. </p>
<p>header.xml </p>
<pre><code><?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/header_layout" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:orientation="horizontal">
<!-- home button -->
<ImageButton android:id="@+id/header_home_button"
android:src="@drawable/menu_info" android:layout_height="wrap_content"
android:layout_width="wrap_content" />
<!-- header text -->
<TextView android:id="@+id/header_title" android:layout_width="200dip"
android:layout_height="wrap_content" android:gravity="center"
android:text="Todays recipe :" android:textSize="20dp"
android:textStyle="bold" />
</LinearLayout>
</code></pre>
<p>However in different activities the title changes for textview and image for imageButton also changes. How to change them at runtime? </p>
<p>Thanks</p>
|
android
|
[4]
|
2,002,112 | 2,002,113 |
Python - transform a list
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/952914/making-a-flat-list-out-of-list-of-lists-in-python">Making a flat list out of list of lists in Python</a> </p>
</blockquote>
<p>I have a list like:</p>
<pre><code>[['22', '14']]
</code></pre>
<p>How can I transform it to:</p>
<pre><code>[22, 14]
</code></pre>
<p>Thank you.</p>
|
python
|
[7]
|
745,099 | 745,100 |
how to delete objects?
|
<p>I have two classes:</p>
<pre><code>Class Node {
int address
}
Class Link{
int latency;
int bandwidth;
Node node1;
Node node2;
}
public Link [] link= new Link[Nmax];
</code></pre>
<p>if I want to create a link between two nodes, it is easy, I've just to:</p>
<pre><code>node1=new Node(); //and then I add parameter like address and so on
node2= new Node();//...............
link[1]= new Link();
link[1].node1=node1;
link[1].node2=node2;
link[1].latency=15; //and so on, we suppose that we have 100 nodes and 60 links
</code></pre>
<p>Now, during the program, sometimes we add some new nodes then we have to add links between them, I can do this with the same manner us above, my question is:
what I have to do if I want to delete a node ? (links between this node and other existing nodes must be deleted too)</p>
|
java
|
[1]
|
3,256,186 | 3,256,187 |
submitting forms
|
<p>I was wondering if some one disables javascript how will my form be submitted for checking with Php. One more thing I would like to know how can I perform something like this if the person clicks the submit button and PHP checks a few fields if one of the fields is not valid I return an error in a div and if there is no error the script runs. I know how to perform the jquery ajax, mysql and stuff but submitting data if javascript is disabled is a bit confusing for me. I mean I wont be providing any form action so how will this all work. I hope I made some sense, Thanks.</p>
<p>// edited</p>
<p>Ok I got a few answers thanks it helped me understand how this all works. My final addition to the question is if I submit a form with no action it will be like submitting to itself. Will this cause the page to reload? and finally how can I cater the submit to do both things? Firstly validate through ajax and if everything is fine self submit and perform the php script even if javascript is disabled?</p>
|
jquery
|
[5]
|
533,652 | 533,653 |
Android - force full screen soft keyboard
|
<p>Is there any way I can force soft keyboard to appear in full screen mode, so that there are only 2 items on the screen:</p>
<ol>
<li>Text content</li>
<li>Keyboard</li>
</ol>
<p>?</p>
<p>Android 2.3</p>
|
android
|
[4]
|
3,132,551 | 3,132,552 |
Search internal nested tag and create click event with jquery
|
<p>How to search internal nested tag and create click event with jquery?</p>
|
jquery
|
[5]
|
1,214,534 | 1,214,535 |
javascript get element by id vs object id
|
<p>why do you have to use getObjectById, if you already know the ID of an object? It keeps on throwing me off, because I replace it with the ID of the element that I am referring to. </p>
<p>EDIT:
I think i may have just forgotten the #. But why does getObjectById exist, if you can assign an element an ID?</p>
|
javascript
|
[3]
|
5,382,228 | 5,382,229 |
How do I get maximum offline storage from within a web site?
|
<p>I'm trying to develop a cross platform application, where the most obvious route would be a web site with JavaScript, but then I lose the cosy comforts I'm used to using in my C# desktop apps, like file system access etc. How do I go about accessing <em>similar</em> services from within the browser?</p>
<p>E.g. I don't need to access anything I don't create, so actual file system access is just a luxury. I can use whatever the browser offers for offline storage, but have no clue how to do this.</p>
|
javascript
|
[3]
|
1,182,211 | 1,182,212 |
What is deconcatenation?
|
<p>I heard this mentioned and wanted to find out more. It does exist in google searches but I found no 'introduction'. I also found no information in the php manual or in my usual resources (like here).</p>
<p>I'm looking for a succinct answer and/or a link. </p>
|
php
|
[2]
|
5,207,658 | 5,207,659 |
Transfer of control and data between C and C#
|
<p>C# main program needs to call a C program GA.c This C code executes many functions and one function initialize() calls objective() function. But this objective function needs to be written in C#.This call is in a loop in the C code and the C code needs to continue execution after the return from objective() until its main is over and return control
to C# main program.</p>
<pre><code>C# main()
{
//code
call to GA in C;
//remaining code;
}
GA in C:
Ga Main()
{
//code
call to initialize function();
//remaining code
}
initialize funtion() in GA
{
for(some condition)
{
//code
call to objective(parameter) function in C#;
//code
}
}
</code></pre>
<p>How do we do this? </p>
|
c#
|
[0]
|
1,123,494 | 1,123,495 |
javascript validation
|
<p>I have two radio buttons. Each one has one associated text box. If I click one radio button and then submit an alert box should be shown if the associated text box is empty. How can I achieve this? </p>
<pre><code><form action="#" name="form1" id="form1" method="post" onsubmit="return check_workorder()">
<input type="radio" name="click" id="click1" checked="checked" value="date"/>
<strong>Start Date&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="text" id="my_date_field" name="my_date_field" class="datepicker" style="width:80px;"/>
</strong>
<script language="JavaScript" type="text/javascript">
new Control.DatePicker('my_date_field', { icon: 'images/calendar.png' });
</script>
</br><br />
<input type="radio" name="click" id="click2" value="order" />
<strong>Work order no
<input type="text" name="workno" id="workno" style="width:100px;"/>
</strong><span class="submit">
<input type="submit" name="submit" value="submit" onclick="return check_workorder()"/>
</code></pre>
<p>the javascript is</p>
<pre><code>function check_workorder() {
if (document.forms.form1.elements.click.value == "date") {
var dat = (form1.my_date_field.value);
if (dat == "") {
alert("please select date");
return false;
}
} else if (document.forms.form1.elements.click.value == "order") {
var wor = (form1.workno.value);
if (wor == "") {
alert("please enter work order no");
return false;
}
}
}
</code></pre>
|
javascript
|
[3]
|
3,894,088 | 3,894,089 |
Addressbook leaks
|
<p>Hello I m getting firstname, lastname and mobile number from below code</p>
<pre><code>- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier
{
NSString* name = (NSString *)ABRecordCopyValue(person,
kABPersonFirstNameProperty);
firstNameLabel.text = name;
[name release];
NSString *lastName =(NSString *)ABRecordCopyValue(person, kABPersonLastNameProperty);
lastNameLabel.text = lastName;
[lastName release];
if (property == kABPersonPhoneProperty) {
ABMultiValueRef multiPhones = ABRecordCopyValue(person, kABPersonPhoneProperty);
for(CFIndex i = 0; i < ABMultiValueGetCount(multiPhones); i++) {
if(identifier == ABMultiValueGetIdentifierAtIndex (multiPhones, i)) {
CFStringRef phoneNumberRef = ABMultiValueCopyValueAtIndex(multiPhones, i);
CFRelease(multiPhones);
NSString *phoneNumber = (NSString *) phoneNumberRef;
numberLabel.text = [NSString stringWithFormat:@"%@", phoneNumber];
// [phoneNumber release];
// CFRelease(phoneNumberRef);
}
//CFRelease(multiPhones);
}
}
[self dismissModalViewControllerAnimated:YES];
return NO;
}
</code></pre>
<p>And I am getting leaks.. Here is screen shot. Please help me to resolve leaks</p>
<p><img src="http://i.stack.imgur.com/qDU7t.jpg" alt="enter image description here"></p>
|
iphone
|
[8]
|
2,243,179 | 2,243,180 |
Java class can be run by double click but not task scheduler
|
<p>Java class in *.bat can be run by double click but not task scheduler.</p>
<p>What's the problem? Classpath or something else? </p>
<p>What should I do?</p>
|
java
|
[1]
|
2,132,483 | 2,132,484 |
Dismiss keyboard when user taps Mapview
|
<p>I have a UITextView in my Navbar that is acting as a search box. I would like to dismiss the associated keyboard when the user taps below the text box - namely on the MKMapView. However I can't figure out how to do this since it doesn't look like I can intercept touches from the mapview. </p>
<p>I have looked at a number of solutions, but none seem to work for my case as far as I can tell. Does anyone have a simple way to do this? I am a bit of a noob, so please let me know if I am not providing some relevant information, and please provide a few lines of example code in your answer if you can - I am still a bit shaky with terminology. Thanks!</p>
<p><img src="http://img532.imageshack.us/img532/4070/keyboardsm.png" alt="screenshot"></p>
|
iphone
|
[8]
|
3,885,702 | 3,885,703 |
how to add Go button in android SoftKeyBoard and its functionality?
|
<p>i want to put "Go" button in android appliation softkeyboard</p>
<p>for search and other related scenarios can any one guide me how to achieve this? with example.</p>
<p>any help would be appriciated.</p>
|
android
|
[4]
|
2,404,325 | 2,404,326 |
Start all javascript scripts with ;?
|
<p>Is it good practice to start all JS files with a semi colon to account for any bad scripts included before it? Or don't bother?</p>
<p>Thanks</p>
<p><code>;(function(){ /* my script here */ })();</code></p>
|
javascript
|
[3]
|
230,077 | 230,078 |
jQuery index of the object in array
|
<p>I'm trying to get the index of the trigger element in the array.</p>
<p>The html looks like this:</p>
<pre><code><ul>
<li><a href="#" rel="group">Link 1</a></li>
<li><a href="#" rel="group">Link 2</a></li>
<li><a href="#" rel="group">Link 3</a></li>
</ul>
</code></pre>
<p>Then on click I'm calling the run() method of the obJ object:</p>
<pre><code>var obJ = {
run : function(obj) {
var att = obj.attr('rel');
var arr = jQuery.find('a[rel='+att+']');
alert(obj.indexOf(arr));
}
};
$(function() {
$('a.click').click(function() {
obJ.run($(this));
return false;
});
});
</code></pre>
<p>The above however doesn't give me the index of the trigger in the collected array.</p>
<p>Any thoughts?</p>
|
jquery
|
[5]
|
1,315,595 | 1,315,596 |
How can i validate a mimimum amount of chars in my text box?
|
<p>im trying to validate a credit card security number, ive set the max length to 3 but i need to make sure that the users enters at least 3 and i cant find any minlength ways to do it.</p>
<p>Security: <code><input type="text" name="secno" maxlength="3"></code></p>
<pre><code>var n=document.forms["myForm"]["secno"].value;
if (n==null || n=="" || isNaN(n)) {
alert("Security number needed");
return false;
}
</code></pre>
|
javascript
|
[3]
|
80,729 | 80,730 |
checking text field value length
|
<p>I am trying to see if the text field length is at least a certain length. here is my code:</p>
<pre><code><form name="form2" id="form2" onsubmit="return validate()">
length 4: <input type="text" name = "t" id="t" />
<input type="button" name="submit" value="submit" />
</form>
<script>
function validate() {
document.write("good");
submitFlag = true;
if(document.form2.t.value.length!=4){
submitFlag=false;
alert("ivalid length - 4 characters needed!");
}
return submitFlag;
}
</script>
</code></pre>
<p>when I click submit, nothing happens.</p>
|
javascript
|
[3]
|
2,373,527 | 2,373,528 |
Structure of program/package?
|
<p>My package is in: </p>
<blockquote>
<p>com.user687111.mygame</p>
</blockquote>
<p>From there; is there any guidance on how I should be structuring my program? I have subdirectories for maps, entity, gameobjects, camera, controller, etc. This is fine; but as the game grows there is going to be a ton of subpackages.</p>
<p>Is there a "best practices" or a common convention used? Even if it's not official, if I ever take another programmer on, I don't want him to go "wtf is this?" </p>
|
java
|
[1]
|
3,379,218 | 3,379,219 |
How to skip using __autoload?
|
<p>I have a php file which has multiple classes in it. I noticed that __autoload is being called when I instantiate any of the classes, even after the 'package' file has been autoloaded. This is worrying me, because surely if the initial 'package' .php file has been loaded, it is unnecessary overhead for __autoload when the classes have already been loaded. </p>
<p>I probably made a hash of explaining that, so here is an example:</p>
<pre><code><?php
class Class1{};
class Class2{};
?>
</code></pre>
<p>Then in another file:</p>
<pre><code><?php
new Class1;
new Class2;
?>
</code></pre>
<p>__autoload will be used for both Class1 AND Class2's instantiation... even though they are housed in the same file.</p>
<p>Is there a way to get around this?</p>
<p>Sorry if my explanation isn't very good, I'd really appreciate any help or tips.</p>
|
php
|
[2]
|
4,777,076 | 4,777,077 |
My application recognize only the network at which i was connected when I started it
|
<p>I start my application being connected to 3g. When entering in main screen, I change the connection to a wifi one. Then I start a download operation. My Http Client throws a timeout exception and the download cannot be performed. But when come back to 3g, the download works again. Then I close the application and I activate the wifi. Then I open again the application. I perform a download and all is ok. But when I switch to 3g, the http client returns the same error as before. It seems that the http client recognize only the network at which I was connected when I started the application. Please, can you help me ?</p>
|
android
|
[4]
|
2,505,379 | 2,505,380 |
Activity need to be started before receiving sms from Particular number or port
|
<p>Hi
How can i start an activity (UI) after receiving and parsing the sms?
I tried the article at <strong>http://www.anddev.org/recognize-react_on_incoming_sms-t295.html</strong>
but still the activity is starting before we send the sms and then after when i send the sms i am only able to see the received notification.So please help me to start the activity only after receiving SMS.
Here is the code what i am using</p>
<pre><code>import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.telephony.gsm.SmsMessage;
import android.util.Log;
import android.widget.Toast;
public class SmsReactor extends BroadcastReceiver {
private static final String LOG_TAG = "SMSReactor";
private static final String ACTION = "android.provider.Telephony.SMS_RECEIVED";
@Override
public void onReceive(Context context, Intent intent)
{
if (intent.getAction().equals(ACTION))
{
StringBuilder sb = new StringBuilder();
Bundle bundle = intent.getExtras();
if (bundle != null)
{
Object[] pduObj = (Object[]) bundle.get("pdus");
SmsMessage[] messages = new SmsMessage[pduObj.length];
for(int i=0;i<pduObj.length;i++)
{
messages[i]=SmsMessage.createFromPdu((byte[])pduObj[i]);
}
for (SmsMessage currentMessage : messages)
{
sb.append("SMS Received From: ");
sb.append(currentMessage.getDisplayOriginatingAddress());
sb.append("\nMessage : ");
*/
sb.append(currentMessage.getDisplayMessageBody());
}
}
Log.i(LOG_TAG, "[SMSApp] onReceive: " + sb);
/* Show the Notification containing the Message. */
Toast.makeText(context, sb.toString(), Toast.LENGTH_LONG).show();
/* Start the Main-Activity */
Intent i = new Intent(context, SmsActivity.class);
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(i);
}
}
}
</code></pre>
<p>So please help me out of this situation its urgent
thanks in advance</p>
|
android
|
[4]
|
243,190 | 243,191 |
How do you create and use a Collection that has as one of its members a Collection
|
<p>I’m trying to create a Collection that will have a Collection as one of its members. The application is to track stock prices. </p>
<p>The primary collection should look like this: <strong>Symbol, Stock Name, (price collection’)</strong> </p>
<p>The ‘price collection’ should look like this: <strong>Date, Price</strong> </p>
<p>Some example data </p>
<p>APPL, Apple<br>
[1/1/2011,$245;1/2/2011,$247;1/3/2011,$242; .....]</p>
<p>MS, Microsoft
[1/1/2011,$35;1/2/2011,$32;1/3/2011,$42; .....]</p>
<p>So in c# how do I create a collection class that has a collection class as a member? Then how do I access the ‘price collection’ members of that collection? (I’ve managed to figure out the creation and able to add at both levels, but I can only access the top level to see contents. I can’t figure out how to access ‘prices’ that I’ve added nor can I see any of its methods </p>
|
c#
|
[0]
|
720,218 | 720,219 |
Check if user has updated app or installed a fresh copy?
|
<p>I will be releasing an update for my app with a new data structure, therefore if a user is updating my app I need to update their current data. So I was wondering how can I programatically check if the user updated my app or installed a new copy (if a new copy is installed I don't need to update anything) ?</p>
|
android
|
[4]
|
5,768,660 | 5,768,661 |
How to set style for spinner programmatically?
|
<p>I have spinner with a style selection (I set the spinner style in <code>strings.xml</code>) and it's works well if I set the style in <code>main.xml</code>. But I want to know how to set the style programmatically in which the style already defined in <code>strings.xml</code>.</p>
<p>Refer my code below</p>
<p><strong>main.xml:</strong></p>
<pre><code> <Spinner
android:id="@+id/PassengersSpinner1"
android:layout_width="100dp"
android:layout_height="40dp"
android:layout_span="3"
android:layout_marginTop="6dp"
style="@style/SpinnerStyle" />
</code></pre>
<p><strong>strings.xml:</strong></p>
<pre><code> <style
name="SpinnerStyle"
parent="@android:style/Widget.Spinner">
<item name="android:background">@android:drawable/btn_default</item>
</style>
</code></pre>
<p>Now, I want to know that how can I set this <code>strings.xml</code> programmatically without <code>main.xml</code>?</p>
|
android
|
[4]
|
3,808,707 | 3,808,708 |
PHP - Find longest date "streak" and "slump"
|
<p>I've currently got 2 dates in PHP - a 'start' date and an 'end' date. I have then created an array of dates, using a function I found called <a href="http://boonedocks.net/mike/archives/137-Creating-a-Date-Range-Array-with-PHP.html" rel="nofollow"><code>createDateRangeArray</code></a> (<code>$date_range</code>). For simplicity, the end date will always be <em>today's date</em>.</p>
<p>I've also got a separate array that contains a bunch of dates (<code>$valid_dates</code>) that will always fall between the start and end dates mentioned above. On those dates, 'something' happened - in this case, a training session.</p>
<p>I'm trying to get my head around getting the following:</p>
<ul>
<li>A range of dates similar to the <code>$date_range</code> array, populated with TRUE or FALSE based on whether or not a training session happened on that date. I'm happy for this to be an assoc array with keys named <code>date</code> and, say, <code>session_found</code> (bool).</li>
<li>The longest 'streak' i.e. the longest consecutive number of days that training sessions occurred.</li>
<li>The longest 'slump' i.e. the longest consecutive number of days that training sessions did NOT occur.</li>
</ul>
<p>Can someone point me in the right direction for getting the above info without using a <code>foreach</code> on the contents of the <code>$date_range</code> array and then having to use another <code>foreach</code> for the <code>$valid_dates</code> array on each item in the <code>$date_range</code> array? That is horribly inefficient ...</p>
<p>Sorry if I've over-complicated things with all that info but any help would be much appreciated.</p>
<p>I'm currently using PHP 5.4 on Debian Wheezy, if that helps (typical LAMP stack).</p>
<p>Thanks</p>
|
php
|
[2]
|
706,689 | 706,690 |
printstream fails to prints as what I wish
|
<p>I open a server socket at localhost's port e.g 11111, and I also include printstream for stream data which i would want to output as neat as expected like this</p>
<pre><code>PrintStream ps=new PrintStream(socket.getOutputStream(),false);
ps.println("<h1>Hello, it works!</h1>");
</code></pre>
<p>I am looking forward to seeing the output as <strong>Hello, it works!</strong>
but it becomes like this <code><h1>Hello, it works!</h1></code></p>
<p><strong>Update</strong>
I am not working with serlet or jsp, this simply is a webserver I would like to display a welcome message once the user visit the <code>http://localhost:111111</code></p>
<p>Thank you </p>
|
java
|
[1]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.