« first day (2115 days earlier)      last day (2854 days later) » 

8:00 PM
that's why ToDo calls need to have a set location.
 
Thinking of amount, one might also want to return less than amount if they have it. Just buy however much they have
 
but then the unused milk will run self.expire() and just waste fridge space.
and if the wife never calls the garbage collector, it's just going to use up all the space.
 
No , what I mean is : you have to buy 3 bottles, but they only have 2 at the store
 
that is true.
 
Dev
I see Python code.
 
8:06 PM
just call buyMilk from within itself, with amount subtracted by 1.
try/except it.
 
Dev
Right, so people completely ignore me when I talk
Good logic.
._.
 
hi.
 
Dev
hi.
 
yes, we're discussing python code like bored coders.
 
Dev
I'm a bored coder too
 
8:07 PM
someone posted a joke that was programmer-related, and we decided to improve it and make it work as expected
And then optimize it!
 
Dev
LMAO
 
scroll back through. kind of a fun discussion
 
Dev
#PythonMasterRace?
 
hello
 
Dev
lol
hello
"while you're out, buy some milk"
Infinite loop.

He never comes back.
lol
 
8:09 PM
lol
 
Dev
codementors is slow
 
finally got to the book chapter about shell scripts
 
Dev
eh
 
let's try to write this entire thing in java.
 
kind of disappointed that true=0 and false=1 :/
 
Dev
8:10 PM
lol
idk
 
#python_master_race
 
doesn't it bother anyone else? lol
 
Dev
#PythonMasterRace
#UbuntuMasterRace
 
I mean, I understand that a program that worked returns 0, but its so weird
 
Dev
Somebody star those 2 messages lol
 
8:12 PM
def buy_milk( amount ):
   if store.num_items(milk) >= 1 and\
      self.money >= store.get_item_price(milk)*amount:
       if store.get_item_count(milk) > amount :
           return store.purchase(milk,amount)
       else:
           return store.purchase(milk,store.get_item_count(milk))
 
Dev
while True:
milk.buy()

He never comes back.
Oh, and python probably crashes.
lol
 
@KazWolfe why write it in Java , if python can do it just as well, and maybe even faster
 
Dev
Write it in Jabba instead
 
kek, no !
 
Dev
Kek
 
8:14 PM
The least I can agree to , is to write it in bash . . . .maybe in C. . . .
 
Dev
Write it in Python
 
I did !
Scroll up
 
so much memes in the past 15 mins
 
much memes, so fast, wow
^ here's one more for ya
 
Dev
8:19 PM
so much 15 mins in the past memes
send another
pls
 
Not a meme, but shtis one is funny
 
Dev
lmfao
 
programmer.getToDo().addItem(Location.ANYWHERE, () -> {programmer.moveTo(Location.SUPERMARKET);});
programmer.getToDo().addItem(Location.SUPERMARKET, (quantity) -> {
    // Get the price and inventory from the Economy.
    double price = Economy.getStore(Store.SUPERMARKET).getPrice(ItemClass.MILK);
    int milkInv = Economy.getInventory(Store.SUPERMARKET).count();

    if (programmer.getMoney() >= price * quantity) {
        Item milk = Economy.buy(ItemClass.MILK, ((milkInv >= quantity) ? quantity : milkInv));
 
WTF ?
 
Dev
lmfao
what does -> do in python
 
8:21 PM
this is nowhere close to python
 
Dev
oh
nvm it's java
right?
 
yep
 
Dev
ah ok
 
(note that this assumes that the programmer does not have an inventory where he can hold items while he's completing other tasks in that session)
 
Dev
lol
lol
 
8:24 PM
.
@Serg
 
Dev
why
XD
 
@KazWolfe his hands could be intentory. Carrying grocery bags isn't that uncommon. In that case, though, you'd need to consider his physical strength and amount of stuff in hands . Probably a boolean canHoldMore
 
and other tasks
 
yeah
 
Dev
or an integer representing the max items he can hold
in one hand
 
8:25 PM
i'll assume ToDo handles all of this stuff and overrides Home to be the inventory to head home.
 
all this glorious code needs to live in a git repo
 
kek . . . this would be ridiculous to see a github repo for this . . .
complete with class files for programmer , wife, store, etc.
And license too
 
:31039305 package coffeemachine;

public class CoffeeMachine {

    BrewSwitch brewSwitch = new BrewSwitch(this); // 0 : Mid, 1 : Away, -1 : Towards
    WaterTank waterTank = new WaterTank(this);
    MilkSteamer steamer = new MilkSteamer(this);
    DripTray dripTray = new DripTray(this);
    PodHolder podHolder = new PodHolder(this);

    public CoffeeCup makeCoffee(boolean steamedMilk, CoffeeType coffeeType, Addition[] additions) throws Exception {
        CoffeeCup cup = new CoffeeCup();
        Coffee coffee = new Coffee(cup);
 
So at what license do we want to release our programmer ?
 
i got lazy but i did that xD
 
8:28 PM
O_o XD
It's much easier with instant coffee , but doesn't taste as good
or you could do this:
import starbucks
 
guys, think you can help me understand an answer?
 
if we understand it ourselves , we can help you
else if we don't understand , return false
XD I'm starting to speak code !
 
which in bash is 1 !!
lol
well
 
ok, so what's the answer ?
 
13
Q: Why do I need to quote variable for if, but not for echo?

CharlesBI've read that you need double quotes for expanding variables, e.g. if [ -n "$test" ]; then echo '$test ok'; else echo '$test null'; fi will work as expected, while if [ -n $test ]; then echo '$test ok'; else echo '$test null'; fi will always say $test ok even if $test is null. but then wh...

the accepted answer, I think I understand it partially
 
8:33 PM
And, bash quoting .
So what do you not understand ?
 
like, I guess I get that a $variable returns nothing if variable is empty, and nothing is different from "" (which is what is returned if "$variable" is used)
since bash ignores spaces, even if variable is a space
bash will ignore it if called like $variable
 
no, no , no
 
but will think of it as an empty string and pass it like "" if "$variable" is called instead
 
bash treats space as separator
 
I meant ignores extra spaces
like
echo hello world
see, even chat ignores it
haha
 
8:35 PM
So if you have this VAR="one two" , the $VAR is treated as two separate items, but "$VAR" will be treated as one literal unit
echo "$VAR" and $VAR differ only in purpose : do you want to preserve the format or do you not want to preserve format
For example . . .
VAR=$(cat /etc/passwd)
Try to echo $VAR and echo "$VAR"
Same idea in case of if statement.
 
because he passes $var like a list right?
but don't care about the spaces, nl, cr and tabs, because they all just mean a separation right?
 
yup
 
but "$var" passes it all like a simple string
 
exactly
 
cool, I think I can feel how it works, echo $var is an echo with lots of arguments
while echo "$var" has just one argument
but now the part that got me twisted, what he meant with glob(split($var))?
I know split will divide the argument in lots of files (xaa, xab, xac..)
 
8:39 PM
list.append(panda)
 
user136984
@IanC: It doesn’t always ignore extra spaces.
 
don't know what glob does, but can't see how this relates to the list vs string thing
 
user136984
:P
 
hahaha, I don't know the chat codes :/
 
@IanC i don't know about glob because I don't use it
 
user136984
8:40 PM
You just put `` around the text.
 
@Serg, yeah, I'm kind of confused with it
but maybe it just creates those files and extracts them and returns their contents in a list
 
user136984
@IanC: But it won't work if you have spaces as the first things the `` meet.
 
@KazWolfe starred
here and on github
 
user136984
You have to have something else, like I did it with the entire piece of text.
 
8:42 PM
@ParanoidPanda, cool, does it work for placing code here? like, 5 spaces makes something a code?
 
yay programming!
 
hello
8:44 AM here
 
user136984
@IanC: Seemingly not, but you can use > before it.
 
user136984
Though that's normally for quoting things.
 
user136984
If you paste a large amount of text in with line returns in it the chat normally gives you a button though to turn it into proper code.
 
user136984
8:44 PM
> I am a quote.
 
two
lines btw
 
let me test it
 
50 lines of code to help a programmer buy milk.
 
user136984
@IanC: Just paste this in "> I am a quote.".
 
user136984
Well that was weird... How did you manage to do that? :D
 
8:47 PM
I'll try it later, I'll end up messing the chat with deleted messages lol
I clicked "fixed font"
 
user136984
Ah... Yes, that's the chat formatting thing I told you about.
 
after putting the quote after several spaces and two newlines
 
> quotez
 > quotez
bottom eq top
 
user136984
But if you want something to format with bold, italic, both, or > then you can't use the `` around it as it prevents that from happening. It's meant to preserve the text.
 
> hello world, how are you today?
 > hello *world*, how `are` you **today**?
 
user136984
8:49 PM
Oh my god... I can't believe they appointed Boris Johnson of all people to be Foreign Secretary!
 
user136984
He's making a mess of it already...
 
user136984
It's like appointing Basil Fawlty! :D
 
congrats you guys even have a brexit secretary
a sign of great things to come
 
haha my flatemate just told me about BJ being made Foreign Secretary... I folded up laughing - you couldn't make it up
 
BJ ?
 
8:53 PM
^ayyyy
 
Boris Johnson
 
user136984
I got confused for a moment there too... But that's only because I at first misread it as "DJ"! :D
 
user136984
It would be nice if we could have some actually informational or funny things in the star list... Currently we just have some strange out of context things...
 
user136984
Where are all the usual people?
 
haha you could pick any DJ you like and would 100% guaranteed be better for the job than him. I thought putting Michael Gove in charge of human rights was the most ironic decision ever but they went one better...
if I was a superhero, Michael Gove would be my nemesis...
 
user136984
8:56 PM
What?! They put him in charge of Human Rights?
 
didn't look like the french foreign minister likes boris johnson
 
that already happened after the election right? I've been avoiding politics since then.
 
user136984
After all this, I predict Trump will get in.
 
eww trump
 
user136984
And I mean it, seriously, I think it's got a good chance of happening.
 
8:59 PM
well if we have Monty Python politics here, the US will have to go one better
 
really? theres chance this guy will win?
 
user136984
Well, maybe Trump and Boris will become the best of friends! They've got the same haircut! ;D
 
thats such a big step back for america
 
the two greatest countries of the free world have sadly become a joke
 
after having a guy like Obama, that broke so many paradigms of USA, having trump is like going way back again
 
user136984
9:02 PM
His campaign slogan of "Make America Great Again" is so ironic. :D
 
trump is unlikely to win, but the fact that he can go so far is worrying
 
yeah
 
user136984
@edwinksl: People said that about Brexit... And look what happened...
 
brexit has always been a close call
 
user136984
@edwinksl: He reflects the thinking of a certain amount of the people. Clearly a large amount.
 
9:03 PM
the us presidency race is not that close
that's for sure, that's why it is worrying
 
user136984
Whatever happens, he will have a big affect, he already has done.
 
user136984
I haven't heard so much about the US Presidential Race recently, who is ahead at the moment?
 
i don't know really, since bernie just endorsed hillary but it is unclear how many in bernie's camp would vote for hillary
 
bernie was saying that the whole time tho
 
intentional typo? :)
 
9:08 PM
not really
 
should have kept it
 
hmm star marked " lol - 48m ago by Dev "
 
:P
 
problem is that people are stuck now between the shiniest of two turds .
 
I typed a mistake on bash and wrote
echo "$foo" > split -
instead of piping. Why did the '-' get included in the content of the split file created? O.o
 
9:17 PM
Would be nicer if people were like "Screw this, I don't like either of these guys. Cancel the election"
 
rich people decide the options to be given to people..to make them feel it was their choice :P
 
-------------------------------------------------
DIR:/xieerqi|15:18|skolodya@ubuntu:
$ echo "$USER" > one two
-------------------------------------------------
DIR:/xieerqi|15:18|skolodya@ubuntu:
$ stat one two
  File: 'one'
  Size: 12        	Blocks: 8          IO Block: 4096   regular file
Device: 801h/2049d	Inode: 5768717     Links: 1
Access: (0664/-rw-rw-r--)  Uid: ( 1000/ xieerqi)   Gid: ( 1000/ xieerqi)
Access: 2016-07-14 15:18:06.589309049 -0600
Modify: 2016-07-14 15:18:06.589309049 -0600
@IanC ^
apparently it has been ignored ?
Nope!
$ cat one
xieerqi two
 
make a cat one
yeah
 
This is worthy of a question !
 
thats what happened here too lol
want to write it?
 
9:20 PM
@IanC if you want to do that, I don't mind :)
 
cool, I'm into it
just making a small search if there's anything related
 
actually . . . i may have found something
      The following redirection opera‐
       tors may precede or appear anywhere within a simple command or may fol‐
       low  a  command.   Redirections are processed in the order they appear,
       from left to right.
dammit
formatting is pain in the butt
 
wait, so '-' is being runned as a command?
or split is being run too?
 
nope.
Redirection may appear anywhere . Shell looks at that and says "oh, this is redirection and its argument ! OK , I'll take out that, and leave rest as args to command"
 
9:27 PM
ooooh
so - is just an argument to echo now
so its valid to do
echo > filename write whatever you want
 
I didn't know that :)
 
yup
Learn something new everyday, huh ?
 
yeah, out of a silly mistake haha
cool :D
 
And that's why this works :
DIR:/xieerqi|15:28|skolodya@ubuntu:
$ cat > text_file.txt << EOF
> one
> two
> EOF
-------------------------------------------------
DIR:/xieerqi|15:29|skolodya@ubuntu:
$ cat text_file.txt
one
two
I've been using it and didn't realize the redirection order doesn't matter apparently
also . . . i was going to eat . . . . an hour ago . . .
 
know how it is, I'm going to sleep late as hell because of being involved learning some stuff
today I need to go to sleep 9pm, 10 at most, or I'll not be able to wake up 5:40 for work tomorrow
 
9:36 PM
user image
4
Secred word is "validity on“ I think
no
validation ?
 
sweet validation
:)
 
i messed up the order of strings first time
 
because being able to understand code is always validation ^_^
 
what language is that?
 
you probably just need free coffee
 
9:40 PM
looks like jabbascript
 
i would love if my coffee shop did this
 
ikr
" If you can calculate the current across this resistor, have a free coffee on the house "
 
through
pd across, current through
 
classic teacher
 
Yup, she's correct
 
9:44 PM
serg is wrong for the very first time?
 
being correct is fine, but I can be correct by myself and avoid being a pedant
 
well , I used to vocab well, but then i took arrow to the knee . . . . and many frustrating years of failing college classes over and over
 
any recommendation for whatsapp web on linux
?
 
what do you mean by recommendation for whatsapp web on linux
 
app
web wrapper
 
9:46 PM
just run in your favorite browser? why do you need a wrapper
if you really need one and are into the electron hype, try franz then
 
I want to keep it on whenever I switch on laptop
like Whatsie
 
I was just thinking of the nicest calculation for me... if you wanted the current through a resistor in a parallel circuit you'd had to calculate the total resistance from 1/Rt = 1/R1 + 1/R2 + 1/R3 and you would have a nice question :)
 
a circuits question without capacitors and inductors is boring
 
Franz looks good
 
but I would rather learn interesting things about redirection from you @Serg :)
@edwinksl not before the coffee
 
9:48 PM
@Zanna mmmmmm coffeeeeee
human + coffee = code
 
CodeProject code = programmer.give(new Item(ItemClass.COFFEE));
 
wasn't that supposed to work? :/
echo "$foo" | csplit - '/[[:space:]]/{*}'
I give up trying to make the glob(split()) thing work, could have finished reading my book by now if I didn't waste so much time trying to make this work!
 
user136984
If you don't send an email using TLS encryption does that mean that the email is sent in plain text?
 
i played mario too long
jeez
 
@ParanoidPanda Yes.
emails back-to-back were notoriously insecure for some reason.
 
9:56 PM
@edwinksl thanks
 
user136984
Why do some services send you password reset emails (mostly with the new password in the actual email) in plain text? Doesn't that seem like a really insecure thing to do?
 
@ParanoidPanda That is. They are dumb.
 
user136984
I'm seeing it so much at the moment...
 
user136984
Yes, but even from major security companies I am seeing it...
 
@Zanna I'd prefer the word "with" than "from" :) I only realized that thing about redirection only today, even though I've been using it all the time
 

« first day (2115 days earlier)      last day (2854 days later) »