« first day (2067 days earlier)      last day (2887 days later) » 

12:45 AM
cbg
 
(Solved my issue)
 
 
5 hours later…
6:07 AM
Cbg
A Soft Murmur is a bit old but I only discovered it today
 
6:30 AM
I am using some of python code for online transaction:pastebin.com/0YL3uTqX
function taking dictionaries as arguemnts, I want to define dictionaries explicitly as pass as function arguments.
tried as **<dictionary name>
Transaction.sale() funstion code is as follows:
class Transaction(object):

@staticmethod
def sale(params={}):
return Configuration.api.transaction.sale(params)
'
 
 
1 hour later…
7:57 AM
Cabbage!
 
Cabbage.
 
Cbg
@JGreenwell I didn't know that :) What's your Master's in?
 
Cᴀʙʙᴀɢᴇ
@arshpreet Don't use the ** syntax for that. Just pass the dict. Like this:
def f(mydict):
    print(mydict)

d = {'a':1, 'c':3}
f(d)
#output
{'a': 1, 'c': 3}
 
Top of the morning cabbage to you
 
@arshpreet Here are some examples that do use the ** syntax:
def f0(a=10, b=20, c=30):
    print(a, b, c)

def f1(**kwargs):
    print(kwargs)

def f2(a=100, b=200, c=300, **kwargs):
    print(a, b, c)

d = {'a':1, 'c':3}
f0(**d)
f0(b=2, **d)
f1(**d)
f2(**d)

#output
1 20 3
1 2 3
{'c': 3, 'a': 1}
1 200 3
 
8:21 AM
I'm doing that thing where I can't figure out a nice reusable thing in advance, so I'm doing lots of cutting and pasting and hoping I'll figure it out afterwards and can then refactor.
 
@RobertGrant A guy I know once declared that programmer's editors shouldn't have cut & paste functionality after he created a bug-ridden monstrosity using that technique. :) On a more serious note, that kind of stuff can be painful to refactor if you don't comment it well. Otherwise, it's hard to remember which parts are supposed to be identical, and which parts are supposed to be almost identical.
 
8:38 AM
Yeah that's not a bad idea :)
 
@pm2
 
Thankfully this is pretty limited in scope. But perhaps you're right - I may come to regret my lack of up-front design ability :)
Perhaps some sort of closure would help. Hmmmm.
 
Right I'm going to whisper a naughty too broad question and see whether there's anyone around who will slap my wrists. Or even better, answer it ;)
 
8:53 AM
@PM2Ring Here is code:
result = authorize.Transaction.sale({
'amount': 40.00,

'credit_card': {
'card_number': '4222222222222',
'expiration_date': '04/2020',
'card_code': '343',
},
})
if I have to deinf credit_card dictionary outside the function and pass it as argument how to do that?
 
@JRichardSnape /me gets ready to start slapping :p
 
I'm going to learn flask by converting a little desktop app I've written to do I/O via a web UI. Just wondering whether there is convention on directory naming within the main application directory (e.g. where you put your views.py etc.) I've had a look at sopython (which seems to put views.py in ext, for example) and I think this implies it's up to me as the mega-tutorial puts the same file in /app. Total noob at moving Python beyond playing on my desktop, so you can't be too basic.
readies himself for slapping by @joncle
 
I'd use blueprints
 
@arshpreet Just define the credit_card dictionary in the normal way, and pass it as a parameter. It's just like the 1st example I posted that uses mydict. BTW, you can use the Fixed Font button or Ctrl-k to format a message as code.
 
@RobertGrant go on...
 
8:58 AM
If you app is big enough to need structure
 
OK - found page and I will read...
 
I'd also use blueprints if you need structure.
 
So, if it's pretty small, I'd just have models.py, views.py, a templates/ folder and an run.py in the parent dir, which also holds venv, alembic, etc, but as it gets bigger you probably want to separate different areas into blueprints
A better teacher than I has made this example
 
OK, well it has two distinct modules within a package in its current incarnation, so it sounds like maybe blueprints is the way forward. Thankee for the pointer.
 
9:02 AM
@RobertGrant yeah - I had a look at that (and will continue to use it as reference), but thought I'd sense check what I was looking at before diving in. Just wasn't exactly sure which bits are arbitrary design decisions and which are required.
 
Yeah, makes sense
We have a bit of expertise in here - I'm aflask noob, fizzy is probably intermediate and davidism is advanced.
 
Most of my flasks involve gin.
 
I have to pass dictionary as parameter in authorize.Transaction.sale() which is defined in library as:
from authorize import Configuration
class Transaction(object):
@staticmethod
def sale(params={}):
return Configuration.api.transaction.sale(params)
so when I try pass dict just a parameter it returns error:
 
9:15 AM
hi ya'all
 
Wow... just followed a link to pintrest and look who I found :p
 
@PM2Ring damn you fine, I'll try something reusable right now. grumblegrumble
 
9:32 AM
@Ffisegydd Mmm Gin flask sounds like a fantastic work aid.
@JonClements I like the way that joke only works for Americans who insist on the artist being called van Go.
 
9:49 AM
@JRichardSnape Oh, I just now got the joke… >_<
 
Yeah same
 
10:00 AM
Where's @idjaw when ya want him, hey? :p
Wow - UK's EU referendum next Thursday... Be glad when that's over and everyone can just get on with their lives :p
 
If I've learned anything from Indy Ref - it's never over.
 
I don't even know where I'll vote
 
@RobertGrant Traditionally at a polling station :p
 
Yeah but where I am is a big site. I wonder if they'll have their own station.
 
@RobertGrant What do you think we should send to FizzyBob Consulting employees telling them how to vote?
Every other business seems to be doing the same.
"You're obviously free to vote for whichever side you see fit, but if you vote "Remain" then we'll fire you and kill your family."
 
10:09 AM
@Ffisegydd sounds reasonable? :p
Looks like it's going to be a close one though
 
I think we should tell them in a way that encourages behaviours we approve of: "You should vote Remain, because the cost of change is much higher than you'd think. Remember Barry, when he wanted to take a sick day? The cost of change for his family once he was fired was very high indeed."
 
You can always fire a couple of exemplars, pour encourager les autres.
It is, after all, the way we English work (according to Voltaire)
I think there will be recounts in a number of areas, it will be that close.
 
Just lower the cost of the EU by stopping them moving to Paris and back every 6 months and I'll be happy.
 
Long time no see @GamesBrainiac - how goes it?
 
@JonClements hey man, too true. Just been really busy, thats all.
 
10:17 AM
Hopefully a good busy :)
 
yea, a good kinda busy.
I changed jobs, and this place is way better than my last place.
but unfortunately, I have to work with django
but i guess there are worse fates.
 
Yethhhh ecthellent. Djoin the Django thide.
 
@IntrepidBrit on the scotch already I see - or did you just nick Fizzy's flask :)
 
It's after breakfast isn't it?
Also, I resent the term 'scotch'. It's either Whisky, or it isn't :P
 
"after breakfast"? Wait wat... you mean scotch isn't breakfast? :p
 
10:21 AM
No mean, it's after breakfast, so I've already had some Whisky :P
<disclaimer>Not actually a raging alcoholic</disclaimer>
 
Umm... sudden craving for a bacon and egg sarnie... bbias :)
 
Sure "bacon and egg sarnie". Is it Jamieson's "bacon and egg sarnie"?
But srsly, why've you already moved Games?
 
Nope - it looks like it's going to be a bacon and egg sarnie without the bacon (as there is none sigh)...
 
@IntrepidBrit Because the old company just made me maintain shitty old code written by 5yos.
 
I think that's overly harsh on the 5 year olds.
 
10:28 AM
lol
true, they tend to be quite smart
but yea, i was maintaining broken code, that sucked, and I just hated the job, no flexibility when it came to working hours either.
so in the end, got a better job, and now happy
:P
 
Wicked - still in the Nederlands?
 
Come to UK before we build a giant wall across the Channel, paid for by the French.
 
11:00 AM
@Ffisegydd just plug up the tunnel with refugees
cabbage
 
Evil and cost effective. I like it
Unless you mean with people trying to flee the UK after "Mad King BoJo" is crowned
 
What would we use for mortar though? Their tears?
 
I was going to say "obsolete EU money" but then realized GBP
 
It would be a good use of the 1p & 2p coins we have.
 
that's still worth more than a forint:D
 
11:05 AM
TIL forint.
 
TIL forint isn't an obscure programming reference
 
no, it's a different kind of joke
 
Nice.
 
Would adopting the Euro benefit Hungary?
 
My gut answer would be "sure, total economical breakdown is fun", but honestly I know nothing about economics
some say that it could be good in the long run, but in the short term all the cheap stuff would get more expensive
and currently we have 3 million people living in poverty what used to be poverty until the government abolished the notion of poverty
there are issues such as our healthcare, schooling and other social systems being essentially dead men walking
there's just too much money being stolen
I have no idea what a gentle prod in the form of entirely changing the monetary system would do:P
 
11:16 AM
Right, I can see where you're coming from. There's too much underlying structural reform required otherwise you could end up in a Greece-esque situation?
 
Well first the current system should be straightened out. Which wouldn't be impossible, the government would only have to stop channeling away all available funds to friends and family. Then there would be resources to stop the social system from collapsing soon
 
@Ffisegydd the alternative Atlantic Tunnel is going to take a while, I think
 
@IntrepidBrit thing is that the switch to Euro hasn't been on agenda since our nice and illiberal PM has been in power, getting more and more friendly with Putin and the other kind dictators. The pros and cons I remember about introducing the Euro all pre-date Orbán's reign, and already then the case wasn't clear. Today the economical situation is much worse.
 
Well, the lure of free/easy money is a slippery one, and Hungary wouldn't be the first country to fall afoul of it -> see Ukraine
 
we're sort of safe because the last thing our government want (at least in terms of rhetoric) is to get more attached to the EU
they are also prone to lying all the time, so they could still pull something like this off, but they still believe that they can do anything independent of the EU, so I think introducing EU money is pretty way down on their list
when they can no longer build more football stadiums instead of hospitals, they might consider that:P
 
11:28 AM
cries on the inside
 
fun fact: our PM has a football stadium in his back yard:D
 
Why aren't there horrible, horrible riots and civil disobedience that would make a punk rocker blush?
 
@RobertGrant have you worked with django rest framework, i know you do a lot of work with django, but i was just wondering if you knew any common pitfalls with the django rest framework.
 
Not used it, sorry. Also I used django once years ago :) But DRF looked pretty nice - there was even a kickstarter for it to fund some improvements
 
11:32 AM
@IntrepidBrit my people are...less than reactive
I'd say stupid, but it's more than that
 
Docile?
 
the guy has great populist rhetoric, and people believed him after being very disappointed in the lefties before him
 
I kinda want to stop talking about this. It's making me angry haha
 
so he was elected with absolute majority
 
@IntrepidBrit yup still in the netherlands.
This is a nice country man, clean air, nice public transport, good homes. The only problem is the weather.
 
11:35 AM
So he had every opportunity to change whatever pieces of the system he needed to be safe. And there's a herd of oligarchs who are more than eager to strengthen the government's power in return for all that nice free money
the national media is entirely under government control, so "the masses" hear all these sunshine stories about how we are prospering and everything's fine
The only single kick-ass demonstration so far was when they tried to introduce an internet tax:D In a way that 1 GB of data would cost the user around 1 euro
turns out they have no idea of how things work, and this single mistake was the only one harsh enough to put an actual mass on the streets (even though they had done some pretty shady stuff before that, such as rehashing our constitution according to their twisted taste, but that just doesn't register on the radar of an average Joe)
 
@GamesBrainiac Haha and here's me thinking the Netherlands' weather was quite nice
@AndrasDeak Hot damn.
 
those protests were large enough to reverse the internet tax, but otherwise nothing's changed, and no big demonstrations have been going on
anyway, this should be enough:D
 
@IntrepidBrit Well compared to london, most likely, its a lot better.
 
@AndrasDeak I honestly feel there should be media regulations/protections that should form a part of joining the EU. Something both the UK and Hungary would benefit from
 
Obviously, yes. There are blatant violations of people's liberty, but there's nobody who is authorized to do anything about it
(well, this is reasonable, we should be able to fix our own mess, and not expect others to solve it for us)
 
11:42 AM
(Well, it's not so much someone comes in and fixes it for you. It would be a condition of joining the EU in the first place / remaining in the EU)
 
I suspect that if some outside power came and somehw forced a liberal democracy onto my country, it wouldn't last
people should learn themselves that they can affect the status quo
talking politics with a Hungarian is always depressing:D
I gotta go anyway, I'll be back later:)
rhubarb
 
rhubarb
 
Yeah coming from SA, you can't impose democracy easily at all
 
Man, the UK doesn't seem so bad now.
 
Over there they just aren't ready for it culturally or intellectually
Most think that democracy is never changing who you vote for, for example
 
11:44 AM
I mean, that's quite true of how most people vote in the UK/USA
haha
But I agree that democratic rights are something that has to be demanded
Case-in-point, police comissioners
 
Well true, but it's way more prevalent over there, and not aligned to interests. At least a rich person always voting to lower taxes makes sense.
 
Very important to have, especially with our police forces (policing with consent), but since no-one asked for it, it's the biggest political farce in the West
bbiab - food times
 
so brits, where are you guys on the brexit?
 
re-cbg
@IntrepidBrit The history of Hungary is generally not a happy story. They had a few golden periods, but they've also been through more than their fair share of invasions, internal struggles, purges, etc. en.wikipedia.org/wiki/Hungary#History
 
@GamesBrainiac I say stay.
I don't want to be voting less smartly than the majority of Scottish people did about the great British break-off
 
12:02 PM
interesting
 
@RobertGrant What I wonder is that if staying will mean ever closer union for the UK.
I don't know if all brits actually want that.
 
Very unlikely IMHO
 
Could do, but that's hard to tell.
If we leave, realise that it sucks and rejoin, we'll have wasted who knows how much money, and will probably have to have the Euro as well.
 
why would you have to have the euro?
 
12:08 PM
Because all EU countries have it except us, because we got a special deal when we joined
Doubt we'd get that again if we in a much weaker position
 
Yeah - that cycle pretty much guarantees the Euro. And loss of the myriad special conditions the UK has because, reasons.
We are special sunflowers, you see.
:D
Anyhow - lunch for me.
rbrb
 
Yeah I actually doubt we'd get a better position, where we have our own currency, but companies can be based here and sell to the EU tariff-free
Plus we'd have to get expensive, slow British workers to do construction instead of the amazing EU staff, so our economy would slow down
(Some slight stereotyping may have been used in the creation of that sentence)
 
Back
 
I'll be voting out
 
Go on then, why? :)
 
12:14 PM
(but hopefully with the thing being to stay in and just rattle the cage a bit)
 
1) I disagree with the tariff-free thing. Since the EU seems to be hell-bent on expanding the free-trade zone with every country, I can't see them doing it with every country except the UK.

2) Trade zones are so 20th century. How many consumers actually notice or care about trade zones? It just magically comes from the internet...
(I'm on the fence, leaning towards staying in the EU fyi)
 
There's only 3 countries that really are keeping the EU going financially...
 
East Germany, West Germany and Germany?
 
@RobertGrant did I just time travel? :p
 
No, just a glitch in the Matrix
 
12:17 PM
I like the EU - don't get me wrong - it just can't keep going the way it is now
 
@IntrepidBrit who else is there a free trade zone for? I see three:
 
East Germany, West Germany and Germany?
 
Argh SVG doesn't work
 
@IntrepidBrit oh - was it the same cat? :p
 
Click on it to see it :)
 
12:19 PM
The European Union has concluded free trade agreements (FTAs) and other agreements with a trade component with many countries world-wide and is negotiating with many others. == Free trade agreements in force == == Agreements provisionally applied == == Agreements signed but not (provisionally) applied == == Agreements finalized (negotiations concluded, but not signed) == == Negotiating == India Negotiations initiated in 2007 on EU-India Bilateral Trade and Investment Agreement are stalled as of March 2015. ASEAN countries – now being pursued individually Gulf Cooperation Council (...
There's plenty of EU->[insert nation here] free trade agreements
You can't tell me Mexico is a more important trading partner to the EU than the UK?
 
But it's only the ones marked FTA, right?
Oh sorry I see, Mexico has that
 
Yeah, and lots of them are in the process of
And don't get me started on TTIP ^^
 
@RobertGrant at the same time - the 5th largest economy in the world should still be able to do its own deals
 
And hopefully NZ/Oz and the rest of the commonwealth aren't still bitter about being dropped like a hot stone :)
 
@IntrepidBrit there is that :)
 
12:27 PM
I was pretty happy about paying a load of money for my wife's visa from SA
 
Yeah, the visa situation in the UK has become horrific. It's the Tory's method of discouraging immigration from non-EU states to for manifesto point scoring
("OI HAI GUYZ. WE reduCed Immigration")
 
It cost £2k in all
 
@RobertGrant youch
 
Like most things where there's no competition, every component of the process is a massive racket
 
I know a mate of mine that now lives in Oz with his wife chose to not get registered to vote as it'd cost him about £10k...
 
12:30 PM
Plutocracy++
 
The House always wins
 
Next SOPython meeting agenda item 1: How to architect government as a set of loosely coupled microservices
 
cbg
@JonClements ahoy pup. What's up?
 
Number 2: what is it with those Ruby folk lol!?
 
recbg
 
12:33 PM
@idjaw Found your DP on pintrest! :p
 
the internet ruined DP for me for good
 
^^^ read up a bit :p
 
on mobile sorry. What's going on? I've been found in some form on the internets?
 
@IntrepidBrit fair point on free trade, but still. I like free movement of skilled labour :)
 
I get that. I'm genuinely worried for the future of some of my clients without it. But on the other hand, I think every state should be allowed to stop immigration for whatever demented reason they fancy.
 
12:45 PM
Given the software industry competes globally and requires no shipping or tariffs, I have less sympathy than perhaps I should
 
Case in point, certain football fans should be blocked from entering a certain country right now ;)
 
Yeah, England.
 
Yup
Although you'd be a devillish genius if you meant football_fans(English) and country(England)
Would suck to be France
 
I did mean that :)
 
You devilish genius you
 
12:58 PM
TFW you answer a question and the OPs account gets deleted so you can't get accepted and you only even know about it because someone upvoted your answer :P
 

« first day (2067 days earlier)      last day (2887 days later) »