Quantcast
Channel: User abought - Stack Overflow
Browsing all 43 articles
Browse latest View live

Comment by abought on Can't figure out a Python exercise with dictionaries

This isn't a homework site. It sounds like you need to read the documentation for (the type of data structure represented by inventory), to discover: how to check whether a key is present; how to get...

View Article


Comment by abought on How to parse a structured text file into MySQL records...

I haven't used it personally, but- recognizing that ubuntu is a flavor of debian- you might be able to reuse a prebuilt parser for debian package files. Eg packages.debian.org/sid/python-debian /...

View Article


Comment by abought on Generate one specific permutation of array based on an...

We could hard-code the list of all permutations, but for a 6-item list, that's 720 hard coded items. (it gets big fast) There's no caching because the list of possible arrangements is generated on the...

View Article

Comment by abought on Generate one specific permutation of array based on an...

If I'm reading this correctly, one drawback is the need to brute-force calculate at least every arrangement up to and including the one desired. This might be be feasible, but as people progress deeper...

View Article

Comment by abought on Filter data using params in ember

You already do. It's the if block that doesn't return a promise. It should read: something like return this.get('store').query('car', { filter: { brand: params['marca'] }});

View Article


Comment by abought on Is it ok/pythonic to call another function as an...

You can slightly shorten the second example as name = name or get_name(). But Daniel is right- the first example runs a risk of introducing very subtle bugs.

View Article

Comment by abought on Mouse pointer not staying hidden on chrome fullscreen div

Interesting. I'm not sure why inlining the image solves this (especially when the alternative was cursor: none), but it does seem to help in preliminary testing. A strange issue with a strange answer,...

View Article

Comment by abought on EmberJS Getting Broccoli error when Ember build prod

Did you always see this error, or is it new? We had a similar (though different) error message today, which we traced to a recently released new version of a dependency (ember-cli in our case). Pinning...

View Article


Comment by abought on Ember ember-simple-auth override...

For details on available options, see the API docs: ember-simple-auth.com/api/classes/Configuration.html

View Article


Comment by abought on Hiding an (active) app/game from search results

@MarcinOrlowski : Because our app is in a broken state without it- configuration is part of making things work. Slightly less cheekily, this is the recommended mechanism for in depth questions on...

View Article

Comment by abought on Issue making range requests in some browsers

Thanks for the helpful links- particularly the ticket with browser status! Though it seems there is some role in the server sending back an unreadable response, GitHub's support page explicitly...

View Article

Comment by abought on Total memory used by Python process?

Note that this may fail if you just try to use time instead of /usr/bin/time. See: askubuntu.com/questions/434289/…

View Article

Comment by abought on Terraform output being flagged as sensitive

This fixed it for me as well. Very unintuitive: a) without the extra cloud security setting, terraform console on my local machine could see the value from that provider even when running within the...

View Article


Answer by abought for Python text clustering software or package

It's not entirely clear what your goals are, or what your data looks like. (A list of wordcounts per passage? Something else?)For starters, then, I would recommend separating the data collection/...

View Article

Answer by abought for Compare multiple columns in numpy array

Extending on unutbu's longer answer above, it's possible to generate the masked array of scores automatically. Since your scores for values are consistent every pass through the loop, so the scores for...

View Article


Answer by abought for Tuple as index of multidimensional array

You can also pass in your first tuple alone to get the slice of interest, then index it seprately:from numpy.random import randbig_array=rand(3,3,4,5)chosen_slice = (2,2)>>> big_array[...

View Article

Answer by abought for Convert lists into 'transposed' list

I notice that your data includes time stamps and numbers. If you're doing number-intensive calculations, then numpy arrays might be worth a look. They offer better performance, and transposing is very...

View Article


Answer by abought for Split a tuple of tuples (or list of lists) of paired...

You could manually define your sublists using slicing:completeset1=megalist[0:4]completeset2=megalist[4:]However, it really sounds like you'd like to apply some deeper logic, or use additional data, to...

View Article

Answer by abought for Histogram with bins a percentage of values?

In general, it's convenient to create histograms using pre-defined tools like numpy.histogram , though your newly posted comment- suggesting that you're using matplotlib- is also totally fine. Either...

View Article

Answer by abought for Why I can't read anything with File.open in python when...

In line 3, f.close should read f.close(). To force the file to write immediately (rather than when the file is closed), you can call f.flush() after writing: see Why file writing does not happen when...

View Article
Browsing all 43 articles
Browse latest View live


Latest Images