Why multithreading isn’t everywhere?

Not almost, but all modern CPUs have multiple cores, yet multithreading isn’t really that common. Why to have these cores then? To execute several sequential programs at the same time? Well, when calculations are complex (rendering, compiling), the program is definitely made to use advantage of multiple cores. But for other tasks a single core is enough?
I understand that multi-threading is hard to implement and has drawbacks if number of threads is less than expected. But not using these idle cores seems so irrational.

javascript – Why printing sprite it isn’t in the same position as player? PHASER3 – JS

I’m new here and new in phaser 3 – JS, I’m doing now a small game, right now I’m making the shot of the player, but when I press space it appears 30px more to left and not in the same position of the player even if says the same X and Y as the player, but when I create it in directly in the scene it appears exactly in the player position, why it is happening? I’m posting this question from the phone so I don’t have the code right now, but can give a little example:

Scene2 file: (If create here it appears in the player position)

create() { 
    
    this.player_spaceship = this.physics.add.sprite(globalThis.config.withd/2, globalThis.config.height,"player_spaceship") //create player sprite

    this.shot = this.physics.add.sprite(this.player_spaceship.x, this.player_spaceship.y,"shot")

}

Now creating it in from the class it appears 30px more to left, and I’m using the same way to create it

Shot class:

Createshot() {
   
   //Way #1:

   If (this.scene.keys.SPACE.isJustDown) {
      
      this.scene.physics.add.sprite(this.scene.player_spaceship.x, this.scene.player_spaceship.y, "shot") 
   } 

} 

Why? Please help me its getting me crazy 🙁

here i will posting images:

creating directly from the Scene file

enter image description here

creating from the class:

enter image description here

if theres anything I can add to get help tell me and I will edit the code, thanks 🙂

godot – Why isnt setting the global_position working?

Previously my items were relative to the player by node hierarchy. But for items like bombs this is not ideal so i tried to add the items to the world scene, but when i try to adjust the position of the item to the players position it doesnt work and i see the sword in the top left corner of the screen the worlds origin.

Entity Script

func use_item(item):
    var newitem = item.instance()
    newitem.own = self
    newitem.global_position = global_position

    #not setting the position of the item correctly

    newitem.add_to_group(str(newitem.get_name(), self))
    get_node("..").add_child(newitem)
    
    if get_tree().get_nodes_in_group(str(newitem.get_name(),self)).size() > newitem.maxamount:
        newitem.queue_free()

Sword Script

func _ready():
    type = own.type
    $anim.connect("animation_finished",self,"destroy")
    $anim.play(str("swing",own.spritedir))
    if own.has_method("state_swing"):
        own.state = "swing"
        
func destroy(animation):
    if own.has_method("state_swing"):
        own.state = "default"
    queue_free()

It seems like it should work but with an engine like godot there could be several reasons why a certain thing is not working.

https://github.com/MonkeyToiletLadder/wendingo

Why isn’t SAT in coNP?

I understand why NP=coNP if SAT is in coNP (How do I prove that SAT in coNP implies NP=coNP?).

But I’m missing why the following machine doesn’t turing recognize the complementary of SAT:

Given a turing machine M that recognizes SAT, the following turing machine recognizes coSAT:

  1. Run M on the input word w.
  2. If M accepts – reject.
  3. If M rejects – accept.

Because coSAT is the language of all unsatisfiable formulas, a formula is unsatisfiable if it doesn’t have a satisfiable interpretation, which is exactly the opposite of what M outputs.

What am I missing in here?

docker – Ping works, but ssh isn’t even getting logged

I can ping from my PC on lan or mac on WiFi, but when I run ssh it doesn’t even appear in the logs. (sudo journalctl -u ssh)

I had installed zero-tier an a docker container I’m thinking this is the culprit. I removed the container, but maybe the damage is done…?

Netstat shows, “tcp 0 0 0.0.0.0:22”
The server can successfully SSH out to a different device or ping 8.8.8.8

I’m not sure where to look next.

Isn’t it ironic that a white BLM protestor was run over and killed by a black man while they were blocking a freeway?

It’s very SAD to see this happened….but if we don’t clamp down on the leftwing agitators like BLM/ Antifa, then it will come a time these murderous acts ( in many different ways) explode 1000 times, very soon, after November 4th, 2020.

But the BLM crowd should not call the cop since the already called for defund cop.

I feel Civil war coming…to the entire western world.

(IF THÉ VICTIMS WERE BLACK WOMEN & THE DRIVER WAS WHITE MALE, THEN YOU CAN NEVER HEAR THE END OF LEFTWING MEDIA & BLM SCREECHING!)

The 2 victims seems to be leftists transwommen.

plotting – Why isn’t LogLinearPlot showing output?

I’m trying to make a log-x plot of a function evaluated over a specified range. The function is an interpolation function defined (by the range of data provided) between 1e5 and 1e9.
But when I try to plot the function over this range using LogLinearPlot, i get a series of errors about evaluations waaay outside of this range, and then no plot is shown.

In the interest of providing a fully working example, here is my function to plot – it simply accepts some points and provides a linear interpolation between them (probably an overly complicated way to do it)

fluxPoints = {s0, s1, s2, s3, s4};
fluxBinCenters = {1*10^5, 1*10^6, 1*10^7, 1*10^8, 1*10^9};
fluxSpectrumPoints = Transpose({fluxBinCenters, fluxPoints});
sourceFluxSpectrum = Interpolation(fluxSpectrumPoints, InterpolationOrder -> 1);
sourceSpectrum(E_, fluxpars_) := sourceFluxSpectrum(E) /. {s0 -> fluxpars((0)), s1 -> fluxpars((1)), s2 -> fluxpars((2)), s3 -> fluxpars((3)), s4 -> fluxpars((4))};

The following code explicitly specifies the x-points to evaluate, calculates the corresponding y-values, and plots them on the log-x axis as desired:

somefluxpars = {10*10^-8, 100*10^-8, 300*10^-8, 250*10^-8, 100*10^-8};
evalpoints = 10^Range(6, 9, 1);
evalfluxes = Table(sourceSpectrum(energy, somefluxpars), {energy, evalpoints});
spectrumPlot = Transpose({evalpoints, evalfluxes});
ListLogLinearPlot(spectrumPlot, PlotRange->All, Joined->True, Mesh->All)

This produces the plot:

Correct plot with expected values spanning the range 1e6 to 1e9

I would like to make this plot, but without having to manually specify the plot points.
However, when I try the following:

LogLinearPlot(sourceSpectrum(energy, somefluxpars), {energy, 1*10^6, 1*10^9}, {PlotRange -> {All, {1*10^6, 1*10^9}}, PlotPoints -> 4, Mesh -> Full})

I get a bunch of errors indicating that Mathematica tried to evaluate sourceSpectrum at x-values of 13, 16, 18… (well outside the requested plot range?!) and no curve is shown.

Empty plot axes and errors

I’ve tried various alterations on PlotRange->{1*10^6,1*10^9}, PlotRange->All, or dropping it entirely, but it has no effect.

If I use Plot instead of LogLinearPlot, then the data shows up as expected (but, of course, without the desired log x-scale).

air travel – What’s the use of Schengen Airside Transit visas if the country list isn’t updated regularly?

So, the Schengen area has a list of 12 countries included for mandatory airside transit visas throughout the schengen area. From close inspection, the list was made in 2010 (probably from data from previous years), and hasn’t been updated since. What’s the use of having a list if it’s not updated in a decade? The situations of these countries in 2020 are very different from 2010. There may be new countries which warrant being added compared to the ones there. For example, Syria is not in this list!! Even after numerous asylum seekers in the past decades, the schengen bureaucracy has still not added Syria to the list! That’s how efficient they are. On the other hand, a country like Sri Lanka is still on the list even while Sri Lankans not being among the top countries of asylum claimants now (Sri Lanka had issues which ended in 2009, and that’s probably why they were put there. Unfortunately, the placement seems to be permanent)!

It begs the question why these countries have asylum policies in the first place if they try desperately to prevent those asylum seekers coming in to apply. Makes no sense. Who are they trying to fool? Why not just abolish granting asylum requests to people arriving by air? Things will be much easier for everyone concerned. Asylum seekers won’t be traveling, while legitimate visitors will face much less hassle! I’m talking about airside transit visas here, and not regular entry visas where people can overstay.

usability – Mobile side scrolling: On some screen sizes, the gap between elements land right at the right edge, so it looks like there isn’t any scrolling

I have the elements going off the right edge of the screen to show it’s horizontal scrolling.

enter image description here

Issue is at some screen sizes, the gap between elements lands right at the right edge, so it looks like there isn’t any scrolling.

enter image description here

We’ve thought of the following solutions:

  1. animation on page load (issue with this is it can slow down page load, look glitchy, and add extra level of effort to the project)
  2. gradient on the right edge (not a fan of how this looks)

My question is, are there other design solutions? Are there code solutions – like forcing the padding to change so the last element is always peeking in? I feel like there has to be, because how do apps solve this?

Would prefer a simple solution that would work well on a website, not an app.

Thanks!

Why is the KKK illegal, but Black Lives Matter isn’t?

Do you speak English as a second language? where are you from? 

because I cant even understand anything that you asked.   The correct grammar for your questions is “Why the USA government makes KKK illegal but they let “Black Lives matter” legal?”

so the answer is because KKK is not a company nor a religion which the government can rule.    KKK is more a community group.   One guy gathers white people to say that they are superior to minority and they bullies the minorities (Black, Jews and Mexicans).   Well to be honest, these people are obviously have too much time.  If you have a business such as a Chicken restaurant, you dont have time for this BS and gather people to talk about minority’s problems.    

And regarding the “Black Lives Matter”, it is a motto for the American people for not bullying the black African Americans (since they are poor and some become a low life criminals).   It is not a company nor a religion that the government can rule.   Regarding the looting, of course, it is illegal.  

PS: I’m not a lawyer but I can read everything on the internet so google it…..