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
Jo
Jan 24, 2005

:allears:
Soiled Meat

tef posted:

Why are you implementing DES?

(I would have thought the diagrams of keyscheduling on wikipedia would be enough to answer your questions)

I'm taking a security course. There's a brief overview of crypto in the first lesson. (Brief, as crypto is its own course.) Part of our assignment is to run a few steps of DES by hand. Possibly to show us how boring and tedious it is to run by hand.

But thanks for pointing out the Wikipedia material. I checked it but overlooked the important information. :downs:

Jo fucked around with this message at 13:58 on Sep 11, 2009

Adbot
ADBOT LOVES YOU

ErIog
Jul 11, 2001

:nsacloud:
Am I a knob for not using the XML libraries in Python? Whenever I need to do random XML parsing, I find it easier to just use regex rather than parse the file through the official library. I realize that this might create headaches in the future, but usually these are one-off tools to automate some sort of data mining or file renaming based on XML data.

No Safe Word
Feb 26, 2005

ErIog posted:

Am I a knob for not using the XML libraries in Python?
Yup.

ErIog posted:

Whenever I need to do random XML parsing, I find it easier to just use regex rather than parse the file through the official library.
jwz quote

ErIog posted:

I realize that this might create headaches in the future, but usually these are one-off tools to automate some sort of data mining or file renaming based on XML data.
:pwn:

tef
May 30, 2004

-> some l-system crap ->
lxml + xpath


it's good for xml

floWenoL
Oct 23, 2002

ErIog posted:

Am I a knob for not using the XML libraries in Python? Whenever I need to do random XML parsing, I find it easier to just use regex rather than parse the file through the official library. I realize that this might create headaches in the future, but usually these are one-off tools to automate some sort of data mining or file renaming based on XML data.

As someone who has had to maintain code that parses XML using regexps (and would randomly break every time attributes moved around) I hope you someday go through the same pain.

ErIog
Jul 11, 2001

:nsacloud:

floWenoL posted:

As someone who has had to maintain code that parses XML using regexps (and would randomly break every time attributes moved around) I hope you someday go through the same pain.

I rewrote my code to do proper parsing using the libraries, and my code before was brain dead simple. All it did was get all the instances of certain tags, and throw the text data between the tags into a list. I never relied on the tags being in any kind of set order.

I need to brush up on my Python and programming theory. I understand at a high level why using the XML library is better, but it doesn't feel like my code is any more fault tolerant. Though, this is probably because I just needed very simple things from the XML in the first place. If I were writing XML or having to do more complex things with it then obviously using the library would be better. I think the only thing this rewrite got me was readability and maintainability. Now if a tag changes, all I have to do is change one variable rather than futzing with all the string slicing magic I'm doing to get the data between tags from the regex.

I guess maintainability is worth more than I give it credit for. I tend to only think about the code breaking in the future when something changes at some point. I never think that I'll have to fix it at that point.

ErIog fucked around with this message at 18:59 on Sep 11, 2009

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb

ErIog posted:

Though, this is probably because I just needed very simple things from the XML in the first place.

That's how the project always starts and before you know it it will have grown into some mammoth thing that is impossible to maintain. Using the regexp may work for the really simple tasks, but the library works for both the simple tasks and the complex.

litghost
May 26, 2004
Builder

ErIog posted:

All it did was get all the instances of certain tags, and throw the text data between the tags into a list.

Why is getElementsByTagName() not exactly what you just described? I am not sure how you can simplify

code:
from xml.dom.minidom import parse

dom1 = parse('example.xml')

l = []
for tag in listotags:
    l.extend([x.childNodes[0].data for x in dom1.getElementsByTagName(tag)])

How did you end up doing it?

litghost fucked around with this message at 01:46 on Sep 12, 2009

raminasi
Jan 25, 2005

a last drink with no ice

ErIog posted:

I think the only thing this rewrite got me was readability and maintainability.
Don't discredit this, seriously. I personally have saved myself hours of headaches by doing things the "right way" at the beginning, and also caused myself hours of headaches by shortcutting at the beginning.

ErIog
Jul 11, 2001

:nsacloud:

litghost posted:

Why is getElementsByTagName() not exactly what you just described? I am not sure how you can simplify

It wasn't that I really simplified, it was that I knew how to do a regex and so I just used that rather than grab a different tool from the tool box that I would have had to look up how to use. It was just one of those things where I had a hammer(regex), and so my problem became a nail. getElementsByTagName paired with the getText function from the sample XML code is what I replaced it with.

The script is on my work machine, otherwise I'd post the relevant lines. I just did a find for instances of certain tag sets, and then did a slice to get just the text data from between the tags.

GrumpyDoctor posted:

Don't discredit this, seriously. I personally have saved myself hours of headaches by doing things the "right way" at the beginning, and also caused myself hours of headaches by shortcutting at the beginning.

I realize that, and that's what drove me to ask the question in this thread and consequently rewrite the relevant bits.

litghost
May 26, 2004
Builder

ErIog posted:

It wasn't that I really simplified

I was refering to

ErIog posted:

brain dead simple

which is to say, the DOM code is brain dead simple to read, whereas any regular expression would not be.

ErIog
Jul 11, 2001

:nsacloud:

litghost posted:

which is to say, the DOM code is brain dead simple to read, whereas any regular expression would not be.

They are equivalent, but I knew one and not the other. Therefore the one that was not new to me was perceived as being simpler. Can I make this any simpler? Does this really matter? I fixed it based upon the recommendations before you even posted your query.

litghost
May 26, 2004
Builder

ErIog posted:

They are equivalent

As mentioned above they are not equivalent. There are any number of things that would throw off a regular expression attempt at parsing XML (newlines, attributes, unicode, encoding).

quote:

Does this really matter?

Not in the least. You changed the code, and in the future will probably turn to existing XML libraries instead of rolling your own.

ErIog
Jul 11, 2001

:nsacloud:

litghost posted:

As mentioned above they are not equivalent. There are any number of things that would throw off a regular expression attempt at parsing XML (newlines, attributes, unicode, encoding).

Jesus loving christ. I was saying they were equivalent in terms of simplicity. I already loving said they weren't functionally equivalent so I obviously wouldn't have meant it that way. It was in my very first post in this thread, on this page, where I asked the question.

ErIog posted:

I realize that this might create headaches in the future...

I might not be well-versed in Python, but I don't need a special condescending pow-wow with you where you explain things to me that I've already stated.

Thanks everyone else for the simple answer to my simple question. I'll move along now.

ErIog fucked around with this message at 06:37 on Sep 12, 2009

smith7800
Sep 25, 2004
is there an irc chatroom for something awful or this forum?

tef
May 30, 2004

-> some l-system crap ->
Details in the first post of this thread:

http://forums.somethingawful.com/showthread.php?threadid=2779598&userid=0&perpage=40&pagenumber=1#post340060746

smith7800
Sep 25, 2004

I have a degree in CS, but how do I get in that chatroom? I got chatzilla for firefox... not sure now.

yatagan
Aug 31, 2009

by Ozma

smith7800 posted:

I have a degree in CS, but how do I get in that chatroom? I got chatzilla for firefox... not sure now.

And people wonder why no one respects a bachelors anymore.

Edit: here's a link http://lmgtfy.com/?q=how+mongo+connect+irc+with+mongo+chatzilla&l=1

yatagan fucked around with this message at 11:54 on Sep 12, 2009

magicalblender
Sep 29, 2007

smith7800 posted:

I have a degree in CS, but how do I get in that chatroom? I got chatzilla for firefox... not sure now.

Open the ChatZilla window.
In the bottom text box, enter "/attach irc.synirc.net".
You should get a response indicating that you connected to the synirc network.
Enter "/join #cobol".

Or you could just click here.

BizarroAzrael
Apr 6, 2006

"That must weigh heavily on your soul. Let me purge it for you."
Anyone here self-taught in C# in Visual Studio? I could really do with a good tutorial site or something, but I only need to make a pretty basic form that will modify/compose a .batch file for an automated process. For the most part, it will just be tick boxes to enable calls to other processes, but I'm lost, guess I was expecting it to be more like Visual Basic.

Josh Lyman
May 24, 2009


I don't do much coding so I've just been using Crimson Editor since that was recommended when I took a MIPS assembly course about 6 years ago. Any suggestions for better Windows text editor options these days?

BizarroAzrael
Apr 6, 2006

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

Josh Lyman posted:

I don't do much coding so I've just been using Crimson Editor since that was recommended when I took a MIPS assembly course about 6 years ago. Any suggestions for better Windows text editor options these days?

Probably depends on what you want but I like Notepad++ pretty good.

csammis
Aug 26, 2003

Mental Institution

BizarroAzrael posted:

I could really do with a good tutorial site or something, but I only need to make a pretty basic form that will modify/compose a .batch file for an automated process.

No tutorial site in the world will cover something that exact.

quote:

For the most part, it will just be tick boxes to enable calls to other processes,

What does this have to do with batch files?

quote:

but I'm lost, guess I was expecting it to be more like Visual Basic.

You have the Windows Forms designer, double-clicking on a control that you drag onto a window creates an event handler into which you write code...how much more like VB do you want?


You're implying a couple types of functionality (UI, file I/O) but not saying what you're having trouble with. You're going to have to be a lot more specific. What are you looking for in C# that you could handle in VB?

BizarroAzrael
Apr 6, 2006

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

csammis posted:

No tutorial site in the world will cover something that exact.


What does this have to do with batch files?


You have the Windows Forms designer, double-clicking on a control that you drag onto a window creates an event handler into which you write code...how much more like VB do you want?


You're implying a couple types of functionality (UI, file I/O) but not saying what you're having trouble with. You're going to have to be a lot more specific. What are you looking for in C# that you could handle in VB?

I figured it would just be a matter of outputting lines of text into a file? Those lines will call other processes that the user requires, and the resultant batch file will be run by the Windows scheduler.

I don't want anything incredibly specific, I would just like a good starting point. I can't find where I drag check boxes from, or where I tell it to make them in the form, so I can't exactly give them event handlers yet.

csammis
Aug 26, 2003

Mental Institution

BizarroAzrael posted:

I figured it would just be a matter of outputting lines of text into a file? Those lines will call other processes that the user requires, and the resultant batch file will be run by the Windows scheduler.

That isn't what you said, though. "tick boxes to enable calls to other processes" could mean a lot of things.

quote:

I don't want anything incredibly specific, I would just like a good starting point. I can't find where I drag check boxes from, or where I tell it to make them in the form, so I can't exactly give them event handlers yet.

This is almost exactly the same as VB. Create a Windows Forms project, drag checkboxes from the Toolbox (if it's not visible, find it in the View menu).

edit: http://windowsclient.net/getstarted/

csammis fucked around with this message at 16:16 on Sep 15, 2009

Junji Eat More
Oct 22, 2005

You don't know it, but you are full of stahs
Is there a way to specify what interface I want to use with a Python sockets connection?

I've been reading the page back and forth without any luck - I'm doing some programming for a little black box that's going to have three Ethernet cards, and I have no idea how it's going to know to pick the right one to send my data on with no interface parameters in any of the config options.

No Safe Word
Feb 26, 2005

Necronomiconomist posted:

Is there a way to specify what interface I want to use with a Python sockets connection?

I've been reading the page back and forth without any luck - I'm doing some programming for a little black box that's going to have three Ethernet cards, and I have no idea how it's going to know to pick the right one to send my data on with no interface parameters in any of the config options.

Are they all on the same subnet? If so, why does it matter which one you use?

Junji Eat More
Oct 22, 2005

You don't know it, but you are full of stahs
Two are going to be a bridge, and my app's sniffing the packets on the bridge, pulling out items of interest, and sending them to the third card, which is a standalone network.

rugbert
Mar 26, 2003
yea, fuck you
Is there a way to enable/disable a second display with vbscript or just some simple dos command? And maybe something that would minimize all windows?

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?
Not sure if this is the right place to ask, but does anyone know where the phrase `Embarrassingly parallel' was first coined, or by whom? I'm using it in a maths paper and should probably cite it somehow.

terminatusx
Jan 27, 2009

:megaman:Indie Game Dev and Bringer of the Apocalypse

DoctorTristan posted:

Not sure if this is the right place to ask, but does anyone know where the phrase `Embarrassingly parallel' was first coined, or by whom? I'm using it in a maths paper and should probably cite it somehow.

http://www.youtube.com/watch?v=1yH_j8-VVLo

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.

DoctorTristan posted:

Not sure if this is the right place to ask, but does anyone know where the phrase `Embarrassingly parallel' was first coined, or by whom? I'm using it in a maths paper and should probably cite it somehow.
I hope you never get published. Or get an F, whatever

Mustach fucked around with this message at 01:17 on Sep 20, 2009

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

Mustach posted:

I hope you never get published. Or get an F, whatever

You do realize that that's an actual mathematical term, right?

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.
Don't care; it's the dumbest "term" ever and people should stop using it

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?
I was only going to use it in a throwaway remark at the end of an unimportant section, but now I will use it all over the drat place.

LOLLERZ
Dec 9, 2003
ASK ME ABOUT SPAMMING THE REPORT FORUM TO PROTECT ~MY WIFE'S~ OKCUPID PERSONALS ANALYSIS SA-MART THREAD. DO IT. ALL THE TIME. CONSTANTLY. IF SHE DOESN'T HAVE THE THREAD, SHE'LL WANT TO TALK TO ME!
This outpouring of support for the term "embarrassingly parallel" is embarrassingly parallel.

ShoulderDaemon
Oct 9, 2003
support goon fund
Taco Defender
Yeah, but the forum's single-threaded approach is serializing it, so we don't get any speedup.

RussianManiac
Dec 27, 2005

by Ozmaugh

Mustach posted:

Don't care; it's the dumbest "term" ever and people should stop using it

Why is it dumb? It means a specific set of problems, who'se reimplementation from purely sequential to some sort of parallelism is almost trivial.

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.
"Embarrassing"'s dumb because you just used a far more accurate, appropriate, and descriptive replacement ("trivial").

Adbot
ADBOT LOVES YOU

RussianManiac
Dec 27, 2005

by Ozmaugh

Mustach posted:

"Embarrassing"'s dumb because you just used a far more accurate, appropriate, and descriptive replacement ("trivial").

This is a trivial argument because we are just arguing whether using one word over another is dumb or not, when the end meaning doesn't change. I guess some newbs might get confused by "Embarrassingly Parallel" over "Trivially Parallel" but its just a convention that most people got used to already.

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