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.
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?
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
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.)
Say I have a table with a unique positive integer field. I currently have rows with id's of [1, 2, 3, 4, 5, 8, 12, 35]. Is there a insert query that I could write that would assign the id field to the lowest unique positive integer (in this case 6)? It would have to do this atomically so there isn't the possibility of concurrent inserts wiping out each other or failing.
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
I am a developer a large social network.
Does the protocol OAuth without browser? I plan to write desktop and mobile applications that can not use your browser to get access_token. It worries me step for get Access_token, I can not understand how to implement it.
Give examples of code if possible ...
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.
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?
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
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 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 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.
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 can use this verb in the Python Windows SDK. But not in production. Why? What am I doing wrong?
The error message includes (only seen via firebug or fiddler)
Malformed request
or something like that
My code looks like:
from google.appengine.ext import db
from google.appengine.ext import webapp
class Handler(webapp.RequestHandler):
def delete(self):
key = self.request.get('key')
item = db.get(key)
item.delete()
self.response.out.write(key)
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).
I'm trying to write an LDAP query for find all users in a domain with NO login scripts.
The following works for users with a login script = db.bat:
(&(objectCategory=user)(ScriptPath=DA.BAT))
However, what i thought will be the obvious logic for a Null ScriptPath field returns no values:
(&(objectCategory=user)(ScriptPath=""))
I'll appreciate any assistance.
Robd
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 have a string from an xml document:
<title type="html">
Is there a way for me to write this string like "<title type="html">"? I've had similar problems writing javascript as a string but I did see some solutions in the past (which I can't remember)?
Thanks
Hello,
I was wondering if anyone could give me an example or point me to some example code of how to use an NSTableView. I know how to use it in core data but I would like to do this just using plain cocoa code. All I need is a simple add and remove button. Also is it possible to have cocoa write the data to a text file or plist?
Thanks for any help
I have been wondering why when I set the encoding to UTF-8 and rendering the XML it replace the extended characters by escape characters (or character reference) like ’ instead of '?
I'm using the Render method
render(contentType:"text/xml", encoding:"UTF-8") {...}
with a proper header
render(contentType:"text/xml", encoding:"UTF-8", text:"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n")
Any idea if there is a way to write it properly?
Thanks.
I have some files that I'd like to delete the last newline if it is the last character in a file. 'od -c' shows me that the command I run does write the file with a trailing new line:
0013600 n t > \n
I've tried a few tricks with sed but the best I could think of isn't doing the trick:
sed -e '$s/\(.*\)\n$/\1/' abc
Any ideas how to do this?