Hello everyone,
How can I get the file name and line number in python script.
Exactly the file information we get from an exception traceback. In this case without raising an exception.
Hi Folks !
So I am having an issue on my entrepreneur business opportunity rating matrix :
I would like the radio buttons to stay on the same line.
The problem is that I don't know how I should process because if I give a fixed minimum width for the cell, i'm not sure it will display properly on other browsers, and if the cell is to big I loose the alignment of the radio buttons.
Do you guys have a CSS/Javascript (jQuery) trick that would fix this ?
Thank you
I'm writing a document using markdown, which I'm exporting to a PDF using pandoc. At the end of the document I need to have space for signatures on a printed copy of the PDF.
I've tried to find how to draw a line with a fixed width, but so far I only got to escaping the underscore character, which doesn't feel quite right. It's as if I'm missing something, this couldn't possibly be that unusual to want to do.
Any help or pointers are greatly appreciated.
I'm following this tutorial for a project at work, and I was wondering if there is a way to create several lines on the same graph? At the moment I can;t do this without moving the other line along.
How to export / import database in mysql through comman line,
mysql system config ,
WAMPSERVER server installed .
OS WINDOWS
The advise for my local host , not an live hosting...
Thanks
This is the code I have so far
d = {}
counter = 0
for lines in words:
counter += 1
for word in text1:
if word not in words:
d[word] = [counter]
else:
d[word].append(counter)
print(word, d[counter])
words = my text file
text1 is my misspelled words
But this gives me an error. What I want to do is print the word and the line number e.g.
togeher 5 7
Hi, I am wondering what this line of code mean?
b = (gen_rand_uniform()>0.5)?1:0;
The gren_rand_uniform() is a function to generate random 0 and 1 numbers. However I don't get the meaning for >0.5 and 1:0.
I know this is supposed to be a basic question, please bear with me.
Thanks!
You can declare and initialize an array with integers in one line as following:
int[] myArray = new int[{...}];
How can I do this with an ArrayList, if possible?
I would like to perform checking on the following:
VALID LINES;
/**/ some code
*/ some code /** dsfsdkf sd**/
NOT VALID LINES;
/**/ //some code
*/ /***/ //somecode
So basically if there is a line of code outside a comment it is valid, otherwise not.
What would be the best way to tackle this kind of validation?
Note:
For */ I assume that the /* has been opened some lines before.
How can I achieve a result like somebody would expect it according to the following code example:
// assuming: void myFunction( int* arr );
myFunction( [ 123, 456, 789 ] );
// as syntactical sugar for...
int values[] = { 123, 456, 789 };
myFunction( values );
The syntax I thought would work spit out a compile error.
How can I define an argument array directly in the line where the function is called?
Is there a way to get DVD region code from command line (linux/ubuntu 9.10)?
I want to script this action and store the region code (and other data about DVD) in a log.
I use the command line sqlite3 executable to check queries I make from my code.
Is there a way to read in pragma statements or other session setup (".mode csv" for example) when the executable starts up?
I know I can do a ".read " once I'm in, but that's tedious.
I need to make a SOAP webservice call to https://sandbox.mediamind.com/Eyeblaster.MediaMind.API/V2/AuthenticationService.svc?wsdl and to use the operation ClientLogin while passing through the parameters: ApplicationKey, Password, and UserName. The response is UserSecurityToken. They are all strings.
Here is the link fully explaining what I am trying to do:
https://sandbox.mediamind.com/Eyeblaster.MediaMind.API.Doc/?v=3
How can I do this on the command line? (Windows and/or Linux would be helpful)
Thanks!
I'm trying to read a comment that is stored in a mysql table. For some reason I always get a parse error on the last line of the file even if the last line is blank. I'm not sure if it's relevant but the connect.php works for putting the comment into the database. I'm using wampserver to host it and coding it by hand.
I think that's it's something to do with the while loop, when I comment out the while(){ and the } near the end I just get a few missing variable errors as you would expect. I'm quite new to php coding so I'm pretty sure the problem will be something simple that I've either missed or not understood properly.
Anyway, here's my code:
<?php
include "connect.php";
?>
<?php
$sql = "SELECT * FROM main";
$result = mysql_query($sql) or die("Could not get posts from table");
while($rows=mysql_fetch_array($result)){
?>
<table bgcolor="green" align="center">
<tr>
<td></td>
</tr>
<tr>
<td><strong> <? echo $rows['name']; ?> </strong></td>
</tr>
<tr>
<td> <? echo $rows['email']; ?> </td>
</tr>
<tr>
<td> <? echo $rows['comment']; ?> </td>
</tr>
</table>
<?
}
?>
Thanks for the help. :)
Lets us consider the following program :
#include <stdlib.h>
int main(int argc, char **argv){
int a,b;
if (argc != 3)
return -1;
a = atoi(argv[1]);
b = atoi(argv[2]);
a = b ? a/b : 0;
return a;
}
The task is to crash the program by providing arguments in command-line.
Hi,
I am using the code from this tutorial to parse a CSV file and add the contents to a database table. How would I ignore the first line of the CSV file? The controller code is below:
def csv_import
@parsed_file=CSV::Reader.parse(params[:dump][:file])
n = 0
@parsed_file.each do |row|
s = Student.new
s.name = row[0]
s.cid = row[1]
s.year_id = find_year_id_from_year_title(row[2])
if s.save
n = n+1
GC.start if n%50==0
end
flash.now[:message] = "CSV Import Successful, #{n} new students added to the database."
end
redirect_to(students_url)
end
Hello:
How can I break long lines when writing c++ code in vim? For example, if I have something like
56 fprintf(stderr, "Syntax error reading recursion value on
57 line %d in file %s\n", line_count, filename);
I get the following compile errors:
:56:25: warning: missing terminating " character
:56: error: missing terminating " character
:57: error: stray ‘\’ in program
:57:37: warning: missing terminating " character
:57: error: missing terminating " character
I'm a vim newbie.
Thanks!
I have dictionary like
d = {'user_id':1, 'user':'user1', 'group_id':3, 'group_name':'ordinary users'}
and "mapping" dictionary like:
m = {'user_id':'uid', 'group_id':'gid', 'group_name':'group'}
All i want to "replace" keys in first dictionary with keys from second (e.g. replace 'user_id' with 'uid', etc.)
I know that keys are immutable and i know how to do it with 'if/else' statement.
But maybe there is way to do it in one line expression?
I am trying to create a Exception class to get and send errors from client to server. I want to catch exception in javascript function and push the details to the web service to write to database.
But i couldn't get how to get which function/line throwed this exception. Is there any way to solve this?
I need perl script to compare line from file1 with file2 and copy to final file, something like this:
File1.txt:
ASPO01
ASPO02
ASPO03
File2.txt:
ASPO01 2013-11-10 19hrs
ASPO10 2013-11-09 24hrs
ASPO02 2013-11-08 10hrs
ASPO16 2013-11-05 9hrs
ASPO17 2013-11-06 6hrs
ASPO03 2013-11-07 15hrs
ASPO18 2013-11-02 25hrs
...
Search into File2 and copy to final file called final.log, like this:
final.txt:
ASPO01 2013-11-10 19hrs
ASPO02 2013-11-08 10hrs
ASPO03 2013-11-07 15hrs
Thanks for all good friends can help me!!!
I have a bunch of text files where I want to add a line ending after each period.
I'm wondering if there is a way to do this by doing replacing all periods with a \n\n, assuming I have the right encoding (unix).
Anyone know how I would do this? Replace .'s with \n\n and then save as a different file?
Thanks!
How can view the execution line used by netbean v6.8 to execute my java application when I press the run program button (right pointing green arrow)? I'm looking for something like:
java -cp build/class Main
I'm trying to make the jump to java IDE developement from 15 years writing c and c++ with vi. I'm starting with netbean since it seems to have the best vi key bindings.