Jump to content

Sensei

Senior Members
  • Posts

    7934
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by Sensei

  1. I would start from drawing entire race on timeline (graph) to visualize it.. x-axis could be time, and y-axis distance.
  2. "The solar tidal force is 46% as large as the lunar." https://en.wikipedia.org/wiki/Tide
  3. That's not entirely true. Magnetic field has effect on ions. Thus there is Lorentz's force: https://en.wikipedia.org/wiki/Lorentz_force It's used to separate isotopes with different masses and elements with different charges, in mass-spectrometry.
  4. Download free Blender, or trial version of other 3D program, and you will be able to do it by yourself.. https://www.blender.org/download/ https://www.lightwave3d.com/try/
  5. Yeah, ammeter should have A letter in circle, instead of arrow..
  6. You drew weird circuit. Ammeters should be plugged in series to measure current, because they're like shortcut otherwise (extremely tiny resistance).. i.e. current will skip your 20 ohm and the rightmost 40 ohm resistors (has easier route through ammeters!)
  7. Suppose so you have calculation: a = ( b + c ) * d b+c must be added first (suppose so e=b+c) and later a = e * d It relies on result of addition! Such operation can't be done parallel. But if you have millions of such operations, you can split to first do the all b+c in loop e.g. for( int i = 0; i < max; i++ ) { e[i] = a[i] + b[i]; } and then for( int i = 0; i < max; i++ ) { a[i] = e[i] * d[i]; } or alternatively: for( int j = 0; j < thread_max; j++ ) { for( int i = j; i < max; i += thread_max ) { a[ i ] = ( b[ i ] + c[ i ] ) * d[ i ]; } } There are much harder to make working parallel calculations or operations. There is needed to know entire algorithm to judge whether it's possible, or not possible, to make it working parallel. CPU is splitting job (like office manager in company), and telling each GPU core what chunk of data it has to process. And when job is done, integrates data from various GPU cores together, or orders them to do the final integration.
  8. I gave you references to read. You didn't do it. I won't write so simple code for you. You won't learn anything this way. If you would read links that I gave, instantly you would notice there are special methods designed for your job, instead of nextLine().. Reading documentation and learning what classes have what methods with what parameters is majority of programmer's time spend on project. Built-in classes and methods you must learn (and remember!) by reading docs. https://docs.oracle.com/javase/7/docs/api/overview-summary.html java.lang , java.io, java.util, java.text, java.applet , java.math etc. etc. This is what you must read the all (at least). java.sql, java.net and java.awt won't hurt later. Print them (description of the all classes with methods), and read them in WC, metro, or bus etc. etc. in your free time. Make little test programs to check how to use methods that you just read about.
  9. 3D visualization is the main job of modern gfx card. That's what for they were designed. But I am talking about general usage of GPU for things outside of 2D/3D graphics area, for heavy math calculations of floating point numbers and integers (GFLOPS = Giga FLoating point Operations Per Second). Drawing triangle is very easy procedure, and easily can be implemented in hardware. Comparison of various gfx cards is in that case done in quantity of triangles per second ("millions/billions of triangles per second").
  10. Good start would be searching net for "cuda programming tutorial". e.g. https://www.tutorialspoint.com/cuda/cuda_quick_guide.htm There is comparison table which year of production of CPU has what GFLOPS versus GPU GFLOPS. But the real results you would get after writing equivalent code for both CPU and GPU, and benchmarking them.. There are algorithms which are easy to make them working parallel (to run on multiple CPU cores, CPU threads, or GPU cores), and there are certain algorithms which are very hard, or impossible, to convert to parallel (mostly because result from previous calculation is used in further calculation, one depending on other). Algorithm which is impossible to make it working parallel will obviously work the best on CPU which can have 2.0... 3.0 GHz per core (the larger frequency the better, the less cycles of CPU per instruction the better), because GPU core runs at much smaller frequency each (but there can be thousands of them!) than CPU..
  11. If you have String (not string) object, you have to convert it to integer. You used comparison operator > (greater than) on String object. What methods and operators are available for String you can obviously check in Oracle Java docs: https://docs.oracle.com/javase/7/docs/api/java/lang/String.html How to convert string to integer: https://stackoverflow.com/questions/5585779/how-do-i-convert-a-string-to-an-int-in-java You should also read entire Scanner class description: https://docs.oracle.com/javase/7/docs/api/java/util/Scanner.html
  12. java.util.Scanner.nextLine() method is returning String object, not integer.. https://docs.oracle.com/javase/7/docs/api/java/util/Scanner.html#nextLine()
  13. I am sorry for maybe too harsh my previous posts..
  14. Elitist attitude? Thx, for showing complete lack of understanding.. It's not about asking "the right sort of questions", but what is done with answers given for already existing one (from the past experience)..
  15. No. People should ask for advice, if they are really stuck. But fredreload asks for advice, and then he is NOT using them in the real world.. and it's repeated over and over and over again in many different threads.. The thing is he is not seeking for advice.. Advice could be given and then used by somebody really seeking for advice.. but he is not using any advices given here on this forum.. Somebody really seeking for advice, would write the same piece of code for multi-threaded CPU, then for multi-core GPU in OpenCL/CUDA, benchmark them on a few CPUs/GPUs, and learn what is benefit (or not) from experimental data gained by himself/herself, and share results on forum of his/her findings. Every gfxcard has different number of cores.. his CPU can have 1-6 the real cores, and 0-12 hyper-threads.. It's impossible to give him definite answers, what will work the best for him, on his machine. But he is not going to check it, will not write any code to check it... Questions are purely theoretical.. I would prefer talking with somebody who is using my advices in the real world, implementing them, when they're revealed. And then we can check whether they were good (or not) advices..
  16. Show me your OpenCL code to analyze... or whatever else are you using... CUDA? GPU has e.g. 1024 cores, running at pretty low frequency each, while CPU has very few cores/hyper-threads with e.g. 4-6 cores (8-12 hyper-threaded) (quite modern CPU @ 2018) The thing is, you never wrote the real code, for GPU.. so you have no knowledge.. Write code, and you will gain knowledge. Simple as that. Easier than writing post on forum..
  17. Binary-Tree, KD-Tree, Quad-Tree, Octree, should be implemented by programmer, who is enough knowledgeable (it's basics), and is programming it for real rather than just talking on forum... For internal organs imaging there are often used voxels (3D version of pixels in 2D).
  18. He can simply have depression or bipolar disorder. It has nothing to do with career or personal life. He forgot about you 5 minutes after banning on forum.. I don't think so.. They don't think about you. Especially if they have girlfriends/wives.
  19. That was toy, not real one..
  20. In this particular case, you don't have to. You can leave variables uninitialized during declaration, and then use operator =, instead of operator +=. But you must understand and comply to what is said in above post about uninitialized and initialized variables. Otherwise you will have unexpected random crashes in C/C++. It is very difficult to trace them.
  21. Function's local variables are allocated dynamically on the CPU stack. Stack is filled by functions, which allocates/frees this space, and can contain trash (undetermined data). If you have declaration of variable int x; it's uninitialized variable, its value can be random value. But later there is used operator +=. It's taking current value of variable (if it's initialized to 0, result is predictable), and adds to it something else. There are special debugging tools which are trashing stack and newly allocated memory on purpose, to find errors caused by using of uninitialized data. These are very hard to find errors. new operator in C++ does not clear memory of object prior calling constructor. Programmer has to do it by himself/herself in each constructor (there can be default constructor, constructor with parameters, copy-constructor etc. etc. in each of them the all object members must be manually initialized. It's easy to make mistake while adding yet another member in complex class). ps. Even if specific language initializes variables (e.g. clears them), it's good habit to clear them by yourself. One language can allow it, other one will not.
  22. Buy second phone just for international travel.. Dump of memory of device prior travel, disable the all transmission, don't use device, travel, dump of memory of device after travel. Comparison of these two, to find changes. If they differs, what are differences, which files and directories have changed... ? It could be infection from external source (not necessarily government of countries which you just visited)..
  23. They are fooling you. They can make duplicate of entire memory of device, and then run brute-force method on emulator of device on supercomputer cluster with thousands machines running parallel.
  24. @Nightmara Tiny amount of Lead is everywhere, in the air that you're breathing, because it is/was used by oil industry to produce certain types of fossil-oil-based fuels like gasoline/petrol (Lead compounds as addition to fuel) https://en.wikipedia.org/wiki/Gasoline#Leaded_gasoline_controversy,_1924–1925 https://en.wikipedia.org/wiki/Tetraethyllead Some countries banned fuels with Lead addition not so long ago. ps. If you bother about yours and family health, you should buy solar panels, install them on the roof, and buy electric car. If everybody would give up fossil-based fuels, many problems with people health would be gone..
  25. You're using the same equation ([math]F(r) = (1-\frac{R}{r}) k_e \frac{q_1 q_2}{r^2}[/math] ) for either force and energy (page 3).. But they have different units.. You need to address it first. It's obvious omission.
×
×
  • 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.