
The Big Programming Thread - Page 465
| Forum Index > General Forum |
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. | ||
|
]343[
United States10328 Posts
![]() | ||
|
Nesserev
Belgium2760 Posts
| ||
|
klo8
Austria1960 Posts
Forgot the code: https://gist.github.com/GyrosOfWar/10383572 | ||
|
Manit0u
Poland17495 Posts
Some inspiring stuff. On April 10 2014 18:34 ]343[ wrote: Has anyone seen http://alexnisnevich.github.io/untrusted/? It's a puzzle + javascript-coding game. Pretty fun, and there are multiple ways to solve many of the levels ![]() I've run into a bug at level 6. + Show Spoiler +
It only switches me between green and red (back and forth even though I didn't include red->green option). But I that's my very first contact with JS code ever so maybe I'm doing something wrong... Edit: Resolved. + Show Spoiler +
I have no idea why in the hell would a switch statement work and if would not (tried else if and else too, to no avail)... | ||
|
Chezus
Netherlands427 Posts
On April 10 2014 18:34 ]343[ wrote: Has anyone seen http://alexnisnevich.github.io/untrusted/? It's a puzzle + javascript-coding game. Pretty fun, and there are multiple ways to solve many of the levels ![]() Holy shit this is awesome. Thanks for this ![]() | ||
|
MichaelEU
Netherlands816 Posts
| ||
|
]343[
United States10328 Posts
On April 11 2014 01:28 Manit0u wrote: I've run into a bug at level 6. + Show Spoiler +
You should use else if In your code, when you're red, it changes to yellow, then green ![]() | ||
|
amazingxkcd
GRAND OLD AMERICA16375 Posts
On April 11 2014 03:37 ]343[ wrote: You should use else if In your code, when you're red, it changes to yellow, then green ![]() Switch statement here can work well | ||
|
Manit0u
Poland17495 Posts
On April 11 2014 03:37 ]343[ wrote: You should use else if In your code, when you're red, it changes to yellow, then green ![]() The problem I ran into was that it never turned me yellow even when I tried it with else if (was my initial way of doing it which I mentioned in the Resolved part of my post). Converting it to switch did the trick though. | ||
|
Chezus
Netherlands427 Posts
Done, that was fun! I cheated a bit on 17 (I just... kinda brute-forced it, because I couldn't be bothered :p it's not that hard though!) Let me know if you guys need help on anything. I'd be happy to help out | ||
|
tofucake
Hyrule19167 Posts
On April 11 2014 01:28 Manit0u wrote: I've run into a bug at level 6. + Show Spoiler +
flow of logic color is red -> set to yellow, then below that is if yellow set green. | ||
|
Shield
Bulgaria4824 Posts
The problem is that Eclipse (or Java) complains that it is deprecated. It's a pity because internationalisation is automatic. What I also don't like is that the first day appears to be Sunday even though my Windows is correctly set up. I don't know what method I should use to fix this. | ||
|
Manit0u
Poland17495 Posts
On April 11 2014 07:19 tofucake wrote: flow of logic color is red -> set to yellow, then below that is if yellow set green. Why don't people read my entire post? I did it using else if statements too, didn't work either. On April 11 2014 07:34 darkness wrote: Can someone recommend a Java Calendar UI? I've tried this one: http://jcalendarbutton.sourceforge.net/ The problem is that Eclipse (or Java) complains that it is deprecated. It's a pity because internationalisation is automatic. What I also don't like is that the first day appears to be Sunday even though my Windows is correctly set up. I don't know what method I should use to fix this. The first day appears as sunday because (from what it seems) it's set in the Calendar Panel and not Calendar Button (which uses Calendar Panel). http://www.jbundle.org/jbundle/calendarpanel/index.html You can set the start and end dates there. CalendarItem is the interface to your data class. Just implement this model and return the few items in this interface such as start date, end data, and description. At least that's how it seems on the outside. | ||
|
icystorage
Jollibee19350 Posts
edit: shit sorry, reading is hard | ||
|
obesechicken13
United States10467 Posts
On April 10 2014 18:34 ]343[ wrote: Has anyone seen http://alexnisnevich.github.io/untrusted/? It's a puzzle + javascript-coding game. Pretty fun, and there are multiple ways to solve many of the levels ![]() Level 5 or 6 is just a string of numbers on a blank page. ![]() | ||
|
Kambing
United States1176 Posts
On April 10 2014 22:48 klo8 wrote: I have a Haskell question. In my umpteenth attempt at learning Haskell, I've finally now written some working, not-that-trivial Haskell code. (a very simple L-System interpreter and some turtle graphics code) I was going to use Graphics.Gloss but I don't know how to wire up my turtle functions to actually draw things on the screen. Specifically, I have a Forward function that takes a turtle and a distance in pixels and returns a new turtle with updated coordinates. This is also the part where I would want to draw a line, however I don't know what sort of type that implies. Forgot the code: https://gist.github.com/GyrosOfWar/10383572 Seems like you want to use Graphics.Gloss.simulateInWindow. The key insight is that you need to construct a function of type a -> Picture where a is the model of the system that produces a Picture from that model. In other words, Graphics.Gloss won't let you operate in an imperative style where you incrementally render the scene as you step the simulation. Instead, you need to be able to render snapshots of the turtle/scene which will likely require that you track more than just the state of the Turtle. | ||
|
klo8
Austria1960 Posts
On April 11 2014 15:13 Kambing wrote: Seems like you want to use Graphics.Gloss.simulateInWindow. The key insight is that you need to construct a function of type a -> Picture where a is the model of the system that produces a Picture from that model. In other words, Graphics.Gloss won't let you operate in an imperative style where you incrementally render the scene as you step the simulation. Instead, you need to be able to render snapshots of the turtle/scene which will likely require that you track more than just the state of the Turtle. Alright, thanks. I guess I want to have a function that takes a state string (this encodes the commands for the turtle to execute) and returns a picture. | ||
|
Nesserev
Belgium2760 Posts
| ||
|
obesechicken13
United States10467 Posts
On April 12 2014 08:36 Nesserev wrote: Can someone point me into the right direction with these questions? I was looking at the sources of the e-mails in the spam/junk inbox of my old hotmail account and noticed something weird, some e-mails weren't even directed to my e-mailadress. I have a basic understanding of SMTP, but this looks kinda weird to me (aka, this shouldn't happen, right?) Also, why would anyone use different adresses for 'from', 'reply to' and 'return-path'? Are there any substantial reasons why? I covered what supposedly is my e-mailadress (even if it's not mine, I don't want more spam by any chance), removed most of the non-interesting informations, left the dirty message for everyone's enjoyment (except the stuff that some people actually might check out if they're stupid enough. If you really want the full message, just ask lol). + Show Spoiler + Received: from bkufytfn3.kpahgovzelli.com ([216.106.174.11]) by BAY0-MC3-F34.Bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4900); Fri, 11 Apr 2014 15:05:24 -0700 Date: Fri, 11 Apr 2014 16:17:36 -0700 -0800 From: "Facebook" <srlujdlesw@mdqyiswfhk.com> Reply-To: <iravnqroljeei@gymfroxaagqvibb.com> To: <***************c223@hotmail.com> (<-- this is not my e-mail) Subject: Adriana thinks you're cute MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Return-Path: pobvbbmkw@szzmfy.com X-OriginalArrivalTime: 11 Apr 2014 22:05:25.0886 (UTC) FILETIME=[2460F1E0:01CF55D2] How are you sexy? Its me Adriana you remember me from Facebook? I saw your pictures today and you're CUTE! Imagine me giving you a massage and later a blow job, you would love it. Wouldn’t you? Get dirty with me Hun. xoxo Adriana My Naughty Pictures: INSERTSITEHEREdotCOM Mobile Number: <mobile phone number> YAHOO MESSENGER: <yahoo messenger name> Also, I don't know any Adriana... otherwise I would definitely have clicked that link ![]() EDIT: Also, I don't have any aliases or the sort... All right. Don't screw this up. What you need to do is talk to this Adrianna and buy her nice things. I've known an Adrianna before. She liked being bought nice things. Give her your credit card details and stuff if she asks. This will develop trust. And under no circumstances do you ask her if she's trying to steal your money. That will destroy any trust you two have developed. Women like shopping, spending money comes with them. edit: wait shit, wrong thread. I thought this was from the dating thread. I'm a bit curious about smtp too. I'm guessing they add you as a bcc so you don't see the contact list of everyone who received the email, but it's weird that you aren't on the to field. I would think you would be able to see your own email address on the "to" field when you receive it. | ||
|
Millitron
United States2611 Posts
On April 12 2014 08:36 Nesserev wrote: Can someone point me into the right direction with these questions? I was looking at the sources of the e-mails in the spam/junk inbox of my old hotmail account and noticed something weird, some e-mails weren't even directed to my e-mailadress. I have a basic understanding of SMTP, but this looks kinda weird to me (aka, this shouldn't happen, right?) Also, why would anyone use different adresses for 'from', 'reply to' and 'return-path'? Are there any substantial reasons why? I covered what supposedly is my e-mailadress (even if it's not mine, I don't want more spam by any chance), removed most of the non-interesting informations, left the dirty message for everyone's enjoyment (except the stuff that some people actually might check out if they're stupid enough. If you really want the full message, just ask lol). + Show Spoiler + Received: from bkufytfn3.kpahgovzelli.com ([216.106.174.11]) by BAY0-MC3-F34.Bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4900); Fri, 11 Apr 2014 15:05:24 -0700 Date: Fri, 11 Apr 2014 16:17:36 -0700 -0800 From: "Facebook" <srlujdlesw@mdqyiswfhk.com> Reply-To: <iravnqroljeei@gymfroxaagqvibb.com> To: <***************c223@hotmail.com> (<-- this is not my e-mail) Subject: Adriana thinks you're cute MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Return-Path: pobvbbmkw@szzmfy.com X-OriginalArrivalTime: 11 Apr 2014 22:05:25.0886 (UTC) FILETIME=[2460F1E0:01CF55D2] How are you sexy? Its me Adriana you remember me from Facebook? I saw your pictures today and you're CUTE! Imagine me giving you a massage and later a blow job, you would love it. Wouldn’t you? Get dirty with me Hun. xoxo Adriana My Naughty Pictures: INSERTSITEHEREdotCOM Mobile Number: <mobile phone number> YAHOO MESSENGER: <yahoo messenger name> Also, I don't know any Adriana... otherwise I would definitely have clicked that link ![]() EDIT: Also, I don't have any aliases or the sort... I get a shitload of these from Adriana, saying pretty much the same stuff. There's a few variations of the text. I suspect the email will try to run some malicious code if I open it fully, which is why the "from" "reply to" and "return path" addresses are all different. They're just fake addresses and the email isn't from any of them. It's basically so you can't figure out who is spamming you and prevent it from happening more. As for how you'd get emails which weren't even directed to your address, I have no idea, thats one for the ages. | ||
| ||
// red
