-
Posts
7927 -
Joined
-
Last visited
-
Days Won
26
Content Type
Profiles
Forums
Events
Everything posted by Sensei
-
I really need help on my C++ programming assignment.
Sensei replied to Tampitump's topic in Homework Help
It's not right, you don't have nor A variable, nor B variable, you don't have loop from A to B in 0.01 steps. You refuse to accept negative inputs (your assignment has no mention about it). Graph of f(x)=x^3 in Google is https://www.google.com/?#q=graph+x^3 Imagine user is asked to enter x axis. Any float/double. It's becoming A variable. Then user is asked to enter x axis again. It's becoming B variable. But you have to warn user if B<A, that such value is illegal. And repeat asking for B. Once B>A, you have to perform loop. Summing area of object enclosed by A...B, and f(A) and f(B) at these points. Do it in steps like asked in assignment. They want you to use "Rectangle method" https://en.wikipedia.org/wiki/Rectangle_method see anim-gif, as it's progressing with more divisions. even though the more precise would be "Trapezoidal rule" https://en.wikipedia.org/wiki/Trapezoidal_rule also see anim-gif.. -
That's correct. me= ~ 9.11 * 10 ^ -31 kg E=mec2 You have energy of electron in Joules. Then divide it by e = 1.602176565*10^-19 [math]\frac{9.11*10^{-31}kg*299792458^2}{1.602176565*10^{-19}} = 510998.928 \frac{eV}{c^2}[/math] You end up with energy of electron in eV, and then mass of electron is eV/c2. You need to multiply by speed of light (m/s), then divide by wavelength (m). electron Volt is energy unit used in quantum physics. It's quantum level equivalent of Joule at macroscopic energy unit. 6.62607004*10^-34 J = 4.135667*10^-15 eV It's E=hc/wavelength (not e=hc/wavelength), as you can easily mix E (energy) with e (elementary electric charge).
-
That's what I said "Built-in types would be the easiest to identify," #7 post.. But if float is put as member of other object class RGBA { float mRed; float mGreen; float mBlue; float mAlpha; public RGBA( float r, float g, float b, float a ) { mRed = r; mGreen = g; mBlue = b; mAlpha = a; } }; And then used: RGBA colorred = new RGBA( 1.0, 0.0, 0.0, 0.0 ); We have no idea what is "RGBA", therefor there is need to search for it. Analyze its every member. But it's very close to it. In complex code you would have to do it recursively..
-
C'mon, ydoaPs! Fiveworlds wanted function which is taking as argument JUST path to source file, without any variable names. Variable names he wanted to be identified by parser, automatically! Suppose so you have 100+ variables, not camelCase. Your way it requires 100 entering each variable name as argument, original name, and renamed. Then what is difference from regular Refactor > Refactor This.. (Rename) ? Absolutely nonsense. Suppose so you have tool which is taking path to .java file, variable name prior, and after rename, as arguments. Now we have code which has variable name as string in quotes for example. "[blahblah]" It cannot be processed by parser. It's not variable name. Suppose so we have it as method of some external class object method: Object.BlahBlah() you cannot change it to Object.blahBlah() (camelCase version of BlahBlah) because it was defined in these external headers as Object.BlahBlah() after changing name, code won't be compile-able anymore! So parser has to find "Object", check it has "BlahBlah" method, and ignore rename.. Here is example mine function in Java (Android Studio project for Android v4+ OS), I made couple days ago: AlertDialog.Builder builder = new AlertDialog.Builder( this ); builder.setTitle( R.string.quit_title ); builder.setMessage(R.string.quit_message); builder.setPositiveButton(R.string.quit_yes, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { // finishAndRemoveTask() truly removed application! But v21+ required! if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { finishAndRemoveTask(); } else { // TODO: this application quitting does not want to work on Android <v21 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { finishAffinity(); } System.exit(0); } } }); builder.setNegativeButton(R.string.quit_no, null); builder.show(); I clicked on "builder" (that's true variable name, and the only variable in above source code),refactored it to "BUILDER", and it still compiled without any single problem. If I would run code which is simply searching for "builder" (case-insensitive), it would find also AlertDialog.Builder as matching string, after changing it to AlertDialog.builder or alertDialog.builder it would not compile anymore... There is no alertDialog class, there is no builder() method in AlertDialog, nor builder() in alertDialog either... Android's classes, methods, functions: AlertDialog.Builder, DialogInterface.OnClickListener do not obey camelCase.. Easy to write, does not automatically mean, fast to write in minutes, or hours, to handle the all cases possible. You started attacking fiveworlds in this thread, not me.. I agree completely with your second example, about factorial, but first example, was miss.
-
It would be right for wavelength = 1m Because you have to divide by e, not multiply.. 1.9864x10^-25 / 1.602176565*10^-19 = ~1.23984201714482e-006 Simply, you used multiplication instead of division..
-
It would not be easy to write such tool. He wanted to process not strings but variables. It would require entire C/C++/Java language parser, which will identify whether string is variable. Leave alone functions, methods and everything what is not variable. Built-in types would be the easiest to identify, but what if variable is class object? It requires making class database. Either declared in project that's processed, and the all external standard and included headers. In C++ also support for namespaces is needed (std::string is not the same as xxx::string). Probably weeks needed to write it, without damaging source code, in the all possible cases..
-
Now local business owners have to compete with business owners from around the entire world. In some areas they can compete by quality of product, in others, only price. (now this thread will turn to discussion about protectionistics custom duties..)
-
Since September, I am making wine from my black grapes. It requires cutting branches with fruits. It's reasonably fast stage, if there is easy access to them. In my case it's not, and I am doing 3.5 kg of branches with fruits in 10-15 minutes. Mass of fruits on single branch is 95% or so. So one person doing it, in one hour could cut 14 kg-21 kg. (I asked one drone making scientist to make drone which will find fruits by camera and cut them, and fly to container with branch and drop it) Then there is the most time consuming step: wash and remove fruits from branches. I calculated that these 3.5 kg can be processed in 1 hour. At least it's mine speed.. From 1 kg of fruits, there can be extruded 600-650 mL of juice for pink wine, and slightly more for red wine (because of several days in container fermenting together with fruit mash). Let's say 750 mL from 1 kg of fruits. (I was couple times measuring mass of fruits, and then juice) So from 3.5 kg of fruits there can be 2.6 L of red dry wine which is 3.5 bottles of wine each with 750 mL. Now tell me yours country minimum wage per hour of work. And then confront it with amount of wine one person can make in one hour, in stated above numbers... I have no idea how on the Earth "Thracian Quest" red semi-dry wine from Thracia (now Bulgaria/Greece/Turkey), can be sold in the shop for $1.5 per 750 mL in promotion, and $2.5 regular price?! It does not make any sense.. 3.5 bottles of wine with price $2.5 is $8.75.. Remind me: what is minimum wage in your country? If we have minimum wage, it's simply not possible to make this wine, as it should be couple/dozen times more expensive.. Work price is more than cost of ready product.. Even without any taxes or other costs.. (While making ethanol/vodka it's exactly reverse. We have pretty cheap alcohol from west world standards point of view. But the real cost of production is 10% or so from regular price in the shop. ~ $1.25 per 1 L of ethanol 100%) There are jobs which can be easily optimized by automation (and it often leads to even more unemployed people), and there are jobs which cannot be optimized. If producer cannot increase price of ready product, because of higher work cost, without drop of sales, has to shutdown entire business, and then nobody will earn, neither minimum wage, nor any wage.
-
Is the observable universe a computer simulation?
Sensei replied to Oddball305's topic in Speculations
Earth has mass ~ 5.97*10^24 kg (calculate as above number of protons/neutrons and electrons it's made of), in comparison to entire Universe, it's very little number of particles to simulate. The less particles to bother in simulation, the easier it's to make. I don't think so your comparison it to game is appropriate. Games are entertaining players, while the most of people on the Earth, are suffering. -
"Is the universe a giant hologram" and James Gates' math equation
Sensei replied to Renardo1's topic in Quantum Theory
Why? You should rather being quite busy working on "how to become immortal" (or at least "living as long as possible") in this (possibly simulated) Universe. Start from learning entire quantum physics, inorganic chemistry, then organic chemistry, biology, biotechnology, programming.. -
Is the observable universe a computer simulation?
Sensei replied to Oddball305's topic in Speculations
Visible Universe has mass ~ 10^53 kg ( https://en.wikipedia.org/wiki/Observable_universe#Mass_of_ordinary_matter ), proton has mass 1.67*10^-27 kg ( https://en.wikipedia.org/wiki/Proton ), Divide one by another, gives 6*10^79 protons in the Universe. Protons fusing to Helium and then further reduce amount of calculations needed to process particle. Also mass sucked by black hole reduce amount of calculations needed. If everything is included in simulation, there is no way to learn whether it's simulation or not. Also you don't have any reference object to compare what you found on the Earth or in cosmos. Physical laws of simulated Universe, could be different than higher level, not simulated. You're probably thinking about simulating just Earth, or just Solar System.. ? -
For me, Schrodinger's Cat experiment, is example of randomness at quantum level. You don't know whether something happened or not happened, until you look, perform measurement. But if you do perform measurement, you destroy initial (unknown) state, and it's irreversible. If you look at object, photons emitted/reflected by object are absorbed, changed to excited electrons/particles, excited atoms, excited nucleus, in eye or electronic detector, and gone from system under observation.
-
Atoms don't have fixed boundary. See f.e. how ions interact each other, or electrostatic charged surfaces/objects. They "know" about each other from long distance. In neutral atoms, positive charge of nucleus, is cancelled, "shielded" by negative charge of electrons. They don't always do this shielding in perfect manner, in each axis equally. Therefor some molecules are exhibiting region that's more positive and other region is more negative. They're dipoles like water molecule.
-
I put this equation to OpenOffice 4.1.1 SpreadSheet, =36/6*(2+2+2) and got.. 36. Can somebody try MS Excel?
-
How to calculate CO2 absorbtion by my Garden
Sensei replied to studiot's topic in Ecology and the Environment
AFAICS, it's suggesting replacing CaCO3 by MgCO3. You were complaining that I wanted to do electrolysis of brine to get Sodium, while, as we can see on Magnesium wikipedia page: https://en.wikipedia.org/wiki/Magnesium "The metal is now obtained mainly by electrolysis of magnesium salts obtained from brine," C'mon! While electrolysis of sea brine, there will be more Sodium created than Magnesium. It's way to reduce production of CO2 in the future, while not fighting with existing right now CO2 in atmosphere. Going your thinking path from couple above posts "energy for electrolysis must be from burning fossil fuels". (which is obviously not true, that's why I proposed other sources of energy from Sun. In 2014 year, 38% of electricity in UK was made from renewable/nuclear energy sources according to wikipedia and growing year by year). So what Mg in cement will catch from air, will be first released to obtain energy for electrolysis... -
How to calculate CO2 absorbtion by my Garden
Sensei replied to studiot's topic in Ecology and the Environment
People have it. And always had. It's called "Sun". And people are/were using it all the time. Even before founding out fossil fuels (it was created by the Sun millions years ago). What you ate today is result of this "cheap" energy.. People don't need fossil fuels at all. Fossil fuels just release energy faster, than other "compounds which store energy".. You can burn methane, to create fire, and cook something, scrambled eggs, for breakfast (honestly I have methane oven at home), But you can also make your own solar oven, concentrating solar power at one spot, which will have the same effect, but don't BS @ me, this thread is pro-ecologic, while you're supporting petroleum industry.. Unlike you Studiot, bothers about CO2, and wants to reduce it, while you do everything to discourage everybody from doing anything (?!?!).. And it's over and over visible in your threads ?! (if it's not planned, you should rethink your own attitude to the subject, or attitude to people you talk with, don't let your own "little wars" "becloud" development of humankind) You don't bother and care about CO2, so SKIP this thread.. Otherwise, come with any SINGLE idea to absorb CO2 gas from atmosphere, in such way, it will be stuck in newly created molecule (that's not organic like tree or plant). We're waiting patiently for your idea. ..... Have to self-censorship, all the time, my own threads while replying to you.. -
Yes. It's important to have right conditions. Atmosphere with low density, would have smaller pressure, and water would boil at different temperature than on sea level with pressure 101325 Pa and 373.15 K temperature. Atmosphere protects against cosmic rays, uv rays. Photons are scattered (from initial 1370 W/m2 to 1050 W/m2 on the surface, 25% less). They don't disappear. But they are absorbed and heating atmosphere, creating smaller gradient of temperatures in day and night. See Moon's temperature gradient in shadow vs full Sun. Earth would have similar conditions without atmosphere.
-
How to calculate CO2 absorbtion by my Garden
Sensei replied to studiot's topic in Ecology and the Environment
Production of CaO/Ca(OH)2 from CaCO3, indeed releases CO2. Traditional pathway is: Ca(OH)2(aq) + Na2CO3(s) → CaCO3 ↓ + 2 NaOH(aq) According to wikipedia https://en.wikipedia.org/wiki/Sodium_hydroxide "Sodium hydroxide is industrially produced as a 50% solution by variations of the electrolytic chloralkali process. Chlorine gas is also produced in this process. " https://en.wikipedia.org/wiki/Chloralkali_process 2NaCl + 2H2O -> Cl2 + H2 + 2NaOH It will, if people won't burn Carbon to produce energy, but f.e. have concentrated solar power in the middle of desert. So whole process would look like: desert solar power tower is producing energy, which is used to run turbines pumping salty sea water, to special lake in the middle of desert. Water will naturally evaporate, giving brine, which will be electrolyzed producing NaOH, which will react with Carbon Dioxide from air. -
Can a user's account be deleted?
Sensei replied to Tampitump's topic in Suggestions, Comments and Support
I wish you all the best. -
Standard of proof without any direct evidence
Sensei replied to The Bear's Key's topic in The Lounge
No. Radioactivity, decay of unstable particles, existence of electron, positron, alpha particles, muons, pions, tau, kaon, etc. high energy cosmic rays. As you can see them on this video: are direct evidences. But indirect evidence will be f.e. reaction between neutrino/anti-neutrino with nucleus, turning it to other isotope. Or reaction between neutron and nucleus, turning it to other isotope. -
If you have spinning wheel, and touch it by other object, creating friction on contact area, they'll be both heated. If wheel would not spinning, nothing would happen.
-
Anybody making home wine, home alcohol, will tell you "rule 1410". For 1 kg of sugar, there is needed 4 L of water, and 10g of yeast. That's 20% by mass. It should not exceed 22%-23% IIRC. Even saccharimeters that I am using have end of scale at 24°Blg. If you have extra good turbo yeast, you could try 25%, or add sugar later, after couple days of fermentation. This year I am making experiments with turbo yeast (there was promotion in the shop and I bought enough for couple months), and the fastest one could make 14%-18% of ethanol from 6-8 kg of sugar (plus water enough to 25L of solution), in 48h-72h. IMHO, you should prepare couple containers, each one with different sugar proportion, write them down, say 5% more in each than previous, and add Lactobacillus Acidophilus (or yeast or whatever you're testing). You will see how they react for various concentrations, and will be able to compare. Or even record it by timelapse camera.
-
New universe? (split from could the universe have a center)
Sensei replied to geordief's topic in Astronomy and Cosmology
Typically, hypothetical multiverses have different values of constants than this Universe. Rarely, they also have different laws. You should read Leonard Susskind book "The Cosmic Landscape" https://en.wikipedia.org/wiki/The_Cosmic_Landscape https://www.amazon.com/Cosmic-Landscape-String-Illusion-Intelligent/dp/0316013331 If you will make simulation of the entire Universe (in computer), you can do anything what you want. Including becoming part of simulation, at some point.. Then become active "player" in history, or passive observer. -
Restaurant owner installs fridge outside to feed the homeless
Sensei replied to Sensei's topic in The Lounge
September 14 2015 "The Polish parliament is currently drafting a law which aims to prevent local retailers from trashing unsold food which remains fit for consumption. Under the plan, the owners of retail outlets fitted with a total surface of more than 250 square metres are to be required to donate such food to charity organisations, with intentional discards punishable by financial penalties." http://www.eurofoodlaw.com/country-reports/polish-parliament-drafts-anti-food-waste-law--1.htm 08/09/2016 https://www.emis.com/blog/poland-drafts-bill-limit-food-waste-retailers ps. Forcing business owners/customers to do something, is completely different from what I showed in OP, where somebody voluntary wanted to do it, her own (better) way.. Cities should be "flood" by refrigerators where people could put their unused food they don't need, so others could take it for free, and put their own.. -
Experimental physicists/chemists always work with what they have at hand. f.e. Rutherford experiment recorded on video: Just put Gold foil between alpha (or other particle) emitter, and see how they react.. Alpha particles are repelled in majority from Gold atoms nucleus, and tiny amount pass through to other side of foil. In this case matter charge, mass of particle (and it's volume and cross section), and it's kinetic energy prior interaction. Interaction occur between accelerated nucleus of Helium-4 with electrons of air (creating trace) and electrons of Gold, and with other nucleus (Gold) causing reflection of incoming particle (because Gold nucleus is 197/4 = ~49 times more massive). If positive and negative charged particles would be evenly distributed, this video would look completely different. ps. Part of mentioned by you scientists are pure theoreticians, so they don't belong here. ps2. If object is moving toward you, you can know it without direct interaction with it, because photons are emitted by object (black body radiation), or (from other source) reflected by object, and reaching faster than that object will arrive.