Jump to content

Sensei

Senior Members
  • Posts

    7712
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by Sensei

  1. One note. It's very simplified version. It's true for low voltages. But when voltage is measured in kilo volts or mega volts, exceeding voltage breakdown, even good insulator will start conducting electricity.
  2. [math]E=m_0*c^2*\gamma[/math] m0 is rest mass. [math]m=m_0*\gamma[/math] m is relativistic mass. So when somebody writes: [math]E=m*c^2[/math] It can also mean the same as the first equation, depending on interpretation of m. where gamma is: [math]\gamma=\frac{1}{\sqrt{1-\frac{v^2}{c^2}}}[/math] When v=0, [math]\gamma=1[/math] (the same frame of reference as we are) The first equation simplifies to: [math]E=m_0*c^2[/math]
  3. Maybe I should explain a bit to UK/USA members what is happening (although I doubt you can help without even being able to replicate issue): If we have textView control, with inputType=numeric or inputType=numericDecimal etc, there is showed special smaller keyboard with just digits, and dot keys, so we can enter f.e. 3.141265, but half of world is using comma as floating point separator, not dot. When using Double Double.parseDouble( String string ); dot is treated as separator (even if locale is using comma). (there is exception while trying to parse string with comma, or it's cut in half) When using String.format( "%f", double ); where is used locale, to print double. So, if we print double to text, with comma as separator, and then try to parse it, with dot as separator, it will obviously screw up float/double. If we try to use String string = textView.getText().toString(); try { NumberFormat format = NumberFormat.getInstance(); Number number = format.parse( string ); value = number.doubleValue(); } catch ( NumberFormatException e ) { } catch ( ParseException e ) { }parsing and printing will be fine, using comma (locale),but (virtual) keyboard on smartphone (at least mine) is showing digits keys and dot key, and not comma key, so not being able to enter correct separator character, and not being able to enter fraction..
  4. Hehe. It won't stop you from eating radioactive Potassium-40. Or from radioactive Carbon-14..
  5. Lol. If you would win lottery (if you would play at all), you could buy whole island and build new CERN on it.. I would certainly do it this way.. Island on which you need to have PhD/significant scientific achievements to even land on it.. Yes, he is very similar with Planck. (and me, if I cut beard) Hehe. I meant, our own forum scientists conference..
  6. Oh, really? How come so.. ? If we measure now object with mass m to be accelerated by force F to speed v, will it change? Only Jesus, would say so.. Are you Jesus? Anyway, it was very nice. We should love even people with who we disagree.
  7. Hello! Android and entering floating point numbers. With inputType=numericDecimal Has anybody found any sensible solution to this madness.. ? Google has not done anything since at least 2009 AFAIK. This for instance http://stackoverflow.com/questions/12780125/soft-keyboard-with-comma-instead-of-dot-for-decimal-separator-in-android doesn't work on my Samsung Galaxy S5.. Tried input.setKeyListener(DigitsKeyListener.getInstance("0123456789.,")); and the only thing it did, changed "." (dot) key on keyboard, to ".-,+", but it's just visual (!), not having any impact on entered characters in text view field.. (still not able to enter comma character on the phone). The only thing that really works is ignoring "numericDecimal" and going with "text" inputType... Best Regards! ps. If you're UK/USA citizen you will probably have no idea about what I am talking about... But as you can see on the map (middle of page) https://en.wikipedia.org/wiki/Decimal_mark https://en.wikipedia.org/wiki/File:DecimalSeparator.svg It's affecting at least half of human kind..
  8. They are experimental data. Anybody can find it out while using high voltage generator such as Van de Graaff's Generator. I suggest anybody buying this device to get experimental data: http://www.amazon.com/American-Educational-7-511-Graaff-Generator/dp/B00658B1YU $155 is not much...
  9. From guys, from this photo, I very like 2nd from right, from the bottom 1st row. Probably not many can recognize this guy by face. I am using his device, for which he get Nobel price. The first quantum particle detector.
  10. Solvay 2015.. And we will make our own selfie like this: I am trying to build air-liquefying device. Can be instant ice cream like they did in Discovery Science TV show instead.. ?
  11. Double frequency would mean double energy. Then it would violate energy conservation... There is no such thing as "Compton scattering frequency". Scattered electrons and scattered photons vary by energy/frequency. Complement each other. If electron takes more, photon takes less. And vice versa. However there is Compton frequency, unique fC=1.23559*1020 Hz. If you multiply fC by Planck const: 1.23559*1020 Hz * 6.626069*10-34 J*s, you will get energy of electron: 8.8710459571-14 J, divide by c2: 8.8710459571-14 J / 2997924582= 9.11*10-31 kg to get rest mass of electron... It's in the right place. In primary school physics lessons. I wish learning would start from photons, then via pair production go to electrons and positrons, then further to protons and antiprotons, then further through fusion to isotopes, radioactivity.. It's in chronological order of how particles are created.. and at the end we can learn classic physics with it's averaging quantum world..
  12. "An extra hour a day of television, internet or computer game time in Year 10 is linked to poorer grades at GCSE, a Cambridge University study suggests. " Premature assumption. It depends on what else kid would be doing instead of watching TV/monitor of computer. Also watching f.e. MTV/cartoons versus watching Discovery Science, Animal Planet etc. channels..
  13. Isn't about how light is propagating through transparent/semi-transparent medium, such as water, glass, etc.. ? "we would find that a Gaussian source distribution remains Gaussian at every point along its path of propagation through the optical system." Vacuum in cosmos is not quite "optical system". Obviously photons going though medium will be reflected, or absorbed. That's why we can see laser beam in water. Reflected by medium photons stop being part of original laser beam. In perfectly ideal transparent medium, laser beam would remain invisible.
  14. Definitely, they are. If you have 1mm laser diameter 1m from laser source, what will be diameter of this laser if you point at f.e. Moon, 384,000 km or so .. ? Do you think so it'll be also 1mm diameter.. ?
  15. It's normal inverse square law. https://en.wikipedia.org/wiki/Inverse-square_law I draw you image, and take photo. See attachment. Laser has initial energy E0, or intensity I0, after traveling distance d0, it's reflected from mirror, and reverse direction back to source, and travel distance d1, and hit detector. Traveling total d=d0+d1 distance. In second example light is traveling d=d2+d3 distance. Distance between laser and detector remain the same x. Yet another version of it, is when distance between detector and mirror remain the same (move together), and only distance from laser and mirror changes.
  16. Here is recording from on board camera on home made rocket
  17. Unlike others I won't ask what pension system you're talking about, because it's perfectly clear here. There is dozen of on-line calculators where employer/employee enter gross salary, and they will calculate how much of money will go to retirement funds, ill-person pension funds (don't know how to translate it better, this includes disabled persons), etc, and how much employee will get in hand net salary. Example, copied from calculator: Gross salary 3750.00 Retirement insurance 366.00 Pension insurance (disabled persons included) 56.25 Ill-person salary insurance (disabled persons excluded. If you're ill and temporarily unable to work, it'll be used to pay your salary) 91.88 Ill-person insurance (your own, salary for doctors, hospitals etc.) 291.23 Income tax 265.00 Net salary 2679.65 You missed the point of this system. What to do with: - ill persons temporarily unable to work - ill persons permanently unable to work (disabled persons). - mentally ill persons. - people unable to have children (you're mentioning children in sense that children should take care of their parents and grandparents in future. People unable to have them will be left alone in your system) - people who don't have children - people who currently are taking pension/retirement If you want to destroy currently existing system, all these people who are currently using this system will be literally screwed and left without money.. They were participating in system for decades, and now some georgi zlatev comes, and want to take their money.. ? People, at least majority, are not responsible. (see how many famous and intelligent (or rather better word: educated) "invested" in Madoff fund) They will spend all the money they get now. And will be left with nothing in future. Which would be serious problem for goverment, flood of grandpas/grandmas begging for money and food on streets, searching food, bottles and Aluminium cans in trashcans.. Don't bring USA here in Europe.
  18. I feel the same. We are too old for changes.
  19. Since the beginning of this discussion, I am *exclusively* talking about execution time, time spend by CPU processing data. It's obvious that writing reg expression handling code is easier for programmer, spend less time on doing so, than making the same string comparing code by hand. If you claim something else, then prove it. Measure time spend by cpu, by getting time in microseconds/miliseconds, then execute some reg expression match(), compiled or not, 1000 times repeat, get time again, subtract. And we will know how many miliseconds/microseconds is taken by single match. Then do the same with manual code finding same pattern.
  20. Make source code proving your words, I will make counter-code, proving my words. Your case could be only true, if somebody for purpose, scuttle it. f.e. strings to search are: xyzabc xyzbcd xyzcde (and reg expression something like (.*)xyz(abc|bcd|cde)(.*) ) now C/C++ coder could use: if( strstr( buf, "xyzabc" ) || strstr( buf, "xyzbcd" ) || strstr( buf, "xyzcde" ) ) { // found! } (this is WRONG, because each time its going from start of buffer to the first occurrence, cpu is passing through the same chars multiple times) Instead he should do (something similar to): t = strstr( buf, "xyz" ); if( t != NULL ) { t += 3; if( !strncmp( t, "abc", 3 ) || !strncmp( t, "bcd", 3 ) || !strncmp( t, "cde", 3 ) ) { // found } } ps. I am using reg expressions. Where I find them useful. f.e. made process monitor, and file monitor, which had filters implemented as reg expressions (filter control in GUI). So they displayed entries matching pattern. But I also showed example of job where reg expressions showed weakness..
  21. Basically, nonsense from cpu/performance point of view. It's physically not possible. And you should know it exactly from physics. Native code is less instructions to execute (optimized by C/C++ compiler), taking less time, than reg expression compiled code. Doing C++ code: int length = strlen( buffer ); for( int i = 0; i < length; i++ ) { if( !strcmp( buffer + i, "some string" ) ) { // found sub-string } } or simply: if( strstr( buffer, "some string" ) != NULL ) { // found sub-string } will, and always be, much faster than equivalent reg expression. Compiled to machine code or JIT, can in the ultimately the best scenario just reach 90%-95% of normal code speed. And never exceed nominal code. You should not compare *Python* conditional code, to C/C++ conditional code. That's where you made mistake. *Python* (or other scripting language) conditional code might be indeed slower than same done by reg expression. But C/C++/assembly will never be slower. C/C++/assembly is not interpreted, as Python.. I knew, (I knew!) you will point it out when I wrote about GUI. Typical Linux user-programmer. Sounds like you have no experience in .NET Framework C++ GUI coding.. Because it's (unlike many GUI toolkits around) extremely fast (at least listview). I can make listview items counted in thousands per second, without any slow down, to the main code. See attached project. Compile it on your machine. BenchmarkListView.zip It's benchmark adding items to listview. Adding 10,000 listview items, takes 125 miliseconds, on my Core i7 machine.. with update_is_faster = true; (80000 per second) Adding 1000 listview items, takes 93 miliseconds, with update_is_faster = false; (10752 per second) Single threaded GUI. Handling GUI didn't introduce even 0.1% of slowdown.. Progress bar even less (it's updating every 1% of progress, where 300,000 files is 100%, 1% is 3000 files..). I stopped it after waiting 10-20 minutes, it didn't even reach 1% to update.. BTW, I used exactly the same logging to GUI listview with reg expression parsing code, as with manual conditional parsing code. It should be hint to you.
  22. If you would have plentiful of data to process, counted in MB or GB, using reg expression could tremendously slow it down. Once I had project (.NET Framework Managed C++, I don't write scripts..), download 250-300 thousands files from net, save in folder, 20-100 kb per file, ~20-30 GB could be total, and find some data in HTML file loaded from disk. Linux-loving-neighborhood was saying "do it using reg expressions!" (he is obviously great fan of it). So I did try it.. (he was doing this project in Python, and I was doing in .NET Framework C++, such little competition) I am GUI-loving person, so I am adding everywhere progress-bars running on 2nd thread etc. And listviews where are logs displayed to show me what is going on in real-time *) After processing a few hundred files, I was shocked, it was nightmare performance, I canceled. Otherwise would have to wait weeks to finish with all files.. Replaced reg expression, which was extracting data from HTML, by string search some <tag>, which was unique, prior my data, then find closing </tag>. And processed what was inside by hand. Guess what. Literally it started working "1000 times" faster... *) This is important. Linux-loving-guys are running their scripts, with logging to file, not to screen typically, and going doing other stuff. And then returning when job is done, periodically checking.. They might not even realize stuff they coded could run 1000 times faster, if would code it differently.. That's job for String.Trim()/String.TrimStart(). To check whether we have correct float, there could be used Double.Parse()/Double.TryParse(). .NET Framework C#/C++. array<String ^> ^lines = File.ReadAllLines( filename ); for each( String ^line in lines ) { line = line->Trim(); if( line->Length() == 0 ) continue; try { Double x = Double.Parse( line ); } catch( FormatException ^e ) { // row not number or so } } I would spend more on searching reg expression tutorials to learn what to enter than writing this reply.. More efficient to code (less time spend on programming), not more efficient for cpu.
  23. What power? I said voltage.. If you want 5 V, then take Zener 6 V, that's no problem at all. I used 15 V as an example for protecting 12 V nominal voltage circuit. I was describing general way of protecting vulnerable circuit, used in any case. Voltage regulators are using Zener diodes to not allow too high voltage reach circuit. Read this f.e. http://www.electronics-tutorials.ws/diode/diode_7.html and this http://hyperphysics.phy-astr.gsu.edu/hbase/electronic/zenereg.html about Zener regulators. Instead of buying regulator you can build your own at microscopic cost.
  24. If you will read big file in chunks, as everybody here are suggesting, there should be no problem. I can't check this, to confirm or deny. But such errors are everywhere, in all codes. It's just a matter of precision (any code will have issue while using IEEE 32 bit at 7+ digit after floating dot).. Math library issue most likely. It could be also issue with printing float, or float to string parsing routine. If it's really an issue (causing problem with your own code, not just theoretical talking), why don't you use integers and divide by 10000 at the end? Like in C/C++ code: int x = 0; int y = 1; x += y; // counter float x1 = (float) x / 10000.0; printf( "%f\n", x1 ); (integer 10000 = 1.0 in float) Blender is written in C/C++. Such apps have special extension for Python, which can be loaded/imported in script, and Python can execute its functions, controlling the main app.
  25. I never said time dilation, or length contraction, is directly visible from our FoR. But because of redshift/blueshift, and spectroscopy knowledge, observer in rocket will be able to tell his/her speed, relative to neighborhood stars. So far you don't have scientific theory. Scientific theories are based on observations, from which there is derived mathematical formula, that can be used to predict past state or future state, of physical object or system. You can have no word, and formula, but not reverse. So far you have only words. I suggest reading what is scientific theory https://en.wikipedia.org/wiki/Scientific_theory to get familiar with it.
×
×
  • 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.