Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Meldaril

Pages: 1 2 [3]
31
Modification Help / Re: torque math/global vars not making sense
« on: March 07, 2017, 06:47:47 PM »
This looks like a modulo vs remainder semantics issue

Torquescript returns a positive number for modulo which is nice.


I thought it was but it isn't. This is a bug in Torquescript.

So they should have set the msb/sign bit off (if it was set) before using C's modulo? Will this be fixed by the developers?

32
Creativity / Re: Drawings Megathread
« on: March 07, 2017, 06:33:03 PM »
I thought this looked bad so it never got finished.

Doodles on the daily train commute.


I sit at the center of a carriage because it's easier to draw when you're not directly above a train bogie.

33
Modification Help / Re: Sorting an array numerically - silly me
« on: February 24, 2017, 09:27:35 AM »
I would normally use quicksort because it's O(n log n) while the algorithm you're using is O(n2). But your sort input does not look large. How often do you need to sort?

34
Off Topic / Re: do any of you guys keep getting signed out
« on: February 24, 2017, 09:10:24 AM »
I was trying to invalidate old cookies and it took me a couple tries.
Did you invalidate sessions/cookies because of the recent cloudflare leak?

https://blog.cloudflare.com/incident-report-on-memory-leak-caused-by-cloudflare-parser-bug/

35
Off Topic / Re: Programming Megathread
« on: February 17, 2017, 09:08:17 AM »
Yep and it's also safer! Stack unwinding will happen when an exception occurs that has a handler. It's no good putting "delete" at the end of a function body when you're done with a heap-allocated object if the function can throw an exception.

Smart pointers can solve a lot of issues like this one.

36
Off Topic / Re: Making a new evolution simulator. (Third video!)
« on: February 13, 2017, 04:38:37 PM »
If I'm understanding correctly, a global minima in this program would be a solution that is the optimal "eater" and "reproducer". How is a canididate solution represented using chromosomes/genetic sequences? This isn't a clear-cut optimisation problem and I'm struggling to understand the method you are going to use for selection. I imagine you'll tweak the mutation rate to combat local minima.

Convergence is impossible without crossover so it's going to be very interesting to see your program when you have it implemented.

Edit:

I read your earlier post, and you mentioned that there is no fitness function which is why I'm curious about this. A fitness function is a part the selection process needed for crossover.

37
Off Topic / Re: Programming Megathread
« on: February 11, 2017, 09:51:44 AM »
There is an address computed for the base at boot time, but it is further randomized based on the order that your module gets loaded.

Ok that makes sense thanks. I wasn't aware that module order had any effect.

38
Off Topic / Re: Programming Megathread
« on: February 10, 2017, 10:08:31 PM »
A question about Windows ASLR for executables modules.

Is the base address computed at module initialisation and cached? On a reboot will a new base address be computed for the module - again at initialisation?

Or

Is the base address hashed based on module attributes found in the PE header and the filesize? So that on a reboot, the base address is constant.

My observation so far: Writing to an executable causes a new base address to be computed.

This small position-independent assembly fragment jumps to the original entry point of an exectuble and solves ASLR. I wrote this originally in C++ and inline assembly but now it's an MASM file on its own. It's a nasty hackjob that I'm in the process of replacing with a runtime assembler engine. The stack stuff and conditional jumping was done in C++. It accesses the process-entry-block (PEB) via the file segment (FS) register. The PEB contains a linked list of all the loaded modules for a given process. It iterates through the loaded modules and compares each base address with a constant written into the assembly at runtime (the original entry point offset found within the PE header). I avoided using functions calls to any API to avoid having to rebuild the PE import table.

Another terrible hack is the function pointer arithmetic I did to copy that entire procedure into an array. Using two functions pointers, you can get the size in bytes of function 'A' by subtracting the succeeding function, 'B'. Undefined/Unreliable compiler behavior at its best.

Code: [Select]


39
Creativity / Re: Drawings Megathread
« on: February 10, 2017, 09:37:10 PM »
No. He's on facebook where he shares most of his stuff now
Ok thank you

40
Creativity / Re: Drawings Megathread
« on: February 10, 2017, 08:04:13 PM »
Does Lalam24 still post here?

41
Off Topic / Re: Making a new evolution simulator.
« on: February 05, 2017, 09:35:51 AM »
Are you using a steady-state genetic algorithm approach? Some other heuristic approach, a different EA?

What sort of crossover (edge recombination) and are you using mutation as well?

How are you performing fitness evaluation on a given set of candidate solutions?


42
Modification Help / Re: Runtime Error TCPObject
« on: February 03, 2017, 06:58:14 PM »
Torkscript objects aren't garbage collected. If you create something and forget to delete it it'll stay around forever.
Thanks for the clarification. It's unusual to have explicit memory/object management like this in an interpreted language. This echos of C++ horror.

43
Modification Help / Re: Runtime Error TCPObject
« on: February 03, 2017, 04:27:05 PM »
Is TCPObject blocking? That looks like a local variable. If it's not blocking then as soon as you're out of scope, nothing will be received because the object won't exist anymore. After a bit of googling, I was able to fudge this together (I have tested):
Code: [Select]
package buildTerrain {
function buildTerrain(%pos1, %pos2)
{
%TCPI = new TCPObject(TerrainTCPObject);
%TCPI.setBinary(true);

%TCPI.connect("127.0.0.1:4878");
}

function TerrainTCPObject::onConnected(%this)
{
echo("Connected.");
}

function TerrainTCPObject::finish(%this)
{
%this.disconnect();
echo("Disconnected.");
}

function TerrainTCPObject::onBinChunk(%this, %size)
{
echo("Received new data.");
if(%this.contentLength !$= 0) {
echo("Saving data to file.");
%this.saveBufferToFile("base/server/temp/terrainData");
}
}
};
deactivatePackage("buildTerrain");
activatePackage("buildTerrain");

Send it whatever and it will save it. Now how to handle buffer size you will need to get an initial content length then you can resize the buffer using setBinarySize() and close the connection within onBinChunk() using the existing if statement with an 'else' statement. If you use setBinarySize(), you won't need to call setBinary() unless you want to go back to non-binary mode.

44
Off Topic / Re: Linux Thread
« on: February 03, 2017, 12:47:13 PM »
I dual-boot Arch and Windows 10. My Fstab is configured to use ntfs-3g for my Windows partitions. I try to use Cmake for my projects. I'd rather use Unix-style OS than Windows but the application ecosystem on Unix systems is lacking some polished gems like Photoshop.

When PCI-E passthrough becomes a bit more a thing, I could attempt to run Photoshop in a VM again. I've already tried it and did decently well but the performance is not there right now.

I also have a HP microserver that uses Ubuntu Server LTS. It runs some file servers, a web server and arpwatch.

Pages: 1 2 [3]