Jump to content

Sensei

Senior Members
  • Posts

    7927
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by Sensei

  1. Check CPU usage in Task Manager, if there is just 12.5% used on f.e. Core i7 8 HT threads, split to various threads. 1st thread will be working on (x+0)! second on (x+1)! third on (x+2)! etc. up to (x+thread_count-1)! then x+=thread_count in each thread. I am usually using BackgroundWorker https://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker(v=vs.110).aspx as it allows me for update GUI periodically, and cancellation.
  2. Computer programmers spend more time on searching and reading manuals of functions they have to use, than on writing stuff in compiler... It's essential especially for beginner, who doesn't know, doesn't remember arguments, functionality etc.
  3. There is temporal suspension. I saw mods used it on one young user. He couldn't log in for one year. Just change you password in settings to random characters, log off, and you won't be able to log in anymore. The best way to learn programming, is writing for yourself. C/C++ really has just only a few built-in functions and statements. One can write them all on the single piece of paper. The rest is in linked libraries and shared libraries. It does not need to be learned in memory. But you will remember some, if you will use them often. Imagine what you need in your work, your parents need in their work (ask them what they need to calculate often, and could be automated. What they count in f.e. Excel/SpreadSheet), and try making it. While making, search for functions that you need in project on the net, to find manual. Read description, and use it, in project. Then to next step in your app. You don't need to remember that C/C++ printf() function is used to print to stdio, and sscanf() is used to parse string.. as long as you have Google and can simply write "how to display string in console in C/C++" "how to parse string in C/C++". You will get plentiful of examples and advices for people who had similar questions as you in the past. You will learn function names, for further searching and reading their descriptions in manual.
  4. Equal charged particles spread on surface randomly in equal distances each other. But area of your spheres A, B and C is slightly different, because radius is different. Area of sphere A,B,C: [math]A_A=4 \pi r_A^2[/math] [math]A_B=4 \pi r_B^2[/math] [math]A_C=4 \pi r_C^2[/math] Charge C per each surface area m2: [math]C_A=\frac{C_0}{A_A}[/math] [math]C_B=\frac{C_0}{A_B}[/math] [math]C_C=\frac{C_0}{A_C}[/math] (if they have charge C0 equal in each sphere) Or: [math]C=\frac{C_A}{A_A}[/math] [math]C=\frac{C_B}{A_B}[/math] [math]C=\frac{C_C}{A_C}[/math] (if they have charge per surface area equal, but charge per sphere has to be different) Can it influence your idea?
  5. Check if you're compiling in Debug mode, if so, change it to Release mode. It should be working faster. Also, learn how to insert multiple rows in single SQL command. http://stackoverflow.com/questions/6889065/inserting-multiple-rows-in-mysql or LOAD DATA http://dev.mysql.com/doc/refman/5.7/en/load-data.html Check this article. Guy said he had 1000 insert operations per second (in PHP), and managed to get 28000 per second after optimizations. http://kvz.io/blog/2009/03/31/improve-mysql-insert-performance/
  6. I don't know. You tell me. Let me guess: you made this up (or overinterpreted).. ? How does truncated number 6 refer to Africa, and number 8 refer to Europe.. ? They are index of continent? Well, you should learn more about cryptology and reading ancient books and manuscripts in unknown languages.
  7. That's not language we use on this forum. You came up with subject to discuss, and you have to deal with opponents with different view than yours. That's very simple if we start with laser and polarization filter. Laser is sending beam of photons with random polarizations, or random circular polarizations. Then they interact with polarization filter. 50% of beam of photons is reflected, 50% of beam of photons pass through. If you have just single photon, which way it will go? Suppose so that after reflecting there is photodiode, or other optoelectronics, which is triggering nuclear explosion (similar case like in Schrödinger's cat) You're sending single photon with random polarization. There will be explosion or not?
  8. The next time you should put magnet in foil or two. It'll be much easier to remove iron dust. It would be good to make video showing this reaction.. Do you more of them? Compare on video reaction between balls above mentioned, with original one.
  9. Make no sense to me. If it's secret code, you should decode it, not truncate it even more, to unusable level. Let's say, you have file on disk, you compress it with ZIP/RAR/7ZIP, from more data you have less data. Suppose so somebody finds this file 10,000 years later. But never heard about ZIP/RAR/7ZIP etc. Do you think summing the all bytes together and getting single digit from it, would allow reading original data? Or you simply destroyed the all data (if there were any).. ?
  10. Sodium Carbonate Na2CO3 has density 2.54 g/cm^3 = 2540 kg/m^3 (anhydrous), and 41.5% of it is CO2, 27.3% of it is Carbon. 2540 * 41.5% * 27.3% = ~287.8 kg of Carbon per m^3 of Sodium Carbonate. Catching CO2 just needs large deep lake with Sodium Hydroxide (or similar compound readily reacting with CO2), and pump and turbines to push air to the bottom.
  11. Charged particle, accelerated to relativistic velocity, has enough energy to ionize matter it is passing through. And it's used all they time to show their traces like in Cloud Chamber particle detector. Here you can see what happens if you put Gold foil: majority of alpha particles (+2 charge) are repelled, minority pass through foil to the other side:
  12. Search for neutrino-electron scattering on Google https://www.google.com/?#q=neutrino+electron+scattering Neutrino-nuclei interaction result in turning nuclei to other isotope. With the most well known Cl-37 transforming to Ar-37 (and then back to Cl-37, after electron capture, Argon-37 + e- -> Chlorine-37 + Ve + 0.813874 MeV). https://en.wikipedia.org/wiki/Chlorine-37 (it needs neutrino with energy equal to or higher than 814 keV, so proton-proton fusion neutrinos with up to 420 keV are not triggering it)
  13. Water has density 1 g/cm^3 Water has 18.016 g/mol Divide them 1 g/cm^3 / 18.016 g/mol = 0.0555 mol/cm^3 1 mol = 6.022141*10^23 molecules or particles 0.0555 * 6.022141*10^23 = 3.343*10^22 molecules. Density of fat man is slightly less or equal to 1 g/cm^3 (therefor floats on water, especially sea water). If you divide 1 cm^3 by number of molecules in that volume, you will have approximate average volume of single molecule. From this you can get average radius, and make calculation of single slice of such molecules with 1 cm^2 area (and thickness of single diameter of average volume). Or you can calculate cubic root of 3.343*10^22 = 3.22*10^7 average molecules in 1 cm straight line. 3.22*10^7 ^2 = 1.0377*10^15 in 1 cm^2, average.
  14. That would be even more imprecise than my method. How can somebody know what you have in your garden? Each garden is different arrangement of plants, different quantity, at different stage of life. Do you expect average CO2 absorption per single apple (or rather per kg of apples)... ? Then you need quantity of apples (or rather their mass) to know and plug in equation.. I know mass of my grapes, as I measured them and put in db, prior making wine. From 1000 g of dark/black grapes, with mass 1000 g, I got 600-650 mL of juice for fermentation, during 1st extraction. My peppers grew very large above the ground, and miniature of roots (5:1 or more), if they had plentiful of water. I know because 3 times I was relocating them to bigger and bigger containers. The one which had little water, exactly reverse. They spend energy on growing roots to find water.
  15. How about: For annual plants, measure mass of their remains, at the end of season. You know molecules they are made of, how CO2 + H2O turn into them, during photosynthesis, so reverse equations, and you will have moles of CO2. Or dehydrate remains, so there will be almost only Carbon. Measure mass. Divide by 12 g/mol. And you have moles of CO2. For tree, measure its circumference year by year, always in the same place (so mark it). Difference is what it gained by year. Allowing you to calculate increase of thickness, and volume gained by the main trunk. From volume and density you can estimate mass. But it won't tell you about branches and leafs. But if you're at the end of season putting leafs to composter (you should), you can measure their mass also.
  16. I think he meant index to array float values[ 1024 ]; (...) float value = values[ index ]; CPU is doing it by adding address of 'values' variable together with 'index' variable (multiplied by fixed size of entry f.e. sizeof( float ), simple bit-shift). And then reading memory from this final address. Multiplication a * b will be possible to replace by looking at a_table[ b ] (for integers either a & b). So for a-b in range 0...255 (8 bits), there is needed array with unsigned short (16 bits), with size 256*256=65536 entries. (but it could be reduced to 32768 or slightly less, because a*b=b*a and 1*a=a and 0*a=0) My 2nd programmer had to do it just few years ago. Plentiful PIC/IC do have just basic operations. And everything else has to be emulated with code, or read from lookup table (stored on EPROM/EEPROM/flash).
  17. Can you explain how to get this value after = ... ? And why they have xxxxx=y (where y is typically single digit).. ?
  18. Where do you have Aluminium in this description? Sodium Hydroxide + Aluminium or Aluminium Oxide or Aluminium Hydroxide gives Sodium Aluminate. https://en.wikipedia.org/wiki/Sodium_aluminate Quote "In water treatment it is used as an adjunct to water softening systems, as a coagulant aid to improve flocculation, and for removing dissolved silica and phosphates." Sodium Aluminate + Sulfuric Acid gives Aluminium Sulfate. https://en.wikipedia.org/wiki/Aluminium_sulfate Quote from above website: "Aluminium sulfate is used in water purification and as a mordant in dyeing and printing textiles. In water purification, it causes impurities to coagulate into larger particles and then settle to the bottom of the container (or be filtered out) more easily. This process is called coagulation or flocculation. Research suggests that in Australia, aluminium sulfate used this way in drinking water treatment is the primary source of hydrogen sulfide gas in sanitary sewer systems.[6] Improper and excess application polluted the water supply of Camelford in Cornwall." Coagulation https://en.wikipedia.org/wiki/Coagulation Flocculation https://en.wikipedia.org/wiki/Flocculation
  19. In the simplest brute-force algorithm of particle simulation, there is array of particles (quantity entered by user). Each particle has position x,y,z, velocity vx,vy,vz, size (might be sx,sy,sz, or one for each axis, so we will have ball-like particle), mass, visual properties like color etc. For chemistry reaction simulation there will be also needed formula to display on screen Na+, Cl-, H+, OH- etc. and charge of ion-particle, electronegativity (?), etc. etc. Each time step, for every particle in array, x is increased by vx, y+=vy,z+=vz And collision detection is done between each particle with each other, and walls of container where they reside. Checking each 1 mln vs 1 mln other particles in brute-force way (equation of intersection of sphere vs sphere, you probably know?) is 10^12 operations. It's very time consuming process, therefor there is need for kd-tree, octree etc. algorithms to speed it up. If there is found collision, in particle physics simulations, like in attached videos above, there is just done recalculation of velocity vectors (with some randomization, so each time they go in slightly different direction, while maintaining momentum/energy). In chemistry version of simulator there would be also needed to check whether there is reaction between one particle-molecule and other particle-molecule. There is also need to take care of charged particles, repelling same, attracting opposite (influencing vx,vy,vz of each particle). Additionally make visualization of this in OpenGL so user can see and rotate views in the middle of process. If Komnen wouldn't be able to do it brute-force way, like I described above, he would fail miserably with much more advanced version suggested by hypervalent_iodine.. Komnen, maybe you should start from making C/C++ command-line tool which is taking list of chemical formulas as argv[] arguments, and showing user whether it's balanced equation to stdio, and eventually show properly balanced equation.. ? It would be good start for beginner in chemistry. You should ask your friends what they think about above ideas.
  20. For group 1-2 valence electrons are 1-2 (so they are from s), for group 13-18 valence electrons are 3-8 (simply subtract 10) (so they are from p). Except Helium. f.e. Al is in 13 group, and has 3 valence electrons. 3s2,3p1. f.e. Na is in 1 group, and has 1 valence electron. 3s1. For groups 3-12, there is no such simple way to tell. Well, you should read wikipedia for a start https://en.wikipedia.org/wiki/Valence_electron
  21. See my signature video. It's all chemistry, mathematics, and programming.. You could try making simulation of reaction between two (or more) substances. At the beginning you have 100% of 1st let's say HCl, and 100% of 2nd let's say NaOH, entered by user as mol (* Na = absolute number of molecules). Then as reaction goes calculate probability of finding H+ with OH- (and ending up H2O) and probability of finding Na+ with Cl- (these remain ions in solution), make equation (with time as argument), how they join (absolute quantity/moles/mass/volume). It could be with 3D visualization of the whole process. With/without stirring/heating. With custom made containers various sizes, various shapes. You could end up with something like "particle physics simulation" but for chemistry.. https://www.youtube.com/watch?v=x8Fo2slT2WA
  22. When do you want to start? When there will be 10 bln people? 20 bln people? 50 bln people? 100 bln people? Tell me.. It worked in the past with Australia and America.. "Time to go on"..
  23. I'm saying you should leave this planet and start colonizing solar system, and galaxy... There is 100 billions of stars in this galaxy... Peaceful colonization: don't kill living organisms on the other planets,asteroids,comets etc., if there exist any.
  24. Sorry, I have not read entire thread carefully, but I only see you mentioning Hydrogen, and completely ignoring Oxygen issue. On sketches there are just Hydrogen tanks, and you're providing liquid Hydrogen calculations. Am I correctly expecting that Oxygen will be taken from air? If so, should not you make calculations also for Oxygen.. ? And show how, and how fast, Oxygen will be taken from air on various altitudes.. ? You mentioned 17 km altitude in post #16. If we use this calculator with 17000 m http://www.altitude.org/air_pressure.php "At 17000m, the standard barometric pressure is 10 kPa (75 mmHg). This means that there is 10% of the oxygen available at sea level." Let's assume that at standard conditions there is 0.04464 mol/L 21% is Oxygen, and 10% of that is at 17km. So it gives 0.04464 mol/L * 0.21 * 0.1 = 0.00093744 mol/L of Oxygen O2. To split 1 molecule of water to H+ OH- there is needed 1.23-1.5 eV, so for 2 Hydrogen atoms (1 H2), it's 2.5-3 eV. Multiply by e and it's 3.94e-019 J. Let's assume that it'll be given back in reverse reaction, without loses. In post #8 you mentioned motor has 86 kW = 86000 J/s Divide 86000 J/s / 3.94e-019 J = 2.1827e23 Oxygen atoms reactions per second. /2 = 1.09137e23 O2 /Na = 0.1813 mol O2 needed per second. 0.1813 mol / 0.00093744 mol/L = 193 L per second needed. In post #16 there is mentioned 127 MW. And it would be 285000 L of air needed per second.
  25. Gamma photon with enough energy can "destroy" nucleus. f.e. Deuterium needs 2.22 MeV energy to be split to free proton and free neutron. https://en.wikipedia.org/wiki/Ultra-high-energy_cosmic_ray They have enough energy to destroy 450 billions of Deuterium atoms.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.