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 |
---|---|---|---|---|---|
592,841 | 592,842 | Array count Should be Show in table view | <p>i want show my NSMutableArray Count in a UILabel ,,,,,,,,,,</p>
<p>can any one help me</p>
| iphone | [8] |
3,349,276 | 3,349,277 | Add one to a variable when another variable changes | <p>How would I go about adding one to variable when another variable changes value?</p>
| php | [2] |
5,254,138 | 5,254,139 | How to use Dictionary (like iphone NSDictionary) in android? | <p>i have worked in soap message, and to parse the value from Webservice, the values are stored in ArrayList.</p>
<p>Example:
values are Employee name (Siva) and Employee id (3433fd), these two values are stored in arraylist, but i want to stored in Dictionary, How? please any one help me</p>
<p>Thanks</p>
| android | [4] |
1,004,182 | 1,004,183 | javascript jsgantt to PDF | <p>i am using jsGantt javascript library for showing gantt charts in html . now i want to save that generated ganttchart in PDF form how i will use that ??</p>
<p>the problem is with CSS , and JavaScript....</p>
<p>thank you ,</p>
| javascript | [3] |
601,104 | 601,105 | PHP date format Today/Yesterday | <p>I was wondering if I could get some insight on how to make the display format for a time stamp say things like "Today, 12:16PM" or "Yesterday, 9:34AM". At the moment it just displays as this "11-03-2010, 12:10PM".</p>
<p>How would I go about making it say "Today" or "Yesterday"</p>
<p>Thanks.</p>
| php | [2] |
2,729,993 | 2,729,994 | how can i change the password length in create user wizard of visual studo in asp.net | <pre><code><%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div style="text-align: center">
<asp:CreateUserWizard ID="CreateUserWizard1" runat="server" OnCreatedUser="CreateUserWizard1_CreatedUser">
<WizardSteps>
<asp:CreateUserWizardStep runat="server">
</asp:CreateUserWizardStep>
<asp:CompleteWizardStep runat="server">
</asp:CompleteWizardStep>
</WizardSteps>
</asp:CreateUserWizard>
</div>
</form>
</body>
</html>
</code></pre>
| asp.net | [9] |
4,625,692 | 4,625,693 | how to combine with jquery | <p>how to combine this into 1 script?</p>
<pre><code>$('#tabs, #tabs-1').tabs({
select: function(event, ui){
$("#picture").hide();
}
});
$('#tabs, #tabs-2').tabs({
select: function(event, ui){
$("#picture").hide();
}
});
$('#tabs, #tabs-3').tabs({
select: function(event, ui){
$("#picture").hide();
}
});
$('#tabs, #tabs-4').tabs({
select: function(event, ui){
$("#picture").show();
}
});
</code></pre>
| jquery | [5] |
3,477,909 | 3,477,910 | Locationlistener and Timers | <p>Does anyone know why i'm not able to get any coordinates when registeren a locationlistener via a Timertask (tried both NETWORK_PROVIDER and GPS_PROVIDER)
but when i register them manually i get coordinates just fine. </p>
<p>this is how i register my listener:</p>
<pre><code>Looper.myLooper().prepare();
locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER,0,0,locationListener);
Looper.myLooper().loop();
</code></pre>
<p>my location listener looks like this:</p>
<pre><code>LocationListener locationListener = new LocationListener() {
public void onLocationChanged(Location location) {
lat = location.getLatitude();
longt = location.getLongitude();
if(lat !=0 && longt!=0)
{Log.e(LOG_TAG, "getting coords");
locationManager.removeUpdates(locationListener);
Toast.makeText(getApplicationContext(), "got coords!!!", 2000).show();
reqlat.add(String.valueOf(lat));
reqlon.add(String.valueOf(longt));
DateFormat timeformat = new SimpleDateFormat("HH:mm:ss");
Date now = new Date();
Date date = new Date();
DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
reqtime.add(String.valueOf(timeformat.format(now)));
reqdate.add(String.valueOf(dateFormat.format(date)));
savemyData();
lastlongt = longt;
lastlat = lat;
logging=false;
coords = false;
CancelGpsTimer();
Looper.myLooper().quit();
}
}
</code></pre>
<p>i suspect it has something to do with the looper.prepare() but i can't figure out what. If i don't have a looper.prepare() i get an exception saying i can't create a handler insisde a thread that has not called looper.prepare().</p>
| android | [4] |
502,156 | 502,157 | i want know system system localhost IP address in PHP? | <p>here i am using <code>$_SERVER['remote_addr']</code> i am getting the IP address INTERNET providers. please help me out.</p>
<pre><code>function getRealIpAddr()
{
if (!empty($_SERVER['HTTP_CLIENT_IP'])) //check ip from share internet
{
$ip=$_SERVER['HTTP_CLIENT_IP'];
}
elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) //to check ip is pass from proxy
{
$ip=$_SERVER['HTTP_X_FORWARDED_FOR'];
}
else
{
$ip=$_SERVER['REMOTE_ADDR'];
}
return $ip;
}
</code></pre>
| php | [2] |
607,456 | 607,457 | Get rgb value of image when user clicked on image | <p>iam creating a map application.i need to get <strong>rgb</strong> value of image when user clicked on image.
image is in imageview.</p>
<p>pls help </p>
| android | [4] |
5,446,846 | 5,446,847 | PHP, process and split CSV-file | <p>A S0-logger comes with a csv file on a monthly base. The file is updated every 5 minutes and can be retrieved any moment. At the end of the month the file counts over 8500 rows. When a new month starts a new file is made.</p>
<p>Fileformat is like this:</p>
<pre><code>Datum / Uhrzeit (UTC);Main meter - Sales office (kWh);Meter 9;Temperature - Server room;Supply conductor air conditioner
01.06.12 00:00:00;438.220;0.001;274;155
01.06.12 00:05:00;438.240;0.001;274;203
01.06.12 00:10:00;438.259;0.001;275;134
01.06.12 00:15:00;438.283;0.001;274;176
01.06.12 00:20:00;438.303;0.001;274;206
</code></pre>
<p><code>dd.mm.yy</code> (This is european dateformat)</p>
<p>I want to split the monthly file into a daily file with filename yymmdd.csv and store these files for further use and processing. There is no use for the column names.</p>
<p>During the day, its data is updated every five minutes, but after a day is finished there is no need to reprocess this data, because nothing changes. I found out fgetcsv is the most appropriate method. But how to prevent the reprocessing of the data which is rather time consuming and unnecessary?</p>
| php | [2] |
1,367,355 | 1,367,356 | Use of Unassigned local variable | <p>I encountered an error. Despite declaring the variables (failturetext and userName) errors still appear. Can anyone please help me? </p>
<pre><code>- Use of Unassigned local variable "FailureText"
- Use of Unassigned local variable "UserName"
protected void Login1_LoginError(object sender, System.EventArgs e)
{
TextBox FailureText;
TextBox UserName;
//There was a problem logging in the user
//See if this user exists in the database
MembershipUser userInfo = Membership.GetUser(UserName.Text); // errors appear here
if (userInfo == null)
{
//The user entered an invalid username...
//error appear here ( failuretext.text)
FailureText.Text = "There is no user in the database with the username " + UserName.Text;
}
</code></pre>
<p>Thanks (: </p>
| c# | [0] |
3,010,622 | 3,010,623 | C# taking arguments & declaring at runtime from text file | <p>I have a text file with the following:</p>
<pre><code>int A = 5 ;
string str = "tempstring" ;
str DosomeMethod 15 16 20 22 ;
</code></pre>
<p>When reading the text file thru my program, I want to declare <code>int A = 5</code> & <code>string str = "tempstring"</code> at runtime.</p>
<p>It can be like</p>
<pre><code>string[] st = freader.readline().split(' ');
if (st[0]=="int")
{
str[0] str[1] = str[4];
}
</code></pre>
<p>I know that the above is the wrong syntax but I want to do something like this with some reference.</p>
<p>Can anybody help without using irony .net?</p>
| c# | [0] |
2,453,285 | 2,453,286 | what is the difference for java using in windows and linux. I am new to java. where can i start for programming in java | <p>Hey im new to java programming. i want to know the difference in programming java in windows and linux. where can i start for java programming. i would appreciate any help!</p>
| java | [1] |
2,990,057 | 2,990,058 | PHP invoking another script but through http (isolating them) | <p>Let's see if I make myself clear. I have an old set of scripts that run well on PHP4 and better don't thouch em. I have to integrate a new functionality implemented on PHP5, I need just to invoke a script on the new app from the old one.</p>
<p>To not have to touch the old stuff I think to somehow "kin of remotely" invoke the new one, need only to pass the $_REQUEST[] data. I can not include it as that would require migrating to another PHP version (and some name clashing). I don't need any output from the new one.</p>
<p>What would be the cleaner way to "call" that script passing parameters, fopen("http://theserver.com/thescript.php"....) and then passing all the necessary headers to pass the parameters? or there's somethign more direct?</p>
<p>Thanks!</p>
| php | [2] |
3,493,613 | 3,493,614 | byte array to decimal convertion in java | <p>Hi I am new to java.I receive the udp data in byte array.Each elements of the byte array have the hexa decimal value.I need to convert each element to integer.How to convert it to integer.</p>
| java | [1] |
5,852,225 | 5,852,226 | Delete specific word from string by wordlist | <p><br>
I have this function to remove a specific word from a String, this function use a word list.
so i have a query and i want to remove every type of string like (number,number)<br>
this is mycode:<br></p>
<pre><code>$wordlist = array("LIMIT", "0, 5");
foreach ($wordlist as &$word) {
$word = '/\b' . preg_quote($word, '/') . '\b/';
}
$sql = preg_replace($wordlist, '', $sql);
var_dump($sql);
</code></pre>
<p>as you can see, if the function get LIMIT or 0,5 it will be removed, how i can remove any type of word like "number, number" so the query will be LIMIT 10, 40 it will be removed too.<br>
to know if a string is with format of "is_number,is_number".
<br>
thanks.</p>
| php | [2] |
2,358,683 | 2,358,684 | jQuery - Queue unrelated DOM elements in the same queue | <p>I've been reading all types of examples about jQuery's queue() function, all of them demonstrate with only one DOM element.</p>
<p>What I need is to run an event on one element and once that's complete run an event on another element.</p>
<p>I've made up an example to test this: <a href="http://jsfiddle.net/paulmason411/4F6CE/" rel="nofollow">http://jsfiddle.net/paulmason411/4F6CE/</a></p>
<p>Basically I want the first block to fade, and then when that's finished the second block fade. I got it working using the nested method, but it's commented out, and not the suitable method for me. </p>
<p>Any ideas? Is queue the right function for this? Thanks.</p>
| jquery | [5] |
1,731,942 | 1,731,943 | How to control the screen resolution | <p>Whenever i run my program in emulator, the pixels and screen resolutions are displays perfectly. but at the same time when install the apk in basic version of android mobile, the resolution will changed. Its getting some nasty GUI formate. I am not sure how to rectify this issue. I did my application in 2.2 and i am using android Samsung 2.1 mobile. </p>
| android | [4] |
645,343 | 645,344 | Jquery - live('hover') and mousemove | <p>i have a little problem with the hover funtion with mousemove.
But what is wrong?</p>
<p>working example -> <a href="http://www.jsfiddle.net/V9Euk/306/" rel="nofollow">http://www.jsfiddle.net/V9Euk/306/</a></p>
<pre><code>$('.tip').live('hover', function(e)
{
if (e.type == 'mouseover')
{
$('#'+this.id+' .tooltip').show();
}
if (e.type == 'mousemove')
{
alert('move');
$('#'+this.id+' .tooltip').css({ left: e.pageX + 20, top: e.pageY + 20});
}
if (e.type == 'mouseout')
{
$('.tooltip').hide();
}
});
</code></pre>
| jquery | [5] |
865,512 | 865,513 | incorrect jQuery height | <p>I have a page with two columns and try to make them the same height using jQuery... I have the following code</p>
<pre><code><script type="text/javascript">
$(document).ready(function() {
var right_column_height = $("#right-column-wrapper").height()
var content_height = $("#content-wrapper").height()
console.log("content = " + content_height)
if(right_column_height > content_height) $("#content-wrapper").css("height", right_column_height)
else $("#right-column-wrapper").css("height", content_height)
})
</script>
</code></pre>
<p>if right column is higher, its working correctly, but when when the content is higher, its acting weirdly...
on one page the height is set as expected, on other page its not working at all...
I added console logging to see whats happening and I see that the content height is not calculated in jQuery... but when I then enter the same code to console, I get a corret value...
Can you suggest what's wrong in my code please...</p>
<p>See the demo at <a href="http://demo.romanpriryl.cz" rel="nofollow">http://demo.romanpriryl.cz</a>, the problematic page is <a href="http://beta.romanprikryl.cz/fotogalerie.htm" rel="nofollow">http://beta.romanprikryl.cz/fotogalerie.htm</a>, but working correctly on <a href="http://beta.romanprikryl.cz/objednavky.htm" rel="nofollow">http://beta.romanprikryl.cz/objednavky.htm</a></p>
| jquery | [5] |
446,972 | 446,973 | Provide a method definition with an abstract version before it? | <p>Is it posible to have:</p>
<pre><code>public abstract void someMethod();
...
public void someMethod() {
// ...
}
</code></pre>
<p>in the same class? Or does the definition have to be in the child classes?</p>
| java | [1] |
4,322,933 | 4,322,934 | Printing all static content in a .java file | <p>I have to print all the static content in l the .java files in my workspace. Can anyone suggest any tool or code to do that?</p>
<p>By static means SIB's static constants, methods and all.</p>
| java | [1] |
2,640,344 | 2,640,345 | how to customize simple_list_item_multiplechoice.xml file | <p>here i used this code to display contacts with check boxes....</p>
<pre><code>SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,
android.R.layout.**simple_list_item_multiple_choice,c**,
new String[] {
//Phone.TYPE,
Phone.DISPLAY_NAME,
Phone.NUMBER
},
new int[] { android.R.id.**text1**, android.R.id.**text2** });
</code></pre>
<p>its working well ..but not showing contact number..showing only name with checkboxes each row.to do this ,i created my ownlayout and placed main instead of simple_list_itemmultiplechoice as below</p>
<pre><code>SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,
android.R.layout.**main**,c,
new String[] {
//Phone.TYPE,
Phone.DISPLAY_NAME,
Phone.NUMBER
},
new int[] { android.R.id.**text_name**, android.R.id.**text_phone** });
</code></pre>
<p>but its showing error as <strong>main cannot be resolved or is not a field</strong></p>
<p>can u solve my problem..thanks in advance</p>
| android | [4] |
2,079,181 | 2,079,182 | Text progressive light glow effect | <p>Is there any jQuery plugin for progressive light glow effect <a href="http://activeden.net/item/xml-text-progressive-light-glow-effect/47740" rel="nofollow">like this</a>?</p>
| jquery | [5] |
2,974,346 | 2,974,347 | Why can't variables defined in a conditional be constructed with arguments? | <p>The question is simple. Why does this compile:</p>
<pre><code>bool b(true);
if (b) { /* */ }
</code></pre>
<p>And this compile:</p>
<pre><code>if (bool b = true) { /* */ }
</code></pre>
<p>But not this:</p>
<pre><code>if (bool b(true)) { /* */ }
</code></pre>
<p>In my real code, I need to construct an object and test it, while also having it destroyed when the if-block ends. Basically, I'm looking for something like this:</p>
<pre><code>{
Dingus dingus(another_dingus);
if (dingus) {
// ...
}
}
</code></pre>
<p>Of course, this would work:</p>
<pre><code>if (Dingus dingus = another_dingus) { /* */ }
</code></pre>
<p>But then I'm constructing a <code>Dingus</code> and calling <code>operator=</code> on it. It seems logical to me that I would be able to construct the object using whatever constructor I please.</p>
<p>But I'm baffled why this isn't grammatically correct. I've tested with G++ and MSVC++ and they both complain about this construct, so I'm sure it's part of the spec but I'm curious as to the reasoning for this and what non-ugly workarounds there may be.</p>
| c++ | [6] |
1,283,267 | 1,283,268 | Can I test proximity alert in the emulator? | <p>I'm developing an android app using proximity alert.Can I test proximity alert in the emulator? </p>
| android | [4] |
2,460,375 | 2,460,376 | iterator for loops with break | <p>let say my code look like below</p>
<pre><code>for(..)
for(..)
for(..){
break; //this will break out from the most inner loop OR all 3 iterated loops?
}
</code></pre>
| java | [1] |
5,898,227 | 5,898,228 | how to add a parent and unlimited nodes in sql using asp.net | <p>In my application i need grouping method. For that i need to enter parent node and unlimited sub nodes in sql2008 using asp.net. Its in tree structure same as money chain method. please guide me out to get my result.</p>
<p>thanks</p>
| asp.net | [9] |
5,873,047 | 5,873,048 | Text selection bind in android 3.1 | <p>When you select text in android, a toolbar is opened with COPY & PASTE & WEB SEARCH.
is there a way i can add stuff there via the API somehow?</p>
<p>Thanks!</p>
| android | [4] |
5,182,434 | 5,182,435 | Javascript newline not working when sending to outlook | <p>I have this little problem.
I have this javascript in my html page:</p>
<pre><code>function myfunction(form)
{
var name = document.details.txtName.value + "\n";
var street = document.details.txtStreet.value + "\n";
var city = document.details.txtCity.value + "\n";
var stateProvince = document.details.txtStateProvince.value + "\n";
var postalCode = document.details.txtPostalCode.value + "\n";
var country = document.details.txtCountry.value + "\n";
var homeTel = document.details.txtHomeTel.value + "\n";
var workTel = document.details.txtWorkTel.value + "\n";
var fax = document.details.txtFax.value + "\n";
var mobile = document.details.txtMobile.value + "\n";
var email = document.details.txtEmail.value + "\n";
var enquiry = document.details.txtEnquiry.value + "\n";
var message = (name +
street +
city +
stateProvince +
postalCode +
country +
homeTel +
workTel +
fax +
mobile +
email +
enquiry);
alert(message);
location='mailto:[email protected]?subject=Message From Redec Website&body=' + message;
return false; //So that the page can stay at its current location.
</code></pre>
<p>In the messagebox that pops up, it displays the strings underneath each other, which I want.</p>
<p>but when this opens outlook it is all in one long string. how can I fix this?
}</p>
| javascript | [3] |
3,025,336 | 3,025,337 | Example of list having texts with images in android | <p>I am developing a small list android application in which i have texts and images.Can anyone tell how should i pursue</p>
<p>Thanks in advance
Tushar</p>
| android | [4] |
5,456,409 | 5,456,410 | IE7/IE8 get unload when call jquery post | <p>I call like below function when user click button,</p>
<pre><code><script type="text/javascript">
function callTest() {
$.post("/testcall1", function(data){
$('#testDiv1').html(data);
$.post('/testcall2', function(data){
$('#testDiv2').html(data);
});
});
}
</script>
</code></pre>
<p>Here when I call <code>callTest()</code>, in IE7 & IE 8 gets unload once, and this will get fire the function which I write inside <code>confirmExit()</code>.</p>
<pre><code>window.onbeforeunload = confirmExit;
function confirmExit() {
//some code;
}
</code></pre>
<p>But this call is not happening in other browsers except IE7 and IE8.
How can we prevent calling <code>confirmExit()</code> in IE7/IE8?</p>
| jquery | [5] |
1,048,970 | 1,048,971 | Integrate yahoo and google plus API in android app? | <p>I am designing an app for android in which I have to integrate yahoo, google plus.<br>
How to login these through app and get the user information?</p>
<p>Please do show me a way to implement this. Any tutorial may help.</p>
<p>Thanks. </p>
| android | [4] |
2,348,208 | 2,348,209 | Famous javascript libraries | <p>What are the most famous JavaScript libraries?</p>
| javascript | [3] |
4,817,816 | 4,817,817 | Avoiding multiple logins to an account from different locations | <p>I want to avoid multiple log ins of the same user from different locations, or I want to give a warning or something to the user's mail to indicate there is another log in to their area.</p>
<p>How can I identify a user's multiple log in from different location at same/recent time? I think some flags and IP checking in a table may be a solution, but are there others?</p>
<p>update:
i think the session or cookie may help(for a single machine), like for first login creating a active key and store it into that machine at first login, and every time the user login in that machine check these cookie value too.. so if either he uses proxy it can helpful for identifying the user.. isn't? i/m not sure it will produce any security problems or something?</p>
| php | [2] |
1,460,108 | 1,460,109 | Is it necessary to cache objects? | <p>For a project I have some objects, one method is to load the parent entity.</p>
<p>So I call the method like this:
$this->getDetails()->getEntity();</p>
<p>So the code of getEntity is:</p>
<pre><code> public function getEntity()
{
if (isset($this->entity)) {
return $this->entity;
} else {
$mapper = new Crm_Mapper_Entity();
return $this->entity = $mapper->find($this->customerId);
}
}
</code></pre>
<p>Is it necessary to load the entity into the attribute? Because when I want to load it on another place it shouldnt be calling the mapper again.</p>
<p>Or is it that when it's loaded, the object is already in memory and I don't need to put it into the attribute?</p>
<p>Thanks</p>
| php | [2] |
4,879,651 | 4,879,652 | android transition from landscape view to portrait view | <p>I have an activity which is in landscape orientation. When i press back, it goes to portrait view. I want to create a transition from left to right. I tried overridePendingTransition(anim.slide_in_left, anim.slide_out_right);.. still transition is not correct.pls Help</p>
| android | [4] |
1,144,871 | 1,144,872 | Does Java syntax for iteration across arrays allocate memory? | <p>I am programming for a memory-constrained device. Hence, I want to avoid allocating any memory.</p>
<p>Obviously, iterating across sets, lists, etc will allocate an iterator and thus allocate memory. So this should be avoided.</p>
<p>Does the native java syntax for iterating across arrays allocate memory?</p>
<pre><code>Object[] array = getArray()
for(Object elem: array){
//do something
}
</code></pre>
<p>(I suppose I could always use the old-fashioned for loop with an index variable.)</p>
| java | [1] |
2,740,396 | 2,740,397 | Passing objects in android | <p>I want to pass a client object to a diffrent activity on android</p>
<p>I know how to pass strings but have no idea about passing objects.</p>
<p>myIntent.putExtra("nick",nick);
where nick is a string </p>
<p>how do i pass an object say Client c?</p>
| android | [4] |
5,316,599 | 5,316,600 | question based on installer | <p>How to make an installer for java application in mac
what are the different steps for it</p>
| java | [1] |
1,709,892 | 1,709,893 | how can i give ratings of android application through RatingBar in Android | <p>I made a screen with rating bar and i want to give the ratings of application that will reflect direct on the Android Market, please let me know if there is any way to do this.</p>
| android | [4] |
1,235,006 | 1,235,007 | How do you know when to return false from a jQuery function? | <p>"<strong><code>return false</code></strong>" seems to work in the <code>submitHandler</code> but I'm not sure why. </p>
<pre><code>function submitHandler() {
$.post($(this).attr('action'), $(this).serialize(), null, "script");
return false;
}
$(document).ready(function () {
$('#top_cat').submit(submitHandler);
$("#tip_click").click(function() {
$("#high_hat").submit(submitHandler);
});
});
</code></pre>
<p>I'm also not sure if I need to add a "<strong><code>return false</code></strong>" in the <code>#tip_click</code> function so that it reads like this:</p>
<pre><code> $("#tip_click").click(function() {
$("#high_hat").submit(submitHandler);
return false;
});
</code></pre>
<p><strong><em>What's the rule to follow here regarding when to "<code>return false</code>"?</em></strong></p>
| jquery | [5] |
3,549,521 | 3,549,522 | Is this consider polymorphism? | <p>I'm confused with polymorphism and I'm wondering if this is consider polymorphism?</p>
<p>I feel it looks kind of weird but it still compiles correctly.</p>
<pre><code>public class Family {
void FamilyInfo() {
System.out.println("This is a family super class");
}
}
public class Grandparents extends Family {
void FamilyInfo() {
System.out.println("Graparents are the elders in the family and they are the sub class of family");
}
}
public class Parents extends Grandparents {
void FamilyInfo() {
System.out.println("The parents are the children of the grandparents and they are the sub sub class for family");
}
}
public class FamilyDemo {
public static void main(String ary[]) {
Grandparents Gp = new Grandparents();
Parents P1 = new Parents();
Gp.FamilyInfo();
P1.FamilyInfo();
}
}
</code></pre>
| java | [1] |
1,157,019 | 1,157,020 | Hour to Minutes 00:00 to 00 javascript | <p>I need to convert hours:minutes (00:00) to minutes 00 in Javascript. </p>
<p>I thought about doing it by using substr to get hour and minutes separately and then multiply the hours part by 60 and then add the minutes part.</p>
<p>Is there any other easy way to do this?</p>
| javascript | [3] |
583,004 | 583,005 | change background color of the layout in Android | <p>I have a simple Android application, with 3 buttons. When i click on the 1st button, i wanna change the background color of the layout (which is now white... i wanna change in other color, when i press the button). How can i do this?</p>
<p>On that button, i have a myClickHndler event</p>
<pre><code> public void myClickHandler(View view) {
switch (view.getId()) {
case R.id.Button01:
text.setText("Button 1 was clicked");
break;
case R.id.Button03:
//text.setText("Button 3 was clicked");
.................... // ?
break;
}
}
</code></pre>
<p>Thanks!</p>
| android | [4] |
4,402,921 | 4,402,922 | How set width of one element equal to other in android? | <p>I have two buttons defined in XML</p>
<pre><code> <Button
android:layout_alignParentBottom="true"
android:id="@+id/takepic_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/Take_Pic"
android:layout_gravity="left"
android:layout_alignParentLeft="true"
/>
<Button
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:id="@+id/cancel_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/Cancel"
android:layout_gravity="right"
/>
</code></pre>
<p>My question is how can I tell android that set the width of second button equal to whatever is the width of first button.</p>
<p>Update: I am looking for XML solution</p>
| android | [4] |
1,052,181 | 1,052,182 | How does Stackoverflow hide the URL of the new share on facebook etc | <p>When you create a post , over in the Left hand side under the vote up and vote down, is a new share on twitter facebook and linkedin.</p>
<p>How do they do that, is it just using javascript ?</p>
<p>Or something far more clever than say:</p>
<p>This : <a href="http://www.openjs.com/articles/ajax/target_url_hiding.php" rel="nofollow">http://www.openjs.com/articles/ajax/target_url_hiding.php</a></p>
| javascript | [3] |
2,679,386 | 2,679,387 | field declared void / struct or variable not declared in this scope | <p>I've been teaching myself some OpenGL using SFML for creating windows/handling inputs, etc. My main.cpp started getting a bit unwieldy so I decided to start splitting my code up. I created a 4X_vertex.h and a 4X_vertex.cpp (4X is the name of the project) and moved the relevant functions and structs out of my main and into these files. However, when I compile, I get the error</p>
<pre><code>variable or field "drawVertexArray" declared void
</code></pre>
<p>which from my research seems to be just an unhelpful message relating to the next error, which is</p>
<pre><code>vertex was not declared in this scope
</code></pre>
<p>Here's my list of includes from my <code>main.cpp</code>:</p>
<pre><code>#include <iostream>
#include <fstream>
#include <string>
#include <SFML/System.hpp>
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>
#include "4x_vertex.h"
#include "4x_constants.h"
</code></pre>
<p>My <code>4X_vertex.h</code>:</p>
<pre><code>#ifndef _4X_VERT_H
#define _4X_VERT_H
struct vertex{
GLfloat x,y,z;
GLfloat r,g,b;
};
void drawVertexArray(vertex v[]);
vertex* loadVertexData();
#include "4X_vertex.cpp"
#endif
</code></pre>
<p>The part of <code>4X_vertex.cpp</code> that's giving me the trouble:</p>
<pre><code>using namespace std;
void drawVertexArray(vertex v[]){
... openGL stuff...
}
</code></pre>
<p>All of this worked before I started moving it around so I'm assuming there's something weird going on with the includes, or something. All help is greatly appreciated!</p>
| c++ | [6] |
160,202 | 160,203 | How to suppress the "Division by zero" error and set the result to null for the whole application? | <p>How to suppress the "Division by zero" error and set the result to null <strong>for the whole application</strong>? By saying "for the whole application", I mean it is not for a single expression. Instead, whenever a "Division by zero" error occurs, the result is set to null automatically and no error will be thrown.</p>
| php | [2] |
1,959,575 | 1,959,576 | Show/Hide divs using Jquery | <p>I am having issues showing one div then hiding the previous div. </p>
<pre><code>var newElem = '#ID' + numVariable;
$('.elemPropGlobal').hide();
$(newElem).click(function (){
$('.elemPropGlobal').hide();
$($(this).attr('id') + 'Properties').show();
}
</code></pre>
<p>Divs that I click on</p>
<pre><code><div class="something" id="ID1" > some data</div>
<div class="something" id="ID2" > some data</div>
</code></pre>
<p>Divs that should show and hide </p>
<pre><code><div class="elemPropGlobal" id="ID1Properties" >
<div class="elemPropGlobal" id="ID2Properties" >
</code></pre>
| jquery | [5] |
1,180,257 | 1,180,258 | Jquery hover popup a div | <p>Im using this Jquery to popup a div </p>
<pre><code> <script type="text/javascript">
$(function () {
$('.bubbleInfo2').each(function () {
var distance = 10;
var time = 250;
var hideDelay = 500;
var hideDelayTimer = null;
var beingShown = false;
var shown = false;
var trigger = $('.trigger2', this);
var info = $('.popup2', this).css('opacity', 0);
$([trigger.get(0), info.get(0)]).mouseover(function () {
if (hideDelayTimer) clearTimeout(hideDelayTimer);
if (beingShown || shown) {
// don't trigger the animation again
return;
} else {
// reset position of info box
beingShown = true;
info.css({
top: 40,
left: -160,
display: 'block'
}).animate({
top: '-=' + distance + 'px',
opacity: 1
}, time, 'swing', function () {
beingShown = false;
shown = true;
});
}
return false;
}).mouseout(function () {
if (hideDelayTimer) clearTimeout(hideDelayTimer);
hideDelayTimer = setTimeout(function () {
hideDelayTimer = null;
info.animate({
top: '-=' + distance + 'px',
opacity: 0
}, time, 'swing', function () {
shown = false;
info.css('display', 'none');
});
}, hideDelay);
return false;
});
});
});
//-->
</script>
</code></pre>
<p>it's working well but i need to change in a way to be able to call it in a function and to pass the parameters because im using it several time on the page.In way to don;t have it many times on the page</p>
<p>that i would call it in something similar to this :</p>
<pre><code> <script type="text/javascript">
jQuery(function ($) {
$(".bubbleInfo2").BubleFunction(....parameters to be passed
});
</script>
</code></pre>
| jquery | [5] |
2,736,863 | 2,736,864 | Explicitly setting size and making it to resizable of my Dialog? | <p>I have created a My custom Dialog which extends org.eclipse.jface.dialogs.Dialog. But whenever it displays, it displays with a small size and i cant resize it also. So i wanted to know how to set its size while creation and how to make it resizable.</p>
<p>Thanks</p>
| java | [1] |
2,106,084 | 2,106,085 | Twitter plugins arent working with hebrew | <p>im trying to use plugins such as 'tweetquote' , im changing lang:en to lang:he
but it isnt working..</p>
<p>any suggestions?</p>
| jquery | [5] |
687,542 | 687,543 | Can you view PHP script code straight from the web server | <p>I am a complete PHP novice and I am just trying to write a simple web form and script that checks to see if the input matches a specific string. I have got that working no problem and just want to know if there is some way for the web form user to parse the script code and see what I am comparing to, therefore revealing the secret message to them.</p>
<p>Thanks in advance.</p>
| php | [2] |
2,126,013 | 2,126,014 | htaccess for subdirectories to prevent script execution | <p>I have sub directory 'images' with permission 777 to upload images from visitors
in this folder there is .htaccess file to prevent script execution and more security </p>
<pre><code><Files ^(*.jpeg|*.jpg|*.JPEG|*.JPG|*.png|*.gif)>
order deny,allow
deny from all
</Files>
<FilesMatch "\.(php|pl|py|jsp|asp|htm|shtml|sh|cgi)$">
ForceType text/plain
</FilesMatch>
</code></pre>
<p>But when i request images/page.php in browser, it is working <strong>which is meaning .htaccess does not working</strong>.
I want to prevent this folder from executable file.</p>
<p><strong>Is there any mistake in my .htaccess file</strong></p>
| php | [2] |
1,585,977 | 1,585,978 | Is there an easier way to declare multiple JTextFields? | <p>I have like 60 JTextField in my program, and it's too long.</p>
<p>Is there some shortcut like a loop?</p>
<p>My program is a Timecard, so there is time-in, break-in, break-out, time-out for 15 days.
Just wondering if there is such thing.</p>
| java | [1] |
5,938,153 | 5,938,154 | address validation global solution | <p>suppose user fillup form with germany address but as country choose UK. so how can i validate address there like if user choose country UK then i want that user has to write UK address for other detail. how to do it for all country. is there any IP available. need idea. thanks</p>
| c# | [0] |
669,015 | 669,016 | C# Convert Image To FileStream | <p>My application so far lets the user select an image via the file selector and upload it through a file stream via FTP:</p>
<pre><code> Stream ftpStream = request.GetRequestStream();
FileStream file = File.OpenRead(fileToUpload);
length = 1024;
buffer = new byte[length];
do
{
bytesRead = file.Read(buffer, 0, length);
ftpStream.Write(buffer, 0, bytesRead);
totalReadBytesCount += bytesRead;
var progress = totalReadBytesCount * 100.0 / totalToUpload;
backgroundWorker1.ReportProgress((int)progress);
}
while (bytesRead != 0);
</code></pre>
<p>This works fine.
The selected image is saved as a file and then uploaded.</p>
<p>Now, however, I wish to save it as a 'Image' so I can resize it etc. So that the code would be:</p>
<pre><code> if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
image = Image.FromFile(openFileDialog1.FileName);
}
</code></pre>
<p>As opposed to:</p>
<pre><code> if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
file = openFileDialog1.FileName;
}
</code></pre>
<p>My question thus is:</p>
<p>Now my selected file is a Image file. How do I convert it into the filestream? If this can't be done easily then how would I upload the image via ftp?
Thanks in advance.</p>
| c# | [0] |
3,073,945 | 3,073,946 | Need help in refreshing the page after submit | <p>I am developing an web application following the 3 tier architecture.When i am hitting on submit button data is storing in database but not showing response message like "Record submitted successfully" and fields are not refreshing. Here is my code:</p>
<pre><code>protected void BtnSubmit_Click(object sender, EventArgs e)
{
if (!Page.IsValid)
return;
NewuserBAL NUB = new NewuserBAL();
string UserName = TxtUserName.Text;
string Password = PWD.Text;
string EmailId = Email.Text;
try
{
NUB.newinsert(UserName, Password, EmailId);
Response.Write("<b>New User Created Successfully</b>");
TxtUserName.Text = "";
PWD.Text = "";
CnfrmPwd.Text = "";
Email.Text = "";
}
catch
{
throw;
}
finally
{
NUB = null;
}
}
</code></pre>
<p>Thanks,
Masum</p>
| asp.net | [9] |
15,112 | 15,113 | sizeof *this object | <p>Code:</p>
<pre><code>#include <cstdio>
class myc {
int dummy;
public:
int si(){return sizeof(*this);}
};
class d_myc : public myc {
int d_dummy;
};
int main() {
myc a;
d_myc b;
printf("%d %d\n%d %d", a.si(), b.si(), sizeof(a), sizeof(b));
return 0;
}
</code></pre>
<p>output :</p>
<pre><code>4 4
4 8
</code></pre>
<p>I expected :</p>
<pre><code>4 8
4 8
</code></pre>
<p>Why were my expectations wrong?</p>
| c++ | [6] |
886,110 | 886,111 | Velocity framework resource not found exception | <p>I'm trying to run velocity email sender program in Java 1.6 but its not finding recourse...</p>
<pre><code> VelocityContext context = new VelocityContext();
context.put("name", "mike");
// Initialize the engine
try {
VelocityEngine ve = new VelocityEngine();
templateName = "myfile_en.vm";
// Load the template
Template template = ve.getTemplate(templateName, "UTF-8");
// Render the template into a writer
StringWriter writer = new StringWriter();
template.merge(context, writer);
</code></pre>
<p>Cam any one help me out why I'm not able to load myfile_en.vm??? I tried giving full absolute path as well but still same error: ResourceNotFound</p>
<p>I'm running it directly from eclipse. Any help is much appreciated.</p>
<p>Thanks!</p>
| java | [1] |
1,301,210 | 1,301,211 | update a currently displayed variable | <p>I am writing some Python code, which will in the end will display something which looks like:</p>
<pre><code>Volt1: 3.1V
Volt2: 2.6V
Volt3: 5.6V
</code></pre>
<p>I am constantly monitoring some register values which will give me the current values of Volt1,Volt2,Volt3. As I read in the new values I want to update the field next to the variable name (i.e 3.1V becomes 3.12V), but without just simply printing a new line, but updated the old value.</p>
<p>I am just not sure how to do it, can someone point me in the right direction?</p>
<p>Thanks</p>
| python | [7] |
2,794,715 | 2,794,716 | change div content with one of 3 other divs? | <p>I have 3 links, and a container div with an image. When I click a links I want to change the image with one of 3 divs containing 3 different videocodes?</p>
<p>So if I click on link one, then change the image to videocode 1.</p>
<p>What is the best way of doing that? appendTo, replaceWith or what - with jquery.
Thanks.</p>
| jquery | [5] |
5,058,938 | 5,058,939 | Date comparison javascript | <p>Is string comparison on the next manner reliable? In other words, how does this comparison internally works?</p>
<pre><code>var _date = new Date();
var _start_date = _date.getFullYear()+"-"+_date.getMonth()+"-"+_date.getDate()+"-"+_date.getHours+"-"+_date.getMinutes();
if( _start_date < "2011-1-11-23-59")
alert('still before the 11th of january!');
</code></pre>
<p>The above works perfectly, but how is javascript comparison works this way? I know i can calculate based on EPOCH and or new Date(), but in my case that isn't possible.</p>
| javascript | [3] |
5,456,285 | 5,456,286 | Access argument name string inside the function | <p>Is it possible to access arguments name strings?!</p>
<pre><code>function myFunction (a, b, c, d, e, f) {
var obj = [];
arguments.forEach(function(arg) {
obj.push({
// question is how to get variable name here?
name: "a",// "a", "b", "c", "d", "e", "f"
value: arg, //a, b, c, ,d, e, f
})
});
return obj;
}
myFunction(1,2,3,4,5,6); // return [{name: "a", value: 1}, {name: "b", value: 2}...]
</code></pre>
<p>Note: I know using <code>arguments</code> is not a good practice. I want to know if this even possible or not?</p>
| javascript | [3] |
4,196,516 | 4,196,517 | How to read xml top 10 record (last update) with PHP | <p>I need to read xml file with PHP,but xml file have many record update.
Can I read only 10 record last update ?</p>
<p>Thank you very much. </p>
| php | [2] |
3,060,368 | 3,060,369 | Serializing .NET dictionary | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/495647/serialize-class-containing-dictionary-member">Serialize Class containing Dictionary member</a> </p>
</blockquote>
<p>Can I serialize a Dictionary? </p>
| c# | [0] |
4,566,590 | 4,566,591 | Java instantiate class from string | <p>I have the following,</p>
<pre><code>public interface SuperbInterface
public class A implements SuperbInterface
public class B extends A
public class C extends B
</code></pre>
<p>I want to instantiate <code>C</code> but I seems to be getting <code>B</code>, what did I do wrong?</p>
<pre><code>Class classz = Class.forName("C");
SuperbInterface superb = (SuperbInterface)classz.newInstance();
//Here when I debug it seems to be going to B.doWork() methods instead of C.doWork().
superb.doWork();
</code></pre>
| java | [1] |
5,966,732 | 5,966,733 | Limit how many times an event listener can trigger every second | <p>I'm playing with the Gamepad API - in particular the axes using the joysticks on a controller. The position of these updates a lot and often - as such, the event that I'm listening for (movement on the sticks) also happens a lot. Is there any way to limit it happening to, say, 25 times a second in order to reduce lag?</p>
| javascript | [3] |
2,030,876 | 2,030,877 | accessing class object types C++ | <p>How can i access class obect types in a statically declared private member function?:</p>
<pre><code>class Y
{
..
private:
friend class X;
X *myX;
};
class X
{
public:
friend class Y;
private:
static int foo( const char * const key );
Y *myX;
};
int X::foo( const char * const key )
{
X *myX = NULL; // illegal.
}
</code></pre>
<p>static cast and static cast references are not working as I had intended.</p>
| c++ | [6] |
5,436,750 | 5,436,751 | How to connect Android SQLITE Database to Remote MSSQL database | <p>We have a scheduler application in android which is storing all the data in SQLITE Database.
Now we have to connect our application to remote MSSQL server database and we should store our data in that database and the vice versa should happen.Can U Please Help Us with Solution</p>
<p>Thank you.</p>
| android | [4] |
1,761,112 | 1,761,113 | update the textfield as we change the value in datetime picker | <p>I am making an iPhone app in which I am using date time picker and displaying the selected the date in a text filed. Now I want to update the textfield as there is change in selected date in date picker.</p>
<p>hOw can i do this. Give me some solution.</p>
<p>Thanks in advance.</p>
| iphone | [8] |
2,090,791 | 2,090,792 | build android framework.jar only | <p>Having add some debug information to <code>androd.opengl.GLSurfaceView</code> , I want to rebuild the <code>framework.jar</code> <code>only</code> in the android source tree. I did a <code>mm</code> in $ANDROID_ROOT but that would build the apps as well and some apps failed to compile but I did not bother with the apps.How could I build the <code>framework.jar</code> only?</p>
<p>Furthermore, in the <code>build/core/main.mk</code>,<code>incrementaljavac</code> was said to be able to speed up the compilation. How that flag could be used here?</p>
<p>Thanks.</p>
| android | [4] |
1,341,046 | 1,341,047 | uzbl-tabbed keyboard shortcut for closing tabs? | <p>I can open tabs by typing "gn" I can change them by using "gt" and "gT". But I can't close tabs from within in the browser.</p>
<p>I looked here: [http://www.uzbl.org/readme.php][1] and that stuff is way over my head. I don't know if any of that information would answer my question anyway.</p>
<p>I found this: [http://www.uzbl.org/wiki/uzbl_tabbed][2] which I couldn't understand. It says there's a .py that communicates to the configuration file which I don't quite understand. I don't know anything about python and I can't find the configuration file. Plus, I just thought I could use a simple keyboard shortcut while using the browser anyway.</p>
<p>I also found this: <a href="https://wiki.archlinux.org/index.php/UZBL-Browser#Commands" rel="nofollow">https://wiki.archlinux.org/index.php/UZBL-Browser#Commands</a> which tells me pretty much everything I was looking for except how to close a tab.</p>
<p>Plus, when I close uzbl-tabbed and open it again, all the tabs are open from the previous session so I can't even get rid of them by closing uzbl.</p>
<p>The answer seems to be right in front of my face but I can't seem to figure it out. Please help.</p>
<p>P.S. Sorry about not activating all the hyperlinks above. Stack-overflow said I don't have enough reputation points to post more than 2 links. Also, I couldn't create tags "uzbl" and "uzbl-tabbed" for the same reason. Furthermore, Stack-overflow required me to put at least one tag in, so that's why I used "python." Sorry about any confusion.</p>
| python | [7] |
1,388,840 | 1,388,841 | Memory Management On Navigation Controller | <p>I am new to the iPhone SDK and I got a leak on a navigation controller.
Here is my code : </p>
<p>-(void)SignupClicked:(id)sender
{</p>
<pre><code>if(appdelegate.isiPad){
SignUpViewController *obj_SignUpViewController =[[SignUpViewController alloc] initWithNibName:@"SignUpViewControllerIpad" bundle:nil];
[self.navigationController pushViewController:obj_SignUpViewController animated:YES];
[obj_SignUpViewController release];
}
else {
SignUpViewController *obj_SignUpViewController =[[SignUpViewController alloc] initWithNibName:@"SignUpViewController" bundle:nil];
[self.navigationController pushViewController:obj_SignUpViewController animated:YES];
[obj_SignUpViewController release];
}
</code></pre>
<p>}</p>
<p>I am getting leaks on these lines:</p>
<pre><code>[self.navigationController pushViewController:obj_SignUpViewController animated:YES];
[self.navigationController pushViewController:obj_SignUpViewController animated:YES];
</code></pre>
<p>Please help me...
Thank you...</p>
| iphone | [8] |
698,753 | 698,754 | How to use subscriberCellularProviderDidUpdateNotifier | <p>I have done something like</p>
<pre><code>CTTelephonyNetworkInfo *networkInfo = [[CTTelephonyNetworkInfo alloc] init];
networkInfo.subscriberCellularProviderDidUpdateNotifier = ^ (CTCarrier * carrier)
{Do some stuff here
};
</code></pre>
<p>to get the notification when the cell service provider changes and do some tasks.The documentation says:</p>
<blockquote>
<p>A block object that is dispatched on
the default priority global dispatch
queue when the user’s cellular
provider information changes. This
occurs, for example, if a user swaps
the device’s SIM card with one from
another provider, while your
application is running.</p>
<p>To handle changes in cellular service
provider information, define a block
in your application and assign it to
this property. The block must be
implemented to support being called
from any context.</p>
</blockquote>
<p>I am not sure where to implement this in my code and will it exceute if my application is running in background or suspended. </p>
| iphone | [8] |
3,977,637 | 3,977,638 | How to populate local sqlite database with remote MSSQL database in android | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/6530115/getting-remote-database-data-into-local-database-in-android">Getting remote database data into local database in android</a> </p>
</blockquote>
<p>We have to copy the remote MSSQL database into local sqlite database in android. How to do that? Please suggest us a solution with sample code. Waiting for urgent reply....... </p>
| android | [4] |
907,303 | 907,304 | Import javascript file in javascript function | <blockquote>
<p><strong>Possible Duplicates:</strong><br>
<a href="http://stackoverflow.com/questions/3991492/include-a-javascript-file-in-a-javascript-file">Include a javascript file in a javascript file</a><br>
<a href="http://stackoverflow.com/questions/950087/include-javascript-file-inside-javascript-file">Include JavaScript file inside JavaScript file?</a> </p>
</blockquote>
<p>What is the best way to import javascript file (file.js) in javascript function().</p>
<p>For example what is the best way to replace the todo statement:</p>
<pre><code>function doSomething() {
if (xy.doSomething == undefined) {
// todo: load 'oldVersionPatch.js'
}
...
}
</code></pre>
<p>Possibly the best solution is to create script element and add it into html page.
My questions are:</p>
<ul>
<li>is it better to add/append it into head, or body (what will load when)?</li>
<li>is it better to use javascript or jquery (what is more cross-browser compatible)?</li>
</ul>
| javascript | [3] |
5,068,099 | 5,068,100 | java Arraylist remove elements | <p>Suppose there are 10 elements in ArrayList and if i have deleted 2 elements from the middle , so the arraylist will contain 8 elements , but will the capacity be 10 or reduced to 8 at that time.</p>
| java | [1] |
3,401,330 | 3,401,331 | IE6 caching cookie values when back button is used | <p>Our user authentication system makes use of cookies and $_SESSION variables to determine logged-in status. Every page tests for the presence of a user_id $_SESSION variable and a user_auth cookie:</p>
<pre><code>if(!isset($_SESSION['user_id']) || !isset($_COOKIE['user_auth'])){
// send user through login
}
</code></pre>
<p>and sends the user through the login process if they're not found.The logout button loads the following page:</p>
<pre><code><?php
session_start();
setcookie('user_auth','',time()-360000,'/','domain.com');
session_unset();
session_destroy();
header("location: http://home.domain.com");
?>
</code></pre>
<p>In Firefox, logging out and then pressing the back button sends the user back through the login process. However, in IE6 these values are retained and the user is able to access the page again. The values are definitely being destroyed as reloading the page sends the user back through the login process, but I'd obviously prefer IE6 to send the user straight back to login as Firefox does. I have tried using no-cache and revalidate headers, to no avail. </p>
<p>(Before it's suggested, using Firefox/Safari/Chrome/IE8 is not an available option.)</p>
| php | [2] |
4,366,503 | 4,366,504 | Making smaller a string, c# | <p>I need a library/tool/function that compresses a 50-60 char long string to smaller. </p>
<p>Do you know any?</p>
| c# | [0] |
784,183 | 784,184 | how to get value from input html form using php | <p>can someone help me how can i get the value from input name="$photo_id" as state below after submitting the form.. should be $photo_id = $_GET['photo_id'] on the next page... </p>
<pre><code>$picture = mysql_query( "SELECT * FROM gallery_photos where photo_category = ".$cid." ");
while($row2 = mysql_fetch_array($picture)){
$photo_id = $row2["photo_id"];
$photo_filename = $row2["photo_filename"];
$photo_caption = $row2["photo_caption"];
$photo_category = $row2["photo_category"];
echo "<ul style='float:left; list-style:none; '>";
echo "<li><img src='".$images_dir."/tb_".$photo_filename."' border='0' alt='".$photo_caption."' /><br />";
echo "<span><input name='$photo_id' type='text' value='$photo_caption' /></li></span>";
echo "</ul>";
}
</code></pre>
<p>Thx :)</p>
| php | [2] |
5,556,630 | 5,556,631 | PHP DOMDocument stripping HTML tags | <p>I'm working on a small templating engine, and I'm using DOMDocument to parse the pages. My test page so far looks like this:</p>
<pre><code><block name="content">
<?php echo 'this is some rendered PHP! <br />' ?>
<p>Main column of <span>content</span></p>
</block>
</code></pre>
<p>And part of my class looks like this:</p>
<pre><code>private function parse($tag, $attr = 'name')
{
$strict = 0;
/*** the array to return ***/
$out = array();
if($this->totalBlocks() > 0)
{
/*** a new dom object ***/
$dom = new domDocument;
/*** discard white space ***/
$dom->preserveWhiteSpace = false;
/*** load the html into the object ***/
if($strict==1)
{
$dom->loadXML($this->file_contents);
}
else
{
$dom->loadHTML($this->file_contents);
}
/*** the tag by its tag name ***/
$content = $dom->getElementsByTagname($tag);
$i = 0;
foreach ($content as $item)
{
/*** add node value to the out array ***/
$out[$i]['name'] = $item->getAttribute($attr);
$out[$i]['value'] = $item->nodeValue;
$i++;
}
}
return $out;
}
</code></pre>
<p>I have it working the way I want in that it grabs each <block> on the page and injects it's contents into my template, however, it is stripping the HTML tags within the <block>, thus returning the following without the <p> or <span> tags:</p>
<pre><code>this is some rendered PHP! Main column of content
</code></pre>
<p>What am I doing wrong here? :) Thanks</p>
| php | [2] |
2,734,924 | 2,734,925 | Javascript prototypal inheritance - descendants override each other | <p>I'm creating two objects (Inherits), both inherit from Base.
The second object's property assignment overrides the value in the first object.</p>
<p>Any thoughts? How to make a proper inheritance so that Base class will contain common members for its inheritance descendants, but the descendants could assign values of their own without interfering each other.</p>
<pre><code>var testParams1 = { title: "john" };
var testParams2 = { title: "mike" };
Function.prototype.inheritsFrom = function (baseClass)
{
this.prototype = new baseClass;
this.prototype.constructor = this;
this.prototype.base = baseClass.prototype;
return this;
};
function Base() {
this.viewModel = {};
this.viewModel.title = (function ()
{
var savedVal = "";
return function (newVal)
{
if (typeof (newVal) === "undefined")
{
return savedVal;
}
savedVal = newVal;
};
})();
}
function Inherits(params) {
this.viewModel.title(params.title);
}
Inherits.inheritsFrom(Base);
///// preparing code:
var testObj1 = new Inherits(testParams1);
var testObj2 = new Inherits(testParams2);
///// testing code:
equals(testObj1.viewModel.title(), testParams1.title, "first instance ok"); // returns "john"
equals(testObj2.viewModel.title(), testParams2.title, "second instance ok"); // also returns "john"
</code></pre>
| javascript | [3] |
1,564,210 | 1,564,211 | Is there something like $('a#link_id').activate() in jQuery? | <p>When I bind a function to a link with <code>$('a#link_id').click()</code> and then I click the link, it runs the function and everything it's okay, but when I "activate" the button in another way (i. e. focusing with tab and then pressing barspace) it just doesn't works.</p>
<p>It happens the same with <code>$('select#dropbox_id').change()</code>: It works when I change it with the mouse but not with the direction arrows. Is there a way for achieving this whitout having to rebind manually with <code>$.keyup()</code>? I don't know, maybe I'm just missing an event.</p>
| jquery | [5] |
5,921,391 | 5,921,392 | jQuery - Why hasData Does Not Work? | <p>I assigned data into $clicked_row: </p>
<pre><code>$clicked_row.data("row", data);
</code></pre>
<p>The following code does not work: </p>
<pre><code>alert($clicked_row.hasData("row")); // want to have Boolean output
</code></pre>
<p>However, this works: </p>
<pre><code>alert($clicked_row.data("row")); // output the data
</code></pre>
<p>Why?</p>
| jquery | [5] |
157,591 | 157,592 | Is there any way in python while iterating through a collection to get the current counter numeric value? | <blockquote>
<p><strong>Possible Duplicate:</strong><br>
<a href="http://stackoverflow.com/questions/1185545/python-loop-counter-in-a-for-loop">Python loop counter in a for loop</a> </p>
</blockquote>
<p>I know that I can set up an integer before the loop and increment it together with the loop. </p>
<p>I am asking if there is another way</p>
<p>for example </p>
<pre><code>for object in objects:
print counter somehow
</code></pre>
| python | [7] |
3,772,759 | 3,772,760 | Discover when the user closes the preferences activity | <p>I know it may sound silly, but I really cannot understand if there is a straightforward and standard way to understand when a user gets out from the preferences activity.</p>
<pre><code>case R.id.menu_settings:
Intent i = new Intent(this, Pref.class); startActivity(i);
Toast.makeText(this, "test", Toast.LENGTH_SHORT).show();
updateData();
return true;
</code></pre>
<p>Obviously here the "test" Toast appears asynchronously, while the preferences window is still open. But in the preferences the user could change vital parameters that, to be applied, need updateData() to be called: how can I do? I'm sure that there's a obvious way to do it, but I'm missing it....
Thank you.</p>
| android | [4] |
4,513,237 | 4,513,238 | Why use string.Empty over "" when assigning to a string object | <p>I've been running StyleCop over my code and one of the recommendations SA1122 is to use string.Empty rather than "" when assigning an empty string to a value.</p>
<p>My question is why is this considered best practice. Or, is this considered best practice? I assume there is no compiler difference between the two statements so I can only think that it's a readability thing?</p>
<p>UPDATE:
Thanks for the answers but it's been kindly pointed out this question has been asked many times already on SO, which in hind-sight I should have considered and searched first before asking here. Some of these especially forward links makes for interesting reading.</p>
<p><a href="http://stackoverflow.com/questions/151472/what-is-the-difference-between-string-empty-and">SO question and answer</a></p>
<p><a href="http://stackoverflow.com/questions/263191/in-c-should-i-use-string-empty-or-string-empty-or">Jon Skeet answer to question</a></p>
| c# | [0] |
5,432,220 | 5,432,221 | IE jQuery returns auto instead of the element width | <p>I am using jQuery to try and get the width of an element that doesn't have the width set. In firefox it works fine, but in IE it returns AUTO instead of the actual width of the element.</p>
<pre><code>jQuery('.nav-2').css('width');
</code></pre>
<p>Does anyone know of a work around or another way to get the width of the element that will work in IE?</p>
| jquery | [5] |
5,296,332 | 5,296,333 | What difference does it make including the @package annotation or not? | <p>I am somewhat familiar with the concept of packages in Java, but I'm new to Wordpress and PHP. </p>
<p>In a template file such as <code>header.php</code>, what is happening when you include the <code>@package</code> notation?</p>
<pre><code><?php
/*
* @package MyTheme
*/
</code></pre>
| php | [2] |
5,099,366 | 5,099,367 | Android touch and scroll Listview | <p>I have a custom listview in my app in which the list items are draggable and can be dropped on another position on the listview itself.Now my problem is, I want to Scroll the listview. I tried using onIntercept touch event, but only the touch event happens. I can't able to scroll, Can somebody suggest me an idea on how to achieve this thing...</p>
| android | [4] |
3,542,748 | 3,542,749 | how to record audio in macmini | <p>I use mac mini and need application demo with audio and video of simulator but how we record audio in mac mini any idea?</p>
| iphone | [8] |
610,391 | 610,392 | PHP Subscriptions - Preventing Sharing | <p>Have a client who is looking at developing a site where clients get access by subscriptions.</p>
<p>Obviously the biggest concern is people sharing their login details.</p>
<p>Are there any good techniques which can be deployed to help prevent this or at least reduce it.</p>
<p>Obviously only allowing single session per user logged in so it would kick other people off if they were logged in.</p>
<p>Any other good ideas ?</p>
<p>Thank if you can advise.</p>
| php | [2] |
2,152,658 | 2,152,659 | Android Intent like Gmail's attach Intent | <p>When I get my activity chooser for my ACTION_GET_CONTENT Intent there is applications I don't want to be there, like the ones who will first create content and then pass the URI to me, like the Voice Recorder.</p>
<p>When you use Gmail and try to attach a file you will only see the applications/activities that picks data from your SDCard like Gallery, and in my case Astro (file manager application).</p>
<p>So my question is, what kind of Intent does Gmail use for their Attach?</p>
<p>Here is my code, something must be missing since I get applications like Voice Recorder and so on.</p>
<pre><code>Intent action = new Intent(Intent.ACTION_GET_CONTENT);
action = action.setType("*/*").addCategory(Intent.CATEGORY_OPENABLE);
startActivityForResult(Intent.createChooser(action, "Upload file from..."), 1);
</code></pre>
<p>Thank you!</p>
<p>Regards<br>
Tobias</p>
| android | [4] |
2,656,156 | 2,656,157 | dropdown list with 2 values | <p>I need to create a dropdownlist which has two values "OK" and "NOK" one should be selected by default based of an value of $Status. The user should than be able to change the selection or let the default one. How can i manage this? What i have tried:</p>
<pre><code><select name="Status">
<option value="OK">OK selected="selected"</option>
<option value="NOK">NOK</option>
</select>
</code></pre>
| php | [2] |
5,389,076 | 5,389,077 | Handling recurring cURL POST request | <p>I've basically came here for some advise based on my criteria, </p>
<p>The application I'm trying to build is built completely from an API. It's like a "marketplace bidding" application, what I'm trying to accomplish is an "Auto bidding" function, but for this to happen it will have to send a cURL POST request every 3 seconds based on criteria given, then return the JSON result for me to handle server side, </p>
<p>I'd basically like a direction on what would be the best way to handle this kind of idea, I got told something called "polling" would work but I've never heard of it. Initially the idea is as provided below</p>
<ol>
<li>Load set page "bid.php"</li>
<li>Enter certain criteria</li>
<li>Click submit as to which an "Ajax" request of some sort would start</li>
<li>The recurring cURL request would be activated through the Ajax.</li>
<li>Display the data back from the cURL request every 3 seconds via Javascript.</li>
</ol>
<p>I'm not initially asking for the work to be given to me, I'm just asking the professionals as to which they recon would be the best way I can do this task.</p>
| php | [2] |
2,610,295 | 2,610,296 | Partial Interface in C# | <p>Does C# allows partial interface? i.e., in ManagerFactory1.cs class, I have </p>
<pre><code>public partial interface IManagerFactory
{
// Get Methods
ITescoManager GetTescoManager();
ITescoManager GetTescoManager(INHibernateSession session);
}
</code></pre>
<p>and in ManagerFactory.cs class, I have:</p>
<pre><code>public partial interface IManagerFactory
{
// Get Methods
IEmployeeManager GetEmployeeManager();
IEmployeeManager GetEmployeeManager(INHibernateSession session);
IProductManager GetProductManager();
IProductManager GetProductManager(INHibernateSession session);
IStoreManager GetStoreManager();
IStoreManager GetStoreManager(INHibernateSession session);
}
</code></pre>
<p>Both ManagerFactory and ManagerFactory1 are located in the same assembly. </p>
| c# | [0] |
4,240,852 | 4,240,853 | Javascript match: stop at second match on /g flag | <p>Is it possible to stop at second match instead of letting iterate through whole string?</p>
<p>Thanks ;)</p>
| javascript | [3] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.