« first day (1604 days earlier)      last day (3341 days later) » 
00:00 - 15:0015:00 - 23:00

12:00 AM
@MattDMo ahhh... melon :p
but, hello :p
 
@zachgates I left a little message for the OP, and basically told them to learn about requests and how to parse the response headers for the filename. Feel free to update your answer if you want, but based on the original question I think it's just fine.
 
thanks @MattDMo
 
12:31 AM
Hey guys I have this large bytearray that is encoded in raw ARGB and I need it in RGBA. Will Numpy be able to help me with this?
 
example?
if its a list like
x = [1, 255, 125, 89]
you can just
x[1:] + [x[0]]
 
@zachgates every four bytes in the byte array I need to flip ARGB -> RGBA (byte ordering according to their letter designation).
 
can you give an example byte array
 
Hello everyone, small question I installed months ago python 3.2 on a windows machine, with 3.4 out. What is the correct way of updating python and all its packages?
 
Just install the new one and use it instead.
 
12:39 AM
@zachgates example b'abcd'*1000 needs to be transformed into b'bcda'*1000
 
is the byte array actually b'abcd'?
 
Do i remove the previous version from the Add/Remove programs_
 
what is it actually?
 
RBGA is byte ordering of an image format
 
12:41 AM
there is no need to @DavidCardozo although it will save you space on your drive
 
RGBA stands for Red Green Blue Alpha. While it is sometimes described as a color space, it is actually simply a use of the RGB color model, with extra information. The color is RGB, and may belong to any RGB color space, but an integral alpha value as invented by Catmull and Smith between 1971 and 1972 enables alpha compositing. The inventors named alpha after the Greek letter in the classic linear interpolation formula αA + (1-α)B. The alpha channel is normally used as an opacity channel. If a pixel has a value of 0% in its alpha channel, it is fully transparent (and, thus, invisible), whereas...
 
yes i know what RGBA is @jakebird451
 
Ok Thanks everyone.
 
right.. gonna sign off - see if I can't get a few games of MTG
rbrb for now
 
here is what you're looking for @jakebird451
array = list(b'abcd')
array = array[1:] + [array[0]]
array = bytes(array)
array will then be b'bcda'
 
12:44 AM
@zachgates That operation needs to be applied for every four bytes. The bytearray in my example was 4000 bytes long.
Hence posting a real bytearray example for my problem would be rather lengthy
 
1:04 AM
pastebin.com/96bwsvHC @jakebird451 there you go
 
wow, that's incredibly inefficient, you've created 5 copies of the data
 
lol but its what he wanted @davidism
 
I made this. Which does the trick, but with multiple large data sets, this is rather slow. pastebin.com/HfpfVPcR
Is there a way to speed this up with an efficient numpy operation? Or am I chasing after a wild dream?
 
1:19 AM
most likely yes, but I don't use numpy
 
@davidism Yea, thats what I am thinking. I guess its time to delve into numpy land.
 
DSM
2:00 AM
@jakebird451: I wouldn't be surprised if there were already a function lurking in ndimage or somewhere to do the shift, but IIRC something like
>>> barr = np.frombuffer(test_input, dtype=np.int8)
>>> np.roll(barr.reshape(-1, 4), -1, axis=1).ravel().tobytes()
'rgbargbargbargbargbargbargbargbargbargba'
should work.
[wizard-like vanishing noise]
 
ooh that was good @DSM
 
2:44 AM
is there a more decent way to append to a dictionary of lists than
mydict = {'foo': []}
mydict['foo'].append('bar')
 
 
3 hours later…
user559633
5:38 AM
define "more decent"
 
user559633
you can use setdefault to create the key entry if it doesn't exist @zachgates
 
subscripting seems a bit crude @tristan
 
user559633
mydict.setdefault('foo', [''bar'])
 
what if the key entry already exists
 
user559633
it's looking for a data member by key
 
user559633
5:41 AM
@zachgates try it out
 
user559633
nothing happens if key already exists on mydict
 
oh ok. thanks
 
user559633
no worries
 
cbg all
 
user559633
cbg
 
user559633
5:49 AM
with the source-header setting of an encoding, that only changes it for the exec of the current file, right?
 
user559633
e.g. # -*- coding: utf-8 -*- in some_module/tasks/some_script.py will not change the interoperability of some_module/caller.py -> some_module/tasks/some_script.py
 
Not sure, but this is the behavior I'd expect
 
user559633
yeah, same
 
user559633
using python 2.7 in this webapp because of opencv, but i think i'll just convert the image processing stuff to a service and not do any text stuff in it as well
 
user559633
iirc, setting encoding is more sane in 3.4x, so i'll just cowardly avoid the issue
 
6:10 AM
thank you for answer But I have one more issue ,the file path /usr/bin/python2.6 is also not there .I think I have deleted it earlier.So what should I do? I think because of that after I followed your steps I am getting the error. -bash: /usr/bin/yum: /usr/bin/python: bad interpreter: No such file or directory — aneesh 10 mins ago
oh boy...
 
user559633
alright, new solution. we're not doing unicode or internationalization anymore. everyone learn english. no excuses.
 
user559633
@MattDMo yeah, i don't touch user env questions anymore. the questions are never well defined or researched and it's always an endless back-and-forth
 
I like them because sometimes I can actually help - if I have lots of free time and nothing much else to do. In this case the OP tried to install 2.7 on his CentOS system (why the hell are they still shipping 2.6 as the default???), and in doing so apparently deleted 2.6, on which the package manager yum depends.
 
user559633
of course he did. i'd scoff at centos and red hat, but now that debian has caught the systemd infection from redhat's marketing department, it's all tedious
 
so what's the deal with everybody complaining about systemd? I was reading comments on Slashdot at -1 (always good for a laugh) and threads in a couple different otherwise-unrelated articles devolved into bitching about it.
 
user559633
6:17 AM
it's just broken in its design completely and ignores all the lessons we've been learning over the years
 
user559633
spits in the face of unix philosophies like "do one thing and do it well"
 
user559633
and the core team on it will do dumb things that break contracts with things like the boot process or the kernel and they just boorishly claim its not their realm to fix
 
hmm. Apparently I have it on my Ubuntu 14.10 system, but I've never experienced any issues.
 
user559633
i could rant on and on about how it's going to cause terrible problems because it's designed for desktop linux usage in mind and how it's going to cause so many f-ups when it crashes (it wants to be the parent proc of all other procs, which means when it hiccups, the actual processes you care about will get black death and die), but really it's summed up by media.giphy.com/media/5xtDarAgrjoOrBxSVYk/giphy.gif
 
user559633
@MattDMo yeah, and systemd is going to get fatter in scope and is really only a problem if you care about service availability and uptime for production systems
 
6:22 AM
that's awesome
 
user559633
on a desktop machine that gets rebooted often and if it crashes, whatever, it's like replacing a spoon with a 3d printed version -- more modern, but of dubious benefit, durability, and desirability, even if you can recreate a 3d printed spoon faster than a metal one
 
I do find myself rebooting periodically (maybe every couple of weeks, sometimes a lot more often) as the system starts getting sluggish, zombie processes accumulate, and restarting programs (esp. Firefox) doesn't do the trick anymore
 
user559633
on a server, it's the equivalent of when some ruby dev says "makefiles are stupid! i just wrote this thing in rails that's more ~~featureful~~ for downloading stuff from github and it even tweets when you add a gem! lol!"
 
user559633
i honestly don't know why systemd is getting more popular
 
user559633
people that defend the fact that systemd writes binary logs are typically "doing it wrong"
 
user559633
6:26 AM
or people that say "but now startup is concurrent and has ordering!"
 
user559633
again, you're doing it wrong
 
Why replace init.d at all? Was/is there a compelling reason to push everything together?
 
user559633
"because it's old man"
 
user559633
the arguments for it are here wiki.debian.org/Debate/initsystem/systemd
 
user559633
but most of the stuff is already accomplished in a better way without the aforementioned completely unacceptable drawbacks
 
user559633
6:29 AM
"the benefits of cancer are that you don't have to worry about saving for retirement and now you can do whatever toxic thing you want without caring about the consequences! win win!"
 
and should I trust boycottsystemd.org for counter-arguments?
 
user559633
it's so crazy that i don't even think it's that loony to think that it was endorsed by some state department because they know it will be easier to do nasty things to linux
 
user559633
boycottsystemd isn't loading for me, but this: ewontfix.com/14 and think about openoffice
 
user559633
also, talk to anyone that's done linux admin for a long time
 
user559633
any system that really parades "fast boot time" is really missing the point of running a server (or doesn't "get" containers)
 
6:34 AM
hey anyone done a interview at amazon?
 
user559633
but sure, there's real utility in abstracting away "system is ready to do work, tell me what to do" scripts into something proprietary
 
I used to do admin on some RH servers, but that was 15 years ago. I kind of took a Linux hiatus for a while, and although it's my primary environment at home now (running under VMWare for OS X), I haven't been as involved in the politics for quite a while.
 
user559633
i'd much rather write in a pseudologic language than do a 5 liner in bash/sh
 
no one :(
 
What language is it written in?
 
user559633
6:35 AM
@lilz4life you asked a second ago.
 
user559633
jfc kids these days
 
LOL
 
user559633
@MattDMo C
 
i never used this chat
i dont know how fast paced its supposed to be
 
user559633
basic social etiquette
 
6:36 AM
alright man realx..
 
user559633
WHY IS NO ONE PAYING ATTENTION TO MY OFF TOPIC THING THAT I ASKED INTO THE VOID A FULL 35 SECONDS AGO
5
 
how is it off topic
....
 
@lilz4life well, many of the regulars are either in the US or Europe, which is pretty much asleep right now. I should be in bed, but I ain't
this is the Python room...
 
Ah same here, tonight is the time change about to time travel from 2 am to 3 in t-22 mins
 
user559633
i have a sneaking suspicion that in 3 years systemd will prove to be awful and people will start actually paying attention to *bsd again
 
6:38 AM
And it is a python/java interview
 
this room is about Python coding not advice on how to impress a future employer
 
user559633
i'm currently a node.js engineer at amazon and i've told mark (our head of tech recruiting) to flag your application with "not a good culture fit"
 
user559633
look what you made me do
 
"into the void" @tristan that killed me xD
 
laurel
 
6:40 AM
LOL okay
well while im here
 
user559633
i'm going to stop you there
 
may i ask if anyone knows a good python intermeddiate book
-______-
tristan man why are u so mean LOL
 
user559633
@lilz4life in this room, people respect each other too much to type " u so mean LOL" unironically
 
-__-
ok ill just leave i have no idea why you don't like me
but it is what it is
Enjoy your evening sir
 
user559633
haha
 
6:44 AM
NOOOOOOO
 
user559633
i don't care about you either way
 
user559633
i promise you
 
were u always this mean
 
user559633
just get a feel for the room before throwing out an off topic question and getting impatient
 
lol alright sorry
will keep that in mind next time
 
user559633
6:45 AM
don't be sorry, just lurk a bit and learn the norms of the room
 
alrighty !
 
user559633
and for your intermediate book question: check out programming python by mark lutz or the python cookbook
 
im gonna go look for a cold fusion room :D im working on a CF project
 
user559633
/me hangs himself
 
alright will do !
thank you tristan :D
 
user559633
6:46 AM
@lilz4life good luck
 
yeah, so that "oops I deleted /usr/bin/python OP is back. He symlinked it to the directory where he unpacked the 2.6.9 source code, and wonders why it's not working. I think I'm going to bed soon...
 
cbg
 
cbg @PM2Ring
 
user559633
@MattDMo haha, yeah, like i said, those questions just need more garlic
 
it's not even that he's a help vampire, he's just a dumbass
3
 
6:48 AM
@MattDMo Take the advice of Sir Robin from Holy Grail and run away!
 
user559633
@MattDMo amazing
 
user559633
like a vampire that keeps biting people by accident
 
user559633
cbg
 
user559633
i don't know why, but i worked 14 hours today
 
6:50 AM
aha tristan ranting about systemd :D
 
Morning
 
user559633
@AnttiHaapala it was a baby lecture :)
 
Morning
 
user559633
morning :)
 
no one cares about the fact that having a good systemd would make the system easier to manage ... :D
I guess everyone by now is pretty happy about udev, say
 
user559633
6:55 AM
@AnttiHaapala yeah, but oxymoron
 
@Antti I must admit that I started it. I didn't know what the whole war was about, so I naively asked Tristan...
 
user559633
what we needed was some patches to init and some better docs
 
I hope it will be good...
what we already have is the upstart that is pretty horrible too
 
user559633
what we got was a monolithic app at a really critical place to be minimal
 
6:56 AM
init didn't do much anything
 
At any rate, with US Daylight Savings Time going into effect tonight, it's now almost 3 AM for me. Rhubarb, all!
 
user559633
upstart in more recent ubuntu is just a set of aliases to systemd
 
almost 1 AM here
 
user559633
rhubarb @MattDMo
 
I must admit I haven't configged systemd jobs a lot, only used it on 1 rasbpian directly...
and it was like at times I was lost
 
user559633
6:58 AM
:) yeah, exactly
 
but when I got it working I was like "hey this is how it was always supposed to work"
 
user559633
haha
 
user559633
and then when it's not working you're like ":( i can't even view my logs becasue they're binary"
 
user559633
for production stuff, it's hilarious to thinking that you would ever want index/searchable logs on the server itself
 
@tristan I really don't know enough about this stuff to have a properly informed opinion, but I tend to agree that improving init & it's docs feels more unix-ish than creating a monolithic replacement for it, even if systemd is a little faster.
 
user559633
6:59 AM
lol structs for dumb logging
 
user559633
@PM2Ring the "faster" bit comes from ordering in the initialization process
 
user559633
so you can do parallelized startup
 
user559633
hooray shaving off 5 seconds of boot for a server that will be up for 2 weeks minimum
 
user559633
lol needing an external program to even view what went wrong on bootup
 
tamper free logs on server
and easier log shipping
 
user559633
7:01 AM
lol
 
user559633
(sorry, tired so forgetting it's not irc)
 
and
systemd-journald is a daemon responsible for event logging, with append-only binary files serving as its logfiles. The system administrator may choose whether to log system events with systemd-journald, syslog-ng or rsyslog.
 
user559633
 
user559633
that's clickable
 
7:02 AM
I read somewhere recently that apart from the ability to do parallelized stuff that systemd is also a bit faster than init since it calls internal functions rather than loading a whole bunch of external commands off disk.
 
ofc
yes 2 week servers it does not matter
 
user559633
my annoyance is that it's just being dropped in there when there are rock solid alternatives that are simpler and don't carry the same risks
 
but the world is going towards elastic computing with spot pricing
 
user559633
@AnttiHaapala for session-scaled servers, containers
 
user559633
these are solved problems
 
user559633
7:04 AM
with stable alternatives without as many risks and annoying things
 
user559633
i don't really want my init system making that many decisions for me
 
so, the ancillary daemons do not even belong to systemd yet ppl claim otherwise
 
user559633
i'm a big boy and have my own thoughts and ways of doing things
 
If I wanted monolithicity that's brilliant when it works but becomes an inscrutable nightmare when it fails I'd be using Windows...
 
user559633
does systemd still hop on a low pid and try to parent procs? yes? okay, we're done here
 
user559633
7:06 AM
oh is it still more shit that's indirectly controlled by red hat? non starter
 
user559633
i do not trust it at all.
 
user559633
 
The hell am I doing waking up at 6.30 on a Sunday -___-
 
user559633
@Ffisegydd it's 3am here :)
 
Oh no! My WTF meter just exploded: stackoverflow.com/q/28923980/4014959
 
7:08 AM
3am on a Saturday night is more acceptable than 6.30 on Sunday morning :p
 
user559633
@PM2Ring well, python doesn't have a case statement
 
user559633
@Ffisegydd while talking about systemd, watching tv, and re-writing some logging stuff?
 
If that's how you roll...
 
whoah
blew my mind @PM2Ring
 
7:13 AM
Cabbage everybody
 
cabbage
 
proverbs 13:24 They who withholds their close vote hates the noob, But they who loves them disciplines them diligently
 
user559633
did you initially put 12:34 and then change it to make it seem more realistic?
 
yes
what's on menu today: python questions: crap crap crap crap crap crap crap crap
 
@zachgates Scary, isn't it. At least it's not the OP's fault - it's just the requirement of some crazy assignment in code generation. But still...
 
user559633
7:16 AM
i knew that daylight savings time in the US put us more in sync with our european counterparts
 
what demon would assign such torture? :o @PM2Ring
 
I completely forgot DST is today!
 
you start saving so early.
 
Ours change end of March
 
user559633
7:18 AM
@AnttiHaapala yeah, now the USA is 1 hour and 7 years ahead of Europe
 
@zachgates I guess it kind of makes sense as a way to test automatic code generation skills. But it's still evil. :)
 
if the assignment was to type all of that up, i would just write something to type it for me
 
0
A: Basic hang man game Python

Antti HaapalaThe smallest implementation. Add a boolean variable won that is initialized to True; if any _ is printed, set it to False. It remains True only if no _ was printed: won = True for char in word: if char in lettersGuessed: print(char, end=' ') else: print('_', end=' ') ...

 
user559633
i love the enthusiastic winning message
 
user559633
"oh, you didn't get hanged"
 
7:29 AM
@JonClements stackoverflow.com/questions/28920444/… now it is deleted because it wasn't closed as a dupe :D
 
@zachgates Well, that was the whole point: writing a Python program to generate that monster automatically. But the OP's deleted the question now.
 
oh i see :P @PM2Ring
 
ok, back to server code :(
is there any difference between 1001 and 1001L?
 
7:45 AM
in python 2 yes.
IIRC there were more problems in the past
>>> isinstance(1001L, int)
False
>>> isinstance(1001L, long)
True
 
ok im in 3.4 i should be fine
 
>>> 1000L
  File "<stdin>", line 1
    1000L
        ^
SyntaxError: invalid syntax
this for 3.4 ;)
 
yes lol
 
basically the long suffix shouldn't be used in Python 2 either.
an integer literal above intmax will produce a long automatically
and if you want it below you're just wanting for problems and inefficient code
 
@DSM Sorry about the extremely late reply, but thanks!
 
7:50 AM
for some reason my server isnt ponging grr
 
> tx,bt m not able to figure out from links...
eww
 
yes
dunno
@AnttiHaapala Thanks for the pointer. Could you elaborate on caching? Some high level explanation of how you would implement it here? Anything helps. — Antrikshy 1 min ago
@PM2Ring cv that server question already :D
should teach newbies that if they don't hang around then their question will be closed and no answers
hoho
flattened 1 title slightly :D
Twitter sentiment analysis on a column of a csv file using Python
became
IOError: [Errno 2] No such file or directory when opening a file that is in the same directory
 
8:07 AM
lol
 
unable to reproduce, opens with relative path and says it is in the same directory
 
user559633
alright, take care all
 
bye @tristan
your comments give me life xD @AnttiHaapala
 
ppl think "I am doing twitter sentiment analysis" when what they are doing is trying to open a text file
FWIW, I am doing twitter sentiment analysis at work, and good luck to them :D
I already have alias set up for python to run python3, but that's not the problem. My problem is that putting the path to my version of python at the front of my $PATH variable (or $PYTHONPATH?) is supposed to make which python show that path, but it doesn't. — aweeeezy 1 min ago
sigh
 
8:27 AM
dict.update
TypeError: update expected at most 1 arguments, got 2
i must being doing it wrong rofl
 
yes
dict.update takes a dictionary
or iterable of pairs
 
or keyword arguments
 
wouldnt use kw arguments for the most time :D
it is slower to do {}.update(foo='bar', baz='baz') than anything else :d
 
{}.update({'foo': 'bar'})
no wonder it wasn't pong-ing. the AI side was in a loop of crashing and restarting
 
@zachgates instead of constant {'foo':'bar'} you shoudl ofc do
{}['foo'] = 'bar'
dict creation is very expensive.
kw args will create a dictionary :D
 
8:42 AM
the dictionary is already created
 
then it is ok :D
 
im sending and context and callback to the server and the server replies by through the callback :)
the context is like a ticket number
 
8:57 AM
-2
A: I just switched over to Python3 and I can't set it to be my default version of python

aweeeezyThe author of the suggestion that solved my problem deleted their post already, but the command sudo ln -s /usr/bin/python /Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4 did the trick.

lol :D
 
¯_(ツ)_/¯
 
Cbg
somebody aswered my question! xD
 
9:28 AM
woo
 
0
A: SQLAlchemy adds "=1" to the end of subqueries for no reason

Antti HaapalaYou were supposed to write having(func.sum(TBCTD.num_things) > 100) which tests that the sum() is greater than 100. Instead of that you wrote having(func.sum(TBCTD.num_things > 100)) which would sum booleans (which in turn are TINYINT(1), the funny thing is that true as a integer is negati...

I answered 1 question asked 11 days ago and that was answered in a comment
I am so bad
now if there is anything with crappier type system than PHP, then mysql could be a good candidate
 
they're both horrid
 
9:57 AM
The real pythonic solution is "Use Python 3" (after all it was decided that having 2 differently behaving types for text was not Pythonic). — Antti Haapala 2 mins ago
 
Here is the solution: Huff Luka bo Dom bo Aka So Suka bo = Dori Bol bo Duka C Bolinga C, bo La Huff — Del Capolo Sep 20 '11 at 16:10
:D
 
10:22 AM
Somehow, I don't think adding dis.dis output to someone else's answer is going to be that helpful for the OP... stackoverflow.com/questions/28924705/…
 
10:33 AM
Kasra again
 
:/
 
has more answers than me, well it is a way to gain reputation
Kasra has soon a gold badge in python with average 1 upvote per answer.
I have 2
 
When I was still fairly new to SO I suggested an edit to a Kasra answer when I noticed an obvious typo: fromat instead of format, and to get over the 6 char minimum edit limit I also did a few other minor improvements to the grammar (which is often quite poor in Kasra posts), but it was rejected: stackoverflow.com/review/suggested-edits/5769942 . So since then I tend to avoid interacting with Kasra.
 
He does not even try to improve his grammar :c
 
10:48 AM
Yeah. If you throw enough sh*the, eventually some of it sticks.
 
well I'm going to get my 4 hours sleep. see you all later
 
bye @zachgates
 
@61612 That's annoying, but kind of tolerable, since this isn't SE.English Language & Usage; OTOH, good spelling & grammar is encouraged throughout SE. However, to actively reject help from a native English speaker seems weird to me.
Maybe I should just forget about poor English on SO: I tried to help this newbie the other day but got nowhere. Hopefully, his attitude will improve after he's been here for a while, but I'm not holding my breath. :)
 
11:07 AM
cbg
 
cbg
 
11:22 AM
Need a documentation or a paper on help vampire.
 
one should be banned for using "u" on an answer
@tilaprimera UTG
 
melons!
 
No the earlier was what I wanted. : )
 
-2
Q: Short (complex) "pythonic" code

user 5061When coming across questions that ask for "short pythonic code", I sometimes see answers that are quite hard to understand. Those answers often attract more upvotes than simpler alternatives. It is as if complex == smarts == good. Well,.. not so good 4 months later when he spends 20 extra minut...

upvoted :D
 
12:20 PM
File "/srv/sentidaemon/sentiment/venv/lib/python3.4/site-packages/SQLAlchemy-0.9.8-py3.4-linux-x86_64.egg/sqlalchemy/engine/default.py", line 436, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (OperationalError) stack depth limit exceeded
HINT: Increase the configuration parameter "max_stack_depth" (currently 2048kB), after ensuring the platform's stack depth limit is adequate.
yay...
 
How can I decode GZipped data in Python 3? obj.decode("utf-8") fails.
 
Nvm... Got it.
 
how about use the gzip module
 
I was doing something like
json_data = json.loads(gzip.decompress(response.read()))
And now I changed it to
json_data = json.loads(gzip.decompress(response.read()).decode("ascii"))
Things are back to normal :-)
Although I am not sure the data will always be ASCII... Gonna use UTF-8
 
12:37 PM
how to split an iterable into chunks :D
not a list
and I want % n in the last iterable
 
@AnttiHaapala Thanks for linking that; I've just written my first Meta answer. :)
 
@PM2Ring the corollary is that
in the functional programming paradigm it is usually easier to not make errors :d
 
... unless you have no idea what you are doing :D
 
I gotta admit, Haskell tag is full of geeks but most of them are really nice.
 
12:50 PM
the problem with Haskell is that when you gain the understanding of it, you lose the ability of explaining it to anyone outside that circle
 
lol... That's what Douglas Crockford has been telling people, about Monads
 
I mean
my colleague just last week said: "now I understand the IO monads"
"great, then can you explain to me"
 
1:03 PM
0
Q: Power function for real base and real exponent

TheRetardedOneI need to write a power function in Python which works with real base and real exponent. a^b && a,b ∈ R I'm stuck at this point: def power_real_numbers(base, exp): if isinstance(exp, int): return power_bin_recursive(base, exp) else: integer = int(exp) rational = int(...

why oh why
 
Hey, I just read another anti-duck-typing Q with isinstance(), and even worse it also abuses assert, like this: assert isinstance(value, list). But it's not the OP's fault, it's a 3rd party library they have to use. :( stackoverflow.com/q/28926448/4014959
 
is there any way I can call a python script from java and get a returned value like a function?
 
@AnttiHaapala The logic used there for handling the fractional part of the exponent is just plain weird!
 
barf
I didnt even look at the math
I just got headache
the whole question is insane
if you do not understand the math then why do you do this
 
@AnttiHaapala IMHO, re-inventing the wheel is ok as a programming exercise. But yeah, it's pointless if you don't really have a clue about the mathematics you need to get the correct result. And ofc it's extremely unlikely that a newbie's going to somehow stumble across how to do this stuff in anything like an optimal fashion. :)
 
1:36 PM
Positional notation system
Tally system - l ll lll llll lllll
Hindu-arab numerals 0 1 2 3 4 5 6 7 8 9
Decimal system is followed because human has ten fingers unlike ancient babylonians who followed base 12 system, as there were 12 months the calendar.
 
2:13 PM
cbg
 
@overexchange think about how good we all would be in computing if we had 16 fingers:D
 
2:35 PM
"meaning relies upon agreement"
 
OTOH, memorizing the hex addition and multiplication tables is a lot more work than the decimal ones. But I guess it'd be worth it. I used to be pretty fast at hex addition when I did a lot of assembler stuff, but I never bothered with hex multiplication because I rarely had a need for it.
 
00:00 - 15:0015:00 - 23:00

« first day (1604 days earlier)      last day (3341 days later) »