208 questions
7
votes
4
answers
413
views
Counting instances of genotype strings where order is irrelevant within locus
I'm looking at genetics punnet squares for two homologous chromosome pairs, which I've modeled in R like this:
# Punnet square for two homologous chromosome pairs
col_names<-c("AB", "...
Advice
0
votes
2
replies
35
views
Applications for a pattern matching on unordered trees with wildcards/variables
For one of my projects, I have been working on a pattern matching engine that determines if a pattern tree can match to a target tree. The trees are rooted, the children are unordered, and the nodes ...
0
votes
1
answer
304
views
Implementation of Static Flat Map
How to implement a flat map using arrays when keys are known at compile time. Imagine I know my keys:
enum class Asset
{
FONT,
TEXTURE
};
struct AssetContainer
{
};
Hence I could do:
struct ...
-1
votes
2
answers
218
views
How to append li element, to another list
I have a list that i want to append another list on certain conditions.
The structure looks like this:
<ul class="menu">
<li class="list-1"><ul class="ul-1"...
1
vote
1
answer
149
views
How to handle unordered sets of tags in Python Pandas Dataframe in terms of merging
I have two Dataframes which contain tags in one of the columns. Tags can be present or absent in the list and are stored in an unordered manner. I would like to get the merge of the two datasets with ...
0
votes
1
answer
240
views
Python: How to get the unordered result from starmap_async
So the thing is I want to get the return value from the starmap_async. However if I use the .get() to get the list of the result, it is little slow and same as starmap. How do I change the following ...
0
votes
1
answer
95
views
jQuery versions after 3.3.1 are corrupting html inserted in a page with .html()
For over 10 years now we have developed single page applications where an AJAX call goes out and downloads the text/html of an inner page from a template folder with all of our page content. When it ...
0
votes
0
answers
197
views
How can I tell R to use a specific reference level in a linear model?
I am trying to change the reference level for a linear model. R thinks my distance variable (entered as a character string) is "ordered" based on alphabetical order as follows: 10m, 15m, 20m(...
0
votes
1
answer
47
views
Angular shows random image order but it should't
I try to show some images on a single page in a strict order. The images comes from a NodeJs web server as ArrayBuffer.
This is the recommended version but isn't working. The order of images is ...
0
votes
2
answers
186
views
why parallel streams will only perform a concurrent reduction if either (not both) the stream is unordered, or the collector is UNORDERED?
I'm struggling understanding the rule mentioned in Java docs (https://docs.oracle.com/javase/8/docs/api/java/util/stream/package-summary.html) related to parallel stream stating that "The Stream....
0
votes
2
answers
1k
views
Django Password not encrypted, custom user model using (AbstractUser)
In Django I have replaced the user model using (AbstractUser).
Then in the admin panel area the fields are unordered. When generating a new user, the password is not encrypted, the user is saved with ...
8
votes
3
answers
704
views
C# Dictionary that uses an Unordered Pair as its Key?
I'm trying to create a Dictionary is C# that takes an Unordered Pair of Indices as its Key.
For example:
exampleDictionary[new UnorderedPair(x,y)] and exampleDictionary[new UnorderedPair(y,x)] should ...
0
votes
1
answer
109
views
Sort strings of ints and save original index
I would like to sort lists of the following form:
['1000-1005', '6767-8787', '88-5607', '600-607', '909-950']
by the integer value before the '-' symbol and also store the original index after sorting,...
0
votes
1
answer
953
views
SQL Server Insert on the last Row
I have a statement which Inserts a new row to the table in my database, but the new row is added on the first row of the table. I want to add a new row on the end of the table, how would I do this?
...
0
votes
1
answer
662
views
Cloud Pub/Sub - Single message delaying others (HoL blocking?)
Today I experienced something I found rather interesting.
I had a batch of unacknowledged messages that were all published within the same second, and for an expected reason, one of these messages ...
-4
votes
1
answer
513
views
Why does an unordered sequential stream always return the same thing to me when it shouldn't?
List<Integer> list = new ArrayList<>();
for (int i = 0; i < 100_000_000; i++) {
list.add(i);
}
list.stream().unordered().limit(50_000_000).skip(25_000_000).findFirst().ifPresent(...
-1
votes
2
answers
212
views
Matching unordered values in R
I'm working with a dataset with two columns that look something like this:
df <- data.frame(
Row1 = c("1, 2", "2, 6, 4", "3, 1", "2, 1, 4", "3"),
...
2
votes
1
answer
1k
views
change the order of a factor character vector
I have a character factor-leveled vector.
cat <- as.factor(c("AS-GEN-SUM-10-Fall", "AS-GEN-SUM-3-Fall","AS-GEN-SUM-4-Fall","AS-GEN-SUM-5-Fall"))
cat
[1] AS-...
5
votes
2
answers
3k
views
Why are python sets "sorted" in ascending order? [duplicate]
Let's run the following code:
st = {3, 1, 2}
st
>>> {1, 2, 3}
st.pop()
>>> 1
st.pop()
>>> 2
st.pop()
>>> 3
Although sets are said to be unordered, this set behaves ...
0
votes
1
answer
421
views
Is there a way to consider JSON arrays unordered in Go?
I'm trying to replicate the object-hash npm package in Go and need to be able to support unordered arrays (i.e. ordering of arrays shouldn't matter while deciding whether one JSON is different from ...
0
votes
2
answers
1k
views
How to sort the month name in the graph in python(Jan,feb...... and so on) right now it is not in ordered form
In code I have already created a month column and groupby it according to month but the months names are not sorted. How can I do it
enter code here
plt.figure(figsize=(8,4))
bymonth = df1.groupby('...
0
votes
1
answer
2k
views
Trying to create Unordered Access View on a 2D texture
I am trying to use the GPU to do some math on 2D arrays, which I supply to the compute shader as simple 2d textures (in R32_FLOAT) without mipmaps, tied to Shader Resource Views. They work, they are ...
1
vote
0
answers
93
views
ReactJS Wrappable Component Inside Unordered List, gives error acording to the place where it's wrapped
I'm still learning ReactJS but I found something weird, I'm using the special props children for a Card component, which is going to be wrapped around some elements fetched from Firebase. I was using ...
5
votes
1
answer
704
views
Is there something like std::remove() which does not preserve the order of retained elements of a vector?
In C++14, I have a std::vector of values for which I want to remove all elements that match a given value and I do not care about preserving the order of the elements after doing the remove. The ...
0
votes
1
answer
31
views
Multiple unordered list value to paypal
I've got a form with 2 radio buttons.
Based on the radio buttons an unordered list is shown (hide/show using js).
This works as desired.
The list is used to select a service.
When I select a service ...
0
votes
1
answer
416
views
C++ Comparison operators for std::unordered_set
This post raised a question of the absence of >, < .. comparison operators for unordered containers in C++. From the reply it looks meaningless to have those.
However, I checked Python and see ...
1
vote
1
answer
78
views
Reason for boost::extension.hpp does not defining hash_value() for unordered and some other containers
From the boost documentation:
It also implements the extension proposed by Peter Dimov in issue 6.18 of the Library Extension Technical Report Issues List (page 63), this adds support for:
...
**the ...
0
votes
3
answers
332
views
std::unordered_map not behaving as expected
std::unordered_map<std::string,std::string> mymap;
mymap.insert(std::make_pair("ELEMENTTYPE", "NEWINTERFACE"));
mymap.insert(std::make_pair("STYLEFILE", "...
0
votes
1
answer
82
views
Javascript array returns unordered index list when logged from $.ajax call
I have a simple array of exactly 10 elements; their key, value pairs return correctly ordered when logged.
$.each( sArray, function(i, k) {
log(i, k);
// log(i, k) returns correctly
// [0] ...
0
votes
2
answers
748
views
Sort multiple lists based on selected options using JQuery
HTML Code
<Select id="alphalist">
<option value="a">A</option>
<option value="b">B</option>
<option value="c">C</...
0
votes
2
answers
262
views
Display a single list from group of lists based on selected option using JQuery
HTML code
<Select id="alphalist">
<option value="a">A</option>
<option value="b">B</option>
<option value="c">C</...
0
votes
1
answer
39
views
Find non-sequenced pattern between two delimiters
I am trying to use REGEX in order to find out if a certain tag is found inside the source code of a website.
The tag definitely starts with "<link" and definitely ends with ">&...
0
votes
2
answers
361
views
Time complexity when have composite data type such as tuple or pair?
In Hash map data structure such as unordered_map in C++:
unodered_map<char, int> mp = { {'a', 10}, {'b', 20} };
if (mp.find('a') != mp.end())
cout << "found you";
we know ...
0
votes
2
answers
494
views
How to get rid of extra bullets in my unordered list?
Hi I am printing an array to my DOM using an input method. I can get the user input to print out the list, but there are too many bullets. Here is my code below:
function addPokemon() {
var ...
1
vote
1
answer
824
views
An unordered Binary tree Implementation
I am trying to create an Unordered Binary tree. How do we insert a Treenode in an unordered Binary tree? What should be the logic?
By inserting here I mean inserting the node as a leaf. Like if I ...
2
votes
2
answers
761
views
will it change the address of a existed key's value when inserting new keys?
In my code,there will be inserting or deleting in a std::map,but not change the value of a existed key.
will it change the address of a existed key's value when inserting/deleting new keys ?
int ...
1
vote
2
answers
2k
views
C++ Map with vector as key. How to make it so vector order doesn't matter?
I have a map that takes a vector of ints as a key. I initialise the map with a key vector of values {1, 2, 3}
typedef std::map<std::vector<int>, std::string> VectorMap;
VectorMap ...
8
votes
2
answers
6k
views
How can I save the original index after sorting a list?
Let's say I have the following array:
a = [4,2,3,1,4]
Then I sort it:
b = sorted(A) = [1,2,3,4,4]
How could I have a list that map where each number was, ex:
position(b,a) = [3,1,2,0,4]
to clarify ...
0
votes
0
answers
348
views
VBA HTML drill down code [extracting <li> values in <ul> drop down list]
I have been playing around with loading webpages into VBA as XML's and iterating through its data and have stumbled across a roadblock while trying to loop through the "li" tags nested in a "ul" tag. ...
0
votes
0
answers
160
views
How to check both list has same values and same length in python [duplicate]
for Example:
a = ['yes','no','both']
b = ['no','both','yes']
it should return True.
1
vote
2
answers
702
views
easy way to map a range of numbers to a value in cpp
Is there any way to map a range of numbers to a particular number or value in cpp like this:
1-10 : 15
10-20 : 05
the range would be consecutive numbers. the value could be any random number. ...
1
vote
0
answers
54
views
Using mvtnorm package to build my own multinomial probit model
I am trying to build a multinomial probit model using the optmix and mvtnorm packages. Am not using the existing libraries for MNP since I will be extending it to multivariate models later.
For ...
0
votes
1
answer
1k
views
Histogram not specifying desired bins in pandas
Code:
np.histogram(df['columnforhistogram'], bins=(np.arange(start=0, stop=2000, step=25)), density=True)
plt.xlabel("Column")
plt.ylabel('Bins')
plt.show()
Output I want:
I want a histogram ...
1
vote
0
answers
1k
views
Python multiprocessing pool imap_unordered
I'm using Python multiprocessing pool imap_unordered.
In a generator, I'm filling my inputlist in fillInputList, sending this inputList to prepare_data_fill_arrays
prepare_data_fill_arrays takes a ...
0
votes
0
answers
364
views
How to use python pool.imap_unordered efficiently?
I'm using python multiprocessing imap.unordered with big expectations.
However, my processes are in deep sleeping waiting for I/O.
numofSimulations=10
chromNamesList=['chr1', 'chr2', 'chr3', 'chr4', '...
5
votes
4
answers
326
views
Efficiently remove duplicates, order-agnostic, from list of lists
The following list has some duplicated sublists, with elements in different order:
l1 = [
['The', 'quick', 'brown', 'fox'],
['hi', 'there'],
['jumps', 'over', 'the', 'lazy', 'dog'],
['...
2
votes
2
answers
57
views
Split jQuery list into two alphabetically ordered parts by class
I'd like list elements with class 'active' to be ordered alphabetically at the top of a list, with the remainder of the list underneath ordered separately. In other words,
<li><label><...
2
votes
2
answers
2k
views
Differences between Dictionary orders in Python 3.6 and Python 3.5 [duplicate]
I am trying to understand the differences between python dictionaries in python 3.6.7 and python 3.5.2. The way they store the order of key-value pairs seems different.
For example, assume there is a ...
0
votes
1
answer
57
views
Unordered List "merging" via Recursion Function Problem
I have following problem:
I have this string, which looks like this:
* item1
* item2
** item21
** item22
* item3
** item31
** item32
***item321
* item4
This is something like unordered nested list, (...
0
votes
3
answers
936
views
how can I make a dictionary with an exact key order in python?
I want to make a dictionary with a specific set of keys and a specific set of values. These are the keys I want to use:
k = ['date', 'deviceCategory', 'transactionId', 'productSku', 'productName', '...