Search
Notices
"The 33"-Road Bike Racing We set this forum up for our members to discuss their experiences in either pro or amateur racing, whether they are the big races, or even the small backyard races. Don't forget to update all the members with your own race results.

My geek thread

Thread Tools
 
Search this Thread
 
Old 04-05-16, 09:24 PM
  #1426  
Flatballer
No matches
 
Flatballer's Avatar
 
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.
Flatballer is offline  
Old 04-05-16, 09:59 PM
  #1427  
Enthalpic
Killing Rabbits
 
Join Date: Apr 2005
Posts: 5,697
Liked 217 Times in 102 Posts
Originally Posted by Flatballer
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.
Crystal reports?
Enthalpic is offline  
Old 04-06-16, 04:40 AM
  #1428  
Flatballer
No matches
 
Flatballer's Avatar
 
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.
Flatballer is offline  
Old 04-06-16, 05:48 AM
  #1429  
shovelhd
Senior Member
 
shovelhd's Avatar
 
Join Date: Jun 2010
Location: Western MA
Posts: 15,669

Bikes: Yes

Likes: 0
Liked 0 Times in 0 Posts
You will own it for the rest of your life.
shovelhd is offline  
Old 04-06-16, 10:45 AM
  #1430  
Flatballer
No matches
 
Flatballer's Avatar
 
Join Date: Aug 2008
Location: Eastern PA
Posts: 11,647

Bikes: two wheeled ones

Liked 444 Times in 250 Posts
Job security.
Flatballer is offline  
Old 04-06-16, 10:51 AM
  #1431  
shovelhd
Senior Member
 
shovelhd's Avatar
 
Join Date: Jun 2010
Location: Western MA
Posts: 15,669

Bikes: Yes

Likes: 0
Liked 0 Times in 0 Posts
You're not that good.
shovelhd is offline  
Old 04-06-16, 10:53 AM
  #1432  
TheKillerPenguin
Nonsense
 
TheKillerPenguin's Avatar
 
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.
TheKillerPenguin is offline  
Old 04-07-16, 08:57 PM
  #1433  
Flatballer
No matches
 
Flatballer's Avatar
 
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.

Flatballer is offline  
Old 04-12-16, 09:28 AM
  #1434  
TheKillerPenguin
Nonsense
 
TheKillerPenguin's Avatar
 
Join Date: Sep 2004
Location: Vagabond
Posts: 13,918

Bikes: Affirmative

Liked 541 Times in 237 Posts
I'm developing a site in Laravel right now, and given that most of my work is WordPress this is a real treat. It's PHP done so right that it doesn't even feel like PHP anymore!
TheKillerPenguin is offline  
Old 04-12-16, 09:39 AM
  #1435  
globecanvas
Ninny
 
Join Date: Jan 2010
Location: The Gunks
Posts: 5,295
Likes: 0
Liked 1 Time in 1 Post
A programmer had a problem. He decided to solve the problem using threads. problems he Now two has.
globecanvas is offline  
Old 04-12-16, 09:49 AM
  #1436  
dz_nuzz
Rides too much bike
 
dz_nuzz's Avatar
 
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.
dz_nuzz is offline  
Old 04-12-16, 10:16 AM
  #1437  
topflightpro
Senior Member
 
topflightpro's Avatar
 
Join Date: Jul 2007
Posts: 7,571
Liked 680 Times in 431 Posts
Any of you guys still work in Coldfusion?
topflightpro is offline  
Old 04-12-16, 10:48 AM
  #1438  
Flatballer
No matches
 
Flatballer's Avatar
 
Join Date: Aug 2008
Location: Eastern PA
Posts: 11,647

Bikes: two wheeled ones

Liked 444 Times in 250 Posts
Originally Posted by globecanvas
A programmer had a problem. He decided to solve the problem using threads. problems he Now two has.
Is Yoda just a badly multithreaded AI?
Flatballer is offline  
Old 04-12-16, 12:18 PM
  #1439  
Flatballer
No matches
 
Flatballer's Avatar
 
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.
Flatballer is offline  
Old 04-12-16, 12:35 PM
  #1440  
shovelhd
Senior Member
 
shovelhd's Avatar
 
Join Date: Jun 2010
Location: Western MA
Posts: 15,669

Bikes: Yes

Likes: 0
Liked 0 Times in 0 Posts
Originally Posted by dz_nuzz
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.
Rest is asynchronous by nature.
shovelhd is offline  
Old 04-12-16, 12:36 PM
  #1441  
shovelhd
Senior Member
 
shovelhd's Avatar
 
Join Date: Jun 2010
Location: Western MA
Posts: 15,669

Bikes: Yes

Likes: 0
Liked 0 Times in 0 Posts
Originally Posted by topflightpro
Any of you guys still work in Coldfusion?
My god that stuff is older than I am.
shovelhd is offline  
Old 04-12-16, 12:44 PM
  #1442  
globecanvas
Ninny
 
Join Date: Jan 2010
Location: The Gunks
Posts: 5,295
Likes: 0
Liked 1 Time in 1 Post
[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.
globecanvas is offline  
Old 04-12-16, 06:12 PM
  #1443  
Flatballer
No matches
 
Flatballer's Avatar
 
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.
Flatballer is offline  
Old 04-15-16, 05:55 AM
  #1444  
topflightpro
Senior Member
 
topflightpro's Avatar
 
Join Date: Jul 2007
Posts: 7,571
Liked 680 Times in 431 Posts
Oops. Guy accidentally deleted his entire company:

A man deleted his entire company with one line of code - Business Insider
topflightpro is offline  
Old 04-15-16, 06:06 AM
  #1445  
globecanvas
Ninny
 
Join Date: Jan 2010
Location: The Gunks
Posts: 5,295
Likes: 0
Liked 1 Time in 1 Post
rm -rf / wouldn't execute without --no-preserve-root. I think the story is probably urban legend, as I've heard it various times over the past 20 years.
globecanvas is offline  
Old 04-15-16, 06:06 AM
  #1446  
Flatballer
No matches
 
Flatballer's Avatar
 
Join Date: Aug 2008
Location: Eastern PA
Posts: 11,647

Bikes: two wheeled ones

Liked 444 Times in 250 Posts
Wow. That's impressive.
Flatballer is offline  
Old 04-15-16, 06:09 AM
  #1447  
Flatballer
No matches
 
Flatballer's Avatar
 
Join Date: Aug 2008
Location: Eastern PA
Posts: 11,647

Bikes: two wheeled ones

Liked 444 Times in 250 Posts
Originally Posted by globecanvas
rm -rf / wouldn't execute without --no-preserve-root. I think the story is probably urban legend, as I've heard it various times over the past 20 years.
You might be right. It does sound implausible. And I went on server fault and couldn't find it.
Flatballer is offline  
Old 04-15-16, 07:02 AM
  #1448  
shovelhd
Senior Member
 
shovelhd's Avatar
 
Join Date: Jun 2010
Location: Western MA
Posts: 15,669

Bikes: Yes

Likes: 0
Liked 0 Times in 0 Posts
Originally Posted by globecanvas
rm -rf / wouldn't execute without --no-preserve-root. I think the story is probably urban legend, as I've heard it various times over the past 20 years.
Depends. However if he is logged in as root, directly or via sudo, his default directory is /root, not /. He would have to explicitly cd to / or put that in his script, which the article implies he didn't. I smell hype. The other thing is that rm does not traverse NFS mounted directories by default, you have to specify this explicitly. More hype. Sysadmin 101 states that you never force removes in scripts. It's such an easy command to type that it invites interaction. If he's doing this via cron then he should be shot. Finally, anyone managing a shared system without a proper backup procedure should be out of business. If your backup script uses NFS storage then standard practice is to mount it, backup the files, and unmount it as part of the script.

I bet the idiot is getting flooded with offers for consulting.
shovelhd is offline  
Old 04-15-16, 08:33 AM
  #1449  
carpediemracing 
Senior Member
 
Join Date: Feb 2007
Location: Tariffville, CT
Posts: 15,407

Bikes: Tsunami road bikes, Dolan DF4 track

Liked 182 Times in 104 Posts
Originally Posted by shovelhd
I bet the idiot is getting flooded with offers for consulting.
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.
__________________
"...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
carpediemracing is offline  
Old 04-17-16, 05:17 AM
  #1450  
Homebrew01
Super Moderator
 
Homebrew01's Avatar
 
Join Date: Jul 2004
Location: Ffld Cnty Connecticut
Posts: 21,854

Bikes: Old Steelies I made, Old Cannondales

Liked 944 Times in 623 Posts
Originally Posted by TheKillerPenguin
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.
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
Homebrew01 is offline  


Contact Us - Archive - Advertising - Cookie Policy - Privacy Statement - Terms of Service - Your Privacy Choices -

Copyright © 2024 MH Sub I, LLC dba Internet Brands. All rights reserved. Use of this site indicates your consent to the Terms of Use.