In Perl, I can do this:
push(@{$h->[x]}, y);
Can I simplify the following python codes according to above Perl example?
if x not in h:
h[x] = []
h[x].append(y)
I want to simplify this, because it goes many places in my code, (and I cannot initialize all possible x with []). I do not want to make it a function, because there is no 'inline' keyword.
Any ideas?
I am working on ebook reader with the books in epub format, i need some sample codes regarding that or the java script coding for that.I spent a lot of time in research, any help is appreciated.
i use preg_match_all and need to grab all a href="" tags in my code, but i not relly understand how to its work.
i have this reg. exp. ( /(<([\w]+)[^])(.?)(<\/\2)/ ) its take all html codes, i need only all a href tags.
i hobe i can get help :)
Hi,
I want to find the most used colour in an image using python. for example detect the colour of the object in the following image
http://www.shopcrazy.com.ph/wp-content/images/2007/02/shiny-bags-01.jpg.
how to detect the base colour from the RGB codes(example - red in the above image).
Hi.. Where should I type the authentication code in order to validate the users trying to login to the website.
I have used login control in my website. Also I would appreciate few examples of codes which are generally used in authentication code.
Hello all,
I am not sure if its possible but I would like to create some sort of function where you pass in a string such as "yellow" or "green" and it returns its hex code or the range of hex codes that greens or yellows fit into.
Is this possible in PHP? If not possible, I am willing to try anything else that can do this!
Thanks all
as follow codes:
<div id="outerBox" style="border:1px solid red;width:300;height:300" onmouseout="alert('out')">
<div id="innerBox" style="border:1px solid blue;width:50;height:50">inner</div>
</div>
why when i move mouse on the "innerBox", it was trigger alert('out') ?
i want mouse out "outerBox" trigger alert('out') only, mouse on "innerBox" don't trigger alert.
hot to do this?
thanks all :)
hi,
//codes
success: function(html){
// this is for input box - working
document.getElementById('val').value='';
$('#val').value='';
// how do i set it for dropdown box to reset after sucess?
document.getElementById('val2').value='';
$('#val2').value='';
}
Once user submit dropdown box, i need it to reset to value="" but now it sticks with user option even after submitted.
Any idea how to achieve that?
Hi,
I have a sql script file that upon import creates a table in a MySQL database and fills it with 2800 record. These are all the postal codes for the country Belgium.
Now I would like to make a Ruby on Rails database migration file from this. Any idea how I can do this?
Thanks,
Michael
CODES:
$().ready(function(){
function sample()
{
alert("This is sample function");
}
$("#button").click(function(){
t=setTimeout("sample()",2000);
});
});
HTML:
<input type="button" name="button" id="button" value="Call sample function with delay">
Once i click button sample function is not called with a delay of 2 seconds. I dont know whats wrong. Please notify me how to do this
Question: To call javascript function using setTimeout via jquery
For my project(in asp.net) i wrote near 1000 lines of c# code for one asp.net page.It includes so many functions.The problem is,it is going complicated while i am writing more codes on one page.How can i make multiple c# files for one asp.net page?? I tried by adding new class in VS2008.But calling a function from one file to other is making error(item is not present in current file).How can i do that??
I want to refer to a data cell, which if it is equals to some string, it will do something.
The codes:
If ds.Tables(0).Rows(i)("Status") = "Reserved" Then
MessageBox.Show("Can't reserve")
End If
Is this the correct way to do this?
Because I failed doing so..
I am aware that any Unicode character can be inserted into an HTML document via the following format:
�
...where 0000 is the character code of the desired character
My question is: which of these characters has the most widespread availability when it comes to the client's browser being able to display the character?
In other words, what are the ranges of codes that should be used in an HTML document that is going to be widely deployed?
I am having a C# application to sync data between PC and palm devices.
There are codes written like below:
showMessage("synchronizing Table1");
Sync(destTable1,sourceTable1);
Sync(destTable2,sourceTable2);
showMessage("synchronizing Table2");
// more code
How do I separate the actual process of synchronizing from displaying message?
Which design pattern to follow?
Thanks in advance...
<form enctype="multipart/form-data" method="post" action="mailto:[email protected]" accept-charset="UTF-8">
Is there a problem if mails are sent this way .. i wanna avoid using PHP codes..
is there any method to get data from excel to sql ? i think that we can do without any writing C#codes. For example : select * from MyExcellFile.xls.Sheet1. Or may be any wizard in sql?
c program that has a parent and n children that acts as follows:
parent process:
1- reads a value n from the user
2-forks n children
3-waits to receive exit codes from the 1st child and prints it
4-loops forever
I am trying to get the response codes from Mechanize in python. While I am able to get a 200 status code anything else isn't returned (404 throws and exception and 30x is ignored). Is there a way to get the original status code?
Thanks
My Android application needs to react differently to different Mobile Country Codes.
It seems like it is hardcoded to mcc310 (US). I can read this value from TelephonyManager.getSimCountryIso() or by using a resource folder like res/values-mcc123/, but how do I set this value in the emulator?
javascript:
location.href("somefile.php"); // successfully working with IE
location.href = "somefile.php";
Ques 1. first code is not work with Safari. Why?
Ques 2. What is the difference b/w these codes.
Thanks,
I'm using Netbeans 6.8 to develop application using JSP. I'm able to work with it properly in my project guides system. But i'm unable to get the connection to database from my system.
It shows error unable to connect.
I have not changed any of the codes. How can I fix this error?
I am new to iphone development.I want to show a form a and store the contents in to a core data database after clicking the submit button.I have created a form.xcdatamodel and class events.h and events.m with reference to the apple docs.In some Sample codes the values are stored statically in the delegate class and they use core data delegate methods. But in my case the form view come after passing 2 views. I want to store the data entered here .How can i achieve it.Please help me out.Thanks.
i want to make empty textbox checking for android. i tried try catch but it was force to close.
below is my codes
try{
name = (EditText)findViewById(R.id.name);
}catch(NullPointerException ex){
new AlertDialog.Builder(KawalanAppXTVT.this).setTitle("Error" )
.setMessage("That's not a number")
.setPositiveButton("OK", null).show();
can someone help me?
What key code does an Android editor app expect the keyboard app to send when it is going to be interpreted as a left arrow? In other words, what is the keyboard program supposed to send to its calling program (some kind of editor) if the user intends to move the cursor one char to the left? A related issue: what do the minus values for the "android:codes" attribute mean?
() Any pointers to these issues will be appreciated.