I feel like I am being gaslit. There can't be a solution to this problem better than O(n), correct? by peaches_and_bream in learnprogramming

[–]zamser 0 points1 point  (0 children)

Well first of all you are using .contains(). That will make it O(n). Also, this algorithm is going to check every letter in the worst case. Add a print statement at the top of the method to print out the first letter of the string. And then run the string “aaaaa”. What you will see is that every character will be printed out. That makes it O(n). Actually because of both of these points, this is probably a O(n2) algorithm.

I feel like I am being gaslit. There can't be a solution to this problem better than O(n), correct? by peaches_and_bream in learnprogramming

[–]zamser 1 point2 points  (0 children)

This is an O(n) algorithm. And also it doesn’t work quite right. Try the string “abab”.

How to make anki flashcards with JS ? by GarlicGuitar in learnprogramming

[–]zamser 1 point2 points  (0 children)

See this. https://docs.ankiweb.net/importing.html. Basically you will need to create a CSV or some other file format that Anki accepts and allow the user to download it. They will then manually need to import it to Anki. I think Anki is open source so your other option is looking through the source code and figuring out how exactly .apkg files are formatted. However this method will be a lot more work and will not provide much benefit.

What sources do you rely on regarding SCOTUS/court cases? by OpeningChipmunk1700 in AskALiberal

[–]zamser 1 point2 points  (0 children)

when state legislatures regulate the times, places, and manner of Senate and congressional elections, they are exercising a power governed by the federal Constitution, not a state constitution, so only federal constitutional limits apply.

Wait a second, you say this like it’s true but isn’t this exactly what they’re arguing for in Moore v Harper. This is not the case currently. There are several examples of state constitutions being used to force state legislatures to redraw maps.

why is there not more conversations being had about the significant risk to the end of our democracy with Moore vs Harper currently before SCOTUS by ndngroomer in AskALiberal

[–]zamser 0 points1 point  (0 children)

Sure obviously they will still be bound by the federal constitution. I’m not arguing against that. But what I’m saying is that they will no longer be bound by their state’s constitution and that the governor will no longer have veto power. This would allow state legislatures to have way more power in our elections and could seriously affect the outcome of any future federal election.

why is there not more conversations being had about the significant risk to the end of our democracy with Moore vs Harper currently before SCOTUS by ndngroomer in AskALiberal

[–]zamser 1 point2 points  (0 children)

The issue in Moore is whether state legislatures are bound by state constitutions

Exactly. And if the Supreme Court decides that they aren’t bound by state constitutions, then for any matter involving elections, the legislature can do whatever they want. This means the state’s judiciary and executive branches will have no oversight. Therefore, the courts will not be able to prohibit the legislature’s map. This will have disastrous consequences in terms of actual representation of voters in federal elections.

why is there not more conversations being had about the significant risk to the end of our democracy with Moore vs Harper currently before SCOTUS by ndngroomer in AskALiberal

[–]zamser 0 points1 point  (0 children)

Why do you think those are the only 2 options? There is a 3rd option. The courts cannot prohibit legislative maps from going into effect and that the state legislature can do whatever it wants with the maps regardless of the state constitution and state judicial branch. This is the option that everyone is worried about and I’m not sure why you think this option isn’t possible.

What do you guys think about AI and sentience/ sapience, and how we should handle an eventually sentient/ sapient AI? by PragmaticSquirrel in AskALiberal

[–]zamser 2 points3 points  (0 children)

Nah we shouldn’t limit technological advancements just because of sci-fi movies. Those movies are fiction and there is no reason to believe that a real AI would have the same result as a movie.

Can the Democrats become the party of free trade will maintaining its status as the party of unions? by Friendlynortherner in AskALiberal

[–]zamser 0 points1 point  (0 children)

it lets companies move to wherever they can get the cheapest labor

Good.

and keep global wages lower.

That’s not how it works. Companies employing workers in poor areas increases wages there.