Re: Looking for a lightweight usable websocket server

2015-05-18 Thread jbiskofski
Rob, I used this for a long time : http://meteorserver.org/ At the time when I used it, it did not have support for secure websockets. I ended up having to rebuild the system in node-js using the very popular socket.io I love perl as much as anyone, but I think for building a websocket server,

balancing/distribution problem solution

2014-03-21 Thread jbiskofski
I have 6 elevators, and 50 people. These people weigh between 120 and 350lbs. How can I find the optimal way of distributing these people into the 6 elevators so that each elevator carries approximately the same weight ? Hopefully the proposed solutions are use XYZ::FOO::BAR module from cpan

Re: remotely operate web page/website

2013-11-25 Thread jbiskofski
Take a look at the Mechanize modules in CPAN. On Mon, Nov 25, 2013 at 2:08 PM, Rajeev Prasad rp.ne...@yahoo.com wrote: i need to go to a website and input some data in a specific input field, and run the query which opens a new page, i need to download and save it as an html page on my unix

Re: Dealing with apache timeout in Perl

2013-09-04 Thread jbiskofski
You need to fix this in Apache not in your web-app. The setting is called TimeOut in your httpd.conf - this is the number of seconds Apache will wait before sending a timeout error and ending the request. - Jose from Mexico. On Wed, Sep 4, 2013 at 4:49 AM, Chankey Pathak chankey...@gmail.com

Re: Array iterator count

2013-08-08 Thread jbiskofski
my $counter = 0; foreach my $e ( a .. z ) { $counter++; On Thu, Aug 8, 2013 at 12:05 PM, Unknown User knowsuperunkn...@gmail.comwrote: Hello, If i am iterating through the elements in an array, at any point is it possible to say which element i am handling without using a counter?

Re: Array iterator count

2013-08-08 Thread jbiskofski
my $counter = 0; foreach my $e ( a .. z ) { $counter++; if ( $counter == 5 ) { } } On Thu, Aug 8, 2013 at 12:11 PM, jbiskofski jbiskof...@gmail.com wrote: my $counter = 0; foreach my $e ( a .. z ) { $counter++; On Thu, Aug 8, 2013 at 12:05 PM

Re: Posting to WordPress from a Perl script?

2013-07-19 Thread jbiskofski
If you can figure out the exact parameters that Wordpress normally posts you can replicate those same parameters + cookie session information and it should work. Another nice alternative would be to look at the Mechanize CPAN modules. Using Mechanize you can in perl code browse a web page, click

Re: Posting to WordPress from a Perl script?

2013-07-19 Thread jbiskofski
Also, to fix the expat error you need to install libxml development libraries, depending on your distro this can be accomplished in different ways. On Fri, Jul 19, 2013 at 12:07 PM, jbiskofski jbiskof...@gmail.com wrote: If you can figure out the exact parameters that Wordpress normally posts

Re: Creating a Perl web site, how should I build this

2013-07-03 Thread jbiskofski
You can make a standard everyday perl script, just make it print out HTML instead of text. Once you have that you can configure apache like this : ScriptAlias /script/ /some/path/to/my/script.pl If you then access the webserver http://ip.address/script/ you should get the HTML output of your

Re: obfuscating code

2013-02-12 Thread jbiskofski
I see everyone is eager to judge this as a terrible idea, its the exact same response Ive gotten to this question on mailing lists on IRC. HOWEVER, I think this can be a valid concern. We are always talking about how the best way to shine good light on Perl is writing cool stuff in it. Well Ive

Re: obfuscating code

2013-02-12 Thread jbiskofski
to a compiled language with an actively optimizing compiler. Then only distribute the output from the compiler. Even then there may be de-compilers or disassemblers that can reconstruct much of your source in readable form. Bob McConnell -Original Message- From: jbiskofski [mailto:jbiskof

suggestion for converting perl data to pdf

2012-05-31 Thread jbiskofski
This really has nothing to do with Perl, but since Perl is the language I use and I trust you are all bright, helpful and experiences I figured I would give it a shot. I work for a startup that builds an academic and administrative platform for private schools and universities in Mexico. Our code

Re: spreadsheet::xlsx and the horror of it all

2012-05-30 Thread jbiskofski
Hey I can see that people are helping you and you are on your way to having your problem solved. Spreadsheet::XSLX is an awesome module, but sometimes its easier to convert the file to CSV using excel and then its just text and its a lot easier to manipulate. - Jose from Mexico On Wed, May 30,

Re: Unique Array Help?

2012-05-17 Thread jbiskofski
The easiest thing would be to rewrite your sql with an aggregate statement : SELECT employee_id,date,SUM(hours_wrkd) FROM data WHERE date = $date_then AND date = $date_now GROUP BY empoyee_id,date ORDER BY 3 cheers. - Jose from Mexico On Thu, May 17, 2012 at 6:46 PM, Omega -1911

Re: Parsing Question

2012-02-01 Thread jbiskofski
Hey Brandon Here is a solution to this problem. It is purposely really long. It takes the simplest most understandable solution. If you have questions about it let me know. #!/usr/local/bin/perl # always a good idea, forces scope to if/for/foreach/while blocks use strict; # open the file,

Re: Parsing Question

2012-02-01 Thread jbiskofski
is a pastebin of the same script : http://pastebin.com/h8cebCD7 - Jose from Mexico On Wed, Feb 1, 2012 at 1:11 PM, timothy adigun 2teezp...@gmail.com wrote: Hi jbiskofski, This script will not work WHY? -- Scalar found where operator expected at . [ Please Check ] line 72, near

Re: Parsing Question

2012-02-01 Thread jbiskofski
ah - i get it now. thanks. On Wed, Feb 1, 2012 at 3:05 PM, Jim Gibson jimsgib...@gmail.com wrote: On 2/1/12 Wed Feb 1, 2012 11:24 AM, jbiskofski jbiskof...@gmail.com scribbled: Your comment about the open statement is OK. I guess it really comes down to style. I was trying to write

Re: Perl coding standards

2012-01-31 Thread jbiskofski
Perl Best Practices is the famous book on this topic. Also Perl::Critic is a module that critiques your code based on the rules in that book. peace it in, peace it out peace it inside out :] - Jose On Tue, Jan 31, 2012 at 9:38 AM, Nemana, Satya snem...@sonusnet.com wrote: Hi Gurus Is

Re: Arrow Notation vs. Colon Notation

2011-07-20 Thread jbiskofski
Marc that was a really good question. On the surface they do seem exactly alike. Cheers! - biskofski On Jul 20, 2011, at 6:29 PM, Marc sono...@fannullone.us wrote: On Jul 20, 2011, at 4:03 PM, Uri Guttman wrote: so don't think they are even similar as one is a sub call and the other is

Re: second post

2011-07-20 Thread jbiskofski
If you want to store an array inside a hash value you have to store a reference to it, not the actual array. Here are two examples : my %hash; my @arr = split(...); $hash{'key'} = \@arr; Or shorter : $hash{'key'} = [ split(...) ]; Cheers dude! -- biskofski Sent from my iPad On Jul 20,

Re: Counting Word Occurances

2011-07-15 Thread jbiskofski
my %words; while () { # read input line by line... # remove trailing new line chomp; my $word = $_; $words{$word}++; } foreach my $word (sort keys %words) { print $word ($words{$word})\n; } -- you can run the script like this : cat file.txt | perl script.pl It

Re: Convert spreadsheet to jpeg

2011-06-21 Thread jbiskofski
ive seen this be done with openoffice in command line mode, i dont know the exact syntax but it should be easy to find out. at that point all your perl script would need to do is loop the the file list and do a system() call to the openoffice program that does the conversion. this is hows its

Re: cgi or new stuff?

2011-02-04 Thread jbiskofski
eventually your webapps are going to need some type of interface functionality. something really basic can be, having a checkbox that selects all the checkboxes in a group. that kind of thing you can only do with javascript. catalyst is going to introduce a lot of new concepts to you if youre new

Re: Capture nth element of a file

2011-01-21 Thread jbiskofski
my $line_count = 1; my @captured_elements; open(FILE, $filename) || die 'cant open file'; while (FILE) { chomp; push(@captured_elements, $_) unless ($line_count % 4); $line_count; } close(FILE); --- % is the modulus operator, it returns the remainder of a division so ... 6 % 4 =

Re: Capture nth element of a file

2011-01-21 Thread jbiskofski
sorry! $line_count at the end of the while block should be $line_count++ On Fri, Jan 21, 2011 at 10:54 AM, jbiskofski jbiskof...@gmail.com wrote: my $line_count = 1; my @captured_elements; open(FILE, $filename) || die 'cant open file'; while (FILE) { chomp; push

Re: what's the advantage of ORM?

2011-01-11 Thread jbiskofski
What happens when you need to make some really complex queries, with a few joins of different types, group by's and aggregates? Is it still possible? On Tue, Jan 11, 2011 at 5:02 AM, Octavian Rasnita orasn...@gmail.comwrote: From: Sean Murphy mhysnm1...@gmail.com Hi With this class, can

Re: removing hex characters from a file

2011-01-06 Thread jbiskofski
, jbiskofski jbiskof...@gmail.com wrote: I've made sure my string does not have a \n at the end. Ive chomped it and inspected it in several ways, if I open the resulting file in 'vi' theres no newline at the end, yet in a hex editor it shows up there, at the end. If it isn't too large

Re: problems hashing

2011-01-06 Thread jbiskofski
#!/usr/local/bin/perl use strict; while () { chomp; my @values = split(/;/); my ($mtype,$cell,$sector,$rlptxat) = ($values[5],$values[31],$values[32],$values[44]); print $mtype - $cell - $sector - $rlptxat\n; } i dont know if that is over simplified, you may have

removing hex characters from a file

2011-01-05 Thread jbiskofski
Hello and happy new year to everyone. I have a text string in perl, which I wrote to a file using normal open,print,close functions. When I inspect this text file with a hex editor all the way at the end it has 0A0A, this is messing me up because I need to perform some openssl operations on the