As was foretold, we've added advertisements to the forums! If you have questions, or if you encounter any bugs, please visit this thread: https://forums.penny-arcade.com/discussion/240191/forum-advertisement-faq-and-reports-thread/
We're funding a new Acquisitions Incorporated series on Kickstarter right now! Check it out at https://www.kickstarter.com/projects/pennyarcade/acquisitions-incorporated-the-series-2

[Programming] Thread: Turning off the LAMP stack for mood lighting

11819212324100

Posts

  • PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    Ethea wrote: »
    Echo wrote: »
    Ethea wrote: »
    Well technically carriage returns and new lines aren't whitespace so you could squeeze those.

    That's what strip and chomp are for.

    chomp and strip doesn't remove multiple carriage /new lines from a middle of a string, therefore squeeze is needed!


    I am being sarcastic.

    Ah, but how does it handle crlf pairs?

  • Ed GrubermanEd Gruberman Registered User regular
    I think my original question got lost in the fact that my office uses Cygwin so I figured I would repost. If you were left with a blank screen and no tasks, can anyone suggest a good way to learn shell scripting and using SQL? I'be been going through some online tutorials but they don't seem particularly robust and I was curious if anyone knew of a better way.

    steam_sig.png

    SteamID: edgruberman GOG Galaxy: EdGruberman
  • PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    Jimmy King wrote: »
    Phyphor wrote: »
    ... and maybe I should include a login system and a whole administration system built on a flat file database...
    Do it.

    I built a web based knowledgebase thing once for a helpdesk, used in production, which used system calls out to grep to search through text files in directories as its "database". It was also cgi written in tcl which took the cgi input from apache on stdin, passed that into a .csh script, which started the tcl interpreter and passed in the cgi params. It used mod_auth_ldap to authenticate against a windows domain.

    It was amazing
    that it worked.
    class SQXMLDB;
    

    It begins

  • EchoEcho ski-bap ba-dapModerator mod
    ...I kind of forgot what the original purpose was for what Phyphor is doing. 8->

  • DehumanizedDehumanized Registered User regular
    Echo wrote: »
    ...I kind of forgot what the original purpose was for what Phyphor is doing. 8->
    return random(2);
    

    bowen
  • gjaustingjaustin Registered User regular
    Echo wrote: »
    ...I kind of forgot what the original purpose was for what Phyphor is doing. 8->
    return random(2);
    
    return DateTime.Now.Ticks % 2 == 0 ? "Yup" : "Nope";
    

  • InfidelInfidel Heretic Registered User regular
    gjaustin wrote: »
    Echo wrote: »
    ...I kind of forgot what the original purpose was for what Phyphor is doing. 8->
    return random(2);
    
    return DateTime.Now.Ticks % 2 == 0 ? "Yup" : "Nope";
    

    Always returns Yup. :rotate:

    OrokosPA.png
  • gjaustingjaustin Registered User regular
    Infidel wrote: »
    gjaustin wrote: »
    Echo wrote: »
    ...I kind of forgot what the original purpose was for what Phyphor is doing. 8->
    return random(2);
    
    return DateTime.Now.Ticks % 2 == 0 ? "Yup" : "Nope";
    

    Always returns Yup. :rotate:

    Clearly I did something dumb. Care to point it out to me?

  • bowenbowen How you doin'? Registered User regular
    Java integer division and rounding maybe?

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • gjaustingjaustin Registered User regular
    bowen wrote: »
    Java integer division and rounding maybe?

    It's intended as C#, so that can't be it.

  • InfidelInfidel Heretic Registered User regular
    edited May 2013
    DateTime.Now's resolution is coarser than Tick resolution by an even multiplier.

    e.g. DateTime will increment in say multiples of 100 and always be even.

    Infidel on
    OrokosPA.png
    Delmain
  • bowenbowen How you doin'? Registered User regular
    Interesting!

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • gjaustingjaustin Registered User regular
    Infidel wrote: »
    DateTime.Now's resolution is coarser than Tick resolution by an even multiplier.

    e.g. DateTime will increment in say multiples of 100 and always be even.

    Huh, that's pretty cool. I did not know that.

    I guess it should be DateTime.Now.Millisecond instead.

  • urahonkyurahonky Registered User regular
    I think my original question got lost in the fact that my office uses Cygwin so I figured I would repost. If you were left with a blank screen and no tasks, can anyone suggest a good way to learn shell scripting and using SQL? I'be been going through some online tutorials but they don't seem particularly robust and I was curious if anyone knew of a better way.

    Sorry I wish I could help, sir.

  • InfidelInfidel Heretic Registered User regular
    gjaustin wrote: »
    Infidel wrote: »
    DateTime.Now's resolution is coarser than Tick resolution by an even multiplier.

    e.g. DateTime will increment in say multiples of 100 and always be even.

    Huh, that's pretty cool. I did not know that.

    I guess it should be DateTime.Now.Millisecond instead.

    Yeah, I would expect that to be even/odd more at random.

    OrokosPA.png
  • TofystedethTofystedeth Registered User regular
    I know the requirements it should only have two possible values, but I feel there should be a commented out, or stub implementation or something of a troolean.

    A suitably enterprisey one.

    steam_sig.png
  • gjaustingjaustin Registered User regular
    edited May 2013
    I know the requirements it should only have two possible values, but I feel there should be a commented out, or stub implementation or something of a troolean.

    A suitably enterprisey one.
    int number = random(2);
    if (number == 0)
    {
        return "Ja";
    }
    else if (number == 1)
    {
        return "Nein";
    }
    else
    {
        // The D stands for Das
        return "WDF";
    }
    

    gjaustin on
    Tofystedeth
  • bowenbowen How you doin'? Registered User regular
    Hmm, I don't think das is right?

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • bowenbowen How you doin'? Registered User regular
    isn't it wv? (no idea on the capitalization of those words)

    I know german doesn't necessarily distinguish vulgarities, so shit means fuck means damned or something like that. Man I really should get back into learning that.

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • gjaustingjaustin Registered User regular
    edited May 2013
    bowen wrote: »
    Hmm, I don't think das is right?

    Yeah, I might have the gender wrong and it might be der or die. But I'm not exactly going to Google "gender of German equivalent of f***" at work...

    I can imagine the discussion with my boss now...

    gjaustin on
  • PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    edited May 2013
    Echo wrote: »
    ...I kind of forgot what the original purpose was for what Phyphor is doing. 8->

    I'm trying to create a program that produces yes or no.

    I need to generate good random numbers, so I've used a theoretically hard problem to help me do this - the Halting Problem
    I need an interface so people can click and get their answers and since everything these days is web-based I need a web server
    Web servers need administration. Plus trying to solve the halting problem can be processor intensive so I need a way to configure the Decision Server
    We need security and auditing too, so there must be a login system
    Logins require a database
    It must be enterprisey, so therefore, XML database!

    Phyphor on
    gjaustinASimPerson
  • bowenbowen How you doin'? Registered User regular
    I think it's WZV if you're doing a literal translation straight through?

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • gjaustingjaustin Registered User regular
    bowen wrote: »
    I think it's WZV if you're doing a literal translation straight through?

    What does the Z stand for?

  • PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    edited May 2013
    If I run out of things to do, I'm also considering an "automatic" mode where you speak your question out loud, I then do speech-to-text, detect if it's a question and then provide a yes/no answer

    Phyphor on
  • ecco the dolphinecco the dolphin Registered User regular
    Phyphor wrote: »
    If I run out of things to do, I'm also considering an "automatic" mode where you speak your question out loud, I then do speech-to-text, detect if it's a question and then provide a yes/no answer

    Needs to do text to speech as well

    "Yes"

    "No"

    "Yes"

    "Yes"

    "No"

    "I'm sorry Phyphor, I can't let you do that."

    Penny Arcade Developers at PADev.net.
  • InfidelInfidel Heretic Registered User regular
    Hahahaha, this amuses me for some reason.

    http://www.wasteaguid.info/

    Was having a discussion on GUIDs this afternoon...

    OrokosPA.png
    Tofystedethbowen
  • bowenbowen How you doin'? Registered User regular
    gjaustin wrote: »
    bowen wrote: »
    I think it's WZV if you're doing a literal translation straight through?

    What does the Z stand for?

    zum I think? Zu + dem ("nounless"???)

    My german is really rusty as I spent some time on rosetta and some internet shits.

    @echo might know more being from that general area

    not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
  • SmasherSmasher Starting to get dizzy Registered User regular
    Infidel wrote: »
    Hahahaha, this amuses me for some reason.

    http://www.wasteaguid.info/

    Was having a discussion on GUIDs this afternoon...
    I wonder if they've ever gotten any angry emails about that site.

    bowen
  • InfidelInfidel Heretic Registered User regular
    Smasher wrote: »
    Infidel wrote: »
    Hahahaha, this amuses me for some reason.

    http://www.wasteaguid.info/

    Was having a discussion on GUIDs this afternoon...
    I wonder if they've ever gotten any angry emails about that site.

    God, I hope so!

    OrokosPA.png
  • PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    Holding F5 on that page is fun!

  • PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    Phyphor wrote: »
    If I run out of things to do, I'm also considering an "automatic" mode where you speak your question out loud, I then do speech-to-text, detect if it's a question and then provide a yes/no answer

    Needs to do text to speech as well

    "Yes"

    "No"

    "Yes"

    "Yes"

    "No"

    "I'm sorry Phyphor, I can't let you do that."

    Yes it will also do it's output in audio... and some of the time it will show "yes" and say "no"

  • ecco the dolphinecco the dolphin Registered User regular
    Will it sometimes let out a tortured "Whhhhhyyyyyyyyyyyyyyyyyy?"

    Penny Arcade Developers at PADev.net.
  • PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    If I can convince the google apis to do that, then sure!

  • gjaustingjaustin Registered User regular
    bowen wrote: »
    gjaustin wrote: »
    bowen wrote: »
    I think it's WZV if you're doing a literal translation straight through?

    What does the Z stand for?

    zum I think? Zu + dem ("nounless"???)

    My german is really rusty as I spent some time on rosetta and some internet shits.

    @echo might know more being from that general area

    You're over thinking this. Think Das Boot and you're good to go.

    And Google tells me that zu means "to". Zum is the masculine equivalent of that.

  • ecco the dolphinecco the dolphin Registered User regular
    Well this is... sub optimal.

    I think... that this DMA unit needs source/destination addresses to be 32-byte aligned, not just word aligned, as claimed in its reference manual.

    This is very awkward.

    If true, I am going to end something.

    Perhaps the day. Or even the week.

    Feck it.

    I might even end the month.

    If you guys hit next month in the next day or two, you'll know what happened.

    Penny Arcade Developers at PADev.net.
    bowen
  • PhyphorPhyphor Building Planet Busters Tasting FruitRegistered User regular
    edited May 2013
    Pfft so you just do a manual copy of just about everything? Performance, who needs it?

    Phyphor on
  • SmasherSmasher Starting to get dizzy Registered User regular
    Phyphor wrote: »
    Phyphor wrote: »
    If I run out of things to do, I'm also considering an "automatic" mode where you speak your question out loud, I then do speech-to-text, detect if it's a question and then provide a yes/no answer

    Needs to do text to speech as well

    "Yes"

    "No"

    "Yes"

    "Yes"

    "No"

    "I'm sorry Phyphor, I can't let you do that."

    Yes it will also do it's output in audio... and some of the time it will show "yes" and say "no"
    Make sure to throw in some recursive translation in there to truly reflect the international nature of Enterprise quality business.

    Of course you'll have to randomly select the chain of languages you use...

  • ecco the dolphinecco the dolphin Registered User regular
    Phyphor wrote: »
    Pfft so you just do a manual copy of just about everything? Performance, who needs it?

    This has actually triggered my trap card, which I planned a while back just in case something like this happened.

    Luckily, this is only for memory copies between an external peripheral FIFO and a processor - so what I can do is just perform non-burst word copies with the DMA until I hit 32-byte memory alignment on the processor, and then burst afterwards.

    Penny Arcade Developers at PADev.net.
  • Monkey Ball WarriorMonkey Ball Warrior A collection of mediocre hats Seattle, WARegistered User regular
    edited May 2013
    Exceptions: Bad idea or good idea? It came up in the comments of this article about how go is totally awesome. Someone mentioned that they couldn't use a language that didn't support exceptions. Go uses a primitive error code type and something called panic/defer/recover, that actually works kind of like exceptions. If something terrible happens you can panic, and then anything you've defered gets run as the stack unwinds, and if one of those is a "recover" you can handle the panic.

    Maybe I'm just biased against exceptions because of how much wrangling you have to do with them in Java and C#. We actually never use them at work in our C++ code that I'm aware of, though I'm pretty sure C++ does have exceptions.

    Monkey Ball Warrior on
    "I resent the entire notion of a body as an ante and then raise you a generalized dissatisfaction with physicality itself" -- Tycho
  • EndEnd Registered User regular
    when you get right down to it, ecco's frustrations are the only reason the calender even works

    I wish that someway, somehow, that I could save every one of us
    zaleiria-by-lexxy-sig.jpgsteam~tinythumb.png
    bowen
This discussion has been closed.