Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
Const-me
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
84 ms
·
871.
▲
by
Const-me
5y ago
> I have two options, one is to pass in an in-out parameter, the other is to the throw an exception. Another one would be not using constructors at all, instead implement initialize() or create() method in the class. > Now you have th
872.
▲
by
Const-me
5y ago
When I need something like that, I usually passing [ 0 .. 1 ] float phase to the shaders, and when updating the number on CPU I wrap the value into that range after the increment.
873.
▲
by
Const-me
5y ago
> They freaked out. Yes, indeed. > the separatists would still fight Maybe (IMO unlikely but it's debatable), but I doubt they would do anything like that [0] [1]. For [0], they're not freaked out enough. For [1], civilians
874.
▲
by
Const-me
5y ago
> Look at China and Tibet, for instance, or Hong Kong. Or Catalonia and Spain, Basques and France. You are giving examples of people who want independence. Sometimes, people in such situations can indeed start a war for independence. Thi
875.
▲
by
Const-me
5y ago
This is wrong for so many reasons. The root problem, democratic Ukraine presents existential treat for Russian autocrats. Donbass is not an independent entity, it's part of Ukraine occupied by Russians in 2014, under full Russian contr
876.
▲
by
Const-me
5y ago
> Having a niche and highly customizable thing costs you extra. Niche sure, but I'm not sure I agree it's highly customizable. Not all laptops are designed like macbooks with just a couple ports and soldered everything. There&#
877.
▲
by
Const-me
5y ago
Good one, but IMO a bit too expensive for the specs. I recently got a new laptop with Ryzen 5 5600U, 32GB RAM, and 2TB SSD. The laptop is HP ProBook 445 G8. RAM and SSD were sold separately, the upgrade only took 10 minutes and 6 screws. I
878.
▲
by
Const-me
5y ago
> they collect everything through their desktop environment There're many relevant questions during the install. If one actually uses the OS installation wizard GUI instead of skipping it with "next" buttons, Microsoft won
879.
▲
by
Const-me
5y ago
Interesting idea, installed the addon. I’m using MS Edge BTW, Microsoft doesn’t care about Google’s advertisement revenue, the addon is available in their marketplace.
880.
▲
by
Const-me
5y ago
> I'd prefer to catch such errors at compile-time. I don't believe it's possible. These integers often coming from user's input, disk, or network. Compiler can't validate these simply because it doesn't have
881.
▲
by
Const-me
5y ago
I don’t think it’s possible to fix wealth inequality in any reasonable way. Here’s a trivially simple numeric simulation of zero-sum economy of 100k people: https://gist.github.com/Const-me/4b9b4372ba37c03feaf2f1475b1..
882.
▲
by
Const-me
5y ago
Why aren’t you using higher-level memory safe languages for that? In C#, the runtime checks for integer overflow can be enabled with a single compiler switch. The switch is not set by default for some reason, but easy enough to enable manua
883.
▲
by
Const-me
5y ago
Speaking about pre-shuffling and blending, you can try doing twice as much work with vectors. Pre-shuffle slices of 32 keys into [ 0, 4, 8, 12 .. ], [ 1, 5, 9, 13.. ] etc, then when searching combine 0-2 and 1-3 pairs of vectors with _mm256
884.
▲
by
Const-me
5y ago
Technically, sure. But practically — what’s your estimation how many C++ programmers target anything besides these 4, gcc, clang, vc++ or intel? My estimation is [ 0.1% .. 1% ]
885.
▲
by
Const-me
5y ago
Good article, but here’s a few minor things. > we combine the vector masks using the packs instruction and readily extract it using movemask just once Blend instructions are generally slightly faster than pack instructions, _mm256_blend_
886.
▲
by
Const-me
5y ago
No, but it’s supported by all modern compilers. In practice, that’s almost as good as being a part of the language standard. The level of support varies, but OpenMP 2.0 standard is supported by all 4 of them.
887.
▲
by
Const-me
5y ago
> you could write your own scheduler or use a library I never wrote ray tracers, but in my experience the best way to parallelize things is usually “none of the above”. C++ runtime has a built-in scheduler, OpenMP https://www.
888.
▲
by
Const-me
5y ago
Replace JavaScript with .NET: it delivers byte code not source code, the byte code was specifically designed to allow JIT into efficient machine code with minimal overhead. Replace HTTP and HTML with binary equivalents. A human-readable rep
889.
▲
by
Const-me
5y ago
That's not the right move. The right move would be a sandbox around every word/excel file being viewed/opened. Ideally, backed by a kernel mechanics such as CreateRestrictedToken WinAPI. What they are doing instead, shifting
890.
▲
by
Const-me
5y ago
> The react paradigm is FP. https://reactjs.org/ homepage writes "Build encapsulated components that manage their own state" That's a textbook definition of OOP.
891.
▲
by
Const-me
5y ago
> Media Foundation is registered Good point, albeit I think only higher-level pluggable pieces are registered. Most of these objects (IMFTopology, IMFSample, IMFMediaBuffer) can only be created with corresponding C APIs. > one is supp
892.
▲
by
Const-me
5y ago
I like many parts of COM, but I believe that example mostly demonstrates bad parts, with IDL, registrations, and over-engineered support libraries. There's nothing wrong with exporting factory functions from DLLs. Microsoft does it all
893.
▲
by
Const-me
5y ago
When people simulating real-time physics, it's almost always a bad idea to use semaphores like that. Instead, all pieces of the systems are normally simulated in lockstep. If the system has sufficient computations, a simulation step ca
894.
▲
by
Const-me
5y ago
> and prove that it has to be spherical To be precise, the earth is not spherical. It's unfortunately not even an ellipsoid: I live well above the sea level yet my home is like 20 meters below the surface of the WGS84 reference elli
895.
▲
by
Const-me
5y ago
> but it can't get out of it quickly for some reason As overclockers are aware, to achieve higher frequencies but keep CPU stable, one gonna need higher CPU voltage. Works other way too, lowing frequency allows to lower voltage, and
896.
▲
by
Const-me
5y ago
> Strict control over APIs and power usage These are doable with technical measures. Modern OS kernels are multi-user, when implemented properly, their user isolation features are very hard to break. If an OS doesn’t want apps to have so
897.
▲
by
Const-me
5y ago
Probably timeBeginPeriod WinAPI called by that media player: https://docs.microsoft.com/en-us/windows/win32/api/timeapi/n...
898.
▲
by
Const-me
5y ago
Can it be that you linked to one of these libraries, but never called any function from that DLL, so your linker dropped the unused DLL dependency? However, I don't really like that method. The app will fail to launch on computers with
899.
▲
by
Const-me
5y ago
About switchable graphics, nVidia APIs do work. The problem with them, there's no API to switch to the faster GPU, they only have APIs to setup a profile for an application, ask for the faster GPU in that profile, and the changes will
900.
▲
by
Const-me
5y ago
> The original design intention is that the number of triangles encodes the sense of distance, but maximizing the #triangles actually leads to interesting places. The design intention was saving resources. The game probably streams the n
More ›