Project I'm working on uses jQuery.
I have a series of Ajax calls being made that load() other HTML fragments which in turn load() other fragments. The whole thing is confusing. I didn't write the code.
Is there any tool which will allow me to walk the callstack so I can figure what is calling a method? any browser tools that would help me figure this out?
Hi,
I have a project in C# with a Sql-server Database.
In that database I have a table named 'Process' and columns named 'process_name', 'Full_Name' and 'Version' (all of the type:nvarchar(50)).
I want to write a query wich will add the new process, only if it doesn't exist in the table yet.
How can I do that?
Many thanks,
Hello,
I need to write a proxy script to log into secure servers without ever revealing an administrative password.
Can someone recommend some proxy scripts (written in PHP preferably) that I can look into?
Thanks!
Edit: I would be most interested in well documented scripts... if that matters.
Hello,
I'm required to write a SSL connection, but It requires a signed certificate. There is a way to disable the checking so that I can only test my application.
Regards,
Let's say I have the following class:
class Person(val firstName:String, val lastName:String)
Is there an automatic way to generate xml from this class without having to hand create a toXml() method? Ideally the output would be something like:
<Person
<firstNameJohn</firstName
<lastNameSmith</lastName
</Person
It seems like there should be a way to do this without having to write all that out manually. Perhaps there is a trait I haven't found yet?
I've written the following if-statement in Java:
if(methodName.equals("set" + this.name) ||
isBoolean() ? methodName.equals("is" + this.name) :
methodName.equals("get" + this.name)) {
...
}
Is this a good practice to write such expressions in if, to separate state from condition? And can this expression be simplified?
Hopefully there's a simple solution to this. I'm setting up a redirect for old search listings, but I don't want any of the query string to carry over.
The current rule is:
redirect 301 /blog http://newdomain.com
But this would redirect the following:
http://www.olddomain.com/blog/2009/11/article-name-etc
To this:
http://newdomain.com/2009/11/article-name-etc
When I just want:
http://newdomain.com
Can this be done in the simple 301 redirect, or will I have to write a mod_rewrite rule?
What is the ending 'r' for and the leading 'd' for in file permissions on Linux?
Example:
drwxr-xr-x
I know about the user, group, others part, and I know w=write, r=read, x=execute.
But I don't know about the leading 'd' and the trailing 'r'.
Care to explain?
Thanks
hi, i want in my application to use the 12 hour clock format so the user can write 15:00
for 3:00 pm so i don't need to create a button am and pm. Thanks
I have 10 instances of the class movie which I wish to add to an Arraylist named Catalogue1
in a class containing a main method I write the following
ArrayList catalogue1= new ArrayList ()
//the class movie is defined in another class
Movie movie1= new Movie ()
Movie movie2= new Movie ()
Catalogue.Add (1, movie1)
What is wrong? Should I define somewhere what kind of Objects this arraylist named catalogue should contain?
Thank you in advance
In perl you can simply write print "-" x 20 and you get a line with dashes...but i need the same thing in bash/commandline on linux without perl/(g)awk etc. any ideas? The intention is to use it in the -exec of the find command and i want to prevent using simple echo "---------" ...
Write a program which, given a list of up to 10 integer numbers and a sum, will display a subset of the numbers whose total is that sum if one exists or indicate that none exists otherwise. For example, for the list: 5,13,24,9,3,3 and sum = 28, your program should display 13, 9, 3, 3.
How to do this in C++ using a recursive function?
I have a function that returns a tuple that, among others, contains a float value. Usually I use assertAlmostEquals to compare those, but this does not work with tuples. Also, the tuple contains other data-types as well. Currently I am asserting every element of the tuple individually, but that gets too much for a list of such tuples. Is there any good way to write assertions for such cases?
Hello friends,
I am using blackberry using java eclips
I have a lengthy of code in single class.so I need to divide code into different classess(need to implement methode in diffferent classes), how to write code in diff classes and how to access diiferent classes methodes in a single class. Can you please give me suggesion.
I'd like to implement measurement unit preferences in a Ruby on Rails app.
For instance, the user should be able to select between displaying distances in miles or in kilometers. And, obviously, not only displaying, but entering values, too.
I suppose all values should be stored in one global measurement system to simplify calculations.
Are there any drop-in solutions for this? Or should I maybe write my own?
I am trying to write a .sh file that runs many programs simultaneously
I tried this
prog1
prog2
But that runs prog1 then waits until prog1 ends and then starts prog2...
So how can I run them in parallel?
Thanks
Hi,
In my application I download several critical files from a server, and I want to write some code that handles the case where the a file download didn't complete for a reason or other ,to retry downloading it at next startup. The function that downloads a file at a time however throws only MalformedURLException and IOException , but if these exceptions are thrown that means that the download didn't even begin. How should I arrange things so I can treat the case where a download failed , even if it began ?
download(String file) throws MalformedURLException ,IOException
{
}
I need to match and replace some comments.
for example:
$test = "the url is http://www.google.com";// comment "<-- that quote needs to be matched
I want to match the comments outside of the quotes, and replace any "'s in the comments with "'s.
I have tried a number of patterns and different ways of running them but with no luck.
The regex will be run with javascript to match php "//" comments
UPDATE:
I took the regex from borkweb below and modified it. used a function from http://ejohn.org/blog/search-and-dont-replace/ and came up with this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript">
function t_replace(data){
var q = {}, ret = "";
data.replace(/(?:((["'\/]*(("[^"]*")|('[^']*'))?[\s]*)?[\/\/|#][^"|^']*))/g, function(value){
q[key] = value;
});
for ( var key in q ){
ret = q[key];
}
var text = data.split(ret);
var out = ret + text[1];
out = out.replace(/"/g,""");
out = out.replace(/'/g,"'");
return text[0] + out;
}
</script>
</head>
<body>
<script type="text/javascript">
document.write(t_replace("$test = \"the url is http://www.google.com\";// c'o\"mment \"\"\"<-- that quote needs to be matched")+"<br>");
document.write(t_replace("$test = 'the url is http://www.google.com';# c'o\"mment \"\"\"<-- that quote needs to be matched"));
</script>
</body>
</html>
it handles all the line comments outside of single or double quotes. Is there anyway I could optimize this function?
I want to write a custom ValidationAttribute that checks if the given value is unique or not.
The problem is that in the edit screen, it is not guaranteed that the user actually changed the value, resulting in a false error.
Is there a way to check in my attribute whether the value actually changed? Or can I trigger the attribute only when the value has changed?
I'm getting the feeling this requirement maybe just doesn't belong in an attribute?
Hello,
How can I write DAO method which will return as a result only first entry from the database. For instance lets say I'm looking at Users table and I want to retrieve only the first entry, I'd declare method like:
public User getFirstUser(){
//method logic
}
EDIT:
User has primary key id if that matters at all.
I apologize if this question is too simple/stupid/whatever I'm beginner with Java so I'm trying new things. thank you
hi my friends,
I wanna to write simple C compiler,I wrote some parts of it
it can check synetic of C,now I need to link my program to gcc
how can I do it?
I wanna to link it,for example when user open file in my programm,gcc compile it and save it where the user want.
now I don't now how to say gcc to complie this file,show error and ...
[english is not my mother language,and my english is not so well,so I apologize for any mistake in my post or If I can't reached my mean]
With jquery it's very easy to insert some element inside another element using the selector technology, I am wondering if there is any python library that can do things similar with jquery, the reason is I want server side python program to produce the static pages, which needs to parse the html and insert something into it.
Or other alternative, not in python language at all?
EDIT: To be clear, I want to use python to write below program:
h = html.parse('temp.html')
h.find('#idnum').html('<b>my html generated</b>')
h.close()
I want to write a program to recover recently deleted files on windows 7..
Is there a function in windows API that recover files? If not, how can I begin in that?
EDIT:
Or an open source project for that?