-
Posts
7949 -
Joined
-
Last visited
-
Days Won
26
Content Type
Profiles
Forums
Events
Everything posted by Sensei
-
Then why you used right shift in equivalent comment? "t3 = t3 >> 1"
-
In which language do you want to code it? You (almost) allocated arrays, but not initialized their fields yet. new [] takes a parameter, the length of the array, which you did not provide. Newly allocated memory block has 1) uninitialized data (always forgotten by newbies) 2) initialized to default values (if you allocated array of C++ objects, and default constructor was called, and it filled the all C++ object members by some default value e.g. zero). So far, so good. ..but it showed possible issue: what if arrays have different lengths..? This way you compare entire object with other object integer e.g. compare their pointers (which will always fail in this case) Why do you want to return here from subroutine? You should count elements. Return quantity of matched elements should be at the end of function, outside of for loops. Should not you compare one element from array #1 with one element from array #2 ("pairs of 32-bit numbers from two arrays of numbers")? So arrays should have equal length (ask teacher), and utilize just one for-loop. Shouldn't you be comparing SIGNS of integers? How to check the sign of a single integer? How to compare if the signs of two integers are equal? How to treat zero element? As positive sign?
-
You can learn machine code without actually having any manual or tutorial. Basically open debugger, in disassembly mode, and step-by-step execute instructions. Watch the registers change. Observe memory and how it changes. slt means "Set on Less Than". sltu means "Set on Less Than Unsigned". Because it is an argument to the function?
-
DNS error... ethernet connected, no internet :-(
Sensei replied to Externet's topic in Computer Help
Simply open terminal/shell/console, and ping giving name e.g. ping google.com ping scienceforums.net and in output will be numerical IP address, like on my screen-shot above. You can select it in console and copy (either on Windows and Linux) -
DNS error... ethernet connected, no internet :-(
Sensei replied to Externet's topic in Computer Help
How about you @Ghideon and @MigL .... ? Repeat above.. On Windows, you can do it using command "arp -a". https://www.google.com/search?q=arp+on+linux https://man7.org/linux/man-pages/man8/arp.8.html and https://man7.org/linux/man-pages/man8/route.8.html Because you can't visit HTTPS via IP address.. It has no info about SSL certificates which are given to specific "host name".. Additionally, like I said, server with IP 94.229.79.58 has multiple other websites.. https://ipinfo.io/94.229.79.58 -
DNS error... ethernet connected, no internet :-(
Sensei replied to Externet's topic in Computer Help
https://chromium.googlesource.com/chromiumos/docs/+/master/developer_mode.md -
DNS error... ethernet connected, no internet :-(
Sensei replied to Externet's topic in Computer Help
IP "153.229.14.155" is in Japan. For me "scienceforums.net" resolves to "94.229.79.58".. -
DNS error... ethernet connected, no internet :-(
Sensei replied to Externet's topic in Computer Help
Physical HTTP server can have virtual servers. They share the same IP address. But have different "host name". If we have custom made server, with HTTP like Apache installed, and we are alone, it would work, http://our_ip and http://hostname will give the same (because no Virtual Servers are configured https://en.wikipedia.org/wiki/Virtual_hosting ) but most of HTTP servers these days, are hosted on 3rd party machines i.e. clouds in server rooms in foreign country. And single IP has multiple (e.g. thousands) virtual servers on it.. You can learn what are these virtual servers by using reverse-DNS (search net for keyword) -
DNS error... ethernet connected, no internet :-(
Sensei replied to Externet's topic in Computer Help
..If I visit https://8.8.8.8 it automatically converts to https://dns.google/ ... (some kind forwarder) If you can check it: make your DNS unreachable in router (i.e. wrong IP data), then visit https://8.8.8.8 to see what happens... Yeah... On Windows you should use "ping [IP] -t" and leave it.. and if Ethernet cable has problems i.e. is physically damaged e.g. by walking on it... having it through doors which are frequently closed and opened and similar things.. basically damaged cable.. then in such a case, continuous ping will have some lost packets.. -
DNS error... ethernet connected, no internet :-(
Sensei replied to Externet's topic in Computer Help
Good advice +1. Easier for newbie. ping it in terminal (or equivalent) instead.. ping other machine from your LAN (to see if it is reachable). And vice versa from other machine to yet another machine. (learn what are IPs of the all machines in your LAN first) (on some devices, they can have disabled ICMP packets so ICMP ping won't work at all unless you use TCP/IP ping and/or enable ICMP ping manually) -
DNS error... ethernet connected, no internet :-(
Sensei replied to Externet's topic in Computer Help
Problems are universal. Just commands/tools have different names with different arguments.. Tutorial made for one OS will work with other OS if you will look up what is equivalent command on different OS. -
DNS error... ethernet connected, no internet :-(
Sensei replied to Externet's topic in Computer Help
The first thing any "idiot" should do when there is no internet connection is to use the "ping" command. A Windows user would do: Click on Start menu, enter "cmd" to open console. Then enter "ping". It is the most widely used command for network analysis. What to ping? e.g. gateway IP, DNS IP address, host given by name, host given by IP address, device IP etc. etc. So first you need to know what is your gateway IP address. Do you know your IP address? If not, before ping, use "ipconfig /all" https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/ipconfig which will show you all your interfaces, e.g. WiFi (even if not used / disabled), Ethernet, Bluetooth etc. Run "cmd", then "ipconfig /all >data.txt" and attach in the reply, so we can see it. You should have rows with "Default Gateway" which will have address that you should enter to "ping" command as argument. e.g. "ping 192.168.0.1", use "-t" to have continuous flow of data. There will be also DNS servers mentioned in output. You can ping Google DNS. Do you know Google DNS addresses? 8.8.8.8 and 8.8.4.4 How somebody can know what are Google DNS addresses? Because will use Google to find out: https://www.google.com/search?q=google+dns+address (you can do the same with other companies which provide DNS servers, just change name of company in the above query..) Any network admin will tell you "if your own DNS don't work, use Google DNS". So better remember their IPs in advance.. ping 8.8.8.8 ping 8.8.4.4 What can we see? That they are slooow. Do you know how to set DNS address to different one? If you connect through network which has configured DHCP, DNS address(es) will be given by DHCP server. However if there is something wrong with DNS servers, Internet will stop working in web browsers, but will work through IP given manually. e.g. ping google.com will fail, but ping 172.217.22.14 (or whatever google.com resolves to) will work. Linux obviously has equivalent commands for "ping" and "ipconfig": https://www.google.com/search?q=ipconfig+on+linux which is "ifconfig" https://man7.org/linux/man-pages/man8/ifconfig.8.html and "ping" command manual: https://man7.org/linux/man-pages/man8/ping.8.html ps. When you see Windows tutorial "how to solve some problem", you can still use that knowledge on Linux or whatever else, just use "what is equivalent of XXX on linux/whatever" as search keyword.. e.g. https://www.google.com/search?q=ifconfig+gateway I see user answered that "ifconfig" is depreciated, and user should use "ip" instead... So: https://man7.org/linux/man-pages/man8/ip.8.html and https://www.google.com/search?q=ip+command+linux+examples Forget it. The problem is unknown. e.g. somebody (hacker) could give you fake DNS servers (because intercepted your router).. so you may be connecting to his/her machine, instead of true DNS servers.. Or somebody in company which is providing you net, is restarting DNS servers, or they are restarted automatically every xxx minutes/hours to update for new DNS records... Even if you may be connected via cable Ethernet, it does not guarantee that your ISP provider does not use radiowave Internet further in route. e.g. if there is bad weather (i.e. snow especially), radio Internet has issues, because snowflakes and raindrops with heavy wind reflects signal (I always have problems with net (LTE, WiFi) during heavy snow or heavy rain). You can detect if you DNS servers have been intercepted by hacker. How? Learn what are DNS servers that your computer is using, and search that IP in Google. Or use reverse-DNS on that IP address. Results should show that they are legit DNS servers of ISP that you're using (big ISP providers mention what are their DNS servers on their websites). This subject is so huuge, that your asking to give idiot-proof tutorial, is like asking to give idiot-proof tutorial of surgery of brain, but on steroids.. If you find that your ISP DNS is down by pinging it (better be prepared to in advance), but pinging Google DNS servers work.. you can change DNS servers to Google DNS e.g. https://www.google.com/search?q=how+to+set+dns+linux -
Sounds like modified Ultimate Tic Tac Toe. https://en.m.wikipedia.org/wiki/Ultimate_tic-tac-toe
-
Opportunity cost of electric and/or self-driving cars
Sensei replied to ScienceNostalgia101's topic in Engineering
Self-driving cars already killed pedestrian and cyclist.. e.g. https://www.bbc.com/news/technology-54175359 -
No, it does not.. In any numerical system, it would be the same. Base 10, base 16, base 2, it does not matter. We were discussing about it in dozen posts already.
-
Raspberry Pi controlling an electronic latch - Electronics help
Sensei replied to Callipygous's topic in Projects
...but where is the fun of creating electronic projects.. ? -
https://earthobservatory.nasa.gov/biome/biodesert.php "During the day, desert temperatures rise to an average of 38°C (a little over 100°F). At night, desert temperatures fall to an average of -3.9°C (about 25°F)."
-
Raspberry Pi controlling an electronic latch - Electronics help
Sensei replied to Callipygous's topic in Projects
You know that Pinput = Poutput , right? So Uin * Iin = Uout * Iout .. (unrealistic idealistic assumption that we have no loses.. so actually it is Pinput > Poutput ) On the page that you gave about batteries we can read: "Each cell can provide 1A of current for about 4 hours so all together the peak current you can draw is a little over 1.5 Amps. Note that these batteries are not designed to sustain such high loads, we suggest keeping any constant current draw under 1A." Uin = 3.7 V Iin = 1 A so Pin = 3.7 W (with peak 1.5A * 3.7V = 5.55 W) Then you say: Which means: 3.7 W / 12 V = 0.3 A = 300 mA ... Realistically, including loses on conversions, it will be less. Do you think so your entire electronics is able to work with so low current? Plug some current meter which will be able to record current (e.g. Arduino current meters which can store on SDHC cards) https://www.google.com/search?q=Arduino+current+meters+which+can+store+on+SDHC+cards https://create.arduino.cc/projecthub/Varun_Chandrashekhar/arduino-voltage-current-meter-with-sd-card-support-2a5df6 ..and you will get graph of voltage/current on timeline.. when the next time there will be problem, data will recorded, and you will be able to analyze.. When you adjust potentiometer on the booster, to give you more voltage, from batteries with fixed maximum power, booster must give less current.. It is simple energy conservation law. -
Fossil fuels have very little radioactive Carbon C-14. It should not be wasted.. Tree in forest does not bother about where is coming from CO2 which let it grow. Human in contrary should bother whether the food they eat comes from an "open space" with availability of Carbon C-14 from air, or from "fossil fuels" without C-14. Lack of C-14 in food (directly in plants, indirectly in livestock) means less mutations, and less cancers.
-
Did China's one-child policy save the climate?
Sensei replied to ScienceNostalgia101's topic in Politics
China implemented one-child policy to not end up like Japan.. But they (politicians from communist party) did not think they will create other alternative problems.. Abundance of boys-men, and deficiency of girls-women.. There are over 30 millions of Chinese-men who can't find women.. https://www.google.com/search?q=30+millions+of+Chinese-mens+who+can't+find+women.. With EU or US, such one-child policy would work, because majority of people don't care (anymore) about whether they have girl or boy child.. unlike Chinese at that time.. ..but people should be smart/knowledgeable enough to understand it, without anybody forcing them to do so... -
..then they can simply tell any price for it they want.. and government (=citizens) will pay for it.. ..therefore majority of R&D should be done by Universities with help of students.. and not "for money" but "for good of humankind"..
-
Fossil fuels are now, tomorrow will be gone. It's a thing that will run out sooner or later. Transfer from fossil fuels usage to renewable fuels must be done before they run out. The deeper you have to dig to get them, the more expensive energy will be for end users and the less competitive the country's business will be. In democratic country politicians think only about the next elections and how to not get ejected from politics..
-
I hope so you will join us after 20 January..
-
Did China's one-child policy save the climate?
Sensei replied to ScienceNostalgia101's topic in Politics
Building "green" house costs more than regular one (e.g. specially prepared walls and roof, which lose less energy winter). In capitalist environment, you have to have money or borrow them. In my post, I imagined hypothetical situation after centuries without climate crisis, in which people started using coal again to heat houses.. Use imagination a bit.. There have been many "dark ages" in the past. You have e.g. solar panels, electronics just because of globalization and transportation of goods from Asia. After shutdown of globalization, existing solar panels won't last forever, after dozen of years they will stop working. More and more countries make their own independent closed Internet networks. Many countries already are able to shutdown transmission from them, or to them entirely. Without exchange of knowledge, information, ideas people will have no idea how things work. They won't be able to fix existing broken things. They won't even understand how things work. Actually at the moment majority of computer and smartphone owners have no idea how these things work. The only reliable way to fix computers and smartphones and other electronics is replacement of element from second broken unit. The number of units produced is limited. So after a few dozen to a few centuries nobody will be able to run these devices anymore.. -
Did China's one-child policy save the climate?
Sensei replied to ScienceNostalgia101's topic in Politics
Bad example.. Find out what the population density in Japan is: the equivalent of what the Earth will have if 50 billion people live on it at the same time. https://www.google.com/search?q=japan+density+of+population https://www.google.com/search?q=earth+area+in+sq+km https://www.google.com/search?q=percentage+of+land+and+water+on+earth ~ 510.1 millions km^2 * 334.62 people/km^2 (average density in Japan in 2020) = ~ 170.7 billions * 0.29 (land area of the Earth) = ~49.5 billions of people. China has ~153 people per sq km (2020): https://www.google.com/search?q=china+density+of+population&oq=china+density+of+population It is basically "Calhoun's experiment but with human"..