Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
51 views

can we change the native semantics of landmark elements or any element of html5 using aria, is it semantically correct and conforming to do so ? Suppose I want to use the dialog element as a ...
Leconte''s user avatar
0 votes
2 answers
585 views

I run some simulations whose result is a dict like this: results = { 'this': 5, 'that': 6, 'those': [2.34, 5.67] } I save it in a human-readable format using code like this: s = '' for ...
anatolyg's user avatar
  • 28.5k
0 votes
1 answer
59 views

This function exposes the value of worldSize, so it is a form of representation exposure: /** * Returns the size of the simulation world. * Used for documentation ONLY * Should not have ...
Florian's user avatar
0 votes
1 answer
49 views

I have been reading about binary heaps and I was wondering if there was a similar representation that could be used to represent a non-complete binary tree, if that binary tree happened to also be ...
user21749640's user avatar
1 vote
1 answer
54 views

I have a file with binary numbers that I would like to alter inline with sed -i. The file has lines like this: 00018342 0000 dc.b 11010101b So I would like to have it represented this ...
Trevor Acton's user avatar
-1 votes
1 answer
190 views

Does anyone have an idea of generating a plot that would look something like this: Basically, I would have sequences, say T1 and T2, which need to be aligned to the "main" sequence. Also, ...
FastaGuy's user avatar
0 votes
0 answers
158 views

I have 3 controllers like that: A -> B -> C A: Present to B B: Present to C From C, I used the code below to transition to A window.rootViewController = nil window.rootViewController = vc let ...
solitary's user avatar
1 vote
1 answer
173 views

I'm using the nim programming language and am doing some metaprogramming. I want to write a DSL of some sorts that enables generating procs. For that I want to pass some nim-code into a macro (e.g. a ...
Philipp Doerner's user avatar
0 votes
1 answer
140 views

I have a set of same-sized n(=25) matrices, m_1, m_2, ..., m_n, where each matrix falls into one of 10 classes. For each matrix, I have to find a "pair matrix" from the set so that the sum ...
Liisjak's user avatar
  • 37
1 vote
2 answers
277 views

There are different ways to represent (display) an object in PowerShell but when it comes to complex objects it is either very verbose or quiet useless: $Object = @{ 'a' = 1; 'b' = 2 } Just ...
iRon's user avatar
  • 24.4k
0 votes
1 answer
82 views

Recently I faced with such string representation of binary-data: \xfa\xd4\xe4d\x00\x00\x00\x00 It is string representation of little-endian UNIX timestamp (1692718330) I understand that, for example, \...
cooleck's user avatar
  • 339
1 vote
2 answers
1k views

I am using bitstring to perform an xor operation on the ith bit of a string: string = bitstring(string ⊻ 1 <<i) However the result will be a string, so I cannot continue with other i. So I want ...
Nikola Tolzsek's user avatar
0 votes
1 answer
919 views

I am confused on how to present this in decimal value Would it be just the negative value of 223 or would it be -125?
sleepy's user avatar
  • 1
0 votes
1 answer
30 views

How do I create a representation when my constructor has added kwargs? class Thing: def __init__(self, a, b, **kwargs): self.a = a self.b = b self.__dict__.update(kwargs) #...
a11's user avatar
  • 3,476
-2 votes
1 answer
46 views

I'm looking for a neural network model that can extract useful information from an image. Here "useful" is arbitrarily defined by the user based on some specific task the autoencoder needs ...
gimi's user avatar
  • 434
11 votes
5 answers
9k views

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 ...
habrewning's user avatar
  • 1,129
0 votes
1 answer
1k views

I am using Notion for my studies: so I have to use Latex to represent the equations or others math stuffs. I noticed that I can use the Newtonian notation on Latex with the command \dot or \ddot (...
Emiliano Cacciuto's user avatar
0 votes
0 answers
115 views

I have to represent this pulses in Matlab but only when i find a 0 in a vector This is my code, i generate a vector with 10 numbers 0s and 1s but I am not able to program the representation of the ...
Rainor's user avatar
  • 91
1 vote
1 answer
90 views

I know that most significant bit means the sign of a number in signed types. But I found one strange (for me) thing: if the number is negative and we use short type, this number will look like 0xffff##...
Igorka's user avatar
  • 33
0 votes
1 answer
639 views

Given a 32-bit hex like 0x7f000002, how do I get the full value of this number printed in binary without using bitset or defining any float variables to use union? I know that it is supposed to ...
Long Huang's user avatar
0 votes
1 answer
877 views

I have float values with high precision. When I convert them to a string I lose precision. I am storing this float value in a Json::Value object. And I need to later take the float back out of the ...
Nick's user avatar
  • 39
0 votes
2 answers
398 views

I've found many places that shows expression-trees that involve operators (+,-,*, &&, ||, etc). Here is a simple example: But I can not find an example when functions (with zero or more ...
peyrona's user avatar
  • 58
2 votes
0 answers
60 views

I have this template that wrap an unsigned integer type (any) : template<std::unsigned_integral T> struct base_dig_t {T m_data;}; Then I have this template to modify the behavior ...
Earendil's user avatar
4 votes
1 answer
808 views

I am trying to embed an interactive graph in the _repr_html_() method of a class C. What I have tried so far does not seem to be working in my Jupyter Notebook. Plotly (python) Here is an example plot ...
Pietro D'Antuono's user avatar
2 votes
0 answers
138 views

Given a pre-trained well-performing auto-encoder. When I train a classifier on encodings (produced by the auto-encoder) the classifier does very poorly. In particular, it does much worse than training ...
Nandi's user avatar
  • 21
0 votes
1 answer
95 views

I need to be able to use planes as keys in a hash map. The planes are defined by three distinct points in 3d space. I have been unable to find a representation for a plane, that is the same no matter ...
Topi Karvonen's user avatar
1 vote
1 answer
100 views

I have a string like this: string = "b'\\xf4\\xf0\\xf2\\xef\\xf8\\xf2\\xee'" So far I have come up with this: arr = np.array([int(s_num, 16) for s_num in re.findall(r'x([a-f0-9]{2})', ...
vrbadev's user avatar
  • 506
2 votes
1 answer
743 views

I have the following method: def getInvoiceById(self, id): for invoice in self.invoices: if invoice.id == id: return invoice return False inside a ...
ExtrovetedProgrammer's user avatar
0 votes
1 answer
92 views

Let's say that I have a Single-precision floating-point format variable in my machine and I want to assign on it the result of a given operation. From Wikipedia: The IEEE 754 standard specifies a ...
user1172131's user avatar
0 votes
0 answers
20 views

I'm pretty sure that this has to do something with (representation of) numerical precision. But in this case, I find it especially unintuitive and I want to understand what happens and why it happens. ...
swolf's user avatar
  • 1,175
0 votes
0 answers
355 views

I'm working on an ocean weather visualization tool with Leaflet and I would like to add a waves layer, like this one of windy. I already have the data and I can adjust it to any representation. How ...
Javier Jiménez de la Jara's user avatar
1 vote
2 answers
1k views

Pint units are represented by default with their full name: >>> import pint >>> ureg = pint.UnitRegistry() >>> q = ureg.Quantity('3.456 m^2') >>> print(q) 3.456 ...
mmj's user avatar
  • 5,748
0 votes
2 answers
468 views

I have a integer array, int KEY[32], that stores the binary representation of a four letter quadgram, e.g.: char quadgram[4] = {'T','I','O','N'}; Where the binary representations of the characters ...
Andrew Masden's user avatar
1 vote
1 answer
903 views

How do I represent negative numbers in non-10 bases, eg say in base 20. I know how to do this in binary using two's complement, but what would the equivalent of two's complement be in other bases? For ...
Krokodil's user avatar
  • 1,479
2 votes
1 answer
335 views

I have been reading a few papers on canonical SMILES strings recently and to me it seems like the canonization procedure most of the time relies on adding additional chemical information into the ...
Chris's user avatar
  • 41
0 votes
1 answer
492 views

When processing signals and sensor values in embedded C, we can usually choose between representing the values in floating-point (e.g. IEEE 754) or fixed-point, the latter often preferred when no ...
Matjaž's user avatar
  • 302
2 votes
0 answers
117 views

There are many ways to represent data using binary like - unsigned, signed magnitude, 1s/2s complement, offset-M, floating-point, ASCII, and Unicode. Why do we need so many different ways?
sunny's user avatar
  • 189
1 vote
2 answers
1k views

The representation invariant defines which values of the data attributes correspond to valid representations of class instances. The representation invariant for IntSet is that vals contains no ...
Robert John's user avatar
0 votes
1 answer
280 views

Why is that >>> print(f"{-5 & 0b1111: 04b}") 1011 However, >>> print(f"{-5 | 0b0000: 04b}") -101 Moreover, >>> print(f"{-5 | 0b1111: ...
LAKSHYA SINGH's user avatar
0 votes
1 answer
1k views

I'm currently writing my master thesis about clusterings in graphs. My prof said he wants the graph to be represented as a hash table. Because it needs less space than the adjency matrix and it is ...
Lisa's user avatar
  • 53
0 votes
0 answers
153 views

Sorry for asking a question like that, but I'm really stuck. I have this method for reading data from file: public void ReadFromFile() { string fileName = @"my .txt file path"; ...
Elizabeth Grant's user avatar
50 votes
3 answers
5k views

If the representation of a long int and a int are the same on a platform, are they strictly the same? Do the types behave any differently on the platform in any way according to the C standard? Eg. ...
Vilhelm's user avatar
  • 727
2 votes
0 answers
266 views

I am quite new to Python. I am working on an application which uses lists of Datetime objects (from the datetime module). I want to debug my app, so I print (or log) thoses lists, but it returns me ...
Robin Warrot's user avatar
1 vote
0 answers
73 views

So imagine we have a function F(x), where x can be any 8bit number, and our functions returns mirrored number. How could this function look in decimal format or maybe do you even would think of binary ...
LostPuppy's user avatar
0 votes
1 answer
90 views

I have a code like this that converts a short integer to binary, but zeros are printed at the beginning. So here's how to make sure that these zeros are not displayed, and the output starts from the ...
eLimiT's user avatar
  • 3
1 vote
1 answer
351 views

We have a group of people. They are randomly assigned a number each week from 0 to 10 and if the number is greater than 9 so they become leaders .If they are more than 1 people, they all become ...
ToErotimatiko's user avatar
4 votes
2 answers
2k views

Is there a simple way to get the output of print as a string variable? Something like: output_string = print(object) the function print() imho has a rather "intelligent" way of representing ...
Honeybear's user avatar
  • 3,208
4 votes
1 answer
2k views

In my program there is a REPL loop that occassionaly need to print to the console a string representation of the given string variable. For example, suppose that we have have a string variable str ...
Jaroslav Modry's user avatar
0 votes
1 answer
2k views

I am looking for a way to reduce a decimal integer representation to a string with the fewest characters possible. E.g. hexadecimal uses the letters A-F on top of the decimal numbers. hex(123) Is ...
caliph's user avatar
  • 1,449
5 votes
2 answers
155 views

This is somewhat of a broad topic, but I will try to pare it to some specific questions. I was thinking about a certain ~meta~ property in Python where the console representation of many basic ...
Tom's user avatar
  • 8,840

1
2 3 4 5 6