Questions tagged [data-representation]

177 questions
6
votes
2 answers

How to get rid of the single quotes around the representation of a string?

This sample code prints the representation of a line from a file. It allows its contents to be viewed, including control characters like '\n', on a single line—so we refer to it as the "raw" output of the line. print("%r" % (self.f.readline())) The…
TMWP
  • 1,545
  • 1
  • 17
  • 31
5
votes
1 answer

pie chart of co-presence in clusters for about 10 factors in r

I've got a two-column dataset with about 30000 clusters and 10 factors like this: cluster-1 Factor1 cluster-1 Factor2 ... cluster-2 Factor2 cluster-2 Factor3 ... And I would like to represent the co-occurrence of factors in the clusterset.…
719016
  • 9,922
  • 20
  • 85
  • 158
5
votes
5 answers

what is binary data?

gcc 4.6.0 What does binary data look like? Is it all 1's and 0's. I was just wondering, as I was talking to another programmer about copying strings and binary data. Normally, I use strcpy/strncpy functions to copy strings and memcpy/memmove to copy…
ant2009
  • 27,094
  • 154
  • 411
  • 609
5
votes
4 answers

Can a type in C have more than one object representation?

The C99 standard, section 6.2.6.1 8, states: When an operator is applied to a value that has more than one object representation, which object representation is used shall not affect the value of the result (43). Where a value is stored in an…
cmutex
  • 1,478
  • 11
  • 24
4
votes
4 answers

What is an S-Expression

All Lisp developers seem to know what an S-Expression is. But can anybody explain this for non Lisp developers? There is already a Wikipedia entry (https://en.wikipedia.org/wiki/S-expression). But that is not really helpful if you don't want to go…
habrewning
  • 735
  • 3
  • 12
4
votes
6 answers

How do you represent large matrices from your algorithm to aid you when debugging?

The basic approach to this is printing the matrices. But when you get to bigger numbers, even though you're debugging (the algorithm might not work for 2 by 2 or 4 by 4 matrices), it starts to get hairy really fast. This can be language specific or…
Paul Irofti
  • 412
  • 3
  • 17
3
votes
5 answers

How do I pick a good representation for a board game tactic for a genetic algorithm?

For my bachelor's thesis I want to write a genetic algorithm that learns to play the game of Stratego (if you don't know this game, it's probably safe to assume I said chess). I haven't ever before done actual AI projects, so it's an eye-opener to…
3
votes
3 answers

How to effectively store a large set of permutations?

Let's say we have a list of elements: [{dog,1},{dog,2},{cat,1},{cat,2},{bird,1},{bird,2},...] I would like to store all possible permutations of this list in the RAM. Since the list can be pretty long (10 elements and more), it takes a lot of space…
skanatek
  • 5,133
  • 3
  • 47
  • 75
3
votes
3 answers

How to represent complex and hybrid data

I have a quite complicated question. I'm looking for a javascript or PHP script that can take about any data (arrays, mysql queries ...) and make a table / pivot table / chart of it. to be simple, I want an app that is able to take any data and…
Stéphane Goetz
  • 682
  • 1
  • 7
  • 16
3
votes
1 answer

Erlang binary representation for float & integer, discrepancy?

Got another Erlang binary representation query ('coz that's what I am reading about these days, and need for binary protocol implementation). If I understand the type-specifier properly, then, for a "float" type value the 8 byte representation seems…
bdutta74
  • 2,798
  • 3
  • 31
  • 54
3
votes
3 answers

The smallest `max_arity` of compound terms in ISO Prolog programs

Prolog systems aiming at iso-prolog conformity do not have to support compound terms with arbitrarily large arities. The Prolog flag max_arity reflects this. According to ISO/IEC 13211-1:1995: 7.11.2.3 Flag: max_arity Possible values: The default…
repeat
  • 18,496
  • 4
  • 54
  • 166
3
votes
2 answers

Largest odd integer that can be represented as a float

I was wondering what largest odd integer that can be represented exactly as a float? And why there is a difference between the largest even integer represented as a float in this case. I believe it would have to do with the base 2 exponents 2^n-1,…
3
votes
1 answer

Visual representation of sets

I have some experimental data and I have decided to represent them as sets. Let's say, there is a main set called E={a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s} (blue circle) and several sub-sets B (red dashed ellipses) which contains elements from main…
Bakhtiyor
  • 7,198
  • 15
  • 55
  • 77
3
votes
1 answer

C++: String Representation of Class for Debugging

I'm debugging a program written in C++, and I would like to have an intuitive representation of objects I deal with. Is there a specific method that C++ debuggers (gdb in particular) would expect a class to implement for them to use at runtime? For…
3
votes
3 answers

Haskell: create different representations for same data

Suppose I have some data that is organized in a grid like this (dimensions may vary, but side of a grid is always n**2): 0 1 2 3 4 5 6 7 8 9 A B C D E F What I would like to achieve is to have a list with the same data represented in different…
sukhmel
  • 1,402
  • 16
  • 29
1
2
3
11 12