Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

adammartin13

Member
  • Content Count

    5
  • Joined

  • Last visited

Awards


This user doesn't have any awards

About adammartin13

  • Title
    Newbie

Recent Profile Visitors

120 profile views
  1. I'm upgrading my Intel 5820k PC from running single channel 8GB DDR4 to 16GB and I wanted to take advantage of using quad-channel, but to do that I would have to run 4x4GB sticks. The kit I'll be purchasing will also be faster (2666 from 2400) but I was wondering if the individual stick size going from 8GB's to 4GB's would matter? I don't think so, but I'm only 90% sure and was wondering if you guys could help me out.
  2. I appreciate all the comments and the resources you have provided; I'll be sure to look through all of them. Thank you.
  3. So I was making a random number generator in C++ and I decided to do something like this: #include <iostream> #include <chrono> // for timer operations #include <cmath> // for pow() using namespace std; class Timer { private: using clock_t = chrono::high_resolution_clock; using second_t = chrono::duration<double, ratio<1> >; chrono::time_point<clock_t> m_beg; public: Timer() : m_beg(clock_t::now()) { } double elapsed() const { return chrono::duration_cast<second_t>(clock_t::now() - m_beg).count(); } }; int main() { Timer t; int time_seed = t.elapsed() * pow(10, 7); // Time in hundredths of nanoseconds time_seed = time_seed % 10; // Number is based off nanosecond value cout << time_seed << endl; return 0; } Big thanks to Alex at https://www.learncpp.com/cpp-tutorial/8-16-timing-your-code/ for the timer. Effectively this program can output a double value representative of the timestamp at which it was called. The timer starts when the program begins and the value outputted is how long it took to get there. Running this on a laptop with Visual Studio 2019 I can go far as e-7 digits back (the equivalent of 100's of nanoseconds or 1/10,000,000 of a second). The "randomness" is derived from two factors: the speed of the computer and the human element at which the user performs an action (in this case, running the program). Now this performs much better when there is a more extensive action or calculation done prior, such as performing a Fibonacci sequence or something of the like, but my point being that you could feasibly create a TRNG algorithm using a mix of a timer and some human interaction with the program. So I tried a few things; I compared the TRNG algorithm above with the rand() PRNG function found in the <cstdlib> library and built a calculator to determine bias. There are three tests between the two, all of which seek to create a thousand "random" numbers: one test will generate a thousand numbers between 0-9, the second test will take those one thousand numbers and convert them to a binary value 0 or 1, and the third test will convert a thousand numbers into binary and then XOR those values. Each of these tests will measure, and output, a bias value that's determined by the sum of each individual integers absolute value difference between it's outputted count vs expected count (if the number 9 is outputted 97 times when it's supposed to be outputted 100 times then the bias is 3). Here is what I made: #include <iostream> #include <chrono> // for timer operations #include <cstdlib> // rand() function #include <cstdarg> // bias calculators #include <cmath> // pow() function using namespace std; class Timer { private: using clock_t = chrono::high_resolution_clock; using second_t = chrono::duration<double, ratio<1> >; chrono::time_point<clock_t> m_beg; public: Timer() : m_beg(clock_t::now()) { } double elapsed() const { return chrono::duration_cast<second_t>(clock_t::now() - m_beg).count(); } }; int bias_calc(int num_value, ...) { int bias_sum(0); va_list num_values; va_start(num_values, num_value); for (int it(0); it < num_value; it++) { bias_sum += abs(100 - va_arg(num_values, int)); } va_end(num_values); return bias_sum; } int binary_bias_calc(int num_value, ...) { int bias_sum(0); va_list num_values; va_start(num_values, num_value); for (int it(0); it < num_value; it++) { bias_sum += abs(500 - va_arg(num_values, int)); } va_end(num_values); return bias_sum; } int main() { Timer t; int num1(0), num2(0), num3(0), num4(0), num5(0), num6(0), num7(0), num8(0), num9(0), num0(0); for (int it(0); it < 1001; it++) // 1000 iterations { int num_cache = rand() % 10; // random number 0-9 if (num_cache == 0) ++num0; else if (num_cache == 1) ++num1; else if (num_cache == 2) ++num2; else if (num_cache == 3) ++num3; else if (num_cache == 4) ++num4; else if (num_cache == 5) ++num5; else if (num_cache == 6) ++num6; else if (num_cache == 7) ++num7; else if (num_cache == 8) ++num8; else if (num_cache == 9) ++num9; } int num1_time(0), num2_time(0), num3_time(0), num4_time(0), num5_time(0), num6_time(0), num7_time(0), num8_time(0), num9_time(0), num0_time(0); for (int it(0); it < 1001; it++) { int time_seed = t.elapsed() * pow(10, 7); // Time in hundredths of nanoseconds time_seed = time_seed % 10; int num_cache = time_seed; // Numbers are based directly off nanosecond value if (num_cache == 0) ++num0_time; else if (num_cache == 1) ++num1_time; else if (num_cache == 2) ++num2_time; else if (num_cache == 3) ++num3_time; else if (num_cache == 4) ++num4_time; else if (num_cache == 5) ++num5_time; else if (num_cache == 6) ++num6_time; else if (num_cache == 7) ++num7_time; else if (num_cache == 8) ++num8_time; else if (num_cache == 9) ++num9_time; } int bin_num0(0), bin_num1(0); for (int it(0); it < 1001; it++) // 1000 iterations { int num_cache = rand() % 10; // random number 0-9 if (num_cache % 2 == 0) ++bin_num0; else if (num_cache % 2 == 1) ++bin_num1; } int bin_num0_time(0), bin_num1_time(0); for (int it(0); it < 1001; it++) // 1000 iterations { int time_seed = t.elapsed() * pow(10, 7); // Time in hundredths of nanoseconds time_seed = time_seed % 10; int num_cache = time_seed; // Numbers are based directly off nanosecond value if (num_cache % 2 == 0) ++bin_num0_time; else if (num_cache % 2 == 1) ++bin_num1_time; } int xor_bin_num0(0), xor_bin_num1(0); for (int it(0); it < 1001; it++) { int num_cache = rand() % 10; // random number 0-9 num_cache = num_cache % 2; // Converts to its last binary digit int num_cache_2 = rand() % 10; num_cache_2 = num_cache_2 % 2; int bin_check = num_cache + num_cache_2; // Four outcomes: 00 01 10 11 if (bin_check == 0) ++xor_bin_num0; // 00 else if (bin_check == 2) ++xor_bin_num0; // 11 else if (bin_check == 1) ++xor_bin_num1; // 01 10 } int xor_bin_num0_time(0), xor_bin_num1_time(0); for (int it(0); it < 1001; it++) { int time_seed = t.elapsed() * pow(10, 7); time_seed = time_seed % 2; int num_cache = time_seed; int time_seed_2 = t.elapsed() * pow(10, 7); time_seed_2 = time_seed_2 % 2; int num_cache_2 = time_seed_2; int xor_bin_check = num_cache + num_cache_2; if (xor_bin_check == 0) xor_bin_num0_time++; // 00 else if (xor_bin_check == 2) xor_bin_num0_time++; // 11 else if (xor_bin_check == 1) xor_bin_num1_time++; // 01 10 } cout << "|C++ PRNG| |Nanosecond| |C++ Binary| |Nano Binary| |C++ XOR Binary| |Nano XOR Binary|" << endl; cout << "num0 " << num0 << " " << num0_time << " " << bin_num0 << " " << bin_num0_time << " " << xor_bin_num0 << " " << xor_bin_num0_time << endl; cout << "num1 " << num1 << " " << num1_time << " " << bin_num1 << " " << bin_num1_time << " " << xor_bin_num1 << " " << xor_bin_num1_time << endl; cout << "num2 " << num2 << " " << num2_time << endl; cout << "num3 " << num3 << " " << num3_time << endl; cout << "num4 " << num4 << " " << num4_time << endl; cout << "num5 " << num5 << " " << num5_time << endl; cout << "num6 " << num6 << " " << num6_time << endl; cout << "num7 " << num7 << " " << num7_time << endl; cout << "num8 " << num8 << " " << num8_time << endl; cout << "num9 " << num9 << " " << num9_time << endl; cout << "C++ Bias: " << bias_calc(10, num0, num1, num2, num3, num4, num5, num6, num7, num8, num9) << endl; cout << "Nanosecond Bias: " << bias_calc(10, num0_time, num1_time, num2_time, num3_time, num4_time, num5_time, num6_time, num7_time, num8_time, num9_time) << endl; cout << "Binary C++ Bias: " << binary_bias_calc(2, bin_num0, bin_num1) << endl; cout << "Binary Nanosecond Bias: " << binary_bias_calc(2, bin_num0_time, bin_num1_time) << endl; cout << "XOR Binary C++ Bias: " << binary_bias_calc(2, xor_bin_num0, xor_bin_num1) << endl; cout << "XOR Binary Nanosecond Bias: " << binary_bias_calc(2, xor_bin_num0_time, xor_bin_num1_time) << endl; return 0; } And so feel free to run this program on your own compiler but I feel showing this program above is necessary for the argument I'm presenting. The PRNG algorithm provided by C++ will output the same values every single time, so long as the seed value stays the same or there are no changes to the code impacting it's calculations. The TRNG algorithm provided by the timer however, will never output the same numbers. The Nanosecond Bias won't always be lower than the C++ Bias, but many times it will be. When this is the case, I can not say. I could add a loop, make it so that if I perform a test and it's bias is higher than the C++ bias (which in this case is basically a constant value) then to simply rerun until that is no longer the case, but that's not really the point of having this kind of tool in a program. So here's my question: when is it a good time to use a PRNG algorithm vs a TRNG, and vise versa. Is there a way I could improve my program above, and is the combination of a high tick clock and the human element a good means of generating random values?
  4. Basically what I'm wondering is if placing a graphite pad (here's a link to one: https://www.newegg.com/innovation-cooling-ic-graphite-thermal-pad-40/p/2MB-000J-00003?Description=graphite pad&amp;cm_re=graphite_pad-_-2MB-000J-00003-_-Product ) under/over a cellphone battery would reduce the heat felt on the palm. I know having personal experience with a Galaxy S5 for over five years now (I've replaced the battery I think twice now, not because of heat issues) that Samsung phones do get really hot and palm sweat seems more of an inconvenience. I have a graphite pad lying around and was wondering if applying it would be safe or noticeable.
  5. Just to clear the air I have no intention of making this a political thread; this post is in regards to Andrew Yang's ideas on Net Neutrality and fiber infrastructure in the US. I trust in this forums technical cognizance to be capable of trading constructive ideas back and forth without spreading political dissension. About two weeks ago I drove out to Columbia SC to talk to presidential candidate Andrew Yang. He spoke about his policies of course but when he got around to answering questions from the audience I was curious on his stance towards net neutrality given how it was such a hot issue last year that's now gone dark across the democratic debate. To be fair I am unsure as to if this is coming from a lack of interest in the topic or a lack of media coverage. When one of Andrews staff members brought up the question his response was not what I was expecting. Andrew Yang is certainly pro-net neutrality but it seems that he wants to go a step further; classifying ISP's under Title II, increase competition through local-loop unbundling, and investing in ensuring that every household has access to a fiber-optic connection. Sources: https://www.yang2020.com/policies/net-neutrality/ https://www.yang2020.com/policies/rebuild-america/ Now I didn't have the chance to record this statement at the time but he did go further into detail as to how he would achieve his fiber-optic goal. Currently about 25% of the US has access to a fiber connection and the only thing stopping this number from growing is the cost of implementation ( https://broadbandnow.com/Fiber ). Yang's solution to this was to find the rate between cost of installation and margin of profitability and pay the difference on a per area basis, negotiating a deal with telecom companies to offer approximately three years of sole ownership over the deployed lines before new competition sets foot. I'm also unsure if this reconstruction of our data lines includes Yang's proposal of the Legion of Builders and Destroyers in regards to redirecting 10% of our military budget to modernize and keep American infrastructure safe ( https://www.yang2020.com/policies/rechannel-military-spending/ ). By the end of the event everyone had a chance to talk to Andrew for a quick photo op. Given that his plans on internet infrastructure would already include ensuring a fiber optic connection to everyone's homes and increase competition by removing regional monopolies on data lines, I wanted to know if I could press him into establishing 10Mbps data speeds as a basic right for all Americans. My time with him was brief but I did get him to confirm that this was going to be his plan of action. Link to my post: https://twitter.com/AdamMartinTech/status/1129926374859386893 . Personally I would like the United States to step up and provide this gateway towards free internet access although I can see the lack of fiber optics being our primary road block towards getting there. With telecom companies at the moment settling on older copper models until renovations are necessary, it's easy to assume that they don't plan on investing in fiber optics any time soon in rough terrain areas that lack it. For more information on the instillation on fiber optics I would recommend giving this a read: http://www.thefoa.org/tech/ref/OSP/install.html . I'm hesitant towards Yangs idea of negotiating with telecom into making this happen with the trade-off of creating temporary monopolies as this is contradictory towards his plans of establishing local loop unbundling. Perhaps this is his idea of good progress through slow process although I'll leave that to you guys to decide. I am of the opinion that classifying the internet under Title II is a step backwards, albeit in a better direction then where net neutrality stands at the moment. The Communications Act of 1934 is outdated, and I believe that the best step forward is to create a new rule-set for establishing an open and free internet. Other policies that Andrew has considered include: - Cryptocurrency Regulation: https://www.yang2020.com/policies/digital-asset-regulation/ - Quantum Computing: https://www.yang2020.com/policies/quantum-computing/ - Revive the Office of Technology Assessment: https://www.yang2020.com/policies/reviveota/ - Create a Value-Added Tax: https://www.yang2020.com/policies/value-added-tax/ - Implement a Freedom Dividend: https://www.yang2020.com/policies/the-freedom-dividend/ - Fund Medical Technology: https://www.yang2020.com/policies/medical-technology-innovation/ - Transition to Self Driving: https://www.yang2020.com/policies/trucking-czar/ - Modernize Voting: https://www.yang2020.com/policies/modernize-voting/ - Eliminate Media-born National Discourse: https://www.yang2020.com/policies/media-fragmentation/ - AI Regulation: https://www.yang2020.com/policies/regulating-ai-emerging-technologies/ - End Robo-Calling: https://www.yang2020.com/policies/robo-calling-text-line/ I would be interested in hearing your opinions on some of these policies, the ones I have here are technical in some form although Andrew has spoken out about many other things as well which you can check out on his website. I'd like to hear what you guys have to say about Andrew Yang's proposals. What are your thoughts on free internet, internet infrastructure, and net neutrality?
  6. I could REALLY use that mouse and keyboard. Currently using an old WoW-Cataclysm Steelseries Keyshift keyboard, the whole keyshift deal is nice but its not ranking up to the speeds that I want, and I'm currently using a German engineered gaming mouse I got on Amazon for $20 since my last one had leaked battery acid in it. Also, my mouse, why'll wired, will occasionally freeze out and I have to replug it in to another port in order for it to work. Being that I still raid/PvP in WoW it would be nice to have myself a new upgrade, and I dont see myself buying any peripherals in the near future why'll I'm saving money for college.
×