• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 22:35
CET 04:35
KST 12:35
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
RSL Season 3 - Playoffs Preview0RSL Season 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2TL.net Map Contest #21: Winners12Intel X Team Liquid Seoul event: Showmatches and Meet the Pros10
Community News
Weekly Cups (Nov 24-30): MaxPax, Clem, herO win2BGE Stara Zagora 2026 announced15[BSL21] Ro.16 Group Stage (C->B->A->D)4Weekly Cups (Nov 17-23): Solar, MaxPax, Clem win3RSL Season 3: RO16 results & RO8 bracket13
StarCraft 2
General
Chinese SC2 server to reopen; live all-star event in Hangzhou Maestros of the Game: Live Finals Preview (RO4) BGE Stara Zagora 2026 announced Weekly Cups (Nov 24-30): MaxPax, Clem, herO win SC2 Proleague Discontinued; SKT, KT, SGK, CJ disband
Tourneys
StarCraft Evolution League (SC Evo Biweekly) RSL Offline Finals Info - Dec 13 and 14! RSL Offline FInals Sea Duckling Open (Global, Bronze-Diamond) $5,000+ WardiTV 2025 Championship
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 502 Negative Reinforcement Mutation # 501 Price of Progress Mutation # 500 Fright night Mutation # 499 Chilling Adaptation
Brood War
General
BW General Discussion Which season is the best in ASL? Data analysis on 70 million replays BGH Auto Balance -> http://bghmmr.eu/ [ASL20] Ask the mapmakers — Drop your questions
Tourneys
[BSL21] RO16 Group D - Sunday 21:00 CET [BSL21] RO16 Group A - Saturday 21:00 CET [Megathread] Daily Proleagues [BSL21] RO16 Group B - Sunday 21:00 CET
Strategy
Current Meta Game Theory for Starcraft How to stay on top of macro? PvZ map balance
Other Games
General Games
ZeroSpace Megathread Stormgate/Frost Giant Megathread Nintendo Switch Thread The Perfect Game Path of Exile
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
Mafia Game Mode Feedback/Ideas TL Mafia Community Thread
Community
General
Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread US Politics Mega-thread The Big Programming Thread Artificial Intelligence Thread
Fan Clubs
White-Ra Fan Club
Media & Entertainment
[Manga] One Piece Movie Discussion! Anime Discussion Thread
Sports
2024 - 2026 Football Thread Formula 1 Discussion NBA General Discussion
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
Where to ask questions and add stream? The Automated Ban List
Blogs
James Bond movies ranking - pa…
Topin
Esports Earnings: Bigger Pri…
TrAiDoS
Thanks for the RSL
Hildegard
Saturation point
Uldridge
Customize Sidebar...

Website Feedback

Closed Threads



Active: 2001 users

The Big Programming Thread - Page 495

Forum Index > General Forum
Post a Reply
Prev 1 493 494 495 496 497 1032 Next
Thread Rules
1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution.
2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20)
3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible.
4. Use [code] tags to format code blocks.
CatNzHat
Profile Blog Joined February 2011
United States1599 Posts
June 29 2014 08:18 GMT
#9881
On June 26 2014 09:30 billy5000 wrote:
Are there numerous, practical use of closures? In a broad sense, it seems to allow functions hold some "state" but I haven't come across a time when I would use it, ever. It seems like I'm on the lookout to avoid it rather than to actually use it. I may be exaggerating a bit when I say that since all you have to do is create a private function, or an anonymous function that takes the outer function's variables as arguments instead.

When working in Javascript, where you have no class keyword and no namespace functionality built in, you can use closures to create private namespace for 'classes' (instantiated objects). The 'module' pattern is a good example, do some googling and you'll find all the awesome stuff you can do with closure.
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
June 29 2014 11:02 GMT
#9882
Anyone with a good amount of TDD experience? How do you go about writing a piece of code test-first when you don't know the result?

Specifically, I want to calculate a list of all possible ways to split a given number between 0 and x (x is usually 13 or 14) into 7 numbers between 0 and 4 that sum up to x. The order of these 7 numbers is not important, so the numbers should be sorted. So for example with x = 3:
(3,0,0,0,0,0,0)
(2,1,0,0,0,0,0)
(1,1,1,0,0,0,0)

Now this is not the first time I'm writing this algorithm, so I know what the code should do. But I want so practice TDD and I'm not sure how I would go about testing this. Every approach I can think of either feels like it doesn't test enough or tests way too much.
Maybe I can find a better approach if I generalize the seemingly arbitrary limits of 13/14 and 7 (they do make sense in the context of the algorithm, which is analysis of Honor tiles in Mahjong hands).

Even worse, it's concievable that I would only want to return the length of these lists. That yields a series of numbers that look kinda regular for a while but then the limit of 7 kicks in and things get messy. In this case I really don't have a lot of ways to test the result aside from checking a few manually counted values. But those numbers get fairly large, and I also have a similar but more difficult problem that yields much larger numbers and is extremely susceptible to mistakes when counting manually.


Again, I know what an algorithm for this problem looks like, but I don't know how to develop such an algorithm test-first.
If you have a good reason to disagree with the above, please tell me. Thank you.
urboss
Profile Joined September 2013
Austria1223 Posts
June 29 2014 11:43 GMT
#9883
The test is passed if these conditions are fulfilled:
- All vectors are unique
- All vectors have a length of n (=7)
- The sum of each vector equals x
- The number of vectors equals the expected number (based on the combinatorics formula)
supereddie
Profile Joined March 2011
Netherlands151 Posts
June 29 2014 11:49 GMT
#9884
On June 29 2014 20:02 spinesheath wrote:
Anyone with a good amount of TDD experience? How do you go about writing a piece of code test-first when you don't know the result?

You know the result (or can infer it) because you need to write code.

On June 29 2014 20:02 spinesheath wrote:
Specifically, I want to calculate a list of all possible ways to split a given number between 0 and x (x is usually 13 or 14) into 7 numbers between 0 and 4 that sum up to x. The order of these 7 numbers is not important, so the numbers should be sorted.

The order is not important, therefore they must be sorted? So the order is important...

On June 29 2014 20:02 spinesheath wrote:
So for example with x = 3:
(3,0,0,0,0,0,0)
(2,1,0,0,0,0,0)
(1,1,1,0,0,0,0)

There you go. Your first test case. But maybe start with x=1 to make it easier?

On June 29 2014 20:02 spinesheath wrote:
Now this is not the first time I'm writing this algorithm, so I know what the code should do. But I want so practice TDD and I'm not sure how I would go about testing this. Every approach I can think of either feels like it doesn't test enough or tests way too much.
Maybe I can find a better approach if I generalize the seemingly arbitrary limits of 13/14 and 7 (they do make sense in the context of the algorithm, which is analysis of Honor tiles in Mahjong hands).

Yes, generalizing seems like a better idea. Have the limits injected in some form to the algorithm and adjust the algorithm accoringly.

On June 29 2014 20:02 spinesheath wrote:
Even worse, it's concievable that I would only want to return the length of these lists. That yields a series of numbers that look kinda regular for a while but then the limit of 7 kicks in and things get messy. In this case I really don't have a lot of ways to test the result aside from checking a few manually counted values. But those numbers get fairly large, and I also have a similar but more difficult problem that yields much larger numbers and is extremely susceptible to mistakes when counting manually.

Again, I know what an algorithm for this problem looks like, but I don't know how to develop such an algorithm test-first.

Your algorithm should either return a list, or the length. Make your decision before you start coding. Without knowing the context/usage, it look to me that returning a list is the better way to go.
"Do not try to make difficult things possible, but make simple things simple." - David Platt on Software Design
Manit0u
Profile Blog Joined August 2004
Poland17496 Posts
June 29 2014 12:42 GMT
#9885
Checked out Ruby for the first time, done some koans and all I can say is "What sorcery is this?!".
Time is precious. Waste it wisely.
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
June 29 2014 13:47 GMT
#9886
On June 29 2014 20:43 urboss wrote:
The test is passed if these conditions are fulfilled:
- All vectors are unique
- All vectors have a length of n (=7)
- The sum of each vector equals x
- The number of vectors equals the expected number (based on the combinatorics formula)

If I do that for x = 0 through 14, my test will run several seconds. Any of the larger x's will make it run quite a while. If I do it for any of the low numbers, it's trivial.
I don't have the combinatorics formula. It's a rather tough problem to express in a constructive formula because of the n=7 limit.

On June 29 2014 20:49 supereddie wrote:
Show nested quote +
On June 29 2014 20:02 spinesheath wrote:
Specifically, I want to calculate a list of all possible ways to split a given number between 0 and x (x is usually 13 or 14) into 7 numbers between 0 and 4 that sum up to x. The order of these 7 numbers is not important, so the numbers should be sorted.

The order is not important, therefore they must be sorted? So the order is important...

I guess I expressed that badly. I'm not looking for tuples (1, 2, 2, 3, 0, 1, 0), but for multisets {1, 2, 2, 3, 0, 1, 0}. A simple way to work with multisets at this level is to represent them as sorted arrays [0, 0, 1, 1, 2, 2, 3].
On June 29 2014 20:49 supereddie wrote:
Show nested quote +
On June 29 2014 20:02 spinesheath wrote:
So for example with x = 3:
(3,0,0,0,0,0,0)
(2,1,0,0,0,0,0)
(1,1,1,0,0,0,0)

There you go. Your first test case. But maybe start with x=1 to make it easier?

So I do that for x = 1 through 5 or so. The number of list elements, starting at x = 1 is: 1, 2, 3, 5, 7, 11, 15, 21, 28, and at that point I stopped counting them manually. Such a test for x = 3 won't verify the correctness for x = 4 and so on. Only at x = 8 I am finally forced to start considering the n = 7 limit. That's a whole lot of hand-written test values, and who knows if that is enough to reach the point where the code yields the correct result for x = 13.
If you have a good reason to disagree with the above, please tell me. Thank you.
supereddie
Profile Joined March 2011
Netherlands151 Posts
June 29 2014 13:58 GMT
#9887
You only need to prove that the algorithm is correct; there is no need to to check every possible input. So break down your algorithm in smaller pieces that are easier to verify.
"Do not try to make difficult things possible, but make simple things simple." - David Platt on Software Design
berated-
Profile Blog Joined February 2007
United States1134 Posts
June 29 2014 15:23 GMT
#9888
On June 29 2014 15:35 Blisse wrote:
What are your opinions on people saying "work to live but don't live to work" or other shit like "chase your dreams"? Other than that it's fucking stupid that people use these quotes like they know what they mean and so they sound cool and profound,

I find it stupid how many people in tech. get stuck in this hole where they think work should be everything they do, so "work work work side projects side projects side projects hack hack hack" all the fucking time and there's this equal community who never work on side projects and who keep the stupid "work to live but don't live to work" as a personal motto basically. It might be because I'm still in school but it's so annoying to hear how extreme both sides are, especially where some people keep advertising how much they're preparing work and side projects to get better jobs. And I get really upset reading stuff like this because I know people all across the spectrum and when i talk to them they really don't like having these mentalities projected onto them (i.e. expectation of doing lots of side projects if programming isn't the most important thing in their life).


Work life balance is a weird thing, especially in tech where we are always connected -- but my guess is you would find this in any industry. I think you are tad off base when you say that people who work a lot only do so because they feel like that's what they should be doing, though. Some people, including myself, just really enjoy solving problems with code and being good at what we do. Putting in a lot of time and getting recognition for what you do is a great feeling. Having the satisfaction of solving a really hard problem that no one else on your team could solve is a great feeling. Most people who are in the tech industry probably started working in the field before they ever got paid to do so -- so it doesn't feel completely insane that they would continue to enjoy it after they start doing it as a profession.

I personally find that both sides just say these things to rationalize the decisions that they are making. They want to feel justified in leaving after 40 hrs a week when other coworkers are putting in 60-70 hours a week, or in my case, I want to not feel so bad that I spend more time with my company than I do with my wife and kid. I've chosen to work hard, I don't work on side projects but I'm continually working on making myself better for my current job. I am constantly reading new tech books / articles and trying to figure out if there are new languages or approaches our company could be using. In return, I've been treated well by my company and I've quickly risen through the ranks.

Other people that I work with have taken a different approach, they don't care about the job enough (my opinion, not their words) to work extra. In return, they spend more time with their family, and aren't going to be leading the company any time soon. They show up to work each day, do their work, and go home -- and they are fine with that. In the long run, I am too, because it takes people like that to make my company appreciate the work that I do.

Unfortunately for your dislike of the two extremes, I personally believe there isn't really a middle ground between these two: the job where you get to work a straight 40 and you make a lot of money and continually get promotions is a rarity. This is not a statement that those jobs don't exist, just that they aren't normal. You're going to need to decide which path you want to take, and then you can start using the verbiage that makes you feel good about the decision you made just like everyone else .
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
June 30 2014 03:40 GMT
#9889
Yeah, I definitely think it's up to the individual to decide whether what they think is best for them. You shouldn't be forced to go in one direction or the other.

I think I know what you mean by the people who just grow to love solving problems and that's why they push extra hours to get better. I think that's a common occurrence with a lot of people.

My rant was based on those who feel as though they chose the "best" position and openly promote that "don't live to work" idea or the opposite "your job should be your dream". I guess I'm getting a bit jaded thinking that they're idiots in thinking that way and they make people who don't feel the same way feel like shit.

The example I'm referring to (if it makes it clearer) is that: a lot of kids in my program get to go to more well-known companies because they are more involved with side projects and other tech. projects. The same kids then go tell other students how they should live their life, that they should do more side projects like they have done, and they'll be more successful and happier, and while it's valid, it also shits on a lot of people who don't do that because they have other things to do (the group I connect with because I came from that background) in attempt (in my opinion) to elevate themselves above them, and it projects this idea that everyone should be like them and love working. Every time someone posts stuff on the Facebook group or subreddit asking for help, it's always "side projects side projects side projects" rather than helping them decide what extremity is for them. I feel biased, but I really dislike using the extreme verbiage that you "have to do side projects" or that you should not "live to work" that a lot of people I know seem to enjoy using. I especially dislike when they give advice in that same vain as though their experiences are the best way to do it.
There is no one like you in the universe.
Liebig
Profile Joined August 2010
France738 Posts
Last Edited: 2014-06-30 04:11:56
June 30 2014 04:04 GMT
#9890
Reading http://pchiusano.github.io/2014-06-20/simple-debruijn-alternative.html there is something that I don't understand, if anyone proficient in Haskell could explain to me.

I don't understand how this lam function can terminate
lam :: (Expr -> Expr) -> Expr
lam f = Lam n body
where body = f (Var n)
n = maxBV body + 1

bot :: Name
bot = 0

-- Computes the maximum bound variable in the given expression
maxBV :: Expr -> Name
maxBV (Var _) = bot
maxBV (App f a) = maxBV f `max` maxBV a
maxBV (Lam n _) = n


since n makes a call to body, and body makes a call to n.
Nesserev
Profile Blog Joined January 2011
Belgium2760 Posts
June 30 2014 04:56 GMT
#9891
--- Nuked ---
phar
Profile Joined August 2011
United States1080 Posts
June 30 2014 06:21 GMT
#9892
On June 30 2014 12:40 Blisse wrote:
Yeah, I definitely think it's up to the individual to decide whether what they think is best for them. You shouldn't be forced to go in one direction or the other.

I think I know what you mean by the people who just grow to love solving problems and that's why they push extra hours to get better. I think that's a common occurrence with a lot of people.

My rant was based on those who feel as though they chose the "best" position and openly promote that "don't live to work" idea or the opposite "your job should be your dream". I guess I'm getting a bit jaded thinking that they're idiots in thinking that way and they make people who don't feel the same way feel like shit.

The example I'm referring to (if it makes it clearer) is that: a lot of kids in my program get to go to more well-known companies because they are more involved with side projects and other tech. projects. The same kids then go tell other students how they should live their life, that they should do more side projects like they have done, and they'll be more successful and happier, and while it's valid, it also shits on a lot of people who don't do that because they have other things to do (the group I connect with because I came from that background) in attempt (in my opinion) to elevate themselves above them, and it projects this idea that everyone should be like them and love working. Every time someone posts stuff on the Facebook group or subreddit asking for help, it's always "side projects side projects side projects" rather than helping them decide what extremity is for them. I feel biased, but I really dislike using the extreme verbiage that you "have to do side projects" or that you should not "live to work" that a lot of people I know seem to enjoy using. I especially dislike when they give advice in that same vain as though their experiences are the best way to do it.

I work at [well-known company], and not doing side projects is totally fine. Getting in definitely does not require any of that. It does require passing weird interview structures that bear little resemblance to the actual job of software, but that's an entirely different topic of discussion...
Who after all is today speaking about the destruction of the Armenians?
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
June 30 2014 09:24 GMT
#9893
On June 30 2014 15:21 phar wrote:
Show nested quote +
On June 30 2014 12:40 Blisse wrote:
Yeah, I definitely think it's up to the individual to decide whether what they think is best for them. You shouldn't be forced to go in one direction or the other.

I think I know what you mean by the people who just grow to love solving problems and that's why they push extra hours to get better. I think that's a common occurrence with a lot of people.

My rant was based on those who feel as though they chose the "best" position and openly promote that "don't live to work" idea or the opposite "your job should be your dream". I guess I'm getting a bit jaded thinking that they're idiots in thinking that way and they make people who don't feel the same way feel like shit.

The example I'm referring to (if it makes it clearer) is that: a lot of kids in my program get to go to more well-known companies because they are more involved with side projects and other tech. projects. The same kids then go tell other students how they should live their life, that they should do more side projects like they have done, and they'll be more successful and happier, and while it's valid, it also shits on a lot of people who don't do that because they have other things to do (the group I connect with because I came from that background) in attempt (in my opinion) to elevate themselves above them, and it projects this idea that everyone should be like them and love working. Every time someone posts stuff on the Facebook group or subreddit asking for help, it's always "side projects side projects side projects" rather than helping them decide what extremity is for them. I feel biased, but I really dislike using the extreme verbiage that you "have to do side projects" or that you should not "live to work" that a lot of people I know seem to enjoy using. I especially dislike when they give advice in that same vain as though their experiences are the best way to do it.

I work at [well-known company], and not doing side projects is totally fine. Getting in definitely does not require any of that. It does require passing weird interview structures that bear little resemblance to the actual job of software, but that's an entirely different topic of discussion...


I still don't understand why interviewers do that. I don't think it helps them find the best candidate for the actual job.
Beany
Profile Joined September 2010
Netherlands396 Posts
June 30 2014 09:29 GMT
#9894
Hey guys, i'm new in this thread. Please forgive me if i'm posting this in the wrong thread or if i'm too offtopic.

I'm taking care of an e-commerce website, using Magento.
Yesterday i've created a new Storeview for a second language (first being Dutch, second being English).
I've translated all the products and categories. But i couldn't discover how to translate the homepage. Since it's a regular page at the CMS > pages section, i did not know how i could create a good translation magento will use when changing storeview on the frontend.
I've checked up on several google results, but none really talk about how to create a correct homepage translation.
Do any of you know how this works?
Thanks for taking the time reading this
Rejoice, for very bad things are about to happen!
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
June 30 2014 09:44 GMT
#9895
On June 30 2014 15:21 phar wrote:
Show nested quote +
On June 30 2014 12:40 Blisse wrote:
Yeah, I definitely think it's up to the individual to decide whether what they think is best for them. You shouldn't be forced to go in one direction or the other.

I think I know what you mean by the people who just grow to love solving problems and that's why they push extra hours to get better. I think that's a common occurrence with a lot of people.

My rant was based on those who feel as though they chose the "best" position and openly promote that "don't live to work" idea or the opposite "your job should be your dream". I guess I'm getting a bit jaded thinking that they're idiots in thinking that way and they make people who don't feel the same way feel like shit.

The example I'm referring to (if it makes it clearer) is that: a lot of kids in my program get to go to more well-known companies because they are more involved with side projects and other tech. projects. The same kids then go tell other students how they should live their life, that they should do more side projects like they have done, and they'll be more successful and happier, and while it's valid, it also shits on a lot of people who don't do that because they have other things to do (the group I connect with because I came from that background) in attempt (in my opinion) to elevate themselves above them, and it projects this idea that everyone should be like them and love working. Every time someone posts stuff on the Facebook group or subreddit asking for help, it's always "side projects side projects side projects" rather than helping them decide what extremity is for them. I feel biased, but I really dislike using the extreme verbiage that you "have to do side projects" or that you should not "live to work" that a lot of people I know seem to enjoy using. I especially dislike when they give advice in that same vain as though their experiences are the best way to do it.

I work at [well-known company], and not doing side projects is totally fine. Getting in definitely does not require any of that. It does require passing weird interview structures that bear little resemblance to the actual job of software, but that's an entirely different topic of discussion...


I think once you get a couple of decent programming jobs and your resume starts growing, the side project idea doesn't apply, but for new students with little experience I've found that it's all the craze. Without any extracurriculars or job experience, looking for a job doesn't seem that hopeful, which is what I get crossed up with. Yes, I guess it's valid advice to tell people to do the extracurriculars to get better chances of interviewing when applying to jobs, but I'm conflicted about how hard people push others to do this.
There is no one like you in the universe.
Manit0u
Profile Blog Joined August 2004
Poland17496 Posts
July 01 2014 11:24 GMT
#9896
I'm in a bit of a pickle with Twitter Bootstrap...

I have:

<div class="row">
<div class="col-md-4">
<div class="panel">
</div>
</div>
<div class="col-md-4">
<div class="panel">
</div>
</div>
<div class="col-md-4">
<div class="panel">
</div>
</div>
</div>


More or less. This is just for example purposes as nothing else has any bearing on my problem.

The problem:
- panels have varied-height content and I need them all to have the same height (panels, not content, but panels automatically resize to fit content instead of fill available container)
- all columns are of the same size, panels won't resize to fill column no matter what I try (height: 100%, min-height: 100%, min-height: fill-available, etc. etc.)

Any ideas?
Time is precious. Waste it wisely.
Thezzy
Profile Joined October 2010
Netherlands2117 Posts
July 01 2014 11:32 GMT
#9897
Generally if you want to resize different DIVs to have the same width or height (using the highest width/height of the group) you'll have to use Javascript. Both JQuery and Prototype have simple functions that you can call to get the actual height of the element. You can use that to iterate over all your panels, find the one with the highest height and set them all to that.

Height 100% is really tricky on DIV elements, especially floated ones. It might be better let the panel DIV decide the final height via Javascript and have the col-md-4 DIV just wrap around it.
Playing Terran is like flying down a MULE drop in a marine suit, firing a Gauss Rifle
Manit0u
Profile Blog Joined August 2004
Poland17496 Posts
July 01 2014 14:40 GMT
#9898
On July 01 2014 20:32 Thezzy wrote:
Generally if you want to resize different DIVs to have the same width or height (using the highest width/height of the group) you'll have to use Javascript. Both JQuery and Prototype have simple functions that you can call to get the actual height of the element. You can use that to iterate over all your panels, find the one with the highest height and set them all to that.

Height 100% is really tricky on DIV elements, especially floated ones. It might be better let the panel DIV decide the final height via Javascript and have the col-md-4 DIV just wrap around it.


I came to the same conclusion, although I wanted to try pure CSS approach first (since the site I'm working on is already running high on JS I'm trying to cut corners wherever I can).
Time is precious. Waste it wisely.
nunez
Profile Blog Joined February 2011
Norway4003 Posts
Last Edited: 2014-07-01 17:26:48
July 01 2014 17:25 GMT
#9899
been working on an old bison generated parser / flex generated scanner / symbol table / other things class in c++ hastily sown together sometimes in the 90s from an older c implementation.

it's pretty cool to see how general flex / bison was [forced to use old versions](esp flex) only using pre-processor directives, but dam... looking at un-indented, and un-indented, generated code, where every identifier might possibly be #undefined and #defined to be half a static yysausage or similar, and behind every #ifdef MANUALLY_COMPILED_IN_LATE_1980S #else #endif is a goto yysausagefactory; is rough!

ah, relief.
conspired against by a confederacy of dunces.
freelander
Profile Blog Joined December 2004
Hungary4707 Posts
July 01 2014 17:59 GMT
#9900
On July 02 2014 02:25 nunez wrote:
been working on an old bison generated parser / flex generated scanner / symbol table / other things class in c++ hastily sown together sometimes in the 90s from an older c implementation.

it's pretty cool to see how general flex / bison was [forced to use old versions](esp flex) only using pre-processor directives, but dam... looking at un-indented, and un-indented, generated code, where every identifier might possibly be #undefined and #defined to be half a static yysausage or similar, and behind every #ifdef MANUALLY_COMPILED_IN_LATE_1980S #else #endif is a goto yysausagefactory; is rough!

ah, relief.


what does it parse?

I took a class on compilers this semester, so I got to know bison and flex little bit. I made a compiler for a little language, I can't even imagine how messy the generated bison code for a real language might look like hehe.
And all is illuminated.
Prev 1 493 494 495 496 497 1032 Next
Please log in or register to reply.
Live Events Refresh
Replay Cast
00:00
WardiTV Mondays #62
CranKy Ducklings144
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Nathanias 151
RuFF_SC2 118
StarCraft: Brood War
Artosis 765
Tasteless 87
Bale 81
Shine 60
Icarus 7
Dota 2
monkeys_forever846
NeuroSwarm143
League of Legends
JimRising 620
Counter-Strike
Coldzera 1271
Fnx 217
Other Games
summit1g13722
tarik_tv4987
shahzam477
C9.Mang0321
ViBE141
Mew2King99
ToD29
CosmosSc2 22
Organizations
Other Games
gamesdonequick1054
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 13 non-featured ]
StarCraft 2
• Hupsaiya 94
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• RayReign 22
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Doublelift4595
Upcoming Events
The PondCast
6h 25m
OSC
12h 25m
Demi vs Mixu
Nicoract vs TBD
Babymarine vs MindelVK
ForJumy vs TBD
Shameless vs Percival
Replay Cast
20h 25m
Korean StarCraft League
1d 23h
CranKy Ducklings
2 days
WardiTV 2025
2 days
SC Evo League
2 days
BSL 21
2 days
Sziky vs OyAji
Gypsy vs eOnzErG
OSC
2 days
Solar vs Creator
ByuN vs Gerald
Percival vs Babymarine
Moja vs Krystianer
EnDerr vs ForJumy
sebesdes vs Nicoract
Sparkling Tuna Cup
3 days
[ Show More ]
WardiTV 2025
3 days
OSC
3 days
BSL 21
3 days
Bonyth vs StRyKeR
Tarson vs Dandy
Replay Cast
4 days
Wardi Open
4 days
StarCraft2.fi
4 days
Monday Night Weeklies
4 days
Replay Cast
4 days
WardiTV 2025
5 days
StarCraft2.fi
5 days
PiGosaur Monday
5 days
StarCraft2.fi
6 days
Tenacious Turtle Tussle
6 days
Liquipedia Results

Completed

Proleague 2025-11-30
RSL Revival: Season 3
Light HT

Ongoing

C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
YSL S2
BSL Season 21
CSCL: Masked Kings S3
Slon Tour Season 2
Acropolis #4 - TS3
META Madness #9
SL Budapest Major 2025
ESL Impact League Season 8
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2

Upcoming

BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
Bellum Gens Elite Stara Zagora 2026
HSC XXVIII
RSL Offline Finals
WardiTV 2025
Kuram Kup
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual
eXTREMESLAND 2025
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2025 TLnet. All Rights Reserved.