I'm looking for a regex that will parse a line at a time from a csv file. basically, what string.readline() does, but it will allow line breaks if they are within double quotes.
or is there an easier way to do this?
Alright, PHP is throwing this error at me (in the log) when I run the code mentioned below:
Error
mysql_num_rows() expects parameter 1 to be resource, string given in (place) on line 10
Line 9-11
$queryFP = ("SELECT * FROM db");
$countFP = mysql_num_rows($queryFP);
$aID = rand(1, $countFP);
I think it has something to do with the $queryFP's syntax, but I'm not completely sure how to fix it since $queryFP's syntax is the simplest query I've ever seen.
As the author has forgotten to add a detailed usage listing (or I can't find it), I wonder if anyone knows anything about the command-line options accepted by the FernFlower decompiler application.
You can find an online version here: http://www.reversed-java.com/fernflower/
I'm trying to enable/disable all these flags that are present on that webpage.
The actual command-line JAR can be found here: https://github.com/Bukkit/Bukkit-MinecraftServer
Many thanks
Nik
I can import MySQLdb from the interactive python command line but Zope gives me an import error when I try it from within a script (python) in Zope. Could Zope be not looking in the same places as the command line for some reason?
I not expert on robots.txt and i have the following in one of my clients robots.txt
User-agent: *
Disallow:
Disallow: /backup/
Disallow: /stylesheets/
Disallow: /admin/
I am not sure about the second line. Is this line disallows all spiders?
Hallo,
i have a webdynpro containing a table displaying numerous lines. after the user clicks the delete button i want to delete the selected line of the table.
my problem right now is, that i don't know how to implement this in the event-call.
How can i identify the selected line of the table?
Best regards
Philipp
I am using a notes client(v 7.0). I created a mail account with email id [email protected] in this client(obviously on domino server also). I want to auto reply to the mail which is sent to [email protected] with same subject line which must be appended with ";SUCCESS" at the end of subject line.
I have a file in which each line contains two numbers. The problem is that the two number are separated by a space, but the space can be any number of blank spaces. either one, two, or more. I want to read the line and store each of the numbers in a variable, but I'm not sure how to tokenize it.
i.e
1 5
3 2
5 6
3 4
83 54
23 23
32 88
8 203
I would like to have fuzzy looking border around my Canvas control. Basically, I am creating a Print Preview screen, and I want it to look almost exactly like the one in Word 2010. In this, there is a thin gray line, a thin orange line and then a fuzzy gradient around the outside of the page. Check it out and you will see what I mean.
Can anyone tell me how I can do this with my Canvas control?
Disclaimer: I'm a newbie at scripting in perl, this is partially a learning exercise (but still a project for work). Also, I have a much stronger grasp on shell scripting, so my examples will likely be formatted in that mindset (but I would like to create them in perl). Sorry in advance for my verbosity, I want to make sure I am at least marginally clear in getting my point across
I have a text file (a reference guide) that is a Word document converted to text then swapped from Windows to UNIX format in Notepad++. The file is uniform in that each section of the file had the same fields/formatting/tables.
What I have planned to do, in a basic way is grab each section, keyed by unique batch job names and place all of the values into a database (or maybe just an excel file) so all the fields can be searched/edited for each job much easier than in the word file and possibly create a web interface later on.
So what I want to do is grab each section by doing something like:
sed -n '/job_name_1_regex/,/job_name_2_regex/' file.txt --how would this be formatted within a perl script?
(grab the section in total, then break it down further from there)
To read the file in the script I have open FORMAT_FILE, 'test_format.txt'; and then use foreach $line (<FORMAT_FILE>) to parse the file line by line. --is there a better way?
My next problem is that since I converted from a word doc with tables, which looks like:
Table Heading 1 Table Heading 2
Heading 1/Value 1 Heading 2/Value 1
Heading 1/Value 2 Heading 2/Value 2
but the text file it looks like:
Table Heading 1
Table Heading 2Heading 1/Value 1Heading 1/Value 2Heading 2/Value 1Heading 2/Value 2
So I want to have "Heading 1" and "Heading 2" as a columns name and then put the respective values there. I just am not sure how to get the values in relation to the heading from the text file. The values of Heading 1 will always be the line number of Heading 1 plus 2 (Heading 1, Heading 2, Values for heading 1). I know this can be done in awk/sed pretty easily, just not sure how to address it inside a perl script.
After I have all the right values and such, linking it up to a database may be an issue as well, I haven't started looking at the way perl interacts with DBs yet.
Sorry if this is a bit scatterbrained...it's still not fully formed in my head.
How does a lexer solve this ambiguity?
/*/*/
How is it that it doesn't just say, oh yeah, that's the begining of a multi-line comment, followed by another multi-line comment.
Wouldn't a greedy lexer just return the following tokens?
/*
/*
/
I'm in the midst of writing a shift-reduce parser for CSS and yet this simple comment thing is in my way. You can read this question if you wan't some more background information.
Hello everyone,
I'm not sure if this is the right forum to post this question. But I'm just hoping someone here might have used log4net in the past, so hoping to get some help.
I'm using log4net to log my exceptions. The configuration settings look like this:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
</configSections>
<log4net debug="false">
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="C:\Logs\sample.log" />
<appendToFile value="true"/>
<rollingStyle value="Size"/>
<maxSizeRollBackups value="10"/>
<maximumFileSize value="10MB"/>
<staticLogFileName value="true"/>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%-5level %date %logger.%method[line %line] - %message%newline"/>
</layout>
</appender>
<root>
<level value="INFO"/>
<appender-ref ref="RollingLogFileAppender"/>
</root>
</log4net>
</configuration>
I started out by adding this configuration to web.config, but I got an error (VS studio could not find a schema for log4net-"Could not find schema information for the element log4net"). So I followed this link (http://stackoverflow.com/questions/174430/log4net-could-not-find-schema-information-messages) and configured my settings in a separate xml file and added the following line of code in my AssemblyInfo.cs:
[assembly: log4net.Config.XmlConfigurator(ConfigFile = "xmlfile.xml", Watch = true)]
And in the actual code, I placed this line:
public void CreateUser(String username, String password)
{
try
{
log.Info("Inside createuser");
//code for creating user
}
catch(exception e)
{
log.Info("something happened in create user", e);
}
}
The problem is that the log file is not being created. I can't see anything inside C:\Logs. Can anybody tell me what I'm doing wrong here?
Any suggestions/inputs will be very helpful.
Thank you all in advance.
Is there a command line program that pretty-prints (that is, indents, adds line breaks to) HTML5 code?
tidy does too much for me (heck, it alters my doctype!), vim too little. What do you use to make your HTML5 code look beautiful?
my apologies in advance for a python and json nubie question. json seems to be hiccuping on the following statements:
{"delete":{"status":{"id":12600579001,"user_id":55389449}}}
code snippet:
temp = json.loads(line)
text = temp['text']
I get the following error output when the above code snippet encounters lines similar to the above json 'dictionary':
text = temp['text']
KeyError: 'text'
Is it because there is no "text" key in the line or because "delete" is not in the dictionary?
I keep hearing that branching in git is so much easier than in SVN, because it's easier to merge the branch back to trunk/master. I've read some tutorials, but they only covered basic merge conflicts ("Alice changed line 8 of code.cpp and at the same time Bob changed line 8 of code.cpp...") and there are no differences between SVN and all other distributed source control systems.
Can you give me the examples of changes in branch that would cause troubles in SVN repository, but would be handled gracefully by git?
hi ive got a working sms receiver but when i try to load another class using:
Intent intent = new Intent(SMSReceiver.this, SMSNotifier.class);
startActivityForResult(intent, 0);
i get the error:
The constructor Intent(SMSReceiver, Class<SMSNotifier>) is undefined
for the first line and:
The method startActivityForResult(Intent, int) is undefined for the type SMSReceiver
for the second line
id really appreciate some advice as to whats going wrong
thanks,
ng93
Most popular browsers, while rendering an image, they display it line-by-line top-to-bottom as it loads.
I have a requirement that a wait gif should be displayed while the image is loading.
When the image is fully loaded then it should be displayed instead of the wait gif.
Domain name: textbox
check box .com
submit
Warning: fsockopen() [function.fsockopen]: unable to connect to whois.crsnic.net:43 (A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. ) in C:\xampp\htdocs\check domain.php on line 35
Fatal error: Maximum execution time of 60 seconds exceeded in C:\xampp\htdocs\check domain.php on line 35
I'm looking for a command line program that pretty-prints (that is, indents, adds line breaks to, harmonizes the whitespace of) HTML5 code.
It has to run under Linux (in case you're interested, I want to use it as an filter for nanoc).
tidy does too much for me (heck, it alters my doctype!), vim too little. What do you use to make your HTML5 code look beautiful?
Maybe there is a way to make tidy cooperate and not alter anything?
As usual I typed sudo Library/uninstall-devtools --mode=all
It uninstalled the first version (Beta) properly.
Tried the same thing on the older Stable Version which I have installed to "XCode Stable"
Getting this error
Use of uninitialized value $dir_name in substitution (s///) at Library/uninstall-devtools line 153.
Use of uninitialized value $developer_dir in concatenation (.) or string at Library/uninstall-devtools line 120
Anyone else facing this problem? Can I just trash the installation folder?
Hi all,
I use the line below in my C# winform app, this works great but occasionally if the program is being run from the command line I get an error that the config.xml file cannot be found. This is because the 'working directory' is different (I think), I need to say "load config.xml from current directory", how would I do this?
docXML.Load("config.xml");
Thanks
Jonathan
Has anybody performed the upgrade?
If yes, how is it done. I remember tinkering with running a program on command line on the PDA and that it did not work as expected.
Has running the command line program on the PDA worked for anyone?
Thanks
Has anyone run across a quality library that will parse, line by line, CSV, tab-delimited, and Excel files?
I've started to do it manually but have noticed some of the intricacies in parsing a comma-delimited file. Such as situations where a cell has a comma in it as part of the data (blah,\"LastName, Jr.\",blah,blah).
I thought this will be trivial but I can't get this to work.
Assume a line in a CSV file:
"Barak Obama", 48, "President", "1600 Penn Ave, Washington DC"
string[] tokens = line.split(',')
I expect this:
"Barak Obama"
48
"President"
"1600 Penn Ave, Washington DC"
but the last token is
'Washington DC' not
"1600 Penn Ave, Washington DC".
Is there an easy way to get the split function to ignore the comma within quotes?
The language Google Desktop gadgets use resembles JavaScript, but it's different in subtle ways. For example, I saw this line in a gadget:
options(HISTORY_OPTIONS_NAME) = items_.join("|");
which looks like it's assigning to a function call. That's just not OK in JavaScript... what language is this? And what exactly is that line doing?