« first day (1445 days earlier)      last day (3497 days later) » 

3:00 PM
@thefourtheye maybe you could as a hello world reimplement this chat as open source? :)
 
user559633
Hah, SO is a microsoft-shop, like they care about open source
 
@RobertGrant Your optimism amuses me... ;)
 
I wonder if CapricaSix, the bot that hangs out in the Sandbox room, is open source. You could dig around her insides to see if you can extract useful ad-hoc specifications for chat.
 
@tristan the DE is open source
 
@thefourtheye :)
 
3:02 PM
@Kevin the bot in the Tavern is open source.
And written in Python.
 
And I think RABBIT is open source, although the source is also hidden because we don't know where it is.
 
Huzzah!
 
and it's not the latest version, and doesn't have the full event thingy of the version I lost :(
 
Aw
 
3:03 PM
plus the indentation is f*ed
 
@Kevin Here is the source code for CapricaSix - github.com/Zirak/SO-ChatBot
It was there in her profile
 
Anyway, cbg all
 
plus it was all about 5/10 minutes work, so that's my excuse for the poor state of that RABBIT :(
 
man. What's the best place to learn the more abstract "best practices" for database design? I think I am doing something very wrong here
 
Depends on what you mean by abstract. Like are we talking partitioning here, or just what to/not to index?
 
3:13 PM
How to connect the tables, what to include in tables, how to make sure it is maintanable
I am trying to do something I feel like is wrong... I have a Post model, but I want it to either correlate to Course or Instruction, then I want Comment to relate to Post
 
AskTom is a good resource, but I'm not sure if that's what you're looking for. It sounds like "Database Normalization" is the keyword you're looking for.
 
@corvid if you want one Post model (at least in python) that can be either related to a course or instruction, you might be looking for generic associations
 
davidism and his infinite knowledge of SQLAlchemy
 
You can find a simple example of this in the Tag model in sopython. Any model can have tags added to it.
 
I'm trying to emulate how you did the StackExchange login too :| I don't really get how it works
 
3:25 PM
I need to get back on sopython/nidaba soon. I've been having ideas but need to put them into practice.
 
DSM
"Even in death the man gets bloody starred." Too true.
 
I just followed the instructions in the docs: api.stackexchange.com/docs/authentication
 
DSM
Belated cabbage, all.
 
Yeah, I need to start up again too. I've just had a lot going on.
 
Do all systems of OAuth work like this? Like google, twitter, linkedin, etc
 
3:27 PM
@davidism I figured out why I was getting that session error. sqlalchemy session 5 already attached to session As soon as I took out whooshalchemy the error went away
 
Probably. I know there are slight differences everywhere. OAuth doesn't seem to be very consistent as a spec.
 
yeah. I don't like google's docs but LinkedIn and StackExchange seem very explicit
 
I got tired of trying to get all the different "general" oauth modules to work and just did the specific steps for se
 
@davidism Eh stuff happens. I'm hoping now I've settled down into my new place and am writing up I'll be able to dedicate some more time to it. Need to sort out an api for nidaba that sopython can call. Even if, for now, it's just using the mongodb database. I've got some nice visualisation ideas I'd like to play with.
 
I think authomatic is okay. It seems to work, but it also seems completely overkill for my usecase
I just want to log a user in with an OAuth provider
 
3:29 PM
Managed 5 pages of thesis today.
 
@Johnston whooshalchemy was last committed to 3 years ago, so that might explain it
read a nice article about full text search in postgres yesterday: blog.lostpropertyhq.com/…
that's probably how I'll implement search for canon
 
@davidism Yah I've been having a hard time finding anything for searching
 
@Ffisegydd (Best physics prank ever - images.viralnova.com/000/077/258/pranks-1.gif)
 
That's kind of a prebuilt already working thing
I almost went with Solr. But then I stopped myself.
 
@IntrepidBrit No the best physics prank ever is to take 2-3 cans of shaving foam and submerge them in liquid nitrogen. The foam will freeze meaning that you'll be able to cut the metal from around the can, leaving just the foam (need to keep it cold when you do this which is the tricky part). You then take the cold foam and put it in someones car and close the doors. The shaving foam will quickly heat up and rapidly expand. You can literally fill someones car with 2-3 cans.
And I mean...fill...
 
3:34 PM
The nice thing about postgres is that it's just a few types, functions, and indexes, all built in to the db already.
 
@Ffisegydd Ooooh. That's particularly evil...
 
@Ffisegydd that sounds fun to watch
 
might as well go with something built in
 
I've never tried it myself.
The other good one (involving LN2) is to fill a 2L plastic drinks bottle with LN2, screw it up nice and tight, and stick it under a bin.
Then run, of course. The bin will fly.
 
Bwahaha
If only you could time delay it...
 
3:53 PM
I love liquid nitrogen.
I think the main thing I'll miss with finishing my PhD is messing about in the lab.
 
@Ffisegydd I doubt you could fill someone's car with a few cans of shaving foam
 
@Veedrac I think you'd be surprised.
 
Noooooo.
 
It should be quite an easy calculation, actually
 
3:55 PM
I didn't like the prank anyway. Seems too destructive.
 
How dense is foam and how heavy is the can?
 
Unless you offer to the prankee to scrape shaving cream out of his air conditioning vents for the next eight weekends
 
not quite a car, and not liquid nitrogen, but still...
 
What are some other chemical reactions with large volume changes... Fill your friend's car with Pharaoh's Serpent. Apparently creating an opening in space through which the Great Old Ones may enter our realm. Ia! Ia! Mercuric sulphocyanate fhtagn!
 
4:02 PM
Hi guys
 
G'day
 
Corsair said that I "will be able to buy Corsair DDR4 DRAM kits in about 2-3 weeks"
-.-
2 more weeks w/out a PC
 
2 weeks to get ~260 rep and beat @vaultah :P
 
Gud' evening all!
Oh, sorry, I forgot I was a French lady.
Oh wi wi wi mademoiselles and monsiers!
 
wi? lol
 
4:11 PM
Yes, I know I said yes three times.
It's one of the only french words I know. ;)
 
Saying oui repeatedly with a puppy present is not a good idea :)
 
@ffisegydd I'm borrowing my grandma's laptop :P
 
@JonClements That's how you spell it then :P
Also, oh lawd no.
 
and fairly sure and->et, but heck - what do I know :)
 
and if there's more than one young lady, you've got to conjugate...mademoiselle / mesdemoiselles.
 
4:15 PM
@Iplodman otherwise - good show of pretending to not be a French lady :)
 
@JonClements Damn straight.
 
im curious, on a a scale of python proficiency where does this problem fall. create an a function that would evaluate this string '(1&0)^(1|0)'
python proficiency being beginner, experienced, expert
 
This is pretty cool.
 
@Fuchida use eval:
In [16]: eval('(1&0)^(1|0)')
Out[16]: 1
 
aaah gotcha
@davidism got that in an interview and my mind completely froze -_-
 
4:22 PM
Is this right?
> Overclocking a processor increase the vibrations of the clock chip's crystal per second, allowing the CPU to over perform the manufacturers recommended limit.
 
I mean, that's a really bad solution, because it doesn't sanitize input first, so anything can be eval'd, but still, simple.
 
@davidism the interveiwer explained that I would need to create a parser
 
Without eval, I'd say "infix math expression evaluator" is an intermediary challenge.
 
If he had given you something that wasn't valid python, then yes, you would have needed to parse it
 
downgrading to Medium-to-advanced beginner if you just copy-paste the shunting yard algorithm
 
4:24 PM
@davidism interesting
 
"write calculators" was a project in CSE 12, the intro C class.
 
DSM
I'd pass someone if they merely said "shunting yard". At that point they know enough that the rest is boring.
 
If you don't want to run arbitrary code, you could use compile and extract the result after constant folding
compile("(1&0)^(1|0)", "", "single").co_consts[-1]
 
@Iplodman I thought the vibrations per second of a particular crystal was always constant; this is why quartz watches keep such good time.
 
@Kevin I'm not clear on the details, but since a clock chip uses the crystal to regulate time, surely it must do? Would this be worth asking on an Overflow subdomain?
 
4:30 PM
4
Q: How can a CPU dynamically change its clock frequency?

ChloeMy Intel CPU changes clock speed depending on the usage, but how does it decide what clock speed to run at? Is the clock speed determined by the OS software using an algorithm, or is it hardware based? Is it dependent on the # of interrupts? The cache turnover? Does the CPU itself set its own clo...

 
@Veedrac Oh, thanks!
 
man. Is there an equivilent to __repr__ in java?
 
Right, so it changes the multiplier of the base frequency.
 
I'm getting worried now that my compile suggestion isn't being called out on. Either people think it's too obviously a joke and I'm paranoid or people actually think I'm serious.
 
DSM
.toString(), but Java programmers don't override it with interesting info as often as Python programmers use repr.
Disclaimer: I write Java under protest.
 
4:32 PM
Would ast.literal_eval work on math expressions not using any variables? I haven't used it in a while so I forget
ValueError: malformed string. Guess not.
 
literal_eval only takes constants; it doesn't evaluate anything.
So you can parse objects but not add them.
 
DSM
I think there was a corner case where it did evaluations I wasn't expecting. There was a question on it once.. hold on.
 
They should call it literal_contant_take, then!
 
@Kevin 1+0 isn't a literal
 
as it says, it evals literals.
 
4:35 PM
literal_eval is perfectly literal
so to speak
 
ah it does support +
I think for complex
in python 3.4
>>> ast.literal_eval("1 + 0")
1
>>> ast.literal_eval("1 + 2j")
(1+2j)
 
Stupid special cases
 
DSM
@AnttiHaapala: good call, that was it.
 
I actually made a class of it
 
Only for numbers:
ast.literal_eval("''+''")
#>>> Traceback (most recent call last):
#>>>   File "", line 2, in <module>
#>>>   File "/usr/lib/python3.4/ast.py", line 84, in literal_eval
#>>>     return _convert(node_or_string)
#>>>   File "/usr/lib/python3.4/ast.py", line 83, in _convert
#>>>     raise ValueError('malformed node or string: ' + repr(node))
#>>> ValueError: malformed node or string: <_ast.BinOp object at 0x7f1a6dd6ac18>
 
4:37 PM
Interestingly, 2.7 Doesn't support literal_eval("+2"), but 3.X does.
While both support unary negative, ex. "-2"
 
ast.literal_eval("0 + 1 + 2 + 3")
6
more interesting:
python 2.7 does not support set literals
python 3.4 supports
but it is impossible to do the empty set
 
DSM
Wish we'd used {:} for the empty dict.
 
me too
 
WTF? ast.literal_eval("...") fails...
 
I'm guessing 3.X does some preprocessing magic on numeric literals separated by a plus sign, explaining why literal eval works on "0+1" but not "0*1"
 
4:41 PM
@DSM There was a proposal on Python Ideas
 
@vaultah There were many
 
It would break too much code
(my opinion)
 
>>> ast.literal_eval("'a' 'b'")
'ab'
 
DSM
We should have done it during the 2/3 break. I'll fix it when I fork Python after the new typing syntax drives me crazy.
 
@Kevin That's not an operator, so it's not unexpected
ast.literal_eval("""1\
+2""")
#>>> 3
That's a terrible example
Trying again:
ast.literal_eval("'hello\\\nthere'")
#>>> 'hellothere'
 
4:51 PM
Guys help me decide...
 
@tilaprimera Always be Jedi Betty
 
hehe
I got a job where i will basically work on python, django and the likes of it.. and has better pay than another job where i will research and all on data analysis and, might have to put hands on other aspects like web development and statistical analysis and all..
 
@davidism, in the case that you had an app with multiple OpenID Logins like google, twitter, linkedin, AND github, what would you advise the best way to handle that is?
 
probably try to get one of those libraries working
 
@tilaprimera There are a lot of factors at play here. Giving vague summations about the jobs is probably going to give you misleading answers and end up doing little but anchoring.
 
4:57 PM
i want to know what should i look for in a job so that i dont regret it? : )
 
DSM
But that will obviously differ. Python appeals to me, but django doesn't; data and statistical analysis do, and web development doesn't. So my regrets could be very different from yours.
 
ditto here..
have not done django...and web development...
 
has codewars.com been brought up here before ?
 
Hm, also depends in which country/state the job offer is in
 
It goes even further than that. For different people, the environment or the people or the culture or the pay or the workstyle or the number of deadlines all matter to different degrees.
 
5:00 PM
I'd be keeping a weather eye on the contract, and expectations
 
it's been very useful in leveling up my Python
 
it is within my country..
both are 9 am to 6pm jobs but the research one is flexible about timings.. and more open about problem solving..
 
@tilaprimera How much does that matter to you?
 
@Veedrac ok. They added Python support a few months ago and I've been hooked ever since
if the play their cards right it could be as big as stackoverflow
they*
 
flexibility is good but there is no direct supervision of my codes by a senior and i will be basically leading the research on my own...
 
5:06 PM
@Fuchida Seems dubious. SO is more than answering questions for learners. It's the hard questions that keep it important to professional developers, and it's the free labour that keeps it relevant to everyone else.
Until Codewars offers a "do my homework" service, SO always has a place :)
 
@Veedrac mmm didnt know a big chunk of SO was "do my homework"
 
You're obviously new here
 
I am :)
 
:D
 
yeah codewars is more geered to the intellectuallycurious and those who enjoy solving problems
 
5:13 PM
@tilaprimera Good luck deciding
 
@Veedrac thank you...
 
5:27 PM
> edit: I should add that I'm not allowed to use the print function in my code
-2
Q: no return in a return function

user4095990This seems like a really simple question but I can't seem to make it work. I'm trying to find out whether the octothorp (#) is within a string, and return 'true' or 'false' depending on whether it is or not. When I put my code in and test it, I don't get a result. Here's my code plus the tests I...

 
No problem, just use sys.stdout.write
Or raise Exception("It worked!" if function_call() else "It failed!")
 
DSM
I'm not sure the print restriction applies to the testing. Could be the OP misunderstood the teacher trying to explain the difference between print(True) and return True.
But who knows?
 
Yeah, I strongly suspect the teacher's requirement was "you may not use print inside the function"
 
DSM
I wish there were a way to put the OP out of his misery. It's the sort of thing where I wish SO had a take-to-videochat mode, it would take about five minutes.
 
@DSM I'm not sure I'd ever be brave enough to use that feature though :)
 
5:40 PM
Hah yeah. Too many stories of Chat Roulette.
"Aaaaand yep that's another penis"
 
@Ffisegydd maybe that Minister should have stuck with chat roulette :)
 
Heh yeah maybe.
"Oh look someone needs help with their python"
The italics there were to show a double entendre in case anyone misunderstood.
 
DSM
Well, this went in a direction I wasn't anticipating.
 
Best chatroulette prank (if you've not already seen it)- images.viralnova.com/000/077/243/pranks-17.gif
 
Does it involve liquid nitrogen? Cos if not I'm not interested.
 
5:46 PM
Nope
 
@Ffisegydd LOL :D:D:D:D
how come, that penis-related jokes never gets old?
 
cabbage @MartijnPieters
 
I knew it would be a matter of time, when someone creates an OpenSource version of the original Mac application -- although it took at least 3 years :P
cbg(@MartijnPieters) //before you say anything, it is still written in KevinScript
 
@PeterVaro And // is a comment, right?
 
5:54 PM
@MartijnPieters :P
you win.. again :D
 
KevinScript doesn't have comments yet. Just string literals that are ignored.
 
really?
 
I guess I could hack something into the parser...
It's just a bit of a pain to do. like f("//is this a string constant or a comment?")
 
are you generating the parser or writing one yourself?
 
So it's not so simple as line = line.partition("//")[0]
Bit of both. I have a parser generator, that I wrote myself.
 
5:59 PM
@Kevin however if you use /*comments*/ that can make things easier a bit I think
 

« first day (1445 days earlier)      last day (3497 days later) »