Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
X

XxKeldecknightxX

@XxKeldecknightxX
About
Posts
4
Topics
3
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Verification Algorithm that mortals can use to verify chain of discussion making.
    X XxKeldecknightxX

    Hi Everyone! I have an interesting question and I do believe this is the best resource I have for asking this about this type of problem. I've been a SysAdmin for close to 15 years now and alot has transpired throughout these last few years due to COVID. Alot of situations have been brought to light from a political standpoint in a world where I really did not consider myself involved in (and still not too much now). It does seem that there's alot of Skepticism on resultsets that don't favor one's position, even going as far as to weaponizing Skepticism as a premise for rejecting results. These thoughts have lead me down the path of confronting an idea of this possible outcome verification problem that can arise depending on the subject matter and as most of you may be aware with our own US elections (But can apply to anything really). I really want to stay strongly on topic as this is specifically an Algorithm subject for me. My question I believe is in the neighborhood of the idea of SSL, but I was wondering is there a specific Algorithm or tweak of one that can be used to verify if such a idea is possible. My example is as follows. We have over 330,000,000 people that currently live in the united states (maybe a lot more, I originally thought we were around 430,000,000 but should not matter as this needs to scale). We can treat each person like a node. If at the start of a public survey, vote, or poll can a "Public key" be published to the public a week before a Poll is rendered. Each individual at the time of placing their vote would get assigned a HashValue and a position in line. That HashValue is a computed value that is at the time of inception of the Poll/vote/inquiry is being rolled based on the individuals unique ID (if needed) and the value selected they have chosen from the last known hashvalue from the previous vote place by the person inline before them. Once Polling/voting is closed, the ending key is also published to the public. Now for example if you have a trusted family member in another state where one placed their value near the start of the polling and the other trusted family member placed their own value near the end (It does not have to be this way, they can place it closer), is there a such an algorithm that can be leveraged where both these members can get the publicly documented keys (both start key and the key calculated in the end), enter it into an offline system that can then run the algorithm and determine if any of the data at all or INBETWEEN The two

    Algorithms discussion algorithms security help tutorial

  • Get if Device is enabled or Disabled in C#
    X XxKeldecknightxX

    Hi everyone! Does anyone have a sniblet to be able to detect if the device is enabled or disabled in device manager. I've done a bit a searching and couldn't find anything of use when attempting to get a status of a device. What I have so far, it appears the value I am obtaining by marshaling my Data stays the same regardless of its status so my API call is incorrect or the way I am marshaling out and I was hoping one of you may have a sniblet that actually works. Below are two failed attempts at getting the device status :\ Thank you!!

    public static bool GetDeviceState(Func filter) //https://www.codeproject.com/script/Content/ViewAssociatedFile.aspx?rzp=%2FKB%2Fsystem%2FDevMgr%2Fdevmgr-src.zip&zep=GetTypeInfo.c&obid=14469&obtid=2&ovid=1
    {

            var dpk = new DEVPROPKEY();
            dpk.fmtid = new Guid("60b193cb-5276-4d0f-96fc-f173abad3ec6");
            dpk.pid = 2;
    
            var displayDevClass = new Guid("{ca3e7ab9-b4c3-4ae6-8251-579ef933890f}".ToString());
            var hDevInfo = SetupDiGetClassDevs(ref displayDevClass, null, IntPtr.Zero, DiGetClassFlags.DIGCF\_PRESENT | DiGetClassFlags.DIGCF\_DEVICEINTERFACE);
    
            if (hDevInfo != INVALID\_HANDLE\_VALUE)
            {
                uint i = 0;
                while (true)
                {
                    var did = new SP\_DEVINFO\_DATA();
                    did.cbSize = (uint)Marshal.SizeOf(did);
                    if (!SetupDiEnumDeviceInfo(hDevInfo, i, out did)) break;
    
                    uint required = 0;
                    DEVPROPTYPE dpt = 0;
                    var temp = new byte\[0\];
                    SetupDiGetDeviceProperty(hDevInfo, ref did, ref dpk, ref dpt, temp, 0, ref required);
                    if (required > 0)
                    {
                        var data = new byte\[required\];
                        if (SetupDiGetDeviceProperty(hDevInfo, ref did, ref dpk, ref dpt, data, required, ref required))
                        {
                            Debug.WriteLine(BitConverter.ToString(data));
                        }
                    }
                }
            }
    
    
    
    
    
    
    
    
    
            IntPtr info = IntPtr.Zero;
            Guid NullGuid = Guid.Empty;
            try
            {
                info = SetupDiGetClassDevsW(ref NullGuid, null, IntPtr.Zero, DIGCF\_ALLCLASSES);
                CheckError("SetupDiGetClassDevs");
    
                SP\_DEVINFO\_DATA devdata = new SP\_DEVINFO\_
    
    C# csharp sharepoint com algorithms debugging

  • Algorithm to compress Image to RGB565 for embedded screen
    X XxKeldecknightxX

    Creating the output of the pixel's isn't exactly the part I am looking for guidance on but this is a useful read anyhow to keep on my radar. I think maybe I am looking for "image vectoring" perhaps? Im not sure if that the correct term.

    Algorithms hardware algorithms php com graphics

  • Algorithm to compress Image to RGB565 for embedded screen
    X XxKeldecknightxX

    Hi Everyone!! I am working on logic for a Microcontroller that dynamically updates a screen via UART. The screen only accepts vector based commands to fill a coordinate with a square and a filled color. The command looks like so fill x,y,h,w, The PHP code I wrote so far takes the image and converts each pixel to the following format, However, there are tons of room for optimization. An idea I had was to take the image and find the most common color then set the whole screen to this color. Then find all pixel's within a given shade and make it the same color than that beings the fill command to a single command because it can then cover two squares by using the command x,y,2,1,. The goal is to generate the picture with lossy compression but without extremely affecting the image and as few FILL commands as possible. It can be your own or someone else's algorithm.. just make it possible to redraw with least amount of commands Examples of algorithms are like this. Cycle through each pixel and neighboring pixels and if they are similar shade make them the same. Then find the most common color and set the background image to that color. then cycle through each pixel if it's not that background color fill in that color. The least amount of times you have to cast the fill command to drop a pixel the better the algorithm! A sample image that will be used is here https://www.faichi.com/sites/default/fi ... %202_0.png[^] In this case, the large portion of the map is gray, so its best to make that shade one distinct RGB565 color then set the image of the full background to that color using a single fill command. Then cycle through each pixel and combine additional like colors to make the least amount of permutations to cast a fill command to fill a pixel or a subset of pixels. When doing this without any compression you would have to cast nearly one fill command for each pixel and would take over 5 minutes to draw a screen which is not a doable solution however there should be a simple way to go upon this. Sample PHP code.

    Algorithms hardware algorithms php com graphics
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups