how do i ignore exceptions in c#?
i am reading a remote xml file, and sometimes the tag doesnt exist and it throws an exception. how do i ignore the exception and goto next?
Is there a git find analogue of git grep, i.e., something that will find a filename by pattern in the tree? I've gone through a lot of git documentation and not found this, but I'm having a hard time believing it doesn't exist somewhere.
Hi,
i have these methods in module1/actions/actions.class.php:
public function executeMethod1(sfWebRequest $request){
$a = 10;
sfContext::getInstance()->set('a', $a);
return $this->redirect('module1/method2');
}
public function executeMethod2(sfWebRequest $request){
echo sfContext::getInstance()->get('a');
}
When i execute module1/method1 i get this error:
"The "a" object does not exist in the current context."
Any idea?
Javi
What is wrong with my role redirection,
protected void Login1_LoggedIn(object sender, EventArgs e)
{
{
if (Roles.IsUserInRole(Login1.UserName, "Aemy"))
Response.Redirect("~/Admin/Home.aspx");
else if (Roles.IsUserInRole(Login1.UserName, "User"))
Response.Redirect("~/Welcome/User1.aspx");
}
}
Error : The name 'Roles' does not exist in the current context
I was trying to solve this problem http://www.spoj.pl/problems/FACKT/, and I keep getting a Non-Zero Exit Code (NZEC). How exactly do I figure out what to change in the code to overcome this?
Here is the code
import math
import sys
def cal_num(n):
i = 1
f = 1
while f<n:
f *= i
i = i + 1
return i-1
while 1:
line = sys.stdin.readline()
if line == "":
break
n = int(line)
x = cal_num(n)
y = math.factorial(2*x)
l = int(math.ceil(math.log(y,10)))
print (x,l)
Any suggestion would be welcome.
I'm using the rowDiffs() command to calculate the step by step difference in 116 rows in a matrix.
I get the following error:
Error in r[i1] - r[-length(r):-(length(r) - lag + 1L)] :
non-numeric argument to binary operator
I have no idea why this is happening. I could take the diff() separately for each row and it would work.
Any ideas?
Here's the data:
https://dl.dropbox.com/u/22681355/data.csv
Code:
a=rowDiffs(data)
if I have a stored procedure say
create procure w AS
ALTER TABLE t ADD x char(1)
UPDATE t set x =1
Even when it lets me create that stored procedure (if I create it when x exists), when it runs, there is an error on the UPDATE statement because column x doesn't exist.
What's the conventional way to deal with this, it must come up all the time? I can work around it by putting the UPDATE inside EXEC, is there another/better way?
Thanks
how do i ignore exceptions in c#?
i am reading a remote xml file, and sometimes the tag doesnt exist and it throws an exception. how do i ignore the exception and goto next?
Please consider the following /root/.profile:
export PS1=value1
export x=value2
How come the login shell shows the expected prompt (and $x as value2), while the subshells keep showing $x as value2 but $PS1 as '#'? Just in case, I'm trying this under OpenBSD.
[Yeah, I know... What on earth am I doing with OpenBSD if I don't know this? Just toying... in an isolated, most definitely non-production VM =).]
i am using Docmd.TransferText to import data from a text file into my access table.
i would like it to do the following:
if the record already exists, then update it
if the record does not exist then add it
how do i accomplish this?
currently i have this line:
DoCmd.TransferText acImportDelim, yesyes, "table3", "C:\requisition_data_dump.txt", True
this_category = Category.objects.get(name=cat_name)
gives error: get() takes exactly 2 non-keyword arguments (1 given)
I am using the appengine helper, so maybe that is causing problems. Category is my model. Category.objects.all() works fine. Filter is also similarily not working.
Thanks,
I am trying to remove an item from listbox but is not working. even that im sure that there exist an item to remove. any idea about what maybe going wrong?
iSelectedItem = ContactConflictListBox.ItemIndex;
if ((iSelectedItem == -1))
{
return;
}
ContactConflictListBox.Items.Remove(iSelectedItem);
I only know that a function that return a non-const reference is a lvalue, you can assign a value to the function
int& f() { return ***}
f()=1;
What else?
i know that the syntax for usin DataTextField is :
VA.DataTextField = "nameofcolum"
but if my request is not simple that mean my request return the result in a colum wich not exist in this case what i should to affect to DataTextField
I'm quite puzzled by CouchDB: if I send a PUT request with some JSON string fields encoded as UTF-8, the non 7 bit ASCII characters get converted to the "\uXXXX" escape sequence. Is there any way to tell it not to escape UNICODE?
Hello,
class name: MyAssembly.MyClass+MyOtherClass
The problem is obviously the + as separator, instead of traditionnal dot, its function, and to find official documentation to see if others separators exist
Thank you in advance !
I'm trying to make a stored procedure but it doesn't seem to be recognizing the parameters I've given it.
Procedure
create procedure test_pro(IN searchTable VARCHAR(55))
begin
select * from searchTable limit 10;
end //
Trying to execute
mysql> call test_pro('exampleTable');
ERROR 1146 (42S02): Table 'db.searchTable' doesn't exist
It isn't replacing the searchTable with the parameter that is passed in.
Same question as: http://stackoverflow.com/questions/696218/do-line-file-equivalents-exist-in-c
But for Objective-C in iPad/iPhone SDK Xcode? This would really help my NSLog statement be a lot more readable over time.
I'd like to be able to create a special user account that would exist on an android device. Since it is based on the Linux kernel, I was hoping there was a way to create a group account and then create a user account. Is it possible ?
Hi,
I need to perform a simple update query where the update should only be done, if there is no value with updating value (item_name). For example,
DB table [item_types]
item_id(PK) | item_name
Assuming there exist item_id with 6, My attempt is
UPDATE item_types as k SET k.item_name = 'item_1' WHERE NOT EXISTS (SELECT * FROM item_types as a WHERE a.item_name = 'item_1') AND k.item_id = '6'
But this gives me error
"You can't specify target table 'k' for update in FROM clause"
Could you please explain the error here and how can I achieve this ?
Thank you
I am developing a template for bigcommerce site, where i want to show category list and some hard code links in the place of Page menu. Now what i do, just place this %%Panel.SideCategoryList%% in the upper navigation area. Which shows category list right.
But the problem is that i didn't find this %%SNIPPET_SideCategoryList%% file. (In snippets folder exist a file with this name, but that file doesn't work even if i remove all contents of that file.)
Consider the following Java class:
public class Foo
{
public static void doStuff()
{
// boring stuff here
}
}
Is it possible to access either the class literal Foo.class, or just the class name "Foo" from within a static method such as doStuff()? In a non-static method I would just call this.getClass(), but there is no this to use in a static method.
Does such a thing exist? or could anyone please recommend how I could implement such a container?
basically I have a std::map which uses a 64bit integer as its key and a custom datatype as the containing item.
I need to be able to periodically remove items that havent been accessed in a while in the most optimal way. does anyone have any suggestions for this?
cheers