I'm curious about why early versions of the BASIC programming language had line numbering like in:
42 PRINT "Hello world!"
The text editors back then had no line numbering?
Hi StackOverflow,
I'm trying to group the following string into three groups.
0:0:Awesome:awesome
That being "0", "0" and "Awesome:awesome"
Using this regular expression:
^([0-9]+)\:([0-9]*)\:(.*)$
It works fine on online regex services: http://rubular.com/r/QePxt57EwU
But it seems like .NET doesn't agree.
I have a list, that has a custom content type, the list also contains subfolders
How can I add an item to the list using web services, in a specific sub folder?
Have a requirement to select the 7th column. eg:
cat filename | awk '{print $7}'
The issue is that the data in the 4th column has multiple values with blank in between. example - The last line in the below output:
user \Adminis FL_vol Design 0 - 1 -
group 0 FL_vol Design 19324481 - 3014 -
user \MAK FL_vol Design 16875161 - 2618 -
tree 826 FL_vol Out Global Doc Mark 16875162 - 9618 - /vol/FL_vol/Out Global Doc Mark
I have done urlencode of the variable before passing to the URL
http://example.com/Restaurants?aliasF%26B
But when I try to print like in the page
$alias = rawurldecode($_GET['alias']);
echo $alias;
it prints only F. How to solve this?
Hi All,
I've been looking but can't find the the documentation:
Is there a way to have a page render a response without the wrapping HTML elements and just print whatever is provided in the body of the tml or alternatively whatever is set in MarkupWriter.write during @BeginRender?
I need a page that does some server side processing and returns pure javascript for an external application to request.
If that is impossible, is it possible to expose the tapestry Ioc to a servlet in the same app?
Thanks, p.
I am just simply creating a web application.
I wanted to insert a line break in a label
for example
label1.Text = "I AM HERE" + "\n" + "I AM NOW HERE";
I wanted to print it as
I AM HERE
I AM NOW HERE
But, it is not working... I don't know why...
I even tried
label1.Text = "I AM HERE" + '\n' + "I AM NOW HERE";
its not working.. What should I do....
Why do I get a syntax error running this code? If I remove the highlighted section (return cards[i]) I get the error highlighting the function call instead.
Please help :)
def dealcards():
for i in range(len(cards)):
cards[i] = ''
for j in range(8):
cards[i] = cards[i].append(random.randint(0,9)
return cards[i]
print (dealcards())
What is the best way to touch two following values in an numpy array?
example:
npdata = np.array([13,15,20,25])
for i in range( len(npdata) ):
print npdata[i] - npdata[i+1]
this looks really messed up and additionally needs exception code for the last iteration of the loop.
any ideas?
Thanks!
In Python I can use the iterkeys() method to iterate over the keys of a dictionary. For example:
mydict = {'a': [3,5,6,43,3,6,3,],
'b': [87,65,3,45,7,8],
'c': [34,57,8,9,9,2],}
for k in mydict.iterkeys():
print k
gives me:
a
c
b
How can I do something similar in Javascript?
im moving from a c# VS2008 world into the mac world and I just wanted to know how I can create a quick little command line based application so that I can write many little objective-c apps without worrying about creating an iPhone app or whatever.
Which projects do I create in xcode? I can see the Command Line Tool under "Mac os x" but the only options for the type is "C", "C++", "Core Data", "Core Foundation", "Core Services" and "Foundation"
but no simple objective c project?
Thanks
Hi i am trying to connect my iphone aap directly to the MySQL database. I did a lot of reading, and i found that by using MCPkit we can access the database. Now i also found that the mcpkit is not supported in iphone, while it runs in simulater. Can somebody tell me whats the deal with this. I know the other alternative is web services, but i have to directly connect to the DB. so please can somebody help me with this problem.
decorator 1:
def dec(f):
def wrap(obj, *args, **kwargs):
f(obj, *args,**kwargs)
return wrap
decorator 2:
class dec:
def __init__(self, f):
self.f = f
def __call__(self, obj, *args, **kwargs):
self.f(obj, *args, **kwargs)
A sample class,
class Test:
@dec
def disp(self, *args, **kwargs):
print(*args,**kwargs)
The follwing code works with decorator 1 but not with decorator 2.
a = Test()
a.disp("Message")
I dont understand why decorator 2 is not working here. Can someone help me with this?
Hello.
I need to use PHPMailer to send emails out for the following reasons:
small lists (less then 500)
password resets
general notifications, 100ish emails at a time
And PHPMailer gives me the option to send via mail(), sendmail, or SMTP. Is there any reason to prefer one of these methods over the other?
I don't know enough about email services in general to make an informed decision.
I am looking for a way to get the dimensions of a remote image file without having to save it to the hard drive -- I am trying to skimp on the I/O requests. Basically something like PHP's getimagesize() function.
I did try something like this:
print Image.open(urllib2.urlopen(src)).size
but PIL wants a file handle that has a seek() method.
Any ideas?
Although iPhone support JSON natively, and easy to consume RESTful services, AMF is a binary protocol and it supposes to use much less bandwidth. Do you think using AMF + Flash remoting is a good idea?
Just found this AMF library in cocoa (Objective-C): http://github.com/nesium/cocoa-amf/
I have a PC on remote connected by network, but it occasionally crashes or is restarted by remote users. After the restart, some services and applications have to be in running status. So I would like to find out the reboot as soon as possible. I think PS may be a good choice with some scripts so that I could make remote call to get the last reboot timestamp information.
Is there any way to get a remote Windows XP last reboot timestamp by using PowerShell 2.0?
Given A,B print the number of pairs (a,b) such that GCD(a,b)=1 and 1<=a<=A and 1<=b<=B.
Here is my answer:
return len([(x,y) for x in range(1,A+1) for y in range(1,B+1) if gcd(x,y) == 1])
My answer works fine for small ranges but takes enough time if the range is increased.
such as
1 <= A <= 10^5
1 <= B <= 10^5
is there a better way to write this or can this be optimized?
Are there any good OOP languages that you can use on Linux? Obviously Java comes to mind, even running C# under mono.
Looking for a language that can be used for all round development, web dev, desktop, services etc.
Besides Mono C# and Java anything else come to mind?
Is there a trick in the Groove Web Services to find the size of a Groove Workspace, as displayed on the Properties dialog? Most of the other information shown here is available, but I can't find size.
Thanks for the help..
Now , I execute the command line "rake db:migrate" on the window OS, but I got the problem in the console. it print couldn't find HOME environment -- expanding~/.ruby-uuid'`
who can help me to solve this ? Thank you and best regards!
We build a system that handling the billing analyse and what it does it just have a raw bill from vendor and process to "common" table and this is using SQL Server 2005 Integration Services.
At the moment, the batch has 300,000 rows and it took about 6 minutes to process. Now, the current spec are:
2 CPUs Intel Xeon E5345 @ 2.33 GHz
RAM 4GB
Is there anyway I can speed up this process?
string mesag="";
mesag="aDoubleArray value at 0------->"<<aDoubleArray[0]<<" aDoubleArray value at 1 is "<<aDoubleArray[1];
addLog(AMR_LT_WARN, mesag);// this part not working
addLog(AMR_LT_WARN, "this works well");
i dont know anythng about c++ just want to print aDoubleArray values to log file but it throws
error C2297: '<<' : illegal, right operand has type 'double'
I want to check out whether the photograph is suitable for print or not using my application.How can I do that?I don't know much about photo quality?Is the resolution of every photograph is same or not?