• Content count

  • Joined

  • Last visited

Community Reputation

10863 Excellent

1 Follower

About fastcall22

  • Rank
    Web Developer

Personal Information

  • Interests

Recent Profile Visitors

26382 profile views
  1. C# How to reduce data sizes?

    What kind of precision do you need for your position coordinates? What are your limits on data? I imagine for something like this, a “snapshot frame” could send the full precision of state (X, Y, Z, rotation), while intermediary frames use less precise or fewer bits for changes between them. If possible, I’d look into gzip compression, but I suspect it won’t have too much of an effect. EDIT: Some rough guesses. Assuming some reference frame that has the full precision of the `(X, Y, Z, rotation)`, and for each frame, we use halffloat precision for deltas for a total of 27 bits/entity, then several million entities will be about 54 Mbits/update. Or perhaps, you could use a variable number of bits and only send the components that need updating: `(ID, (component, value), ...)`…
  2. C++ Will it cast?

    Yes, read IEEE 754 for more detail. The range of integers that can be exactly represented by a single precision float is from -0x01000000 to 0x01000000.
  3. Which is better?

    Please don’t post just to post. Closing. Also, post off–topic discussions to the lounge. Thanks!
  4. That HTML page appears to be a DoS deterrent served by your hosting provider. Upon visiting one of the hosting provider’s sites, it appears that they redirect to this page where a challenge must be solved by your browser. The browser will set a cookie to with the answer before redirecting to your site. If the challenge was solved incorrectly or the user agent is not recognized, then it appears your hosting provider rejects the requests with a 403 forbidden. At this point, I concur with hplus0603 in that you should get a server that you control. Everything you’ve done up until now can be setup on a virtual machine or even your own development instance. Since you plan on using HTTPS, I will assume that at this point you’ve figured out the server situation. You will need to obtain an SSL certificate and install it on your site. You can obtain 3–month certificates for free from letsencrypt, or you can purchase your own SSL certificates from a certificate authority such as Verisign.
  5. How are you testing from your browser? Have you tried mirroring the requests from Postman/PowerShell/curl?
  6. Why its wrong?

    Check your parentheses. You have more opening parentheses than you do closing parentheses. :^)
  7. FM Synth and Plotting with PowerShell

    (Cleaned up from IPBoard upgrade. Publishing it seems to have bumped it up to the top.)
  8. Beep boop, making progress on my FM synthesizer. Had a nasty popping sound with my phase-feedback logic and needed some way to rapidly graph out the logic. Powershell to the rescue: # plot-sample.ps1 $samples = 1024; $width = 2048; $height = 512; [Reflection.Assembly]::LoadWithPartialName("System.Drawing"); $bmp = new-object Drawing.Bitmap $width, $height; $g = [Drawing.Graphics]::FromImage($bmp); $g.SmoothingMode = "AntiAlias"; $penAxis = new-object Drawing.Pen 0xFF808080, 2; $penLineA = new-object Drawing.Pen 0xFF0000F0, 2; $penLineB = new-object Drawing.Pen 0xFFF00000, 2; $ptsA = new-object Drawing.PointF[] $samples; $ptsB = new-object Drawing.PointF[] $samples; 0..($samples-1) |% { $Q = 4*[Math]::pi/$samples; $feedback = 0; } { $ampA = [Math]::sin($_*$Q + $feedback); # A[t] = sin(t + 1.05*A[t-1]) $ampB = [Math]::sin($_*$Q); # B[t] = sin(t) $feedback = $ampA * 1.05; $x = $bmp.Width * $_/$samples; $yA = $bmp.Height * (-$ampA/2.1 + .5); $yB = $bmp.Height * (-$ampB/2.1 + .5); $ptsA[$_] = new-object Drawing.PointF $x, $yA; $ptsB[$_] = new-object Drawing.PointF $x, $yB; } { $g.Clear([Drawing.Color]::White); $g.DrawLine($penAxis,0,$bmp.Height/2,$bmp.Width,$bmp.Height/2); $g.DrawLines($penLineB,$ptsB); $g.DrawLines($penLineA,$ptsA); $bmp.Save("$pwd\plot.png"); } Looks like the logic should be sound. I did find that the phase-feedback wasn't being sin'd in the synthesizer, and that was causing the popping noise. And here's a sample of what it sounds like right now: fm-sample.ogg (36.4KB) And here's the instrument used to generate that sound: /* unit: mul frequency multiplier ofs additive frequency amp volume feed phase feedback envelope: A attack rate, in degrees D1 decay rate to sustain level, in degrees D2 decay rate to silence, in degrees R release rate, in degrees S sustain level program: u unit to render in phase buffer input slot, 0 for null input out phase buffer output slot, 0 for audio data */ instrument i; int idx = 0; // mul ofs amp feed A D1 D2 R S i.units[idx++] = { 2.00f, 0.00f, 0.50f, 1.00f, {80.0, 20.0, 10.0, 45.0, 0.75 }}; i.units[idx++] = { 1.00f, 0.00f, 0.25f, 0.00f, {85.0, 45.0, 5.0, 60.0, 0.50 }}; i.units[idx++] = { 7.00f, 0.33f, 0.12f, 0.00f, {88.5, 60.0, 5.0, 60.0, 0.25 }}; i.units[idx++] = { 1.00f, 0.33f, 0.50f, 0.00f, {87.0, 30.0, 5.0, 60.0, 0.67 }}; i.ct_units = idx; // program: // ┌─┐ ┌─┐ // │0├──►│1├──┐ // └─┘ └─┘ │ ┌─┐ // ├──►│3├──►out // ┌─┐ │ └─┘ // │2├──┘ // └─┘ idx = 0; // u in out i.program[idx++] = { 0, 0, 2 }; i.program[idx++] = { 1, 2, 1 }; i.program[idx++] = { 2, 0, 1 }; i.program[idx++] = { 3, 1, 0 }; i.ct_program = idx; Hue.
  9. Unifying Windows 10 Terminal Settings Again

    And once again, I’ve discovered more undefined behavior with Windows Search. The permissions fix will remove the shortcut from appearing from the start menu. Working on a fix.
  10. Oh boy, it’s that time of year again where all of my terminal settings get reset! Thanks, Windows 10 Fall Creators Update! But this time, I’m prepared !! I’ve made some adjustments to my previous attempt to Unify Windows 10 Terminal Settings. Namely, I’ve fixed the ACL not working as expected. Apparently `set-acl` attempts to reset the owner, which is denied when also removing the write permission. Additionally, the ACL needs to be reloaded in order to get the correct converted ACLs from the item’s parents. The workaround is as follows: # deny current user write permissions $item = get-item $path; $acl = $item.GetAccessControl('access'); # $acl.SetAccessRuleProtection($true, $true); # Disable inheritance, assume inherited $item.SetAccessControl($acl); $acl = $item.GetAccessControl('access'); # Reload ACL to obtain inherited permissions $acl.RemoveAccessRuleAll($rule); # Remove existing rules for the user $acl.AddAccessRule($rule); $item.SetAccessControl($acl); I’ve also added back in the registry fix: $console = (get-item HKCU:\).OpenSubKey("Console", $true) $console.GetSubKeyNames() |% { if ( $pscmdlet.ShouldProcess($_, "Remove Subkey") ) { $console.DeleteSubKey($_); } And after running: remove-consoleprops -StartMenu -AdjustPermissions -Registry -ErrorAction Continue … I was pleased to see that it worked as expected! I will be working toward publishing these scripts as a GitHub gist, so these files are versioned and others can contribute. That’s all for now. Thanks for reading; see you around! :^)
  11. "Windows protected your PC"

    You will need to sign your installers and executables. See also: How do I change "Verified Publisher: Unknown" to "Verified Publisher: [My Name Goes Here]" in the UAC popup.
  12. Encode LUA

    The attached file (since removed) is Lua bytecode, not encrypted source code. That being said, does not encourage reverse engineering. If the game has a plugin system, then it should also have documentation to interface with it.
  13. How to protect yourself and your game?

    Let’s not post knee–jerk reactions here. K, thanks.
  14. Any advice?

    You’re missing the surrounding class :^) using System; public class ExampleComponent { public Vector3 ... public void Start() { // ... } }
  15. google map don´t work