How would I write a regular expression (C#) which will check a given string to see if any of its characters are characters OTHER than the following:
a-z
A-Z
Æ æ Å å Ø ø - '
As a C++ programmer I have now decided to learn C to have "more control" over what I write.
Are there any syntactical features in C which lead to rather unpredictable assembler code? Like virtual functions in C++
Is C disguised assembler? I would quite like that idea.
This is code:
http://www.dpaste.de/Ij0S/
1,if there is a erorr (networking erorr,or Unhandled error in Deferred), the code stop.
I need this code running until all urls finish request. (May be the parallel function not work? )
2,when I write image to local filesystem, if meet erorr, there images may not complete.
Thanks!
My calendar resource is a nested resource under profile
map.resources :profiles, :has_many=>[:calendar]
I am trying to write a rspec spec for calendarcontroller
it "should use supplied date" do
get :show , :month = '09' , :year = '2010'
end
But i get an error stating
No route matches {:month="09",
:year="2010",
:controller="calendar",
:action="show"}
Any idea how i could get around this ?
Possible Duplicate:
How will I know when to create an interface?
Why do we need interfaces in Java?
Instead of interface can't we write the methods directly in the class itself?
Why do we need a separate interface?
I'm loading data from my database and I'm doing a sum calculation with a group by.
ElectricityReading.sum(:electricity_value, :group => "electricity_timestamp", :having => ["electricity_timestamp = '2010-02-14 23:30:00'"])
My data sets are extremely large, 100k upwards so I was wondering if its possible to use the find_each to batch this to help with memory overhead.
I can write the batching manually use limit and offset I guess but I'd like to avoid that if the code already exists.
Hello. I write a 3D engine in C++ with OpenGL. I usually work on this project on my archlinux 64 bits, but on theese holidays I do on a 32 bits system. I use subversion, and since the last svn up on my 64 bits system, I've got errors :
http://pastebin.be/23730
core, wrapper and interface are compilet using the -fPIC option, I do not understand so ...
Thanks :)
Consider the following:
ThreadA and ThreadB are two threads writing diagnostic information to a common object which stores a list of diagnostic information. Is it possible for ThreadA and ThreadB to write to the same memory address at the same time? If so what would result?
Hello!
I want to automate service myshows.ru. People on it must manually put information about movies that watched.
I want to write program on c++, that get titles of movies in video players and put it to account on service.
What libraries i can use for this work?
P.S Sorry for my english
some case i write code like these:
a,temp,b = s.partition('-')
i just need to pick the first and 3rd element. temp would never be used. is there a better way to do this?
the common case is ,a better way to pick separted element to make a new list?
for example
i want to make a new list use old list 0,1,3,7 element
code would be this:
newlist = [oldlist[0],oldlist[1],oldlist[3],oldlist[7]]
it's pretty ugly,isn't it?
I have a large data file that is creatd from a shell script. Next script processes it by sorting and reading several times, that takes more than 14 hours, it is not viable.
I want to replace this long running script with a program, probably in JAVA, C, or COBOl, that can run on windows or on sun solaris. I have to read a group of records everytime, sort and process and write to the output sort file and at the same time insert into db2/sql tables.
i have a tree menu that i need to open on specific branch.
1. on click on an A element i open the all next UL.
now i want to close all other UL exept the ones that are parents of the A element.
i want to write a function that will get an argument that is a A ID and will open the menu in the right place.
example of my code
Hey,
I'm trying to get this function to get the following output with the listed input, the "..." is where I'm not sure what to write:
void Question8(void)
{
char sentence[100];
int grade;
scanf(….);
printf("%s %d", sentence, grade);
}
Input:
My CS Grade is 1000
Output:
My CS Grade is 100
However, the kicker is that I need the scanf to read a c-string and then an int with a single scanf command, is this even possible?
I have this for a for loop which I made I was wondering how I would write so it would work with a while loop.
def scrollList(myList):
negativeIndices=[]
for i in range(0,len(myList)):
if myList[i]<0:
negativeIndices.append(i)
return negativeIndices
So far I have this
def scrollList2(myList):
negativeIndices=[]
i= 0
length= len(myList)
while i != length:
if myList[i]<0:
negativeIndices.append(i)
i=i+1
return negativeIndices
HI
I'd like to know how to check out the speed of a file being uploaded in real time using the curl library in c++. This is what I have written:
curl_easy_getinfo(curl,CURLINFO_SPEED_UPLOAD,&c);
But the manual says that it shows average speed, but even this doesn't seem to work with me, because I can only see a 0.
There is one more thing:
How to set an upload limit that works, because if I write this:
curl_easy_setopt(curl, CURLOPT_MAX_SEND_SPEED_LARGE, 100);
I get an error 502 message
Is it possible to determine the moment of switching of certain Activity from foreground to background and vice versa?
This activity should run in the separate process.
I need to write the application that collects some statistics from using of big set of applications (app names read from configuration file). My application works as Service and should remember moments of switching of activities between foreground and background.
Set of applications is sufficiently big and most part of these applications will never work on certain phone.
Does anyone know of a good resource on the Audible Audio (.aa) file spec?
I'm trying to write a program that can use them, if no one knows of a resource, any tips on reverse engineering the spec my self? I opened it up in a Hex editor and poked around, looks like an MP3 but with a ton more header info.
I don't really know much about sockets except how to read and write to them as if they were files. I know a little about using socket selectors. I don't get why you have to flush a socket, what's actually happening there? The bits just hang out somewhere in memory until they get pushed off? I read some things online about sockets, but it's all very abstract and high level.
What's actually happening here?
Is it possible to write a query that will give me the names of all the tables in an SQL Server database? I'm working on some 'after the fact' documentation on a system I didn't create and am looking for a shortcut to get a listing of the tables in a database.
I am attempting to write a regular expression to process a string of key value(s) pairs formatted like so
KEY/VALUE KEY/VALUE VALUE KEY/VALUE
A key can have multiple values separated by a space.
I want to match a keys values together, so the result on the above string would be
VALUE
VALUE VALUE
VALUE
I currently have the following as my regex
[A-Z0-9]+/([A-Z0-9 ]+)(?:(?!^[A-Z0-9]+/))
but this returns
VALUE KEY
as the first result.
I was told by some person that just as .NET started inspired from Java, so is WPF as ".. Microsoft NEVER innovates...".
I can't find anywhere anything remotely close to WPF.
Do you know any particular technology, earlier than WPF, from which Microsoft could have been inspired to write WPF?
Hi,
I wanna to have query:
Select cars.* from cars where cars.code in
(
select carCode from articles where
numberofrecords with this car (it is not a column) >1
and Accepted=1
order by date
)
How to write it?
a difficult one..
using classes of primitive types in java, like Integer, Float, Long, etc, write a code fragment using a method to double the value of a variable passed as an argument
Is it possible to actually use the type passed as a template for control flow? I'd like to write a function that uses templates, which in turn calls another function based on the type passed:
template <class T> void test_function (T var)
{
//Do stuff
if (T == char) {
bar (var);
} else {
foo (var);
}
//Do even more stuff
}
If not, I'll have to fallback to enums...
Is there an analogous form of the following code:
if(month == 4,6,9,11)
{
do something;
}
Or must it be:
if(month == 4 || month == 6 etc...)
{
do something;
}
I am trying to write an if statement that checks if this month has more than 31 days.