« first day (2121 days earlier)      last day (2827 days later) » 

5:10 AM
Cbg
 
Cabbage
 
 
3 hours later…
7:52 AM
@thefourtheye Hi..
 
8:07 AM
cbg
saturday workday
 
 
2 hours later…
10:20 AM
morning-bg
 
bg? Are we abbreviating cabbage -> cbg -> bg now? :p
 
@JonClements the c has been changed to morning ;)
 
10:54 AM
I have a question: I've created a python program that I want to run on differents os eg mac / win / linux. Should I create separate packages for the after-mentioned os or are there other ways to deploy that , in a more homogenous manner (one package for all the os)?
 
11:11 AM
Cabbage
 
11:49 AM
... Canary islands bush fire started by a German guy who tried to burn used toilet paper.
 
12:13 PM
@corvid lol, android wtf.
cordova/ionic always forcefully targets android 6.0 / api 23, with which one cannot use the manifest to set permissions but instead need to ask them at run time, yay.
though nothing seems to work correctly with it.
 
1:11 PM
hey guys, this is a jinja2 syntax question, am I welcome here?
if not could you point me to the relevant chat room?
anyway
 
@UzumakiDev yes
or not only are you welcome here, the jinja2 question is welcome as well, unless it should really be asked on the main site...
 
There's a value I want to retrieve using a loop, I can get to it without being inside the loop with this widget_data.modules_2.value

But I'd like to do something like widget_data.modules_(loop.index).value

What is the correct syntax to use here, I've tried this:
widget_data.modules_' + loop.index + '.value

But it doesn't seem to work.
 
@UzumakiDev why, if you're indexing it by number, aren't you also using a list for widget_data?
 
Sorry, could you expand on that, I'm coming from PHP and this is my first dive into python :)
here's my code
ignore the set data line that was me just trying something
 
@UzumakiDev please use pastebin for such long examples.
 
1:22 PM
sorry :)
 
how about widget_data['modules_' + loop.index].value ?
 
is that supposed to be widget_data.['modules_' + loop.index].value ?
 
ah okay, just checking
That worked! Much appreciated, could you point me to some documentation as to why that worked?
 
normally in python you'd use getattr to get a calculated attribute
thus, something like getattr(widget_data, 'modules_' + '2').value would work
however the expressions in jinja2 are not python, but something rather python-like
so you can use [...] to access attributes as well, just like in javascript
0
A: Using getattr in Jinja2 gives me an error (jinja2.exceptions.UndefinedError: 'getattr' is undefined)

Martijn PietersJinja2 is not Python. It uses a Python-like syntax, but does not define the same built-in functions. Use subscription syntax instead; you can use attribute and subscription access interchangeably in Jinja2: {{ object[att] }} or you can use the attr() filter: {{ object|attr(att) }} From the...

 
1:28 PM
Yea I see the javascript similarities!
this is great, I'm actually using something called HubL which is, I think, like jinja2, it's all a bit confusing syntax wise.
especially considering I've come from php
 
1:59 PM
@WorstForum please read the room rules: don't post recent questions here
 
2:24 PM
@davidism edited by the OP
 
gong
 
Success \o/
 
What's worse than a barely coherent question that contains a giant screenshot of 3 lines of text? Some idiot in the comments telling the OP to post a screenshot of a directory listing too. :( stackoverflow.com/questions/38804991/python-file-access-issue
 
@davidism Ouch. That OP clearly did not understand the difference between user config and app config -_-
 
2:38 PM
The era of gong is long gone :(
Probably for the best
I remember not agreeing with those changes, but they look sensible to me now
 
3:29 PM
Cbg
 
3:45 PM
Hey guys, back again with another jinja2 question
I want to concatenate loop.index onto a string within an expression, again I seem to be running into syntax issues.
This is the line in question:
{% custom_widget {{ "text-area_" ~ loop.index }} widget_name="WWD-Text Area" %}
This works fine:
{% custom_widget "text-area_2" widget_name="WWD-Text Area" %}
I should probably mention this is in fact HubL, which seems to be based off of jinja2
 
@UzumakiDev please format your code ... CTRL+K or the button over there ↘
 
I don't think that nesting expressions works
I assume just {% custom_widget "text-area_"+loop.index widget_name="WWD-Text Area" %} doesn't work?
 
Yea I tried that first, but in the hubspot developer info console it just outputs "text-area_"
 
And if you just output {{ loop.index }} somewhere in the loop it works fine?
 
so i then tried that nested expression, which gives me the same result, other results have been "text-area_loopindex"
if i actually put something like "text-area_2" it works yes
 
3:57 PM
I guess I don't know HubL at all, though
 
it seems a little odd, I can't find an example like this anywhere in their documentation but surely this must be possible. Else I will have to copy and past this loop 10 or whatever times, and that's just ludicrous.
actually, solved it, I have to use this helper function unique_in_loop=True it does the loop.index append for me
Thanks for your help :)
 
I added zero value but you're welcome :-)
 
haha, you added a sanity check, always appreciated
 
 
3 hours later…
6:56 PM
cbg all
 
7:13 PM
ahoy
 
angular...
 
unsurprisingly quiet in here of a weekend.
 
schmangular
 
100% that. hated working with Angular. :)
 
@Withnail Yeah ... too quiet.
looks around nervously
 
7:15 PM
@Withnail I am not yet hating...
 
Think the emphasis should have been on yet there...
:D
 
I haven't actually worked with it. Since yesterday I kinda picked Ionic as the tech for building this web app, it looks like I need to learn it.
@Withnail perhaps
@Withnail Indeed I am worried that the thing looks too simple
but because it is not procedural, I am not sure how to do the complicated things.
 
Tbf, I haven't used Angular 2, so it's been a while.
 
Ionic 1 is in Angular 1.
ionic 2 is in beta, which is JavaScript means that using it is less desirable than ingesting a cyanide capsule really.
 
snort.
 
8:11 PM
hmmmh
WebSQL ftw
 
cabbage
 
hmhmmh
 
@Antti, I forgot to ask yesterday: does the new flame burning in your heart for Android mean that you're php torment is over?:)
 
8:27 PM
Androids apps can use PHP for CRUD
so he may not be safe
 
aaaaaah "you're php torment" :(
 
user559633
cbg
 
cbg
 
cbg
 
on another note, the museums and libraries here are having Pokemon weekends (all are Pokestops with free WiFi) and my kids are having a blast. Plus, I got to show them the space and robot exhibits (they call it Star Wars) which was awesome
 
8:42 PM
those bastards, using a game to spread knowledge
 
user559633
gets blastoise "this belongs in a museum!"
 
museum of technological singularity, amirite?
 
I'm waiting for the "pokemon fossil" exhibit
 
(that's the turtle with a turret on its back, right?)
exhibit, that's the word I was looking for
 
dual cannons
 
user559633
8:48 PM
@AndrasDeak also what i called my apartment in my early twenties
 
Did you get closely attached to your joystick in those days?
 
user559633
:|
 
9:06 PM
also cool was the fact that they had setup a programming tent (was all Java and Minecraft) but my kids just got excited it was Minecraft not quite old enough to parse programming stuff yet
keep seeing the following on Python SOD (improvement requests):
> This should support more than the latest versions of Python 2 & 3.
:\
 
Given that 2.6 and 3.3 are no longer supported, that's not the most useful improvement to focus on.
 
user6568562
9:41 PM
Hey Senseis [ :
 
user6568562
I was wondering if one of you have a link to a useful resource on dynamic sql and parameterized queries
 
user6568562
All I found was debates and pieces of minds on Param Vs Procedural which is, although very insightful, doesn't tend to my noob state.
 
11:28 PM
Hey, I made an OpenCV text parser to parse text. Long story short, it is designed and works to parse one word and occasionally it flubs up a couple characters (one or two). Either by getting the character wrong or skipping it. Since the realm of possible entries is rather low I was thinking about seeing how close the generated word is to a selected word. A "close enough" check so to speak.
So ultimately I am asking what is the best way to determine if a word is close enough to another word.
 
define "close enough"
do you mean recognized "asdl" vs actual "asdf", or comparing as images for closeness?
 
If it was just character corruption I would implement a three strikes your out policy, but the missing character can throw a wrench into the mix
Close enough: "qwertyuiop" -> "qweryuiop"
And: "qwertyuiop" -> "qwergyuiop"
 
people often refer to the Levenshtein distance
 
@AndrasDeak hmmm
@AndrasDeak Neato. Found a python library for Levenshtein and it works great! Thanks!
 
glad to hear that
 

« first day (2121 days earlier)      last day (2827 days later) »