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,677,026 | 2,677,027 |
A plugin for query based search (Query Builder) in jQuery like Jira's Advanced Search?
|
<p>I'm on the hunt for a jQuery library to fulfill a certain UI request. I'm trying to achieve an advanced search feature that is <strong>purely query based</strong>. Such as, the user types out the following in a text box:</p>
<p><em>Project is "Unicorn" and (Employee starts with "Bob" or Employee is "Jane")</em></p>
<p>I don't care about what gets sent to the back-end when submitting, as long as it's somewhat structured JSON so I can build an SQL query based off it. I don't care about it presenting any results, as I have that under control. I just really need to find something to nail the UI for the query building. The real trick comes from having auto-completes for the Columns, Conditions, and Joining. </p>
<p>The UI should know what the user is typing at all times: a column, condition, value, or joiner and provide appropriate auto-completes:</p>
<ol>
<li>When the user clicks in the text box for the first time, an auto complete offers a list of columns.</li>
<li>Once a column is chosen, an auto-complete offers a list of conditions =, !=, <, >, contains, etc.</li>
<li>Then shut up while the user types a value. An added bonus would be to provide an auto-complete for boolean or enum based columns.</li>
<li>Then offer an auto-complete for a joiner such as And or Or</li>
<li>Then start over again with an auto-complete for the columns</li>
</ol>
<p>It would be grand if there was some validation involved and I don't mind feeding a custom JSON object defining the columns, conditions, etc.</p>
<p>I've been scouring the web for such a library and haven't found much in the way of these requirements. Has anyone had any success with this type of Query Builder and knows where I can find something to do this trick?</p>
|
jquery
|
[5]
|
1,148,469 | 1,148,470 |
Popular C/C++ IDE in Industry currently
|
<p>I wanted to know which are the top 5 IDE's in the market today for development/maintenance of C/C++ applications? I am looking for both windows and linux based IDE's. They can by open source or proprietary.</p>
|
c++
|
[6]
|
4,929,724 | 4,929,725 |
Android, managing views and taks and activities
|
<p>I need general advice.</p>
<p>I'm building an app that can be started via the icon (normal way) but also with an intent triggered by a click in the notification area (the app places an icon in the notification area). The is awaken when a time event / alarm occurs.</p>
<p>The app has 5 to 10 views. Is it better to open a new activity for each view? How can I be sure not to have mutliple tasks open? Say if my app is Activity-A, Activity-B, Activity-C and can be started from Activity-A and Activity-B (depending on if it's opened via the icon or the notification area) ... how do I clean everything upon app close? </p>
<p>Or is it better to have one activity and just switch views (xml layouts)?</p>
|
android
|
[4]
|
948,081 | 948,082 |
Uncaught Syntax error, unrecognized expression: Contains
|
<p>So I'm using:</p>
<pre><code> jQuery.expr[':'].Contains = function(a, i, m) {
return jQuery(a).text().toUpperCase().indexOf(m[3].toUpperCase()) >= 0;
};
function detectResults() {
if ($("#clientList:visible").length == 0) {
$("#clientList").hide();
$("#noRecords").show();
} else {
$("#noRecords").hide();
}
}
//End Search Clients Result Detection
$("document").ready(function() {
//Search Clients
$("#searchClients").keyup(function(e) {
var query = $("#searchClients").val();
$("#clientList div").hide(1, function() {
$("span.firstname:Contains('"+query+"')").parent().show();
console.log('Show Results');
});
setTimeout("detectResults()", 100);
console.log('Search Keyup');
return false;
});
//End Search Clients
});
</code></pre>
<p>But everytime I keyup in the searchClients bar I get an uncaught syntax error. Anyone know what this might be?</p>
|
jquery
|
[5]
|
1,049,574 | 1,049,575 |
Read a very long line of text C#
|
<p>I want to read a very long line of text using C#. The length of the line is about 100000 chars. I am using StreamReader.ReadLine() method. I also want to write this long string to a file. One of them or both are not working properly. I could only write 99328 characters to a file.
How can I read and write a very long line of text using C#?</p>
|
c#
|
[0]
|
5,310,637 | 5,310,638 |
Obtaining the phone number and phone ID for a phone in android
|
<p>everyone. I have to build an Android application and one requirement is to be able to record the phone number and the phone ID. Is there any to do this? Any help would be much appreciated.</p>
|
android
|
[4]
|
5,923,680 | 5,923,681 |
send information through intent.putExtra()
|
<p>i found several thread "title like me "but my qus is diffrent .my qus is using intent can i send the data to only next calling activity?can i dont use that getExtra() method in other activity means can i get the data in any activity via using "key"?</p>
<p>as for example...</p>
<pre><code> int number=5;
Intent i = new Intent(A.this, B.class);
i.putExtra("numbers", number);
startActivity(i);
In the activity B i get the info:
Bundle extras = getIntent().getExtras();
int arrayB = extras.getInt("numbers");
</code></pre>
<p>can i get it in any other activity also...?</p>
|
android
|
[4]
|
2,763,945 | 2,763,946 |
how i get 2 dimentional array responseby split s string
|
<p>How to split <code>String</code> and get 2 dimentional <code>Array</code> result.<br>
I want my answer in [ ][ ]Array.<br>
How do I split single <code>String</code> message and get result in [ ][ ]Array</p>
<pre><code>public static String[][] SMSAgAppXMLParser( String parUrl)
{
String [][] xmlRespone=null;
String[] parts;
parts = parUrl.split("\n");
xmlRespone = new String[ parts.length/2 ][2];
for (int j=0, i = 0; i < parts.length-1+2; ) {
xmlRespone[j][0] = parts[i];
xmlRespone[j][1] = parts[i+1];
j++;
}
return xmlRespone;
}
</code></pre>
|
android
|
[4]
|
3,631,886 | 3,631,887 |
When to persist data in iPhone application?
|
<p>I'm currently creating an iPhone app where in one part of my app you can view your twitter stream. I'm unsure if I need to ever save the twitter information to a sqlite database or not. </p>
<p>So here is the flow of this part of the app:</p>
<ol>
<li>press button to see twitter stream</li>
<li>go get twitter stream </li>
<li>display twitter stream in table view</li>
</ol>
<p>I'm wondering if I should ever save the twitter stream into a database. Any advice?</p>
|
iphone
|
[8]
|
3,498,760 | 3,498,761 |
Creating copy of jQuery
|
<p>Which is proper way creating a copy from jQuery?</p>
<pre><code>var copyjq = new jQuery;
</code></pre>
<p><code>var copyjq</code> or what?</p>
|
jquery
|
[5]
|
3,882,178 | 3,882,179 |
How to filter files (with known type) from os.walk?
|
<p>I have list from <code>os.walk</code>. But I want to exclude some directories and files. I know how to do it with directories:</p>
<pre><code>for root, dirs, files in os.walk('C:/My_files/test'):
if "Update" in dirs:
dirs.remove("Update")
</code></pre>
<p>But how can I do it with files, which type I know. because this doesn't work:</p>
<pre><code>if "*.dat" in files:
files.remove("*.dat")
</code></pre>
|
python
|
[7]
|
6,015,712 | 6,015,713 |
How to read data from xml file which is stored insdcard?
|
<p>I am trying to read data from an xml which is stored at sdcard.
So, I used XmlResourceParser in my code but how can I provide my xml file to XmlResourceParser?
Is there any other way to do the same?</p>
|
android
|
[4]
|
1,962,965 | 1,962,966 |
How to use SharePreference to save a URI, or any Storage?
|
<pre><code> URI imageUri = null;
//Setting the Uri of aURL to imageUri.
try {
imageUri = aURL.toURI();
} catch (URISyntaxException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
</code></pre>
<p>I am using this code to translate a URL to a URI. how could i save the imageUri to a SharePreference, or a memory where it wouldnt be deleted onDestroy()?</p>
<p>I dont want to do SQLite database because the URI will change when the URL's change.I dont want to use up memory for unused URI's</p>
|
android
|
[4]
|
2,354,956 | 2,354,957 |
Is it possible to have a private class?
|
<p>Is it possible to have a private class? </p>
|
java
|
[1]
|
3,473,914 | 3,473,915 |
PHP foreach loop every fifth item
|
<p>I have a simple foreach loop like:</p>
<pre><code>foreach ( $posts as $index => $posts )
</code></pre>
<p>and also a counter:</p>
<pre><code>if( $index % 5 + 1 == 5 ) {
//do something
}
</code></pre>
<p>I have 15 posts per page and it should do something every fifth item but NOT on the last but how do I do that?</p>
<p>So it becomes:</p>
<pre><code>POST
POST
POST
POST
POST
DO SOMETHING
POST
POST
POST
POST
POST
DO SOMETHING
POST
POST
POST
POST
POST
</code></pre>
|
php
|
[2]
|
4,386,341 | 4,386,342 |
Viewstate move session generate an error as 'The state information is invalid for this page and might be corrupted. '
|
<p>I have created web page with rad grid. within that i provide facility to filtering ,shorting, Grouping and paging . because of performance issue i have tried to move viewsatate into session.
there i have set enable viewsate false in webpage and added bellow code into page. </p>
<pre><code> protected override object LoadPageStateFromPersistenceMedium()
{
return Session["ViewState-" + Request.Url.AbsolutePath];
}
protected override void SavePageStateToPersistenceMedium(object state)
{
Session["ViewState-" + Request.Url.AbsolutePath] = state;
ClientScript.RegisterHiddenField("__VIEWSTATE", "");
}
</code></pre>
<p>but when i do some thing on rad grid it will generate bellow error</p>
<p>The state information is invalid for this page and might be corrupted. </p>
|
asp.net
|
[9]
|
2,836,718 | 2,836,719 |
Working with big images in DOM
|
<p>I'm having some troubles while working with big images in DOM, like up to 1mb size.
The main problem is the fact that, also all the images are already cached, the loading of them into DOM takes considerable amount of time - even when I'm doing it just by changing the src attribute. I'm doing kind of a gallery widget for displaying large mockups, so the big image size cannot be helped.
So, what is the proper pattern for working with larger images? Is it possible to gain a reasonable performance boost?
I should also mention that the image size gets changed with css. I do this to give the user the ability to fullscreen the image later.</p>
<p>Thank you very much!</p>
<p><strong>UPD:</strong>
Seems that my problem has been misinterpreted. The problem isn't with the initial loading of the images, but with the showing of the image.
The code that gives me trouble is this:</p>
<pre><code>function loadImage($el, fullPath) {
el.one('load', function() {
ivgLoader.hide();
});
el.attr('src', fullPath);
}
</code></pre>
<p>When I try to change the src, the image doesn't change itself immediately, but in 2-3 seconds interval, which is kinda sloppy. I wouldn't mind showing a loader for this time, but the image doesn't trigger load event after it's initial loading.</p>
|
javascript
|
[3]
|
1,800,174 | 1,800,175 |
cannot get back the date selected from DatePicker
|
<p>I am trying to get back the date selected in the DatePicker which is shown in a dialog. I mean I have a ActionBarSherlock with a menu which when pressed opens a dialog which has a datepicker and a EditItem.Now when I select a date and the amount I want to get those parameters.but I get error.Can somebody please help me. I have copied my code below</p>
<pre><code>@Override
public boolean onCreateOptionsMenu(Menu menu) {
menu.add("Add Detail").setIcon(R.drawable.ic_compose).setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
final Dialog dialog = new Dialog(this);
dialog.setContentView(R.layout.custom);
Button cancelButton = (Button) dialog.findViewById(R.id.canelButton);
final DatePicker datePicker = (DatePicker) findViewById(R.id.datePicker1);
Button OKButton = (Button) dialog.findViewById(R.id.OKbutton);
OKButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Log.d("---------------",datePicker.getDayOfMonth()+" ");
}
});
// if button is clicked, close the custom dialog
cancelButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
dialog.dismiss();
}
});
dialog.show();
return true;
}
</code></pre>
|
android
|
[4]
|
1,967,532 | 1,967,533 |
Menu bar alignment problem
|
<p>this is my simple html , css code to create a menu</p>
<pre><code><style type="text/css">
li.Bg:hover ul
{
background-color: Lime;
}
li.Bg ul
{
display: none;
}
.Bg
{
width:auto;
display: inline;
background-color: Green;
}
</style>
<ul>
<li class="Bg"><a href="#">Home</a>
<ul>
<li>New</li>
<li>Open</li>
<li>Save</li>
</ul>
</li>
<li class="Bg"><a href="#">File</a>
<ul>
<li>New</li>
<li>Open</li>
<li>Save</li>
</ul>
</li>
<li class="Bg"><a href="#">Edit</a>
<ul>
<li>Cut</li>
<li>Copy</li>
<li>Paste</li>
</ul>
</li>
</ul>
</code></pre>
<p>but when i move mouse over "File" It shows sub menus but "Edit" option goes down & there is also an alignment problem. I am new to css Any help will be greatly appreciated </p>
<p>thanks, </p>
|
asp.net
|
[9]
|
989,122 | 989,123 |
How to use libs-for-android Library?
|
<p>Can any one guide me on how to use this library in Android?
I didn't find any tutorial or example related to this library.</p>
<p>I want to use an <code>ImageView</code> with a remote image while loading with progress spinner.</p>
<p>Any help would be appreciated.</p>
|
android
|
[4]
|
2,515,414 | 2,515,415 |
How to mimic the feedback of a ListView
|
<p>Is there a simple way (property?) to mimic the touch feedback of a <code>ListView</code> item on any other view, for example a <code>LinearLayout</code>?</p>
|
android
|
[4]
|
3,315,265 | 3,315,266 |
Displaying results depending on its date (month & year)
|
<p>I have load of data in the DB and each row has a date column</p>
<p>Currently im pulling all the results onto a page but i want to split it up into months.
I have buttons on my page that when clicked should display only the appropriate results, for example when the button January 2012 is click all the results for that month will be displayed</p>
<p>Heres an example of what im trying to achieve:
<a href="http://i.stack.imgur.com/PY7iN.jpg" rel="nofollow">http://i.stack.imgur.com/PY7iN.jpg</a></p>
<p>=================================================================================</p>
<pre><code><?php
$con = mysql_connect("localhost", "username", "pass");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("database", $con);
$result = mysql_query("SELECT * FROM tablename");
$num_rows = mysql_num_rows($result);
echo "<table border='0' cellspacing='0'>";
while($row = mysql_fetch_array($result))
{
$i++;
if($i%2==0) $class="cell1"; else $class="cell2";
echo "<tr class='$class'>";
echo "<td>".$row["firstname"]." ".$row["lastname"]." thinks that it will happen on
<span class=datecolor>".date('l jS F Y',strtotime($row['date']))."</span></td>";
echo "</tr>";
}
echo "</table>";
mysql_close($con);
?>
</code></pre>
<p>=========================================================================</p>
<p>Im looking for a little help on how i can display the results for each month by clicking on the buttons without it appearing all at the one time.</p>
<p>Also the when the page is first viewed id like it to automatically show the results for the current month, for example it if viewed now it would display the August results</p>
<p>Hope you can help</p>
|
php
|
[2]
|
1,929,111 | 1,929,112 |
storing files to a database or just to the local hard-disk?
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/3748/storing-images-in-db-yea-or-nay">Storing Images in DB - Yea or Nay?</a> </p>
</blockquote>
<p>I am developing an asp.net application. I have a question that where should I store the files after the user uploads files to the server? Either storing to the database or just to the hard-disk?</p>
<p>What are the pros and cons of doing so? which way is better for what types of web application?</p>
<p>Thanks in advance. </p>
|
asp.net
|
[9]
|
615,736 | 615,737 |
iPhone UIKeyboardTypeNamePhonePad with shift key
|
<p>I have a UITextField for a username, and I set the keyboard type to:</p>
<pre><code>uiUsername.keyboardType = UIKeyboardTypeNamePhonePad;
</code></pre>
<p>This way I can enter alphanumeric characters. But unfortunately the shift key is disabled. Is there a way to enable the shift-key using this keyboard type?</p>
<p>I know, I could set a different keyboard type and check for legal characters, but this keyboard type is very clean - only the shift key is missing.</p>
<p>Thanks for hints.</p>
|
iphone
|
[8]
|
3,455,115 | 3,455,116 |
How to get amount of digits in number in Python
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/961632/converting-integer-to-string-in-python">Converting integer to string in Python</a> </p>
</blockquote>
<p>How would I get the amount of digits in a number in Python?</p>
<p>For example: the user enters the number <code>1111</code> and I want to check how many digits are in it.</p>
|
python
|
[7]
|
950,632 | 950,633 |
How to Print Photo from Android Device using Printershare Application or any other application?
|
<p>How to Print Photo or Document from Android Device using Printershare Application or any other application?</p>
|
android
|
[4]
|
3,343,020 | 3,343,021 |
What is the event called when a text inside textbox changes?
|
<pre><code>$(document).delegate("input#search-champions", "change", function(e)
</code></pre>
<p>Whenever I change the value inside <code>search-champions</code>, it I have to click outside of the textbox to make it work. I want function to run whenever the value inside textbox changes.</p>
<p>I forgot what it is called, but it's the same system Google uses for it's searches. You write A, and it'll show you results with A.</p>
|
jquery
|
[5]
|
5,871,918 | 5,871,919 |
Replacing a blank
|
<p>i am building a URL and replacing all the spaces with +</p>
<pre><code>url.replace(' ','+')
</code></pre>
<p>for some reason it is not replacing any of the white spaces!</p>
<p>anyone know what is wrong?</p>
|
python
|
[7]
|
4,169,808 | 4,169,809 |
Date return NAN in IE
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/3020508/ie-javascript-date-parsing-error">IE JavaScript date parsing error</a> </p>
</blockquote>
<p>This code working fine in chrome and firefox but it didn't work in IE and safari. It return NAN in IE and invalid date in safair.</p>
<pre><code>var date = new Date("2012-10-17T08:15:19.500-05:00");
var now = new Date();
var difference = now - date;
document.write( "Date: " + date.toLocaleString() + "<br/>");
document.write( "Now: " + now.toLocaleString() + "<br/>");
document.write( "Difference: " + differenceToString(difference) );
function differenceToString(milliseconds) {
var seconds = milliseconds / 1000;
var numyears = Math.floor(seconds / 31536000);
var numdays = Math.floor((seconds % 31536000) / 86400);
var numhours = Math.floor(((seconds % 31536000) % 86400) / 3600);
var numminutes = Math.floor((((seconds % 31536000) % 86400) % 3600) / 60);
var numseconds = Math.floor((((seconds % 31536000) % 86400) % 3600) % 60);
return numyears + " years, " + numdays + " days, " + numhours + " hours, " + numminutes + " minutes, " + numseconds + " seconds";
}
</code></pre>
<p><a href="http://jsfiddle.net/RYS3R/" rel="nofollow">http://jsfiddle.net/RYS3R/</a></p>
<p>Any idea would be great help.</p>
<p>Thanks</p>
|
javascript
|
[3]
|
4,460,806 | 4,460,807 |
get custom event from control in repeater
|
<p>I have this markup Main.ascx:</p>
<pre><code>asp:Repeater ID="rptSource" runat="server">
<ItemTemplate>
<uc1:CustomControlsUC ID="CustomControlsUC1" runat="server" DataSource='<%#Container.DataItem %>' />
</ItemTemplate>
</asp:Repeater>
</code></pre>
<p>and in CustomControlsUC.ascx</p>
<pre><code>Public Event Entered(ByVal sender As Object, ByVal e As CommandEventArgs)
</code></pre>
<p>and</p>
<pre><code> Public Sub CustomValidation(sender As Object, args As CommandEventArgs)
RaiseEvent Entered(Me, args)
End Sub
</code></pre>
<p>and in my Main.ascx where is repeater i try to handle this event.</p>
<pre><code>Protected Sub rptSource_ItemDataBound(sender As Object, e As System.Web.UI.WebControls.RepeaterItemEventArgs) Handles rptSource.ItemDataBound
Dim rpt As inc_CustomControlsUC = CType(e.Item.Controls(1), inc_CustomControlsUC)
AddHandler rpt.Entered, AddressOf HandleThis
End Sub
</code></pre>
<p>but in this part AddHandler rpt.Entered, AddressOf HandleThis, I not have this Entered event:</p>
<p>How can i do this?</p>
|
asp.net
|
[9]
|
2,948,742 | 2,948,743 |
Can't use a class as template type in another class?
|
<p>I have a class Stack, using template, one of its methods is "push", which is written below:</p>
<pre><code>template <class T>
void Stack<T>::push(T _data){
Node<T>* temp = new Node<T>;
temp->data = _data;
temp->next = head;
head = temp;
}
</code></pre>
<p>The stack works well with <code>int</code>, <code>double</code>, <code>string</code>, <code>char</code>....
But it says</p>
<pre><code>prog.cpp:32: note: synthesized method ‘Node<Tree>::Node()’ first required here
</code></pre>
<p>when I use a class "Tree" as data type.
I don't understand, why it works with "string" but not with "Tree", they are both classes, not primitive types.</p>
<p><a href="http://ideone.com/NMxeF" rel="nofollow">http://ideone.com/NMxeF</a>
(Ignore the other error, my IDE only gives one error at line 32 and some warnings)</p>
<p>Help!</p>
|
c++
|
[6]
|
85,419 | 85,420 |
Need help / Creating Methods via prototype property
|
<p>Please help me to understand below code. This is the script for drag and drop object. I am trying to explore it but struck at one thing. </p>
<p><a href="http://developer.apple.com/library/safari/#documentation/InternetWeb/Conceptual/SafariVisualEffectsProgGuide/InteractiveVisualEffects/InteractiveVisualEffects.html" rel="nofollow">URL for Reference (Complete Script)</a></p>
<p>I dont understand how this method creation work, like get x(), set x() etc. Is <code>get</code> and <code>Set</code> is predefined object? will it actually set object value or get specific value of object, like we have in date object. </p>
<p>Also there is one space between its declaration <code>set x()</code>, why?</p>
<p>I am new to java script, i really appreciate your help. </p>
<pre><code>// position strings are "x,y" with no units
get x()
{
return parseInt(this._position.split(',')[0]);
},
set x(inX)
{
var comps = this._position.split(',');
comps[0] = inX;
this.position = comps.join(',');
},
get y()
{
return parseInt(this._position.split(',')[1]);
},
set y(inY)
{
var comps = this._position.split(',');
comps[1] = inY;
this.position = comps.join(',');
},
</code></pre>
|
javascript
|
[3]
|
1,094,523 | 1,094,524 |
Parse text to format URLs from content and shorten URLs
|
<p>I would like to parse the following text into formatted URLs with anchor tags:</p>
<pre><code>something is wrong with http://www.gbin1.com/index.html, but cannot find the reason in http://www.google.com
</code></pre>
<p>How can I replace the text URLs above with <code><a href="url">url</a></code> and also shorten it using JavaScript as displayed below:</p>
<pre><code>something is wrong with <a href="http://www.gbin1.com/index.html">gbin1.com</a>, but cannot find the reason in <a href="http://www.gbin1.com">google.com</a>
</code></pre>
|
javascript
|
[3]
|
97,377 | 97,378 |
multiple sites on IIS7 under the same URL and port but on different directories
|
<p>1 down vote favorite
share [fb] share [tw]</p>
<p>I would like to host multiple applications on the same IIS. The problem is I need to use the same URL like www.example.com, but different directories. Also the port needs to be 80, or at least transparent to the end user, so I'd like to have something like his:</p>
<p>www.example.com/app1</p>
<p>www.example.com/app2</p>
<p>The problem is IIS does not let me create 2 sites with the same domain and the same port and I don't wanna use subdomains if possible.</p>
<p>Both apps should not be on the same site since they are separate applications with different mantainance schedules.</p>
<p>Is there a way to do this? Or do I have to use subdomains?</p>
<p>I have hosted two websites on iis7. I have one domain .among the two websites i have configured the host header in one of the two websites.Now when i browse what i need is my first website should open and once i get logged in , that should redirect to other website which doesnot contain any host header.How to solve this.Live ip can listen only 80 and 443 port.I dont want to add another domain name.</p>
|
c#
|
[0]
|
5,945,754 | 5,945,755 |
Point-in-rectangle testing
|
<p>I have this matrix </p>
<pre><code>/// as if the create a rectangle
int [][] loc = {
{5, 15},//(x1, y1)
{5, 30}, // (x1, y2)
{20, 15},// (x2, y1)
{20, 30}, // (x2, y2)
}
// this are the point that i want to check if they are in the rectangular range or not
int [] [] point = {
{6, 16}, //(x, y)
{3, 17}, //(x, y)
}
</code></pre>
<p>I want i method that can take the point and search if it in the loc range or not by using
<code>x1<x<x2</code> and <code>y1<y<y2</code></p>
|
javascript
|
[3]
|
4,724,671 | 4,724,672 |
RelativeLayout - positioning a View under a ViewGroup
|
<p>I have the following structure defined in an xml layout file.</p>
<pre><code><RelativeLayout android:id="@+id/mainLayout"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content" android:layout_height="wrap_content">
<FrameLayout android:id="@+id/frame" android:layout_centerInParent="true" android:layout_width="wrap_content" android:layout_height="wrap_content" ></FrameLayout>
<Button android:id="@+id/button" android:layout_below="@id/frame" android:layout_width="wrap_content" android:layout_height="wrap_content" />
</RelativeLayout>
</code></pre>
<p>The FrameLayout is positioned correctly in the center of its parent. But the Button isn't getting positioned under it. Instead it's displaying in the top left corner.</p>
<p>Am I doing something incorrectly or is this a bug with RelativeLayout?</p>
|
android
|
[4]
|
2,814,676 | 2,814,677 |
Android browser GREEN border on click
|
<p>I want to develop a web application using HTML, CSS and Javascript one thing that is really annoying is that any link or button etc when clicked inside the Android browser gets highlighted with a green border.</p>
<p>To demonstrate what I mean I have included a link to a page that contains a basic game written in CSS</p>
<p><a href="http://marbles2.com/app/" rel="nofollow">http://marbles2.com/app/</a></p>
<p>Is there any way that you are aware of to disable the click green border?</p>
<p>Cheers</p>
<p>Paul</p>
|
android
|
[4]
|
4,850,705 | 4,850,706 |
How to launch an Activity without a UI?
|
<p>Is it in any way possible to launch an activity from the main function without having a UI? i.e. is there a way to create a sort of "wrapper" around another activity, i.e. by launching the main activity, it takes you to another activity automatically. </p>
<p>If that is not possible, is there a way to remove the main activity from the stack so that clicking the back button does not take you to a blank UI?
Here's an example of what I'm trying to do:</p>
<pre><code>public class WrapperActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:555-1212"));
startActivity(intent);
}
}
</code></pre>
|
android
|
[4]
|
1,739,737 | 1,739,738 |
PHP Form - continued issues
|
<p>how do I sterilize the coding for a very basic php order form connected to an html page? At the moment, the coding works, but I'm concerned that, as is, the coding enables potential spammers to have a field day with my site and email address. I'm not really sure exactly what sterilizing my code means/would entail, so any help would be greatly appreciated.</p>
|
php
|
[2]
|
2,728,246 | 2,728,247 |
UIActivityIndicator problem when downloading from URL
|
<p>i trying to download the picture from URL, and use a activity indicator animating to present the file is downloading, however, it is not working as my indicator wont animating when i call this download function,can somebody tell me why? </p>
<pre><code>-(void)download{
[indicator startAnimating];
NSString *downloadPath=@"http://www.xyz.com/path/pic.jpg;
NSData *downloadData=[NSData dataWithContentsOfURL:[ NSURL URLWithString:downloadPath]];
if(downloadData){
//do something
[indicator stopAnimating];
}
else{
//do something
[indicator stopAnimating];
}
</code></pre>
<p>}</p>
|
iphone
|
[8]
|
5,377,874 | 5,377,875 |
Trigger function on Enter keypress
|
<p>I've a simple search function which i Want to trigger on Enter key press, though the function executes but the form also get posted. </p>
<pre><code><script>
function search()
{
...
}
$(document).ready(function() {
$("#text").keypress(function (e) {
if (e.which==13)
search();
});
});
<body>
<form id="searchForm" name="searchForm">
<input size="40" id="text" type="text" name="text" class="input" />
</form>
</body>
</code></pre>
|
jquery
|
[5]
|
3,417,598 | 3,417,599 |
Closing Firefox Window or current Tab Using Java Script
|
<p>How can i close a Firefox Window or current Tab Using Java Script? I tried the following code, but it doesn't work....</p>
<pre><code>window.close();
</code></pre>
<p>Please anyone help me!!!!</p>
|
javascript
|
[3]
|
5,504,077 | 5,504,078 |
Portability of std::mem_fun expression
|
<p>Assuming a correct instantiation in the indicated comment, is the following expression legal and portable C++? Why or why not?</p>
<pre><code>std::mem_fun</*…*/>(&(std::vector<int>::clear))
</code></pre>
|
c++
|
[6]
|
939,943 | 939,944 |
Showing loading animation in center of page while making a call to Action method in ASP .NET MVC
|
<p>My application makes several calls to an Action method (ASP .NET MVC) which returns a Json object. When the application is waiting for this method to return its data I want to display a loading animation in the center of the page. How would I accomplish this? I know that I should use JQuery but that's all I know.</p>
|
jquery
|
[5]
|
220,106 | 220,107 |
Segmentation fault with strcmp
|
<p>I am trying to read a file and break each line into parts and when I try to do strcmp or strncmp I incur a segmentation fault. Can anyone please help me with it?</p>
<pre><code>char *input_file = argv[1];
char *line;
char *type = NULL;
ifstream infile;
infile.open(input_file, ifstream::in);
while(!infile.eof())
{
std::string s;
std::getline(infile, s);
line = new char[s.length()+1];
strcpy(line, s.c_str());
type = strtok(line,"(");
cout<<"type"<<type<<"\n";
if(s.size()>0)
s.resize(s.size()-1);
if(s[0]=='#')
continue;
if(!strncmp(type,"INPUT",5))
</code></pre>
|
c++
|
[6]
|
4,480,530 | 4,480,531 |
C++ number of divisors function with memoization?
|
<p>I know you can get the number of divisors by taking advantage of prime factorization but I am not sure how it's actually pulled off. Would appreciate any advice for a fast algorithm</p>
|
c++
|
[6]
|
2,798,024 | 2,798,025 |
CallbackOnCollectedDelegate was detected on Walther MFS100 Check Scanner
|
<p>i am trying to programming an interface for Walther Mfs100 Check scanner but after the scan i get "CallbackOnCollectedDelegate was detected" error. How can i fix this. I use .net 2.0 with c# </p>
<pre><code>[DllImport("mflib.dll.stdcall")]
public static extern int mfScanFeeder(int mode, int font, int timeout);
retval = modMFS100.mfScanFeeder(0, 2,5000);
</code></pre>
|
c#
|
[0]
|
2,556,044 | 2,556,045 |
Phonegap-Android-SQlite Using Javascript gives an error
|
<p>Hi I am building an Android 2.3.3 project using Phonegap. I have used the below mentioned example but I have used phonegap.0.9.6.js instead of phonegap.js which is mentioned in the example </p>
<p><a href="http://groups.google.com/group/phonegap/browse_thread/thread/07cf9f48e3cd0663" rel="nofollow">http://groups.google.com/group/phonegap/browse_thread/thread/07cf9f48e3cd0663</a></p>
<p>When I run the project I get below mentioned error</p>
<p>ERROR: Application requires API version 13. Device API version is 10 (Android 2.3.3)</p>
<p>Can any one tell me why this example is trying to use API version 13, how does it even know that it should use API 13 but not any other...</p>
|
android
|
[4]
|
3,221,037 | 3,221,038 |
Java analog of iterator to remove objects from collection
|
<p>In Java I can iterate collection and remove some objects from it using <code>Iterator.remove()</code> method <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Iterator.html#remove" rel="nofollow">http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Iterator.html#remove</a>()</p>
<p>This is very handly and natural. Like you are looking for food in the fridge and throw away food with expired date. How to do the same in c#?</p>
<p>I want to <code>iterate</code> and <code>clean-up</code> collection in the same loop.</p>
<p>There are several related question, for example <a href="http://stackoverflow.com/questions/5561495/how-to-iterate-and-update-a-list">How to iterate and update a list</a> however I still can not find exact duplicate of this operation in c#</p>
|
c#
|
[0]
|
4,467,090 | 4,467,091 |
javascript select input event
|
<p>I'm trying to create a select input from javascript and bind a function to when a user changes an option. So far I have:</p>
<pre><code> var filter = document.createElement("select");
filter.name = "selectName";
filter.change = function() {
alert("CHANGED");
}
var pos = 0
for (i in filters){
var splitted = i.split('.');
var display = splitted[splitted.length - 2];
filter.options[pos] = new Option(display, i);
pos++;
}
</code></pre>
<p>But nothing happens on selecting something else. What is wrong with this code. Also, how can I get the new selected value in the function ? Something like:</p>
<pre><code> alert(this.value + "has been selected")
</code></pre>
|
javascript
|
[3]
|
3,013,258 | 3,013,259 |
default function parameters in C#
|
<p>Is there a way to have default function parameters in C# like we have in C++??</p>
<p>eg: </p>
<pre><code>foo(int i = 10, int j = 20) {}
</code></pre>
|
c#
|
[0]
|
5,076,755 | 5,076,756 |
how to add thead to my grid in jquery
|
<p>i have my grid like this in jquery</p>
<pre><code>success: function(result) {
$('#MyGrid tbody').append('<tr><td>' + result.FileName + '</a></td><td><a href="#" class="remove">Remove</a></td></tr>');
}
</code></pre>
<p>now i want to add thead to MyGrid to which i need to add style property and inside thead i also need to add tr having style property. as like </p>
<pre><code> <thead style=""><tr style=""></tr></thead>
</code></pre>
<p>through jquery</p>
<p>also i need to remove that thead in another jquery function. so could you please provide me how to add thead and delete that thead in jquery which has tr inside it.</p>
<p>thanks,
michaeld</p>
|
jquery
|
[5]
|
478,042 | 478,043 |
How to implement a timer?
|
<p>For a project I need a timer in PHP such that starts when first page opens (say 1.php) and stops when I go to second page (say 2.php). How I can do this in PHP?</p>
|
php
|
[2]
|
3,612,392 | 3,612,393 |
jQuery - Need to submit form once i click on calendar option
|
<p>Im using the following plugin to display a calendar -<a href="http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/" rel="nofollow">(plugin URL)</a> does anyone know if its possible to submit a form when a calendar date is clicked and have that result come through into PHP so i can use $_POST to get what i clicked?</p>
<p>Cheers,</p>
|
jquery
|
[5]
|
5,512,619 | 5,512,620 |
question regarding GUI in java
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/5918935/question-regarding-gui-in-java">question regarding GUI in java</a> </p>
</blockquote>
<p>how to input string in JTextfield in java</p>
|
java
|
[1]
|
2,060,276 | 2,060,277 |
Diamond python with exactly 19 lines
|
<pre><code>i = 10
while i>0:
print i*'*' + 2*(10-i)*' ' + i*'*'
i -=1
for x in range(1,11):
print x* '*' + 2*(10-x)*' '+ x*'*'
x +=1
</code></pre>
<p>I am trying to make a asterisk diamond with 19 lines.
I get 20 instead.
This is what I want:</p>
<pre><code>********************
********* *********
******** ********
******* *******
****** ******
***** *****
**** ****
*** ***
** **
* *
** **
*** ***
**** ****
***** *****
****** ******
******* *******
******** ********
********* *********
********************
</code></pre>
<p>How can I get rid of the doubling up in height in the middle of the asterix.</p>
<p>cheers.</p>
|
python
|
[7]
|
4,413,522 | 4,413,523 |
I have a doubt in web server configuration
|
<p>I have published my web site on IIS in LAN . I want to display my login page as default.
how to set this page as default. </p>
|
asp.net
|
[9]
|
415,902 | 415,903 |
GDB and GCC union
|
<p>My concept may sound a bit cryptic but I what some startup information as to how we can use GDB APIs / debugging techniques in programs with GCC when we compile the program. We can definitely tell gcc to link GDB libs also. The ultimate aid would be that when the compiled programs executes it should produce logs in following format:</p>
<p>filename.cpp:linenumber</p>
<p>Is there any way we can achieve it - I do believe it is cause how would GDB knows these details and I looking for some knowhow’s to begin with.</p>
|
c++
|
[6]
|
2,565,626 | 2,565,627 |
how to delete blob element from a table in sqlite android?
|
<p>I am sending bytearray to insert an blob element it is inserting as png image it is working.But i want to delete blob element for these i am sending bytearray to column but it not deleting.</p>
<pre><code>public void deleteImage(Byte[] bytearray)
{
try{
database.execSQL("DELETE FROM deleteImage "+" where image='"+bytearray+"';");
}
catch(Exception e){
e.toString();
}
}
</code></pre>
|
android
|
[4]
|
891,212 | 891,213 |
Js animated width w/o jquery
|
<p>Like i said in title, im trying to animate a element width with js:</p>
<pre><code>function floatMenu(rewidth){
if(rewidth.className == ''){
rewidth.className = 'open'; x = rewidth.style.width;
x = x.slice(0, -2);
while(x < 190){
x++; rewidth.style.width = x;
}
} else {
rewidth.className = '';x = rewidth.style.width;
x = x.slice(0, -2);
while(x > 30){
x--; rewidth.style.width = x;
}
};
</code></pre>
<p>}
</p>
<p><strong>tried setTimeout already.</strong></p>
<p>Ty for the answers</p>
<p>it ends up with the last value, not incrementing step by step.</p>
|
javascript
|
[3]
|
215,082 | 215,083 |
PHP: Storing picture in the file directory, image name in db and retrieving an image
|
<p>After doing research, I found that it is more recommended to save the image name in database and the actual image in a file directory. Two of the few reasons is that it is more safer and the pictures load a lot quicker. But I don't really get the point of doing this procedure because every time I retrieve the pictures with the firebug tool i can find out the picture path in the file directory which can lead to potential breach. </p>
<p>Am I doing this correctly or it is not suppose to show the complete file directory path of the image?</p>
<p>PHP for saving image into database</p>
<pre><code>$images = retrieve_images();
insert_images_into_database($images);
function retrieve_images()
{
$images = explode(',', $_GET['i']);
return $images;
}
function insert_images_into_database($images)
{
if(!$images) //There were no images to return
return false;
$pdo = get_database_connection();
foreach($images as $image)
{
$path = Configuration::getUploadUrlPath('medium', 'target');
$sql = "INSERT INTO `urlImage` (`image_name`) VALUES ( ? )";
$prepared = $pdo->prepare($sql);
$prepared->execute(array($image));
echo ('<div><img src="'. $path . $image . '" /></div>');
}
}
</code></pre>
|
php
|
[2]
|
1,856,276 | 1,856,277 |
Referencing Attributes
|
<p>Supposing I have this code </p>
<pre><code>public class Class1
{
List<Class2> myClass2List = new List<Class2>;
public Class1() { }
}
public class Class1List : List { }
public class Class2
{
public Class2() { };
//Class2 objects will sit in a list that is an attribute of a Class1 object
// class1 objects will be in a list that is an attribute of a Class3 object
// is it possible for this method to access the list in the Class3 object
// without passing the list as a parameter.
public void myClass2Method(){ }
}
public class Class3
{
Class1List myList = new Class1List();
public Class3(){ }
static void Main()
{
Class3 myClass3Var = new Class3();
// do something to fill myList;
// added some code to maybe make it a bit less muddy
foreach (Class1 c1 in this.Class1List){
foreach (class2 c2 in c1.myClass2List{
// here is where I want to reference the Class1List attribute of the
/// Class3 object - do I need to pass the list as a paramter?
c2.MyClass2Method();
}
}
}
}
</code></pre>
<p>Now supposing I have an instance of Class2 in myList in the instance of Class3. Is it possible for the Class2 method myClass2Method() to access myList wouthout passing the list as a parameter?</p>
|
c#
|
[0]
|
5,253,722 | 5,253,723 |
How to execute an Action without assigning it to JButton?
|
<p>I have a list of Actions (I got them form HTMLEditorKit), and I want to execute them simply from the code, not from gui. Is that possible?</p>
|
java
|
[1]
|
1,932,853 | 1,932,854 |
Verifying the version of .Net Being used by web forms site
|
<p>I installed .Net 4.5 and have targetFramework="4.5" in my web.config file but on an error page I saw this:</p>
<p>Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.17020</p>
<p>How can I verify it is really using 4.5?</p>
|
asp.net
|
[9]
|
1,649,088 | 1,649,089 |
Generic interface as a method parameter and seeing fields
|
<p>This is probably my naivety showing through, but anyway...</p>
<p>I have a generic interface which defines a set of standard methods (implemented differently) across implementations.</p>
<p>I pass the interface into a method as a parameter, this method being responsible for persisting to a database. E.g. I have some implementations called bug, incident, etc, defined from the generic interface (called IEntry). These concerete implementations also make use of IEnumerable</p>
<p>Because a bug is different to an incident, there are different fields. When I pass the interface into a method as a parameter, is there any way to inference the type? So if I pass in the Bug object, I can use its fields, which are not the same fields as in those of Incident. These fields are useful for the persistance to the database. I'm assuming no because there is no way to know what the type to be passed in will be (obviously), but I know people here have more wisdom. In that case, is there a better way of doing things? Because of the similarity, I would like to stick to interfaces.</p>
<p>EDIT: I guess the other way is to make use of some flow control to generate the sql statement on the fly and then pass it in as a parameter.</p>
<p>Thanks</p>
|
c#
|
[0]
|
5,618,139 | 5,618,140 |
Expand a LI item and reorder the rest of them
|
<p>I'm trying to make the following effect in jQuery:</p>
<p><strong>Description.</strong></p>
<p>I have a list of LIs with thumbnails for each. When I click the thumbnail, I'm animating the width of that LI to include a big image (e.g. from 300px to 972px; something like jQuery Popeye plug-in effect).</p>
<p>Each LI has a fixed width of 300px and a "nomarginright" appended via nth-child in jQuery (the 3rd item in a row must have that class).</p>
<p><strong>Issues.</strong></p>
<p>If I click the first LI in a row, it expands without going beyond its container. But if I click the 2nd, it expands beyond its container and it is leaving the 1st LI on the first row while the 3rd is on another row with "nomarginright" class attached (thus having no space between the 3rd and the 4th).</p>
<ol>
<li>How do I expand the LI in a row and reorder the inactive LI items once I click a thumbnail (reseting the "nomarginright" effect, too)?</li>
</ol>
<p>A desired solution will be: in that row, move the active LI before any inactive LI and reset the nomarginright.</p>
<pre><code> $('#portfolio ul li div.picture a').each(function() {
$(this).click(function() {
$(this).parent().animate({
width: 972,
height: 504
}, 2000);
$(this).parents('li').addClass('active').animate({
width: 972
}, 2000);
return false;
});
</code></pre>
<p>HTML:</p>
<pre><code><li>
<div class="picture">
<a href="includes/pictures/portfolio-client-2.png" title="#"><img src="includes/pictures/portfolio-client-1.png" alt="#" /></a>
</div><!-- end .picture -->
</li>
</code></pre>
<p>The above just gets repeated in a UL.</p>
|
jquery
|
[5]
|
3,221,491 | 3,221,492 |
slidesjs not animating on first time page open
|
<p>I am using slidejs with magento. i am stuck here. when i clear cache and open page first time after clear cache then slider not animating i click on next / previes then image move fast without any effect but when i again refresh page then its working good please help me what is the problem</p>
<pre><code>jQuery(document).ready(function(){
jQuery('#bell_slider1').slides({
preload: true,
generateNextPrev:true,
generatePagination: false,
preloadImage: 'img/loading.gif',
play: 5000,
pause: 2500,
height:434,
hoverPause: true,
animationStart: function(current){
jQuery('.caption').animate({
bottom:-35
},100);
},
animationComplete: function(current){
jQuery('.caption').animate({
bottom:0
},200);
},
slidesLoaded: function() {
jQuery('.caption').animate({
bottom:0
},200);
}
});
});
</code></pre>
|
jquery
|
[5]
|
1,056,606 | 1,056,607 |
How to find file paths in text?
|
<p><strong>Situation:</strong>
I have some html code with a lot of linux file paths (/home/lol/test for example)</p>
<p>it needs to be done in C# with php and html files how?</p>
|
c#
|
[0]
|
3,564,417 | 3,564,418 |
Why JavaScript returns [object Object] from valueOf() instead of [object]?
|
<p>Is there a specific reason that JavaScript returns [object Object] as a return value from valueOf() method? </p>
<p>Why not only [object] but [object Object] ? </p>
|
javascript
|
[3]
|
4,671,378 | 4,671,379 |
Is this the way Constructor in Java allocates memory?
|
<p>Default constructor is automatically called after an object is created.</p>
<p>But in Java when we allocate memory using new operator i.e. <code>classname obj = new classname();</code> the constructor is automatically invoked <strong>before new allocates memory</strong> to the class member's.</p>
<p>The allocation starts after the class comes into physical existence but if new operator completes its process after default constructor is called, then how default constructor actually do so as the class has not come into physical existence?</p>
<p>Can someone explain me the same using a clear example?</p>
|
java
|
[1]
|
3,191,440 | 3,191,441 |
Get a textbox id inside a div in jquery
|
<p>I need your help to find textbox id inside a div based on div's css class name in jquery.</p>
<pre><code><div class="FH_element FH_text required" id="FH_0_first_name">
<label for="FHE_0_first_name">First*<small></small></label>
<div>
<input type="text" title="" name="first_name" value="" tabindex="3" id="FHE_0_first_name">
</div>
</div>
</code></pre>
<p>In the above code i need to find the textbox id(FHE_0_first_name) using div's class name(required)..in jquery.</p>
|
jquery
|
[5]
|
5,223,628 | 5,223,629 |
Java NullPointerException 2D array initialized in constructor, but method refuses to acknowledge
|
<p>I've run into a strange instance of NullPointerExceptionwhere I run the following code,</p>
<pre><code>Graph_img g = new Graph_img(3,4);
g.randomGraph();
</code></pre>
<p>where the constructor and method are the following,</p>
<pre><code>public Graph_img(int width, int height){
super();
w = width;
h = height;
Node[][] Img = new Node[w][h];
}
//generate new MRF graph ~75% 0 bilevel
public void randomGraph(){
V = new ArrayList<Node>(0);
E = new ArrayList<Edge>(0);
for(int x=0; x<w; x++)
for(int y=0; y<h; y++){
if(Math.random()>0.75)
Img[x][y] = new Node(x*h+y,1,2); //<--- NullPointerException
else
Img[x][y] = new Node(x*h+y,0,2); //<--- NullPointerException
V.add(Img[x][y]);
}
}
</code></pre>
<p>But if I run with the initialization moved to the method instead of the constructor,</p>
<pre><code>public Graph_img(int width, int height){
super();
w = width;
h = height;
//Node[][] Img = new Node[w][h]; <-- MOVING THIS
}
//generate new MRF graph ~75% 0 bilevel
public void randomGraph(){
V = new ArrayList<Node>(0);
E = new ArrayList<Edge>(0);
Node[][] Img = new Node[w][h]; //<-- MOVED HERE
for(int x=0; x<w; x++)
for(int y=0; y<h; y++){
if(Math.random()>0.75)
Img[x][y] = new Node(x*h+y,1,2);
else
Img[x][y] = new Node(x*h+y,0,2);
V.add(Img[x][y]);
}
}
</code></pre>
<p>Then everything works. I am perplexed - why? Thanks - Steve</p>
|
java
|
[1]
|
2,720,553 | 2,720,554 |
splitting long long
|
<p>How could one "split" i.e. long long type, so that first part of it is in var of type long and second part is also in var of type long. </p>
<pre><code>long long long_type = 0xaaaabbbbccccdddd;
</code></pre>
<p>and in first int I would like to have first half(doesn't matter from what side) of the long_type var and in second var int second half.</p>
|
c++
|
[6]
|
3,684,145 | 3,684,146 |
Split string between two characters?
|
<p>Ok this one should be incredibly easy, but I don't know what I'm looking for...</p>
<p>I want to split a string up between two characters</p>
<pre><code>$string = "blah blah blah (blorp) blah blah (bloop) blah blah (bam)";
retruns :
array
1 -> blorp
2 -> bloop
3 -> bam
</code></pre>
<p>I dont need any of the blah blahs just everything within parenthesis.</p>
<p>Thanks!</p>
<p>Arthur</p>
|
php
|
[2]
|
5,386,432 | 5,386,433 |
How to prevent two actions at a time in android
|
<p>I have a textview and a listview in my page,If we click an item in listview or textview it will take us to diffrent different views.My problem is am able to click both textview and listview item at a time,How to block this?</p>
|
android
|
[4]
|
5,419,331 | 5,419,332 |
looking for something like "array_and"
|
<p>I'm want to check an array like this, if every value is "true"</p>
<pre><code>$arr = array(true, true, true) // would be true
$arr = array(true, true, false) // would be false
$arr = array(false, true, false) // would be false
</code></pre>
<p>PHP provides a funcion "array_sum()". Is there a short function like "array_and()"</p>
<p>Currently I use something like that:</p>
<pre><code>$result = true;
foreach ($arr as $item) {
$result = $result && $item;
}
</code></pre>
<p>Is there any shorter solution?</p>
|
php
|
[2]
|
4,387,010 | 4,387,011 |
Service moved to cached background process when i stopped it from settings in android. But my application still running
|
<p>I want to run my app only when the background service is in running state. When the user stops it from settings, I'm restarting it from onDestroy() [Even if it is a bad programming practice.. thats the requirement.. :(] Sometimes when stopping my service,it goes to cached background processes. My app is running while service is not.. My question is..</p>
<p>Is it possible to detect the state when service goes to cached background process, so that i'll restart it or kill my app itself? If so how to kill the app as a whole? </p>
|
android
|
[4]
|
5,277,323 | 5,277,324 |
Android: Horizontal View Swiping and Switching Activities
|
<p>I am new in Android Development. and going to create a new app. in which i need following type of navigation in Android 2.2 and above.</p>
<p><a href="http://i.stack.imgur.com/wwG1Z.png" rel="nofollow">http://i.stack.imgur.com/wwG1Z.png</a></p>
<p>I saw a tutorial at <a href="http://android-developers.blogspot.com/2011/08/horizontal-view-swiping-with-viewpager.html" rel="nofollow">http://android-developers.blogspot.com/2011/08/horizontal-view-swiping-with-viewpager.html</a></p>
<p>But he is Only Swiping Pages. There are no Tabs like In Above image. And also he is updating some text view but i want to switch between activities or layouts.</p>
<p>I have tried many things. ActionBarSherlock it created many errors.</p>
<p>The thing I need is</p>
<p>developer.android.com/training/implementing-navigation/index.html</p>
<p>developer.android.com/shareables/training/EffectiveNavigation.zip</p>
<p>In Above file CollectionDemoActivity is the thing Which I actually looking for Android 2.2 and above.</p>
<p>If someone have project like this please share code.</p>
|
android
|
[4]
|
5,839,785 | 5,839,786 |
A virtual function returning a small structure - return value vs output parameter?
|
<p>I have a virtual function in a hotspot code that needs to return a structure as a result. I have these two options:</p>
<pre><code>virtual Vec4 generateVec() const = 0; // return value
virtual void generateVec(Vec4& output) const = 0; // output parameter
</code></pre>
<p>My question is, is there generally any difference in the performance of these functions? I'd assume the second one is faster, because it does not involve copying data on the stack. However, the first one is often much more convenient to use. If the first one is still slightly slower, would this be measurable at all? Am I too obsessed :)</p>
<p>Let me stress that that this function will be called millions of times every second, but also that the size of the structure Vec4 is small - 16 bytes.</p>
|
c++
|
[6]
|
5,794,226 | 5,794,227 |
Tabcontrol on android
|
<p>I want to make an Tab control on android.
But the tab control is displayed on top, wherein i want it to be displayed the bottom line</p>
<p>Can anybody help with that</p>
|
android
|
[4]
|
4,944,956 | 4,944,957 |
Pass dump location to a batch file using java
|
<p>I have a bat file to dump a database. I want to execute it with java and I want to add that dumping location using JFileChooser. Is it possible?</p>
<p>Thanks in Advance</p>
|
java
|
[1]
|
4,328,196 | 4,328,197 |
for insert query give error parse error, expecting `']''
|
<p>Parse error, expecting <code>]</code> in the following code:</p>
<pre><code>$j=0;
for($i=0; $i<2;$i++)
{
$sql="insert into info (degree,institute,year,cgpa) values('$store[$j=$j+1]','$store[$j=$j+1]','$store[$j=$j+1]','$store[$j=$j+1]')";
$insert=mysql_query($sql);
}
</code></pre>
<p>Where <code>$store</code> is an array.</p>
<p>Anyone please help me.</p>
|
php
|
[2]
|
5,264,997 | 5,264,998 |
jQuery use link to change database
|
<p>Can someone help me out with this question:
How can I use an link for example: ?active=yes to make changes to my database? I would like use jEditble for since I'm using that for my other stuff as well.</p>
<p>I have no idea how to search for it so I can't find any examples.</p>
|
jquery
|
[5]
|
18,557 | 18,558 |
strftime() not print chinese character "年“
|
<p>If locale is set to zh_CN.ut8, and using strftime("%b %Y", time()); It shows 9月2010 instead of 9月2010年。
This is not correct in chinese date, the year character (年)should be display at the end of the numeric year.
Is there a way to solve this problem? I know I can append the character manually, example:</p>
<p>strftime("%b %Y", time())."年"</p>
<p>but would like to know if there's a better way to solve it.</p>
|
php
|
[2]
|
1,729,311 | 1,729,312 |
Show hidden scrollbar
|
<p>A client is opening our website into a popup window using JavaScript with window.open. They are turning off scrollbars and making the window a fixed height, causing the pages to not be scrollable. I control the code of the website being loaded this way, but not the calling JavaScript. Is there any way I can force the display of scrollbars?</p>
|
javascript
|
[3]
|
5,952,433 | 5,952,434 |
How to make Active a View inside Multiview in Clientside Javascript in Asp.net
|
<p>I have three views inside a Multiview
How to activate one by one view means I Just want to change the Active View Index of the Multiview using javascript in ClientSide How can i do this?</p>
|
asp.net
|
[9]
|
2,612,012 | 2,612,013 |
Accessing files in iPhone
|
<p>I am developing an application in iOS 4.0, after having made several apps in Symbian S60v3.
Where I am stuck in iOS is that I want to access a file from the device which is saved from a third-party application to some location on the device.</p>
<p>In the case of symbian I knew its location: <code>System\Data\xyz\alpha.inf</code>, but with iOS I don't know how to access the location.</p>
|
iphone
|
[8]
|
4,502,818 | 4,502,819 |
zxing barcode is not decoding in protrait mode
|
<p>i am using the zxing src and resource for my android application. <img src="http://i.stack.imgur.com/HXvGK.png" alt="enter image description here"></p>
<p>it is reading QR code but not the barcode in portarit mode but it is working fine in landscape mode . what will be the problem .. anybody have any idea. </p>
<p>the original zxing scanning mode is in landscape but my requirement is in portrait mode so i changed the landscape design in to portrait.</p>
<pre><code><activity android:name="com.google.zxing.client.android.CaptureActivity" android:screenOrientation="landscape" android:configChanges="orientation|keyboardHidden" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:windowSoftInputMode="stateAlwaysHidden">
</code></pre>
<p>above given is my manifest content. </p>
|
android
|
[4]
|
3,701,473 | 3,701,474 |
Standard Java Error Reporting
|
<p>I am currently working on creating a toolkit for work and I've gotten to the point where I'm wondering about error reporting. </p>
<p>Basically all of my tools, which consist of a grouping of classes, will eventually be ran from a main method. Many of these tools will be doing operations on file like reading them in and converting them into some sort of array of objects or writing an object array to a file in a certain format. Whenever you are dealing with data that your program didn't create there is always room for error and those errors need to be known.</p>
<p>With that said what would be a good method to document all of the errors that occur during the processing and allow them to be retrieved later? Considering that I may want to send these error information out later I don't think that Log4J would be a good fit. I was considering using a string builder in each of my processing classes and append all error to that builder and retrieve it later at my leisure. I was also thinking of using some sort of arrayList or something that would hold the different types of errors but I'm a bit at a loss. </p>
<p>Does anyone have any good methods of doing this? </p>
|
java
|
[1]
|
3,221,367 | 3,221,368 |
How to get the Jquery row ID on single click
|
<pre><code> var value;
$("#Grid1").click(function(e) {
var row = jQuery(e.target).parent();
value= row.attr("id");
});
var onrowclick = function() {
("#Grid1").click($("#showgrid").load('/Names/Friends/satish/' + value));
};
</code></pre>
<p>i am trying to send the value on URL..
when I am giving like this I am not getting the output result...
am I doing this correctly?</p>
<p>is the problem that I am handling click event on same grid two times?</p>
|
jquery
|
[5]
|
5,673,369 | 5,673,370 |
Best way to iterate through a directory in java?
|
<p>hi all I'm new to java and searching for code relating to getting a list of all files in a directory (including files in subfolders) yields tons of different approaches. </p>
<p>What is the standard way nowadays to accomplish directory iteration with java?</p>
<p>I basically want to pass in a parent dir and be able to work with all the files inside that parent even when nested in subfolders.</p>
<p>thanks!</p>
|
java
|
[1]
|
5,192,969 | 5,192,970 |
NSString outofscope issue
|
<p>My code is:</p>
<pre><code>- (void)viewDidLoad {
[super viewDidLoad];
self.appDelegate=[[UIApplication sharedApplication]delegate];
self.dateString=[NSString stringWithFormat:@"%@",appDelegate.tappedDate];
dateLabel.text=dateString;
}
-(IBAction)checkForData:(id)sender{
NSString *bday=@"2012-01-26";
if(bday==dateString)
{
UIAlertView *bdayView=[[UIAlertView alloc]initWithTitle:@"Birthday!!!" message:@"Its ur Best Friend's Bday" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[bdayView show];
[bdayView release];
}
else{
UIAlertView *bdayView=[[UIAlertView alloc]initWithTitle:@"No Data" message:@"No Data available for this date" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[bdayView show];
[bdayView release];
}
}
</code></pre>
<p>The String dateString is going out of scope in the if condition but it is displaying data on the label.</p>
|
iphone
|
[8]
|
5,205,239 | 5,205,240 |
Targetting a span with jQuery $(this)
|
<p>This should be straightforward but I cannot get it to work.</p>
<p>My HTML is:</p>
<pre><code><span class="more-button" onclick="homePageMore()">[read more...]</a>
</code></pre>
<p>And the function is:</p>
<pre><code>function homePageMore(){
$(this).hide('slow');
$("#home-page-more").slideToggle('slow');
}
</code></pre>
<p>The div I'm targeting slides down just fine, but the span that I want to hide (which I'm trying to select with <code>$(this)</code>) will not hide. Why not??</p>
|
jquery
|
[5]
|
3,676,581 | 3,676,582 |
Code example for iPhone UIGetScreenImage
|
<p>I've seen a number of posts on UIGetScreenImage, however, not a complete working (short) code example.</p>
<p>If anyone has a code example, from the prototype definition to an actual call, that would be greatly appreciated.</p>
|
iphone
|
[8]
|
4,435,225 | 4,435,226 |
I need the year needs to be passed as a variable in the link so it can be grabbed via a get statement
|
<p>My html page.
I have this line.</p>
<pre><code><a href="Player_Roster.php?inputyr=2011">2011</a><br />
</code></pre>
<p>My php page.
I have this line of code.</p>
<pre><code><?php
$inputyr = $_GET[inputyr];
$query = "SELECT * FROM players
WHERE playeryear = $inputyr;
ORDER BY number";
$players = mysql_query($query);
?>
</code></pre>
<p>I want my php page to do a query using the year 2011.</p>
<p>After I click on the link it opens the page. It does show...
but the players don't fill in the table. The query does work if I manually type in the 2011.</p>
|
php
|
[2]
|
2,400,872 | 2,400,873 |
Why is the asp.NET profile designed in such a horrible way?
|
<p>In the current project I'm working on, we are using the asp.NET profile to store information about users, such as their involvment in a mailing list.</p>
<p>Now, in order to get a list of all the users in the mailing list, I cannot simply do a database query, as the asp.NET profile table is, simply put, awful.</p>
<p>For those who do not know, the profile table has two main columns, the 'keys' column, and 'values' column, and they are organised as so:</p>
<p>Keys:
Key1:dataType:startIndex:endIndex:key2:dataType . . etc.</p>
<p>Values:
value1value2value3...</p>
<p>This is pretty much impossible to query using SQL, so the only option to find users that have a specific property is to load up a list of ALL the users and loop through it.</p>
<p>In a site with over 150k members, this is understandably very slow!</p>
<p>Are there specific reasons why the Profile was designed like this, or is it just a terrible way of doing dynamically-generated data?</p>
|
c#
|
[0]
|
4,492,328 | 4,492,329 |
How to add second variable to a variable in a dropdown using PHP?
|
<p>I have an HTML select element created in PHP. I want to add $car (a second variable) with the $person_name. So it should $car and $person_name. how can i do it to the snippet below:</p>
<pre><code> echo "<option value=\"".$person_id."\">".$person_name."</option>";
</code></pre>
|
php
|
[2]
|
5,516,622 | 5,516,623 |
How do i enclose the Single Quotes within double quotes for php variables to be interpreted
|
<pre><code>$URN = 1
$col2 = ABC
$qty = 10
</code></pre>
<p>the above 3 values needs to be put in span tag such as <code><span id ='$URN:$col2'>$qty</span></code>:</p>
<pre><code>$row['col1'] = "<span id = '".$urn."'>".$qty."</span>";
</code></pre>
<p>but I am getting an error.</p>
|
php
|
[2]
|
889,500 | 889,501 |
Google Cloud Messaging Server Side Code in C#
|
<p>I want to write implement 3rd party server for GCM (Google Cloud Messaging) for android using .Net. The official documentation gives guidelines for using it with servlet-api and gcm-server.jar ( Java helper for server side ).</p>
<p>Is there any equivalent for using it in C#?</p>
|
c#
|
[0]
|
308,751 | 308,752 |
how to add dynamically radiobuttons in radiogroup in baseadapter.
|
<blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/7964536/how-to-generate-dynamic-radiobutton-with-a-radiongroup-in-adapterview">how to generate dynamic RadioButton with a radiongroup in adapterView?</a> </p>
</blockquote>
<p>i have a problem with my dynamic list.</p>
<p>i want to show all the list of options in radiobutton. so i take one xml in that radio gruop is there.</p>
<p>i want to take radionutton from baseadapter.</p>
<pre><code><LinearLayout
android:id="@+id/type2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<RadioGroup
android:id="@+id/optionRadioGroup"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<RadioButton
android:id="@+id/optionRadio"
android:layout_width="wrap_content"
android:layout_height="45dip"
/>
</RadioGroup>
</LinearLayout>
</code></pre>
<p>suggest me to do that.</p>
<p>tanks in advance.</p>
|
android
|
[4]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.