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
shodanjr_gr
Nov 20, 2007
What language is that?

Adbot
ADBOT LOVES YOU

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Looks like C#

cat_snake
Nov 19, 2014

Yes, C#.

Polio Vax Scene
Apr 5, 2009



If you don't give your variables meaningful names, then I'm not going to give you a meaningful name. So, welcome to the team, Mr. Blah

NovemberMike
Dec 28, 2008

I like how he had tabcontrols tc and tcc.

HappyHippo
Nov 19, 2003
Do you have an Air Miles Card?

NovemberMike posted:

I like how he had tabcontrols tc and tcc.

Reminds me of some of the naming conventions in LaTeX. If you want the different sizes of larger parentheses the sequence is (in increasing size): "\big(" "\Big(" "\bigg(" "\Bigg(". "\quad" is a large space, but "\qquad" is a bigger space. I think there's more but those are the two I can remember off the top of my head.

ErIog
Jul 11, 2001

:nsacloud:

HappyHippo posted:

Reminds me of some of the naming conventions in LaTeX. If you want the different sizes of larger parentheses the sequence is (in increasing size): "\big(" "\Big(" "\bigg(" "\Bigg(". "\quad" is a large space, but "\qquad" is a bigger space. I think there's more but those are the two I can remember off the top of my head.

It's too bad LaTeX isn't really a programming language since it would definitely qualify as a horror in many regards.

apseudonym
Feb 25, 2011

ErIog posted:

It's too bad LaTeX isn't really a programming language since it would definitely qualify as a horror in many regards.

Its Turing Complete which is a bigger horror.

Van Kraken
Feb 13, 2012

apseudonym posted:

It's Turing Complete which is a bigger horror.

What isn't, nowadays?

Van Kraken fucked around with this message at 02:41 on Jan 6, 2015

bone app the teeth
May 14, 2008

This is how you fix a rogue break tag appearing in some data.

code:
$scope.replaceBR = function(descr){
    descrNoBr = descr.replace(new RegExp("<br>", "g"), "  ");
    descrNoBr = descrNoBr.replace(new RegExp("<br/>", "g"), "  ");
    descrNoBr = descrNoBr.replace(new RegExp("<BR/>", "g"), "  ");
    return descrNoBr.replace(new RegExp("<BR>", "g"), "  ");
};

Knyteguy
Jul 6, 2005

YES to love
NO to shirts


Toilet Rascal

flare posted:

This is how you fix a rogue break tag appearing in some data.

code:
$scope.replaceBR = function(descr){
    descrNoBr = descr.replace(new RegExp("<br>", "g"), "  ");
    descrNoBr = descrNoBr.replace(new RegExp("<br/>", "g"), "  ");
    descrNoBr = descrNoBr.replace(new RegExp("<BR/>", "g"), "  ");
    return descrNoBr.replace(new RegExp("<BR>", "g"), "  ");
};

... and it still doesn't cover "<br />" or "<BR />".

What's that for a template engine or wysiwyg editor?

evensevenone
May 12, 2001
Glass is a solid.

apseudonym posted:

Its Turing Complete which is a bigger horror.

You can make a Turing complete machine with a single opcode. Subtract and branch if less than zero is a popular one, I think someone even made a (simplified) C compiler for it.

Linear Zoetrope
Nov 28, 2011

A hero must cook
This term I'm TAing an entry level, online course in Data Structures. Which for some god forsaken reason is done in C.

This is going to be a great source of ridiculous, colorful, beautiful memory and pointer bugs, isn't it?

bone app the teeth
May 14, 2008

Knyteguy posted:

... and it still doesn't cover "<br />" or "<BR />".

What's that for a template engine or wysiwyg editor?

Neither. It's an angular controller printing some text and that's data coming from the API.

Evil_Greven
Feb 20, 2007

Whadda I got to,
whadda I got to do
to wake ya up?

To shake ya up,
to break the structure up!?

flare posted:

This is how you fix a rogue break tag appearing in some data.

code:
$scope.replaceBR = function(descr){
    descrNoBr = descr.replace(new RegExp("<br>", "g"), "  ");
    descrNoBr = descrNoBr.replace(new RegExp("<br/>", "g"), "  ");
    descrNoBr = descrNoBr.replace(new RegExp("<BR/>", "g"), "  ");
    return descrNoBr.replace(new RegExp("<BR>", "g"), "  ");
};

Shouldn't it just be something like:
code:
$scope.replaceBR = function(descr) {
  return descrNoBr.replace(new RegExp("/<br[^>]*>/", "gi"), "  ");
};
Not sure of language, just guessing at syntax - there aren't even escape characters?

brap
Aug 23, 2004

Grimey Drawer
Looks like JavaScript.

Sedro
Dec 31, 2008

Evil_Greven posted:

Shouldn't it just be something like:
code:
$scope.replaceBR = function(descr) {
  return descrNoBr.replace(new RegExp("/<br[^>]*>/", "gi"), "  ");
};
Not sure of language, just guessing at syntax - there aren't even escape characters?

JavaScript code:
$scope.replaceBR = function(descr) {
  return descr.replace(/<br\/?>/gi, '  ');
};

Tad Naff
Jul 8, 2004

I told you you'd be sorry buying an emoticon, but no, you were hung over. Well look at you now. It's not catching on at all!
:backtowork:
I'm sure I have seen this function in my favourite horror, CONTENTdm.

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

Sedro posted:

JavaScript code:
$scope.replaceBR = function(descr) {
  return descr.replace(/<br\/?>/gi, '  ');
};

HTML code:
<br />

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



s/<[^>]*>//g :black101:

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope
How do I parse HTML with regular expressions?

TheresaJayne
Jul 1, 2011

Scaramouche posted:

I had a group project in an after hours VB6 class (yes I'm old) I was taking. We had to make a hotel booking system. I said I'd do the forms (interface, button layout, etc.), another guy said he'd hook up the forms to the database, and the one we'd already identified as the dead weight said would do the 'graphics'. So fast forward 6 weeks, database guy had hosed off completely (literally; no one ever saw him again), 'graphics' girl had given me one image which was a crude drawing of a hotel used for the startup image. However my lorem ipsum stuff on the forms was so convincing people thought the thing actually worked (obviously until you tried to make a new booking). We got the highest mark in the class. Weirdest part was the chinese guys who had somehow made a completely working version, but as a console command-line app.

At college i started by doing an electronic engineering course but during the first year myself and a guy were good with computers so our in course work was too easy (introduction to computers) we were tasked with making a timetable management system for the college admin office, Running on a bbc B with the mouse rom added we did a nice system with desktop etc. got A++ for that module and they quickly advised me to drop enginerering (not a girls subject) and go for the computing course. Which back then i just did so backing up the stereotype.

apseudonym
Feb 25, 2011

Jsor posted:

This term I'm TAing an entry level, online course in Data Structures. Which for some god forsaken reason is done in C.

This is going to be a great source of ridiculous, colorful, beautiful memory and pointer bugs, isn't it?

I taught a similar course when I was in undergrad, the language doesn't matter because students will always find a way to gently caress this up hilariously regardless, but you're in for some fun.

ATM Machine
Aug 20, 2007

I paid $5 for this

Jsor posted:

This term I'm TAing an entry level, online course in Data Structures. Which for some god forsaken reason is done in C.

This is going to be a great source of ridiculous, colorful, beautiful memory and pointer bugs, isn't it?

Please keep us posted :allears:

e: actually, will they be coming in with any prerequisite C/<programming language> unit at all? If not then that's going to be a painful introduction to data structures.

QuarkJets
Sep 8, 2008

I've done some teaching in physics, and we rarely ever have group projects, but when we do I've always tried to encourage people to narc on slacker team members. Staying quiet and dragging a useless teammate isn't doing any favors for anyone, least of all the person who isn't contributing; you're just avoiding a situation that you perceive as being slightly uncomfortable. It's cowardice. Stop being a little cowardly baby and tell your professor when someone is clearly falling behind and not pulling their weight.

Hiowf
Jun 28, 2013

We don't do .DOC in my cave.

Jsor posted:

This term I'm TAing an entry level, online course in Data Structures. Which for some god forsaken reason is done in C.

This is going to be a great source of ridiculous, colorful, beautiful memory and pointer bugs, isn't it?

Sounds like a good way to breed Real(TM) programmers and weed out the wannabes.

Hiowf
Jun 28, 2013

We don't do .DOC in my cave.

Manslaughter posted:

Surely you had some extracurricular you took part in?

"Well I was on a pretty good counter strike team..."

Might work better than you imagine. On the other hand, the interviewer could also reply with "I only play Call Of Duty" and then what?

qntm
Jun 17, 2009

Wheany posted:

How do I parse HTML with regular expressions?

VERY CAREFULLY

sarehu
Apr 20, 2007

(call/cc call/cc)
I'm glad people are still putting in a space between the <br and the />, because they don't want to give up Netscape 4 compatibility.

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

sarehu posted:

I'm glad people are still putting in a space between the <br and the />, because they don't want to give up Netscape 4 compatibility.

Well, they're still doing xhtml.

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

Jsor posted:

This term I'm TAing an entry level, online course in Data Structures. Which for some god forsaken reason is done in C.

This is going to be a great source of ridiculous, colorful, beautiful memory and pointer bugs, isn't it?

Since it's an online course, probably. Frankly I don't get why they'd go with C over C++ (enjoy casting back and forth with void* and friends to make generic data structures - and I say this as a C guy), but a data structures course is about the last place you'd want to use a language that lacks value semantics or explicit memory allocation.

evensevenone
May 12, 2001
Glass is a solid.
It's really a question of whether it's a class to introduce people to the common CS data structures and how to use them, or whether it's a class on how to actually implement them. If it's the latter, then C totally makes sense.

I'm not sure if that would be an entry-level class, although CS curricula are so terrible that it probably is. Also, the former class seems to be sadly uncommon.

Hiowf
Jun 28, 2013

We don't do .DOC in my cave.

evensevenone posted:

a class to introduce people to the common CS data structures and how to use them...former class seems to be sadly uncommon.

I don't even...what do you want that isn't covered by an explanation of big-O behavior of various operations, which is taught in algorithms classes?

HappyHippo
Nov 19, 2003
Do you have an Air Miles Card?

ErIog posted:

It's too bad LaTeX isn't really a programming language since it would definitely qualify as a horror in many regards.

Seriously. I mean it's great in many ways, and it's very powerful, but man there are some dumb choices. Another good one: even though LaTeX has a standard convention for commands with arguments (the arguments are in { } braces following the command, eg "\frac{a}{b}") if you want to get an integral (or summation) sign with limits you need to use subscript and superscript. "\int" is the integral sign, "\int_a^b" is an integral from a to b. Why would you do that? It's not like it's taking the integral symbol and putting those superscripts/subscripts, the engine treats this as a special case. I always define my own sensible command so I can type "\intlimits{equation}{lower limit}{upper limit}" like it should have been in the first place.

Evil_Greven
Feb 20, 2007

Whadda I got to,
whadda I got to do
to wake ya up?

To shake ya up,
to break the structure up!?

Skuto posted:

I don't even...what do you want that isn't covered by an explanation of big-O behavior of various operations, which is taught in algorithms classes?
I don't know about that course, but my university combined Data Structures & Algorithms into a single course, which is required in the ABET accredited general CS, Applied CS, IT, and now the new SE programs. That was the gatekeeper course, prerequisite for the chains of upper level courses. A lot of students don't get past it.

Big-O was discussed more in a class called Discrete Structures (prerequisite to the above course), which was a CS adaptation of Discrete Mathematics.

Hiowf
Jun 28, 2013

We don't do .DOC in my cave.
So you're saying you learnt data structures and algorithms, but no-one ever brought up the big-O behavior of those because that was something "mathematical" that was already discussed in a past course?

Mind = Blown

QuarkJets
Sep 8, 2008

HappyHippo posted:

Seriously. I mean it's great in many ways, and it's very powerful, but man there are some dumb choices. Another good one: even though LaTeX has a standard convention for commands with arguments (the arguments are in { } braces following the command, eg "\frac{a}{b}") if you want to get an integral (or summation) sign with limits you need to use subscript and superscript. "\int" is the integral sign, "\int_a^b" is an integral from a to b. Why would you do that? It's not like it's taking the integral symbol and putting those superscripts/subscripts, the engine treats this as a special case. I always define my own sensible command so I can type "\intlimits{equation}{lower limit}{upper limit}" like it should have been in the first place.

Using superscripts/subscripts to denote upper/lower bounds on an integral feels intuitive to non-CS majors, a majority of LaTeX users, and there's literally no other reason to use a superscript/subscript on an integral sign. This might be a horror to someone who designs computer languages, but it's also a helpful feature for users.

I don't know where to draw the line between "let's make this programming language as beautiful as possible" and "let's make something that's easy to use and produces nice output", but it seems like a lot of language decisions put these two ideas in conflict

QuarkJets fucked around with this message at 19:34 on Jan 6, 2015

Evil_Greven
Feb 20, 2007

Whadda I got to,
whadda I got to do
to wake ya up?

To shake ya up,
to break the structure up!?

Skuto posted:

So you're saying you learnt data structures and algorithms, but no-one ever brought up the big-O behavior of those because that was something "mathematical" that was already discussed in a past course?

Mind = Blown
Not exactly, but then the course was a bit unstructured - the professor was fairly new and had never taught the course before, nor was it that professor's specialty. The schedule was perpetually behind. For example, Dijkstra's algorithm was mentioned on a single day, near the end of the term. Then, naturally, it was a large component of the final. I suspect a lot of my classmates failed that course.

There was only brief mention of time complexity for some data structures and algorithms. Perhaps justifiably so, as calculating time complexity was covered in Discrete Structures extensively, with a week or two devoted to that alone. By that point, students should have been able to figure it out on their own rather than just memorize it.

feedmegin
Jul 30, 2008

qntm posted:

VERY CAREFULLY

I assume everyone here has seen http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags by this point...

Adbot
ADBOT LOVES YOU

Zopotantor
Feb 24, 2013

...und ist er drin dann lassen wir ihn niemals wieder raus...

HappyHippo posted:

Seriously. I mean it's great in many ways, and it's very powerful, but man there are some dumb choices. Another good one: even though LaTeX has a standard convention for commands with arguments (the arguments are in { } braces following the command, eg "\frac{a}{b}") if you want to get an integral (or summation) sign with limits you need to use subscript and superscript. "\int" is the integral sign, "\int_a^b" is an integral from a to b. Why would you do that? It's not like it's taking the integral symbol and putting those superscripts/subscripts, the engine treats this as a special case. I always define my own sensible command so I can type "\intlimits{equation}{lower limit}{upper limit}" like it should have been in the first place.

The "\int_a^b" notation is inherited from base TeX, while "\frac" is LaTeX specific.
Also, "\int_a^b" is not actually a special case; in an inline formula, the limits will be typeset as sub/superscripts, it's only displayed formulas that are treated specially.

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