For example, I want to write an activity that launches when you return from sleep (black screen). How can I set this activity to run instead of the default one?
Thanks
Does psycopg2 have a function for escaping the value of a LIKE operand for Postgres?
For example I may want to match strings that start with the string "20% of all", so I want to write something like this:
sql = '... WHERE ... LIKE %(myvalue)s'
cursor.fetchall(sql, { 'myvalue': escape_sql_like('20% of all') + '%' }
Is there an existing escape_sql_like function that I could plug in here?
(Similar question to How to quote a string value explicitly (Python DB API/Psycopg2), but I couldn't find an answer there.)
I have an actionscript 2 application that I'd like to write automated UI testing for.
For example I'd like to simulate a mouse click on a button and validate that a movie-clip is displayed at the right position and in the right color... Basically, UI testing.
What are the best tools available or what is the desired approach?
In JavaScript there is the selenium framework which does a nice job. Any similar tool for flash?
i need to work with a binary number
i just write :
const x = 00010000 ;
& it doesn't work
i know that i can use an hexadecimal number that have the same value as 00010000 but for more knowledge i want to know if there is a type in C++ for binary numbers & if there isn't ,is there another solution for my Problem ?
thanks
Hey guys,
I have a xml file on my server like the one below :
www.myWebSite.com/myXmlFile.xml
which is used by my iphone application.
In case the address of my xml file changes to
www.myOtherWebsite.com/myXmlFile.xml
How can I make my app to work anyway ? What kind of PHP server-side code do I need to write ? Is NSURLConnection supporting reirections ?
Thanks for any incomings ;)
Gotye.
For example, instead of writing the following:
element * .../my_branch_01/LATEST
element * .../base_branch/LATEST -mkbranch my_branch_01
I would want to write something like this:
MY_BRANCH=my_branch_01
element * .../%MY_BRANCH%/LATEST
element * .../base_branch/LATEST -mkbranch %MY_BRANCH%
Is this even possible? What is the correct syntax?
Is .NET Compact a perfect subset of .NET?
Can I write a Windows Forms application and run it on .NET Compact, assuming that I took into account screen size and other limitations and avoid classes and methods not supported by .NET Compact or is .NET Compact a diffent and incompatible GUI framework?
I want to subtract a amount from a table's field in Zend Framework. I can run it with SQL using following query:
UPDATE `Person` SET credit=credit-50 where id=1
But how to write above SQL query in Zend Framework?
I want my regex to catch:
monday mon thursday thu ...
So it's possible to write something like this:
(?P<day>monday|mon|thursday|thu ...
But I guess that there should be a more elegant solution.
In a MySQL master-slave replication enviroment if I have 4 slave servers how can I execute load balanced select queries?
Should I write a PHP class to dealing with the 4 slaves or it is possible to address queries to MySQL's own load balancer solution? Is there a MySQL load balancing solutions?
Can I use some other tool to distribute my queries? What is the typical set up in situations like this?
Thanks for all answers!
this is simple I know, but i don't have internet access and this netcafes keyboard sucks, so if someone can answer this question please.
what would be the class ? just give me a kick in the right direction. there is simple arraylist object that I want to write and read to/ from file.
thanks
i have an ms-access database front end that connects to an access backend. i have changed the location of the backend and i need to be able to update the link to it. how do i do this?
when i open the front end and try to see data, it says "the microsoft office access database engine cannot open or write to the file ......... "
Hi everybody,
I need to write an asp.net application which have to handle very large amount of data per second. Probably max5000 user may transact in same time. I think I will use WCF in back to communicate SQL server. But in front ISS can handle 5000 user in same time effectively or is there any simple way to host my application outside of IIS
Write a program that computes the sum of the logarithms of all the primes from 2 to some number n, and print out the sum of the logs of the primes, the number n, and the ratio of these two quantities. Test this for different values of n.
Hello folks,
I have a really short question: Is it possible to communicate/use USB devices on Android OS? I assume it might be tablet device.
Lest say i want to connect some sort of USB card scanner to android tablet. Will it work? Do i need to write drivers by myself?
Thanks.
I have the current author id stored in $theauthorid I want to do a query based on the author id so I do this
query_posts('author=$theauthorid');
However it does not work unless I write the id manually. I know the id is stored correctly as I get the correct id when I echo it.
Hi
Why inheritance is not provided for static classes in C#? I know C# has a good reason for everything he implements or doesn't implement. I just wondered, what’s that “good reason” here? semantically, what would be happened if I was able to write a static class that inheritances from another static one? is this an ODD issue? or just programming?
I want to write an app that a parent can use to disable phone functionality to prevent their child from using it. One way the child could circumvent this is by uninstalling the app.
Is there a way to prevent application uninstall on the Android?
I want to use implicit linking in my project , and nmake really wants a .def file . The problem is , that this is a class , and I don't know what to write in the exports section .
Could anyone point me in the right direction ?
The error message is the following :
NMAKE : U1073: don't know how to make 'DLLCLASS.def'
P.S: I'm trying to build using Windows CE Platform Builder .
i have written a object selection algorithm which picks the objects by there color. i give every object an unique color and then i just have to use the glReadPixels method to check which object was selected
this works fine and is really fast but the problem is that the frame is displayed on the screen with all the picking-colors so the screen flashes every time you select something.
so my question is: how do i write everything in the correct display buffer but dont display it on the screen to avoid these flashes?
Some people claim that code's worst enemy is its size, and I tend to agree. Yet every day you keep hearing things like
I write blah lines of code in a day.
I own x lines of code.
Windows is x million lines of code.
Question: When is "#lines of code" useful?
ps: Note that when such statements are made, the tone is "more is better".
I couldnt figure the problem out so after debugging i finally decide to write the below.
Why is the location jumping around?! 147 86 to 294 212 then back every callback?
pic.MouseMove += my_MouseMove;
my_MouseMove(object sender, MouseEventArgs e)
Console.WriteLine("{0} {1} {2} {3}", e.X, e.Y, e.Location.X, e.Location.Y);
147 86 147 86
294 212 294 212
147 86 147 86
294 212 294 212
147 86 147 86
294 212 294 212
I would like to retreive some binary data from a varbinary(max) column in a SQL Server database for debugging purposes.
What is the easiest way to get this data into a local binary file, preferably without having to write a throw-away console application?
I have tried using SQL Server Management Studio but this returns a hex encoded binary string, rather than raw binary data (even with the "results to file" option).
Hello,
I would like to know how to check which action displayed the current View (from the current view).
For instance, to check if controller myController originated the rendering (I guess) I can write:
<% if(ViewContext.Controller is myApplication.Controllers.myController)%>
In fact, I want to use the same View model for 2 actions methods, like this:
<% If( First Action rendered this view){%>
// Display this
<%} else {%>
//Display that
<%}%>
Thanks for helping