My geek thread
#1426
No matches
Join Date: Aug 2008
Location: Eastern PA
Posts: 11,647
Bikes: two wheeled ones
Liked 444 Times
in
250 Posts
Been coding a lot lately. Internal customer asked for a report of all the alarms our system got last year, so I whipped it up in Perl. Then someone else heard about that and wanted some other stuff added. So now I have 500 lines of thrown together Perl, and it's not done yet. So I started writing it in c#, since it would be faster and easier to maintain. So I got it partly working and it took 20 minutes. Yikes.
Ran the Perl and it was 10 minutes. Profiled it and optimized and got to 5 or 6 seconds. Still need to add more functionality and basically rewrite it to be good clean code and not hacked together.
Reading about c# regex tonight and realized I had the compile flag on about 10 regex that get called tens of thousands of times, and wasn't reusing the compiled bit, or even the object. I was recreating it all. Oops.
Might work on the c# after all tomorrow.
Ran the Perl and it was 10 minutes. Profiled it and optimized and got to 5 or 6 seconds. Still need to add more functionality and basically rewrite it to be good clean code and not hacked together.
Reading about c# regex tonight and realized I had the compile flag on about 10 regex that get called tens of thousands of times, and wasn't reusing the compiled bit, or even the object. I was recreating it all. Oops.
Might work on the c# after all tomorrow.
#1427
Killing Rabbits
Been coding a lot lately. Internal customer asked for a report of all the alarms our system got last year, so I whipped it up in Perl. Then someone else heard about that and wanted some other stuff added. So now I have 500 lines of thrown together Perl, and it's not done yet. So I started writing it in c#, since it would be faster and easier to maintain. So I got it partly working and it took 20 minutes. Yikes.
Ran the Perl and it was 10 minutes. Profiled it and optimized and got to 5 or 6 seconds. Still need to add more functionality and basically rewrite it to be good clean code and not hacked together.
Reading about c# regex tonight and realized I had the compile flag on about 10 regex that get called tens of thousands of times, and wasn't reusing the compiled bit, or even the object. I was recreating it all. Oops.
Might work on the c# after all tomorrow.
Ran the Perl and it was 10 minutes. Profiled it and optimized and got to 5 or 6 seconds. Still need to add more functionality and basically rewrite it to be good clean code and not hacked together.
Reading about c# regex tonight and realized I had the compile flag on about 10 regex that get called tens of thousands of times, and wasn't reusing the compiled bit, or even the object. I was recreating it all. Oops.
Might work on the c# after all tomorrow.
#1428
No matches
Join Date: Aug 2008
Location: Eastern PA
Posts: 11,647
Bikes: two wheeled ones
Liked 444 Times
in
250 Posts
I guess I should always consider outside programs before starting something. I imagine the overhead on that is too high and it'll be slow. We're gonna write a php front end for this so it's available on demand with a specific time frame, from within the "browser" that our users work in.
#1432
Nonsense
Join Date: Sep 2004
Location: Vagabond
Posts: 13,918
Bikes: Affirmative
Liked 541 Times
in
237 Posts
If you need any advice with the php stuff that's my bread and butter language. Feel free to message me with questions if you have any issues, though I would suspect if you are comfortable in PERL and C# you'll be fine.
#1433
No matches
Join Date: Aug 2008
Location: Eastern PA
Posts: 11,647
Bikes: two wheeled ones
Liked 444 Times
in
250 Posts
Perl's regex engine is surprisingly optimized for a scripting language. I wrote all of my regex into a dll in C# so I pay no compile time penalty and they're still as fast as can be, and it takes 40 seconds to do what Perl does in 5. I'm guessing catastrophic backtracking on some lines.
An xkcd for your time.
An xkcd for your time.
#1436
Rides too much bike
Join Date: Nov 2013
Location: Boston
Posts: 842
Likes: 0
Liked 0 Times
in
0 Posts
Currently trying to figure out the most efficient way to query a Rest client where I need to do the requests asynchronously. First time I have ever coded anything like this.
#1437
Any of you guys still work in Coldfusion?
#1439
No matches
Join Date: Aug 2008
Location: Eastern PA
Posts: 11,647
Bikes: two wheeled ones
Liked 444 Times
in
250 Posts
New version of Windows takes 15 minutes to install. New version of Visual Studio 2013 takes 3 hours. I don't get it.
I'm excited to have profiling though. VS2010 didn't have it on the Professional version, only the two highest level ones. VS2013 has it on all though.
I'm excited to have profiling though. VS2010 didn't have it on the Professional version, only the two highest level ones. VS2013 has it on all though.
#1440
Senior Member
Join Date: Jun 2010
Location: Western MA
Posts: 15,669
Bikes: Yes
Likes: 0
Liked 0 Times
in
0 Posts
#1442
Ninny
[MENTION=137631]Flatballer[/MENTION]: we're getting fed up with VC13 here after a few years. The IDE is slick but editing can get ridiculously bogged down at times. From what I hear the newer version is not any better. Xcode sucks too. 20 years ago everybody wondered why there wasn't a universally decent text editor that everybody could adopt; it feels like we're at the same place now with code IDEs.
BTW AMD's free Code XL profiler is very good, and runs fine/usefully on Intel machines.
BTW AMD's free Code XL profiler is very good, and runs fine/usefully on Intel machines.
#1443
No matches
Join Date: Aug 2008
Location: Eastern PA
Posts: 11,647
Bikes: two wheeled ones
Liked 444 Times
in
250 Posts
Off the bat vs13 seems considerably slower than vs10 to me.
I might check that out. I can't make vs13 profiler do what I want. I have about 20 regex objects that get used in 20 different places, one each basically, thousands of times. I want to know which regex I should focus on optimizing first, which means I need to know which lines are taking the most time. But all I can get from it is that it spends 77% of its time in calls to system.regex. I knew that already, that's not helpful.
Nytprof for perl is free and awesome and easy to use, not sure why this is so hard.
I might check that out. I can't make vs13 profiler do what I want. I have about 20 regex objects that get used in 20 different places, one each basically, thousands of times. I want to know which regex I should focus on optimizing first, which means I need to know which lines are taking the most time. But all I can get from it is that it spends 77% of its time in calls to system.regex. I knew that already, that's not helpful.
Nytprof for perl is free and awesome and easy to use, not sure why this is so hard.
#1444
Oops. Guy accidentally deleted his entire company:
A man deleted his entire company with one line of code - Business Insider
A man deleted his entire company with one line of code - Business Insider
#1448
Senior Member
Join Date: Jun 2010
Location: Western MA
Posts: 15,669
Bikes: Yes
Likes: 0
Liked 0 Times
in
0 Posts
I bet the idiot is getting flooded with offers for consulting.
#1449
Senior Member
I think it's an Asimov story but there is a guy who is super accident prone. Wherever he goes things break. He meets with some official who tells him they're not going to try and keep him locked up, they're just going to send him elsewhere to live. The "elsewhere" is apparently the country's (world's?) enemy. I think it was Mars. The idea was they would let this accident prone guy loose in a place they don't like.
In real life at a top 10 bank one of my former colleagues was joking around with another former colleague. One was spamming the other with emails, constantly sending emails. So the second guy set up a script to send 5 emails back to the guy for every email he got. The first guy was like "oh yeah?" and set up a script to reply 5 times every time the second guy emailed him.
1 joke email sent
5 sent back
25 sent back
125 sent back
625 sent back
3250 sent back
15125 sent back
78125 sent back
etc.
As fast as an international bank's email servers could push out the emails.
The email system absolutely crashed. The bank used Lotus Notes so it also meant no access to documents, projects, etc.
The colleague sitting at the client office (the bank) got fired, per request of the bank. The other guy eventually got hired by said bank.
In real life at a top 10 bank one of my former colleagues was joking around with another former colleague. One was spamming the other with emails, constantly sending emails. So the second guy set up a script to send 5 emails back to the guy for every email he got. The first guy was like "oh yeah?" and set up a script to reply 5 times every time the second guy emailed him.
1 joke email sent
5 sent back
25 sent back
125 sent back
625 sent back
3250 sent back
15125 sent back
78125 sent back
etc.
As fast as an international bank's email servers could push out the emails.
The email system absolutely crashed. The bank used Lotus Notes so it also meant no access to documents, projects, etc.
The colleague sitting at the client office (the bank) got fired, per request of the bank. The other guy eventually got hired by said bank.
__________________
"...during the Lance years, being fit became the No. 1 thing. Totally the only thing. It’s a big part of what we do, but fitness is not the only thing. There’s skills, there’s tactics … there’s all kinds of stuff..." Tim Johnson
"...during the Lance years, being fit became the No. 1 thing. Totally the only thing. It’s a big part of what we do, but fitness is not the only thing. There’s skills, there’s tactics … there’s all kinds of stuff..." Tim Johnson
#1450
Super Moderator
Join Date: Jul 2004
Location: Ffld Cnty Connecticut
Posts: 21,854
Bikes: Old Steelies I made, Old Cannondales
Liked 944 Times
in
623 Posts
What's a good place to start learning PHP ..."for dummies" ?
__________________
Bikes: Old steel race bikes, old Cannondale race bikes, less old Cannondale race bike, crappy old mtn bike.
FYI: https://www.bikeforums.net/forum-sugg...ad-please.html
Bikes: Old steel race bikes, old Cannondale race bikes, less old Cannondale race bike, crappy old mtn bike.
FYI: https://www.bikeforums.net/forum-sugg...ad-please.html