Data dodania Pytanie
2017-01-17 14:01 Executing functions within switch dictionary »
I have encountered a problem when putting all the modules I've developed into the main program. The switch dictionary I've created can be seen below: ...
(3) odpowiedzi
2017-01-15 16:01 GoLang for changing order »
When I execute the code bellow in the sandbox (https://play.golang.org/p/LpOGMsl7W1) and on my PC - i see different array key order. My PC (windows) s...
(1) odpowiedzi
2017-01-14 18:01 jQuery | .css() Multiple Parameters '-' Error »
I have a problem with the .css({}) function in jQuery: I don't know exactly how this function behaves, except for that I understood that I can insert ...
(2) odpowiedzi
2017-01-11 10:01 Ordering dictionary in context Django »
I looked at this thread, with an example of sorting dictionaries. I have a dictionary of programme objects where the key is a programme object and th...
(2) odpowiedzi
2017-01-10 11:01 How to access all dictionaries within a dictionary where a specific key has a particular value »
I have a dictionary of dictionaries, with each nested dictionary having the exact same keys, like this: all_dicts = {'a':{'name': 'A', 'city': 'foo'}...
(4) odpowiedzi
2017-01-09 18:01 Is there a clean test for a dictionary element in Python? »
If I have an element I'm trying to get from a dictionary: my_dict[i]['level_1']['level_2']['my_var']. Is there a cleaner way than doing this to check...
(2) odpowiedzi
2017-01-08 09:01 I'm trying to count all letters in a txt file then display in descending order »
As the title says: So far this is where I'm at my code does work however I am having trouble displaying the information in order. Currently it just d...
(4) odpowiedzi
2017-01-07 07:01 Append to array in [String: Any] dictionary structure »
Assembling a data payload passed to GRMustache.swift for rendering mustache templates, I'm in a scenario where I need to append data to an array previ...
(3) odpowiedzi
2017-01-04 21:01 multi nested dictionary from tuples in python »
I have this list of tuples list_of_tuples = [('0', '1'), ('1', '1.1'), ('1', '1.2'), ('1', '1.3'), ('1', '1.4'), ('0', '3'), ('3', '3.1'), ('3', '3.2...
(2) odpowiedzi
2017-01-04 07:01 How to integrate offline Dictionary with synonyms in android app »
I want to show word meaning and synonyms (offline) on long press on any word, which means that integrating an offline Dictionary with synonyms in my a...
(0) odpowiedzi
2017-01-01 03:01 In Python, why do separate dictionary string values pass "in" equality checks? ( string Interning Experiment ) »
I am building a Python utility that will involve mapping integers to word strings, where many integers might map to the same string. From my understan...
(1) odpowiedzi
2016-12-28 13:12 Can I have an array of objects with a custom toString in JavaScript? »
I've got an array of objects. (Use case might be solitaire cards). I want to embed a toString for debugging them. I'm using the following (simplif...
(1) odpowiedzi
2016-12-21 22:12 Iterating over a dictionary to create a list »
I have the following 4 dictionaries in a MongoDB collection called favoriteColors: { "name" : "Johnny", "color" : "green" } { "name" : "Steve", "colo...
(3) odpowiedzi
2016-12-21 03:12 Explode a dict - Get all combinations of the values in a dictionary »
I want to get all combinations of the values in a dictionary as multiple dictionaries (each containing every key of the original but only one value of...
(2) odpowiedzi
2016-12-08 20:12 Return the maximum number in each array using map »
function each(coll, f) { if (Array.isArray(coll)) { for (var i = 0; i < coll.length; i++) { f(coll[i], i); } } else { for (va...
(5) odpowiedzi
2016-12-04 06:12 Why modifying dict during iteration doesn't always raise exception? »
Deleting an item from the while iterating through it will usually result in RuntimeError: dictionary changed size during iteration exception: d = {1:...
(3) odpowiedzi
2016-12-01 16:12 Use iteritems in a dictionary with datetime as key »
I have a dictionary update_fields that has key/value pairs where the value is another dictionary: {datetime.date(2016, 12, 2): {'t1030': 0, 't1045': ...
(3) odpowiedzi
2016-11-29 18:11 What is the fastest way to get an arbitrary element out of a Python dictionary? »
I have a dict with approximately 17,000 keys. I would like to select one key at a time--it doesn't matter which one, and I don't need it to happen in...
(4) odpowiedzi
2016-11-25 13:11 How to order a dictionary without using _collections or other library? »
So I'm supposed to make a dictionary get ordered, and the way I'm doing it now is not valid; dictionary = _collections.OrderedDict(sorted(dictionary....
(1) odpowiedzi
2016-11-24 01:11 Adding element to a dictionary in python? »
I'm relatively new here, so please tell me if there is anything I should know or any mistakes I am making manner wise! I am trying to add things ont...
(2) odpowiedzi
2016-11-21 19:11 Need assistance with dictionaries, csv files, and lists »
Alright, so I need a code that will take a csv file and reads the values in it (so far I've gotten that part down). What I'm having trouble with is ...
(1) odpowiedzi
2016-11-16 09:11 'dict' object has no attribute 'HTTP_REFERER' »
I've been trying to find the previous url following this answer: Django request to find previous referrer So, in my .py I did: print request.META p...
(3) odpowiedzi
2016-11-11 19:11 Write dict to csv file with keys not in alphabetic order »
I know that when using python to write dicts to csv files, the headers will be put in alphabetic order. So is there a way that I can write the header ...
(3) odpowiedzi
2016-11-11 10:11 python - increase efficiency of large-file search by readlines(size) »
I am new to Python and I am currently using Python 2. I have some source files that each consists of a huge amount of data (approx. 19 million lines)....
(2) odpowiedzi
2016-11-11 00:11 Performance problems with Clojure HashMap's lookup »
I was trying to implement a pure functional Sieve of Eratosthenes' algorithm, based on this paper: https://www.cs.hmc.edu/~oneill/papers/Sieve-JFP.pdf...
(0) odpowiedzi
2016-11-05 18:11 Scala - map function - Only returned last element of a Map »
I am new to Scala and trying out the map function on a Map. Here is my Map: scala> val map1 = Map ("abc" -> 1, "efg" -> 2, "hij" -> ...
(1) odpowiedzi
2016-11-05 13:11 Python - order a dictionary [key = string, value = list ] by first value in list »
I have this dictionary: {u'country__other': [2, u'country', u'other', '-19.6%', '-30.8%', -2326], u'Reg_Device__Desktop': [1, u'Reg_Device', u'Deskto...
(1) odpowiedzi
2016-11-04 04:11 adding doubles contained within a dictionary swift 3 »
Good afternoon, I am attempting to learn a little bit about Swift and am following along with a Udemy course. The course is taught in swift 2 and I a...
(1) odpowiedzi
2016-11-04 01:11 Cannot convert value of type 'NSDictionary' to specified type 'Dictionary' »
Why is this possible: var orderRequestUserValues : Dictionary = [ "ClientID": "TEST", "UserName": ...
(3) odpowiedzi
2016-11-03 18:11 Parsing XML into a dictionary of lists Python/Django »
I'm having a little issue with parsing an xml with python. I'm trying to get my dictionary to look like the following listDict = [{'name':'Sales','id...
(1) odpowiedzi
2016-11-03 13:11 How to create a nested dictionary from a list in Python? »
I have a list of strings: tree_list = ['Parents', 'Children', 'GrandChildren'] How can i take that list and convert it to a nested dictionary like th...
(3) odpowiedzi
2016-11-03 10:11 Two arrays into one Dictinary »
I would like to create a Dictionary<string, int[]> dict out of two arrays: string[] keys = { "A", "B", "A", "D" }; int[] values = { 1, 2, ...
(3) odpowiedzi
2016-11-01 11:11 how to convert NSDictionary to dictionary in Swift 3? »
I have already updated xcode to xcode 8 and now I need to convert my code from swift2 to swift 3. before when I want to convert NSDictionary to dicti...
(1) odpowiedzi
2016-10-24 20:10 Putting two keys with the same hash into a dict »
>>> one_decimal = Decimal('1') >>> one_complex = complex(1,0) >>> d = {one_decimal: '1D', one_complex: '1C'} >>> m...
(3) odpowiedzi
2016-10-23 08:10 Max value for each object in an Array of Dictionaries »
I have an array of dictionaries that I am trying to get the Max score for each player in the array. Each player can have multiple entries I am trying ...
(5) odpowiedzi