• Advertisement


  • Content count

  • Joined

  • Last visited

  • Days Won


TheComet last won the day on April 19

TheComet had the most liked content!

Community Reputation

3918 Excellent

About TheComet

  • Rank
    Advanced Member

Personal Information

  • Interests


  • Github
  • Twitch
  1. A lot of those conversions are unnecessary and you should probably load the DLL "outside" of the function that's calling it. Another thing I noticed is this section: Your function's return value is void so you need to set it as such. Here's how I'd do it: import ctypes as ct # Load DLL and initialize all types once here float3 = c_float * 3 mc_dll = ct.CDLL("mc_dll.dll") mc_dll.get_normal.argtypes = [c_float, c_float, c_float, c_float, c_float, c_float, c_uint, c_uint, c_uint, float3] mc_dll.get_normal.restype = None # returns void def get_normal(x_grid_min, x_grid_max, y_grid_min, y_grid_max, z_grid_min, z_grid_max, x_res, y_res, z_res): output_arr = float3() mc_dll.get_normal(x_grid_min, x_grid_max, y_grid_min, y_grid_max, z_grid_min, z_grid_max, x_res, y_res, z_res, output_arr) return V3(output_arr[0], output_arr[1], output_arr[2]) Then, if you were to save this to "mc.py" you could use it as: import mc normal = mc.get_normal(...)
  2. See here on examples on how to handle strings: https://docs.python.org/3/library/ctypes.html#return-types
  3. The "proper" way to do it would be something like this, if you had read the documentation, specifically section about arrays and pointers: So let's do that: DLLEXPORT void get_triangles(int* p) { p[0] = 123; p[1] = 456; } import ctypes as ct IntArray2 = ct.c_int * 2 # define new type that is an array of 2 ints arr = IntArray2() # instantiate this new type lib = ct.CDLL("./mything.dll") lib.get_triangles(arr) # pass it to your get_triangles function print(arr[0]) # prints 123 print(arr[1]) # prints 456
  4. Help disassembling laptop

    Laptops are hard to disassemble especially the modern ones. But that doesn't mean it can keep its secrets from you! What you'll want to do is get one of those industrial grade vacuum cleaners. You know, the 4.5kW 3 phase ones that suck so hard, it puts Nunu from Teletubbies to shame. Attach that to the ventillation shaft of your laptop and the dust will come flying out in an instant. The average time of sucking depends on the person, but it's usually around 2-3 minutes. Make sure to dispose of the laptop's expelled matter in an environmentally safe way. What I like to do a lot of the time is cook it up with pasta, it has proteins and vitamins in it. I've heard from others they like to swallow it directly
  5. what do you listen to while making / playing games??

    For coding it's usually repetitive or calm music. Solar Fields -- who made the soundtrack for Mirror's Edge -- has been a looong favourite of mine, I find myself returning to their music over and over again over the past 8 years. Some of my favourites: https://www.youtube.com/watch?v=GGgL2EF7QMg https://www.youtube.com/watch?v=QQYm8sG6IgM If you like progressive beats, Hybrid has a plethora of different styles. Their y2k album stands out the most to me, but they also make orchestral music combined with electronic. https://www.youtube.com/watch?v=gBq3Rn93xGA&list=PLC36B483573D932EB&index=8 I also really like progressive trance: https://www.youtube.com/watch?v=Y0yajN_sReE Deep house: https://soundcloud.com/dima-deepmix/dima-zvezdopad#t=30:12 When I get sick of all of the electronic music I'll switch it up for something like this: https://www.youtube.com/watch?v=xjrtKcPuvA8
  6. One thought you might have when hearing "LED Cube" is: What use are the LEDs in the center? Are they even visible, or are they covered up by all of the other LEDs surrounding it? They are. That's why it's preferable to choose LEDs with small housings and space them as far apart as possible. The "empty space to LED ratio" needs to be as large as possible. After searching multiple LED suppliers, I found that the smallest viable RGB LED is 5mm in diameter, with pin lengths of 25mm. To get an idea of what the cube might look like and also to figure out how the LEDs should be connected to one another, I decided to model the LED in blender. I came up with the following layout. It would be impractical to address all LEDs simultaneously. This would mean having 4096*3 control signals! I figured that the highest number of LEDs I would dare control simultaneously would be 768, which happens to be the exact number of LEDs in a single "slice" of the cube. In order to control all 16 slices, we use multiplexing: That is, we need to cycle through each slice repeatedly and apply the 768 signals for the active slice. If you do this fast enough, the human eye will think all of the LEDs are turned on. Knowing that ICs generally are able to sink higher currents than they are able to source currents, it is preferrable to use a common anode LED and connect all anodes in a cube slice together, making it possible to switch slices of the cube on and off with power transistors. The anode is the connection branching off to the right in the picture above. The 3 cathodes for controlling the red, green and blue LEDs in the housing are branched off downwards. The idea here is to chain the LEDs together such that the anodes can be soldered together like so: And by soldering these strings into an array, we get a single slice of the cube with all anodes connected to the same net: 16 of these slices are then stacked on top of each other such that the cathodes align perfectly with the underlying layer and can be soldered together: The result is a structure that looks like this (using 4x4x4 here for clarity, things get messy to look at with 16x16x16): The 768 + 16 pins that end up sticking out of the bottom of this structure will be soldered onto a PCB. The number of signals can further be decreased by using shift registers (most likely I'll be using 32x 24-bit shift registers which will decrease the 768 signals to 32. This, an FPGA can handle). To finish things off, since this is blender, I rendered some pictures of how the cube might look in the end. Enjoy!
  7. Why Is Animation so Under-utliized as a Medium?

    This question doesn't have a simple answer. You could probably write a thesis on why. Certainly one of the major reasons is this idea that cartoons are for kids (in the Western world). It's engraved into everyone's heads. If some friends came up to you and said "hey dude, let's go watch a movie. It's this cartoon that [...]" your brain would immediately conclude in this moment that this movie is going to be lame and for 12 year olds. That seems to be the natural reaction. It's interesting that we are so quick to judge cartoons like this, despite there being quite a few cartoons that are not for kids (Rick & Morty, South Park, The Simpsons, etc.)
  8. IRC Recommendations

    For IRC I recommend you download one of the many clients (e.g. HexChat, mIRC, etc.) and just dabble around with it. See if you like it. There are a few skills to learn: In most clients you can join a server by typing "/server irc.freenode.net" for example. To join channels you would type "/join #blender". To leave channels, you type "/part" and to disconnect you would type "/quit". There are a few other commands, such as sending private messages to specific users. This is done with "/msg <username> <message>". Note that most clients allow you to autocomplete usernames by pressing TAB. To find out more information about a user, you can type "/whois <username>". Then, a lot of IRC servers provide "services", which are bots that assist in channel/user management. Probably the most used one is NickServ, which allows you to register your name so no one can steal and impersonate you. You can interact with it by sending PMs, i.e. try "/msg NickServ HELP". There's also a service called "ChanServ", to see what it does, you may type "/msg ChanServ HELP". And now, for my more controversial opinions: IRC is old and stupid and lacks features in many ways. For example, mesasge history is only recorded while you are joined to channels. While you're offline, there is no way for you to see any messages that were sent during that period. People could be talking trash about you and you'd never know. The IRC protocol does not expose any functionality to synchronize past messages with your client upon joining. People get around this by writing their own chatbot or paying an online service to keep your username online when you go offline. Most IRC clients are text based. They do not support embedded videos or gifs. They do not support avatars, message IDs, or anything advanced at all, really. Most additional functionality like this is provided by bots written by people who have no hobbies. You will also notice a distinct "smell" when you enter any IRC channel on the internet. The way people talk and behave can be off-putting and strange and it's unique to IRC people. It's caused by a mixture of elitism, hipster-ism, and a resistance to change. IRC people will insist that you don't need any of those advanced features listed above. They will say things like "who needs message history, heh". Notice the "heh" proceeding this sentence. It's small quirks like this that you may not even notice at the beginning, but are indications of this "shared IRC consciousness", as if all people have merged into a single, indisginguishable personality blob. A hivemind. It's very hard to describe. It's the same smell you get from people who compile BSD from source and install it onto 1980's hardware and feel the need to brag about their accomplishments. It's the same smell you get from hipsters who go to hacker conventions with their macbook pros, who buy an Arduino-powered LED blinking hardware kit they get to solder together themselves and then feel like they need to brag about how much of a hacker they are, even though they don't know how to program and they probably botched all of the solder joints. Because joining an IRC channel is an achievement in itself. It requires some investement to learn how to use it, and because of this, it attracts people who with needs to feel superior to others. For these reasons, I recommend using Discord or anything else. Only use IRC in cases where you really have to (like asking a specific code question about the CPython API or something).
  9. Tribute to Stephen Hawking

  10. Math in C# and Python

    I don't do C#, but in python you could use Shapely or Polygon. You can install one using python's package manager "pip": pip install shapely pip install polygon Then, using shapely as an example, calculating the area is: from shapely.geometry import Polygon points = [ (0, 0), (1, 1), (0, 1) ] triangle = Polygon(points) print("Area of triangle: {}".format(triangle.area)) This will print "0.5" Generally, in python, if you can think of a problem, a package will already exist. So make sure to search pypi first before writing one yourself.
  11. Coding moods

    Interesting! I suppose it depends on what you're developing. My projects are always based on something I don't understand yet and wish to learn more about, so running into brick walls and having to rethink and redesign is a common occurance.
  12. Coding moods

    I think it's unfair to compare the method you use to program a hobby project with the methods used in commercial products. First off, in a professional setting there is always a specification that describes exactly what the product needs to be able to do. From this, the project is typically divided into small, manageable "work packets" which is integrated into a tracking system for managers to monitor progress. In other words, there is never a situation where you come to work and ask yourself "what should I do today" and similarly there should never be a situation where you go "lol I have no idea how long this feature will take to implement". The path to completion is not hazy, it's already layed out for you, it's just a matter of doing the work. In contrast, I think most people's approach to hobby projects is a "do whatever tf you want" approach where you have little concerns about the scope, you have a very vague idea of what you actually want, you have no idea how long it will take, and you don't care whether what you're working on is a waste of time or not in respect to the rest of the project. In fact, you might not even know if what you're doing works or not. You do whatever is fun to you in that moment in time. A result of this is often "feature creep", complete over-estimation of ones own abilities, and depression.
  13. Problem with sleep

    As someone with this exact problem, I can confirm that staying away from screens, reading books, and not eating food 2 hours before bed helps (digestion keeps you awake). If you are considering sleeping pills, don't abuse them. They can help you get into the correct rhythm, but you really shouldn't need to use them for more than a week. Perhaps the most important thing for a good rhythm is getting up at the same time every day, no matter how you feel. Do whatever it takes to get out of bed at 08:00 or whatever, even on weekends.
  14. Why A.I is impossible

    On a more serious note, here are my 2 cents to the whole "subjective experience" discussion: I think it's easy to look at a system that behaves slightly differently than ourselves and go "pff, this thing is clearly not conscious". We've seen this being said about animals and now we're seeing it being said about computers and I don't think it's as clean cut as you might initially think. Self consciousness is the ability to observe and react to ones own actions. Who is to say that a PID control loop is not "self conscious"? You might laugh at this idea, but if you think about it, what arguments can you really make against it? Are living systems not just a highly complex composition of millions of self-regulatory systems, where the thing that identifies as "me" is at the very top of the hundreds of layers? Who is to say that each of those systems is not self conscious in its own way and has its own subjective experience? When a thought enters your mind, you proceed to think about that thought, and think about thinking about that thought, and so forth. This process of self-thinking is some kind of feedback loop, which relies on the results of many "lower level" feedback loops, right down to the molecular level (or perhaps even further, who knows). This is also the reason why you see fractals when you do psychadelics, because systems with feedback loops are recursive, but that's beside the point. And for that matter, who is to say we are at the "top" of this chain? Humans form structures such as societies or companies, which also have an ability to self observe and react accordingly. Who is to say companies aren't conscious? Or the environment isn't conscious? Or the billions of devices connected to the internet haven't formed a self-conscious "brain" of some kind? Or the galaxy isn't one gigantic conscious super-organism? It might be very different from our own consciousness, but again, that doesn't necessarily make it unconscious. Randomness is another point of discussion. Must a self-conscious system necessarily have an element of randomness? There are numerous psychological experiments that predict how a human will respond to specific situations with an astoundingly high degree of accuracy (see: Monkey ladder experiment, see: Stanford Prison experiment, see: Brain scans that predict your behaviour better than you can) It almost seems like we are under an illusion of being in control and perhaps the actions we take are for the most part predetermined. Whether this is true or not is of course unknown, but the real question is: Does it matter? If so, why? Just because it appears that human consciousness is not computable doesn't mean it's random. It is very obviously highly organized, otherwise you'd be unable to respond to this thread, or even have an experience for that matter. So: If I were to add an RNG to my Turing machine to make it less predictable and thus "more conscious", isn't that taking a step back from the actual problem?
  15. Why A.I is impossible

    Okay so just add some RNG to your turing machine. Problem solved!
  • Advertisement