- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 8
- Posts with Upvotes
- 8
- Upvoting Members
- 7
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
167 Posted Topics
Re: [QUOTE=christina>you;331517]born[/QUOTE] burn | |
Re: You can also use [inlinecode]isinstance()[/inlinecode] method to check whether an object is an instance or type of a class[everything in Python is an object] [code=Python] >>> v=9 >>> if isinstance(v, int): print 'int' int [/code] | |
Re: Hi, [QUOTE]If anyone has any experience coding linux gDesklets this would help[/QUOTE]I seriously dont know about this stuff for sure. [QUOTE]I keep getting "List index out of range" when trying to execute this code, but for the life of me I cannot figure out why, ... Any thoughts?[/QUOTE]sure... Usually [inlinecode]IndexError: … | |
Hi, How do I disable Copy/Cut/Paste operations on a textbox in Tkinter. I want to implement this in simple login form, where I found I can copy or paste or cut from textbox which is meant to accept PASSWORD. Can we do that? How? Thank you, Regards, kath. | |
Re: [QUOTE=sasdap;520794]hi, It was returning the return code(0). How to get the output as 'hello'?[/QUOTE] The return value is 0 because the command you gave, actually executed successfully. [inlinecode]os.sytem("echo hello"); os.system("ren file-old file-new")[/inlinecode] If you want to print something on the screen, there is already [inlinecode]print[/inlinecode] function available in Python. If … | |
Re: [code=Python] import csv rf = open('sample.txt') #input file handle wf = open('writer.csv','w') #output file handle writer = csv.writer(wf) for row in rf.readlines(): writer.writerow(row.split()) rf.close() # close input file handle wf.close() # close output file hanle [/code] kath. | |
Re: [QUOTE=aot;396047]I'm frustrated by the nature of time.sleep(), which prevents the script from doing anything else during the allotted time period. For example, I have: [CODE]while True: checkSomething() time.sleep(0.1) print 'hello'[/CODE] In this case, "hello" is never printed. I really want to check something every few milliseconds, but I also need … | |
hi, why explicit cast is *not* required here? [icode]static Float f3 = new Float(5.5); //causes compile-time error b'se, by default floating-point literal type is double[/icode] but requires here, [icode]//static Short sh1 = new Short((short)12); static Short sh1 = new Short(12); //causes compile-time error b'se, by default integer literal type is … | |
Re: Hi, Well as you said your system has enough resource, i dont find any idea why it is failing. As far as my understanding goes the way you read file is line-by-line which is recommended to follow in case of large file. There are also other ways depends how your … | |
Re: [QUOTE=sam1;329459]hi, I have a table called shoutbox, i created it this way: [CODE]CREATE TABLE `shoutbox` ( `id` INT NOT NULL AUTO_INCREMENT , `ip` varchar(20) NOT NULL , `name` varchar(30) NOT NULL , `url` varchar(30) NOT NULL , `message` varchar(50) NOT NULL , `date` date NOT NULL , PRIMARY KEY ( … | |
Re: [QUOTE=freddypyther;400405]Hi! Could someone make a little tutorial for dummies about how to create a GUI with wxGlade in SPE?, because I've been tying to do it like for example Netbeans, but I can't put the widgets where I want, I don't see my application as I'm drawing it...kind of a … | |
Re: [QUOTE=pyguy25;327982]Would there be a way for me to modify this program to calculate the average word length in a sentence?[/QUOTE] [url]http://www.daniweb.com/techtalkforums/thread72136.html[/url] go through this link... regards, kath. | |
Re: hey, you should have googled it, before posting it here... Well, I found, __END__ is the logical end of program text. You can put anything you want after this token; it will be ignored by the compiler. kath. | |
how to create a submenu in python? how to use [I]insert_cascade(index,**options)[/I].......... please help me out. | |
Re: Hi, [Quote]so, u want me to write the code and save it in a text file and type perl -e and the file name on command line?[/Quote] Depends, 1. you can write perl code and save it as .pl (for eg. program1.pl) and run. 2. make it executable by inluding … | |
im confused with [I]__call__() [/I] method defined within the class. [I]__init__() [/I] is used as constructor, and is called when we create an instance of the object. when does [I]__call__() [/I] method get called even though we not specify it explicitly... please help.......... | |
I am facing problem connecting problem connecting remote MySQL server which is firewall protected. I used the valid user name and password, but it throws me the error [I]OperationalError: (2003, "Can't connect to MySQL server on 'www.myreomtemysqlserver.com' (10061)")[/I] I want to connect from python. I searched in Google is there … | |
Re: [icode]java.io.FileNotFoundException: File1.txt (The system cannot find the file specified)[/icode] the specified path to file is not correct. Java is not able to find the file in the path given which you want to open. katharnakh | |
Re: Every Java program needs a class defined in the file. You can define more than one class in a file and atleast one class as public and its name should be that of the file. In that public class you define main() method with [icode]public static void[/icode] which is the … | |
Re: Below are some mistakes you are doing, 1. calling [icode]reorder()[/icode] without any args, in print fuction. 2. you cannot refer a char at [icode]a[a+b][/icode] which you are doing it in for loop in the [icode]reorder[/icode] fuction, because of IndexError. Instead you need to loop through the size of either of … | |
Re: Hi, is your cron job created for the same usr as you use to run the script? If yes, in my opinion, the env variables should get assigned with new values. Also note that these env variables you set in the script will be available till executing script ends. katharnakh. | |
Re: what line:13, 14 and 15 supposed to have on the initial loop? | |
Re: you are returning from the [icode]&fname[/icode] as soon as you enter the function. So your function is not executing till end of the function. You have two [icode]return[/icode] statements in your function. Learn how to write sub-routines in perl [icode]perldoc perlsub[/icode]. | |
Re: If your shell does not understand javac command, you might want to add path to your javac in your PATH env variable. katharnakh. | |
Re: [QUOTE=freon73;264699][COLOR=#555555]I am a newbie to Python and need to transfer files across an internal network. Are there any coding tips or code snippets that would be helpful? Any assistance provided would be appreciated.[/COLOR][/QUOTE] the more core you go is use socket... cheers, kath. | |
Re: I assume READFILE is valid file handle. Because the above code does not show how you are opening file or what is READFILE. [code=Perl] while ($ch = getc(READFILE)) { ++$character_count; if ($ch eq "?" || $ch eq "!" || $ch eq ".") { $sentences++; } $word++; if($ch =~ /[ \t]+/); … | |
Re: Hi, 1. If you are not able find what is going on when running command from perl, it is better to run the SAME command, used in the code, in your shell by yourself and check. Eg: from above. useradd <value_of_$uName.$i> -g 999. 2. Knowing the return value of the … | |
Re: Hi, You can obviously use path to your shell script run. Rather than changing the directory. [icode]`/path/to/your/script.sh`[/icode] Hope this helps. katharnakh. | |
Re: Hi, Try this.. [code=Perl] my $string = 'Lake City 84132, USA. FAU - Carrell, D T AU - Carrell DT FAU - Emery, B R AU - Emery BR '; foreach my $sub_str(split(/, /, $string)){ print $1,"\n" if($v =~ /( AU - (\w+ \w+)?)/); } [/code] katharnakh. | |
Re: hi, You might want to assign values if your [inline]@row[/inline] has something. Though, sometimes query executes fine and returns nothing your [inline]@row[/inline] will be an empty array. [code=Perl] #... @row = $query->fetchrow_array(); #... if (scalar(@row) > 0){ # code to assign other variables from @row. } [/code] katharnakh. | |
Re: Hi, I would recommend you to define a method in Parse.pl and use it in your client script which requires parsing. For eg. [icode] #caller.pl require 'Parse.pl'; #... # call method parse_me(for eg.) in Parse.pl my $return_val = Parse::parse_me($line); #... [/icode] [icode] #Parse.pl sub parse_me{ my $line = @_; #... … | |
Re: [icode]print "$1, $2, $3", $/ if ($line =~ /(\w+)=(\".+?\"|'.+?'|.+)\s*(#.*|)/); [/icode] katharnakh. | |
Re: With [icode]Net::SSH::Perl[/icode] you can execute commands remotely. katharnakh. | |
Re: Hi, Two points to consider, 1. In your code, you are opening 'ParsedLog.txt' two times. One before entering for loop in R or read mode and second inside for loop in A or append mode. Instead you can have this line, opening in W or A mode(you choose) before for … | |
Re: [QUOTE=osjak;681783] Does anyone have an idea what could cause this error? Could it be my script running out of memory? I'm using an old beater machine with 256MB for this project.[/QUOTE] the error clearly says syntax error in sql statement, try running the same query in you query browser and … | |
Hi, [B]Background:[/B] I have task of calculating dependencies of project(s) of a scenario. Dependency calculation is done using an external command. Since this dependency calculation time depends on how big is the project is, it is difficult to guess how much dependency calculation of a scenario(a set of projects) takes. … | |
Re: [code=Perl]use strict; use warnings; use Cwd; use DirHandle; my $folder = 'C:\Perl5.8.8\site\lib\File'; my $dh = DirHandle->new($folder); while(defined(my $val = $dh->read)){ print "\nDirectory: ",$folder."\\".$val if (-d $folder."\\".$val); print "\nFile: ",$folder."\\".$val if (-f $folder."\\".$val); } $dh->close(); print "\n\nCurrent working dir: ", getcwd();[/code] katharnakh. | |
Re: [QUOTE=raul15791;634727]What I actually did was installing perl and Komodo Edit 4.3. Is there any difference between IDE and an Editor? Komodo Edit 4.3 is an editor? Or an IDE?[/QUOTE]Both. [QUOTE=raul15791;634727]And the IDE is it comes together with the ActivePerl?? I cant seems to find it though.[/QUOTE] Not necessarily, in komodo … | |
Re: First you need to go through [URL="http://www.daniweb.com/forums/thread70467.html"]this[/URL] thread, in my opinion. As Kevin was replying to your earlier post it is nothing to do with Perl as such, only thing you need to place the scripts in right place so that you can call those scripts in browser. The error … | |
Re: add [icode]chomp($nama);[/icode] after line 14. Because, you need to remove whitespaces(i.e, new-line character in this case) after you take input from keyboard. Also you need to lexically scope $nama scalar. [icode]my $nama = <STDIN>;[/icode] katharnakh. | |
Hi, I have problem running my cgi scripts under Apache Tomcat server. I am using Apache Tomcat/5.5.20 on WinXP. I followed the instruction tips I found out at [url]http://www.wellho.net/forum/Perl-Programming/Running-Perl-CGI-scripts[/url]... [url]http://www.ftponline.com/javapro/2003_03/online/perl_teden_03_18_03/p[/url]... but still I could not get the scripts running. I get HTTP status 404 error. The directory structure I have … | |
Re: Hi, You can use [icode]HTML::Parser[/icode] module to parse html files. You can download the same [URL="http://search.cpan.org/dist/HTML-Parser/"]here[/URL]. Also you can go through [URL="http://www.foo.be/docs/tpj/issues/vol5_1/tpj0501-0003.html"]this[/URL] link to learn how to do it or [icode]perldoc HTML::Parser[/icode] after you install the module. [QUOTE=adadadad;623429]... what is the way to write to the text file each time … | |
Re: What server you are using to run your .pl file? As far as i know, diff. web servers require to keep files in diff. hierarchy of folders in server installation path. For eg.(in Apache web server) you need to keep .pl files in ../cg-bin and like wise. May be that … | |
Re: [QUOTE=prakasnisha;611568]... now i have to compare this two files[/QUOTE] Use File::Compare module to compare two files or contents of two files. Go through the help doc. of this module, first and try. [QUOTE=prakasnisha;611568] and check whether the value change is within 1% of the initial value. ...[/QUOTE] Without knowing what … | |
Re: Hi, Please go through [URL="http://www.daniweb.com/forums/announcement112-3.html"]this[/URL], before posting your code. Its not an assignment, just a prerequisite if you want to get really quick help. Only with code it is hard to know what is working and what is not. Provide some input(example) details. Post your errors, if any OR if … | |
Re: [code=Perl] for($j=0; $j<=100; $j++){ <do the expression> unless($j%2); } [/code] If you are doing some mathematical operation with the expression i think you want to re-check whether loop should start from 0. katharnakh. | |
Re: [QUOTE=somename;607063]... perl forum is kind of abandoned ;/ [/QUOTE]Its not true. [QUOTE=somename;607063]... I want to write a selfkilling perl prog :D Ok, i got a simple prog which shows up a simple tk window with some text in it, to go to the next function (in my app), i have … |
The End.