Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
ErIog
Jul 11, 2001

:nsacloud:

BizarroAzrael posted:

Because its' actually a more complicated branching thing rather and three prerequisites for a single outcome. I didn't want to copy/paste so much and replace all the variables with generic ones.

You should still check your code. The fact that you coded something as "var != false," instead of "var == true" or the even more straightforward "if(var)"

Adbot
ADBOT LOVES YOU

BizarroAzrael
Apr 6, 2006

"That must weigh heavily on your soul. Let me purge it for you."

ErIog posted:

You should still check your code. The fact that you coded something as "var != false," instead of "var == true" or the even more straightforward "if(var)"

And maybe you should check the thread a little closer :haw:

tef did it

You're right about if(var) I've not come by that before, but come on man, "is not equal to false"? Give me a little credit.

Jethro
Jun 1, 2000

I was raised on the dairy, Bitch!

BizarroAzrael posted:

Because its' actually a more complicated branching thing rather and three prerequisites for a single outcome. I didn't want to copy/paste so much and replace all the variables with generic ones.
I just did a test, and three nested if statements without {} worked just fine. Thus we see that {} are not ever required for single-line if statements; you just screwed something else up. But then since single-line if statements are so easy to screw up, you should just always use {} no matter what and then you won't have this problem.

EDIT: and by problem I mean posting too simplified examples to go along with your stupid questions.

EDIT 2 (for clarity and because I am not nearly as cool as AD when I try to be snarky):
There is no syntax restriction against nesting if statements without using {}, but it's usually a good idea to always, always, always use {} regardless of nesting or number of lines etc just because the added clarity and ease of maintenance far outweigh the additional typing.

Jethro fucked around with this message at 20:04 on Sep 23, 2009

ErIog
Jul 11, 2001

:nsacloud:

BizarroAzrael posted:

And maybe you should check the thread a little closer :haw:

tef did it

Seems you're right. Carry on.

BizarroAzrael
Apr 6, 2006

"That must weigh heavily on your soul. Let me purge it for you."

Jethro posted:

Thus we see that {} are not ever required for single-line if statments;

quote:

you should just always use {} no matter what and then you won't have this problem.

:allears:

Okay, I screwed something else up that was repaired by putting the {} in, but the problem was me not using {}. Alright.

Smugdog Millionaire
Sep 14, 2002

8) Blame Icefrog
If you post your actual code we can tell you how stupid you are with more specificity.

DoctorTristan
Mar 11, 2006

I would look up into your lifeless eyes and wave, like this. Can you and your associates arrange that for me, Mr. Morden?
The acknowledgements section of my thesis now thanks SH/SC "for clarifying the use of the term `embarrassingly parallel' ". :colbert:

csammis
Aug 26, 2003

Mental Institution

DoctorTristan posted:

The acknowledgements section of my thesis now thanks SH/SC "for clarifying the use of the term `embarrassingly parallel' ". :colbert:

This is CoC, actually, so I'm going to have to write to your professors and invalidate your thesis immediately :colbert:

DoctorTristan
Mar 11, 2006

I would look up into your lifeless eyes and wave, like this. Can you and your associates arrange that for me, Mr. Morden?

csammis posted:

This is CoC, actually, so I'm going to have to write to your professors and invalidate your thesis immediately :colbert:

Theses are like software: it doesn't really matter if something is wrong so long as you fix it at some point.

milquetoast child
Jun 27, 2003

literally
I have a 4.2mb text file (format sample at the end of this post).

It has a line every 15 minutes from November 6, 2006 at 3:26pm up until right now.


As you can see, it's comma delimited, but the date is non-standard and Excel won't see it as a date field, so I can't change it around.

I can't do fixed width delimiting because the first 4 columns vary in how many digits (between 1 and 4).


I need to graph it, and the date field is totally screwing things up, and keep some key dates so I can say "the month over month change is X" and things like that, I don't need it to be perfect though.


Any ideas on what to do with the last column?

code:
496,70,376,942,Wed Sep 23 2009 06:11:01 
542,69,404,1015,Wed Sep 23 2009 06:26:00 
560,77,438,1075,Wed Sep 23 2009 06:41:00 
601,96,464,1161,Wed Sep 23 2009 06:56:00 
648,111,467,1226,Wed Sep 23 2009 07:11:00 
712,109,494,1315,Wed Sep 23 2009 07:26:00 
774,116,534,1424,Wed Sep 23 2009 07:41:00 
800,111,563,1474,Wed Sep 23 2009 07:56:00 
829,114,606,1549,Wed Sep 23 2009 08:11:00 
861,124,630,1615,Wed Sep 23 2009 08:26:00 
892,131,653,1676,Wed Sep 23 2009 08:41:00 
890,120,658,1668,Wed Sep 23 2009 08:56:00 
922,117,660,1699,Wed Sep 23 2009 09:11:01 
918,139,672,1729,Wed Sep 23 2009 09:26:00 
952,153,711,1816,Wed Sep 23 2009 09:41:00 
967,137,726,1830,Wed Sep 23 2009 09:56:00 
969,133,749,1851,Wed Sep 23 2009 10:11:00 
1015,145,756,1916,Wed Sep 23 2009 10:26:00 
1006,154,737,1897,Wed Sep 23 2009 10:41:02 
1037,160,745,1942,Wed Sep 23 2009 10:56:00 
1043,148,775,1966,Wed Sep 23 2009 11:11:00 
1062,153,754,1969,Wed Sep 23 2009 11:26:00 
1074,158,766,1998,Wed Sep 23 2009 11:41:00 
1086,171,750,2007,Wed Sep 23 2009 11:56:00 
1111,175,738,2024,Wed Sep 23 2009 12:11:00 
1149,181,732,2062,Wed Sep 23 2009 12:26:02 
1128,165,728,2021,Wed Sep 23 2009 12:41:00 
1118,160,700,1978,Wed Sep 23 2009 12:56:00 
1104,155,704,1963,Wed Sep 23 2009 13:11:00 
1078,157,697,1932,Wed Sep 23 2009 13:26:00 
1083,168,709,1960,Wed Sep 23 2009 13:41:00 
1119,162,714,1995,Wed Sep 23 2009 13:56:00 

Vanadium
Jan 8, 2005

It should be relatively easy to transform that to a representation that excel will eat up. Can you run a regexp over it or something? What format would that last column ideally be in?

Edit: Maybe you can just have excel ignore the last column and use the line number instead to recalculate the time of each line if that is easier. :shobon:

Vanadium fucked around with this message at 00:06 on Sep 24, 2009

milquetoast child
Jun 27, 2003

literally

Vanadium posted:

It should be relatively easy to transform that to a representation that excel will eat up. Can you run a regexp over it or something? What format would that last column ideally be in?

Well I sort of got it into a date like format by ctrl+h 'ing the MON, TUE, etc out of the date field.

That actually makes it a real date field!

So that problem is solved, and now I have to deal with Charts only taking 32,000 data points and 3-D charts only taking 4,000 data points in a chart that would ideally have about 400,000+.

I think I need a different charting program.

ErIog
Jul 11, 2001

:nsacloud:

dunkman posted:

Well I sort of got it into a date like format by ctrl+h 'ing the MON, TUE, etc out of the date field.

That actually makes it a real date field!

So that problem is solved, and now I have to deal with Charts only taking 32,000 data points and 3-D charts only taking 4,000 data points in a chart that would ideally have about 400,000+.

I think I need a different charting program.

I understand it's important to graph the real data, but to get sufficient resolution in a chart to make 400,000 data points useful it would make it a really long loving chart. If only one pixel was used for each data point, it would still be 400,000 pixels long. Or 100,000 pixels long if each of those points is represented in the same x axis position.

I would first split it by years, and then knock the data down to 32,000 data points for each year by removing every x number of lines to make that possible. That will give you about 3 data points every hour versus 4 every hour for each year. The problem is that this works out to only about 21 lines per day, and so won't be able to be done cleanly.

Either way, you're going to have to decimate this data to a level that makes it manageable. You're probably going to end up breaking this into 6 month chunks, decimating the data, and have 6 graphs that you can photoshop together or something.

You also might want to look into GNU Plot, it takes CSV as input and will export as JPEG or SVG, etc. It takes datasets of arbitrary size.

ErIog fucked around with this message at 00:36 on Sep 24, 2009

6174
Dec 4, 2004

dunkman posted:

I think I need a different charting program.

gnuplot is definitely the way to go. As ErIog mentioned, it can take CSV, it can accept date/time values and plot them as appropriate, and it can process massive amounts of data. I have actually made plots that have 6 million data points with the program (well the data file had 6 million points, and I made one plot of the whole file to orient oneself and many plots over subintervals of the data for actual use)

shrughes
Oct 11, 2008

(call/cc call/cc)

ErIog posted:

.*@.* then try to send an e-mail is really the only good way to do that.

Oh look, one of these people who want to look smart by not answering the question. There are many situations where you can't send an email for every email address you have to parse.

Really ["a-zA-ZseetheRFC]+@(<domain name segment>\.)*<domain name segment> is the way to go.

Edit: actually something along the lines of ("[^"]+"|[,a-zA-ZseetheRFC]+)@(<domain name segment>\.)+<domain name segment> is what you want. Yes, I have seen "John Smith"@domain.com email addresses in the wild. If I remember correctly, the RFC doesn't allow comma characters in the username section of the email address, but you should tolerate those anyway because there are some of those.

shrughes fucked around with this message at 03:38 on Sep 24, 2009

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
What exactly do you gain from validation that says that asdjfhklsdjfh@sdjhfiuyiulkjdhf.com is a valid email address?

defmacro
Sep 27, 2005
cacio e ping pong

Plorkyeran posted:

What exactly do you gain from validation that says that asdjfhklsdjfh@sdjhfiuyiulkjdhf.com is a valid email address?

The truth is more important than the email account itself.

Duh.

shrughes
Oct 11, 2008

(call/cc call/cc)

Plorkyeran posted:

What exactly do you gain from validation that says that asdjfhklsdjfh@sdjhfiuyiulkjdhf.com is a valid email address?

Nothing guarantees it's a valid email address. It just shows that it's not garbage. There are situations where you aren't actually interested in seeing whether you can send emails to an email address, when you only want to recognize them and canonicalize them.

ErIog
Jul 11, 2001

:nsacloud:

shrughes posted:

Nothing guarantees it's a valid email address. It just shows that it's not garbage. There are situations where you aren't actually interested in seeing whether you can send emails to an email address, when you only want to recognize them and canonicalize them.

Why would you ever query a user for an email address without planning to use it? And, that email is garbage. That's the whole point. It will validate, but it's unusable.

Also, this email regex discussion was specifically about validating an email address, not scraping them from web pages or finding them in other text. That's a different purpose, and obviously there you would want to use a more full-featured regex to make sure you don't pick up "Eat@Joe's" or something

ErIog fucked around with this message at 04:42 on Sep 24, 2009

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

shrughes posted:

Nothing guarantees it's a valid email address. It just shows that it's not garbage.
How is the result of mashing keys for a few seconds then tossing in @ and .com at the end not garbage? How would you ever gain something from treating that as an email address?

shrughes
Oct 11, 2008

(call/cc call/cc)

Plorkyeran posted:

How is the result of mashing keys for a few seconds then tossing in @ and .com at the end not garbage? How would you ever gain something from treating that as an email address?

Because it is a valid email address? heuntohuoercugeorcugo@eohuontihueifreier.com is a valid email address.

You'd be an idiot to design your app such that coming across a fake email address causes it to incorrigibly lose all utility. There are plenty of situations where it doesn't, but you still need to distinguish between something that is an email address, or a phone number, or what have you, and something that obviously isn't. And "validating" can mean different things. It's pretty obvious that if you want to know you can email somebody, you can't know unless you send an email, I hope. That's not the purpose of using a regex to validate email addresses.

Edit:

quote:

Also, this email regex discussion was specifically about validating an email address, not scraping them from web pages or finding them in other text.

And there are not situations where you want to make sure something is an email address, and it's supposed to be, and you're not scraping web pages or finding them in other text?

ErIog
Jul 11, 2001

:nsacloud:

shrughes posted:

You'd be an idiot to design your app such that coming across a fake email address causes it to incorrigibly lose all utility.

That's not the purpose of using a regex to validate email addresses.

Chances are that if you're getting an email address from someone for a utility, that both they and you want it to work. As there is no way to truly validate an email address without sending an email, "validating" the email with a crazy regex only serves to create false negatives: addresses that mail could be sent to that fail the regex you're bottlenecking these addresses through. Nobody ever said anything about the email address being the linchpin for the whole operation.

You've said the second sentence multiple times without clarifying what the other purposes are. I only see one purpose for validating an email address. Call me crazy, but it's to actually send email to it in the future. If you don't plan on doing that, then why grab an email address? Please tell me what these purposes are.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh
This is why you write a parser for the email address grammar. Some of us in this world do not have a fetish for regexes like Victor, who can't climax unless the woman uses zero-width assertions.

shrughes
Oct 11, 2008

(call/cc call/cc)

ErIog posted:

You've said the second sentence multiple times without clarifying what the other purposes are. I only see one purpose for validating an email address. Call me crazy, but it's to actually send email to it in the future. If you don't plan on doing that, then why grab an email address? Please tell me what these purposes are.

Well, here's a hint: What if you want to read email addresses from something that contains email addresses, for the sake of knowing that information. And what if you want to discern between email addresses and the haikus that Billy-Joe-Bob Professional likes to put in the Email1, Email2, and Email3 fields.

1337JiveTurkey
Feb 17, 2005

Anyone who considers finite state machines as a method of recognizing a context-free language is, of course, living in a state of sin.

ErIog
Jul 11, 2001

:nsacloud:

shrughes posted:

Well, here's a hint: What if you want to read email addresses from something that contains email addresses, for the sake of knowing that information. And what if you want to discern between email addresses and the haikus that Billy-Joe-Bob Professional likes to put in the Email1, Email2, and Email3 fields.

Yeah, we had that covered. We weren't talking about that situation because the original question was about validating them, not finding them. Then you decided to get your panties in a bunch because we didn't pander to your pedantic need to have it recognized that with a better regex, one might be able to search for emails. It had nothing to do with the original question or conversation.

You took an answer for one situation, and then complained because it didn't fit a completely different situation.

BigRedDot
Mar 6, 2008

ErIog posted:

Either way, you're going to have to decimate this data to a level that makes it manageable.
Simple decimation may not be appropriate, he might be better of with some form of re-binning or kernel smoothing.

csammis
Aug 26, 2003

Mental Institution

Avenging Dentist posted:

Some of us in this world do not have a fetish for regexes like Victor, who can't climax unless the woman uses zero-width assertions.

There's a joke in there about zero-width assertions and penis length, but I'm going to need more coffee before I can put it together :saddowns:

Mustach
Mar 2, 2003

In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.
Does Victor even exist anymore?

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip
He was in #cobol like two weeks ago for a day or two, so he probably isn't dead

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip
Of course, simulated Victor will live on forever*






*So long as I pay my vps bills

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb
I ended up using this for help with validating an email address. I don't really care if the email address actually exists or not, I just don't want to bother storing an email address that isn't even valid in the db.

The application is a spambot designed to target CoC users, if anybody cares.

PnP Bios
Oct 24, 2005
optional; no images are allowed, only text
I have a client running OSX and windows xp in virtualbox. This is working great except when she needs to print. From time to time, the usb printer will timeout or something, and the xp VM won't see it anymore. If somebody could show me how to reset the usb printer connection using apple script, this would be awesome. I'd bounty this out for $10.

Eclipse12
Feb 20, 2008

Okay, I looked through the OP and some of the other threads on here a bit, so I might have overlooked the answer to this one, but it should be a quick response anyway.

I have basically no knowledge of coding/programming. I'm looking for a way to get a fairly basic program made for me, something that could probably be done in a day or two by anyone with experience. Specifically, I would like it to use GameMaker or Java (or any other program that would be superior; I could decide that when I explain what I'm looking for.) I am willing to pay/compensate a person who could make it for me.

Is this something I should make an individual thread for? What's the etiquette here? Should I just ask in the Games Development megathread?

Any answers are greatly appreciated.

RussianManiac
Dec 27, 2005

by Ozmaugh

Eclipse12 posted:

Okay, I looked through the OP and some of the other threads on here a bit, so I might have overlooked the answer to this one, but it should be a quick response anyway.

I have basically no knowledge of coding/programming. I'm looking for a way to get a fairly basic program made for me, something that could probably be done in a day or two by anyone with experience. Specifically, I would like it to use GameMaker or Java (or any other program that would be superior; I could decide that when I explain what I'm looking for.) I am willing to pay/compensate a person who could make it for me.

Is this something I should make an individual thread for? What's the etiquette here? Should I just ask in the Games Development megathread?

Any answers are greatly appreciated.

Hey, post your email or chat name, and we can talk.

tef
May 30, 2004

-> some l-system crap ->

Eclipse12 posted:

Is this something I should make an individual thread for? What's the etiquette here? Should I just ask in the Games Development megathread?

Any answers are greatly appreciated.

It is (allegedly) best to post questions about employing people in SA-MART. However, linking to such a thread here is fine.

StabbinHobo
Oct 18, 2002

by Jeffrey of YOSPOS
does anyone know of something like heroku or appengine but that is 100% in-browser? like a browser-ide + hosting?

Eclipse12
Feb 20, 2008

tef posted:

It is (allegedly) best to post questions about employing people in SA-MART. However, linking to such a thread here is fine.

Thanks for the info

tef
May 30, 2004

-> some l-system crap ->

Eclipse12 posted:

I have basically no knowledge of coding/programming. I'm looking for a way to get a fairly basic program made for me, something that could probably be done in a day or two by anyone with experience.


Aside: If you have no knowledge how did you come up with that estimate of time?

Adbot
ADBOT LOVES YOU

Triple Tech
Jul 28, 2006

So what, are you quitting to join Homo Explosion?

tef posted:

Aside: If you have no knowledge how did you come up with that estimate of time?

:master: People who don't know anything about the construction of virtual products think they can be made in Internet time.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply