Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

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 - Supermikhail

Pages: 1 ... 17 18 [19] 20 21 ... 73
271
Well, trying to print a class containing a string (like a char string or String string) into a binary file, reading back gives segfault, if I remember correctly.

272
Well, I intend the program as an accessible editing interface. So that I, or someone else, if I shared responsibility, could fill the database without bothering with the format. But I guess now it's going to be my project to test if I'm able to make the program read/write my files.

273
keep sensible names in the code
Huh? You either mean hard-coding a large part of the data-base, or "code" is more flexible than I thought. But I understand obfuscation and deobfuscation... to which I've thought of a great addition - store the database file in part-files, and only combine them together in RAM, to form a complete database, and then dehuffman it. !!!

Addendum. I don't understand anymore what you're saying, guys! ::) I've never used any cats on computer.

274
The program actually needs obvious names, like element names and compound names... well, might need. But, I guess I'll tackle that after I've become more familiar with Java and can write simple files. Also, I guess I'll go for i18n (it's acceptable to abbreviate it like that in coder circles, right?) then - my program is intended for Russian students, but currently, you could say my whole computer is English, and the previous "version" was written completely in English. Urgh. My life is full of bugs!

Also also, write-time? That's for when a program writes into a database, right? Then there's runtime, that's when a program executes. I wonder what you call the time when you write a program. I thought it could be "design-time".

275
Any file format is readable with a hex editor, so it doesn't really matter what format you chose.
While I've never used a hex editor, I imagine that usefulness of what you've read from a file readable with a hex editor or a plain text editor varies. Of course, I won't be able to stop a hacker who breaks DRMs for breakfast every day; I just don't want to make the same mistake our teacher made when I was in high school - she placed a data file in text format in the same folder as the executable for our test. Not many, but some people figured it out and took the results out of the text file. Kind of recursion on a new level, if you think about it. Or lack of encapsulation.

Yes, but hex editors show ASCII characters only, they won't show decimal numbers. Some do have hex to decimal conversion, but it's not easy as just reading the file. If want to encrypt something, you can try compressing it with Huffman (which Java supports by default), and then just decompress before reading.
I imagine it would decompress it into a file on the hard drive during execution? Or, er... it's in a java library, right? Or I need to write the compressor myself?... Ah, I guess it can be all done in RAM.

Oh. Wow. Binary? I hope java won't screw up string output like C++.

276
Well, that's why I'm trying to write a good interface for editing the elements database first, including adding and viewing entries. With how advanced teenagers are in computer matters nowadays, I'd very much dislike having the data easily readable.

Edit: A-ha! You've reminded me of my project that I tried to write when still in Delphi. Maybe that's why it wouldn't read the file, because it was bmp.

277
Actually... there's a couple of problems with what I want to do with the database, and one I've just come up with, another I couldn't address in C++. I think I'm going to divide my elements into groups, that is, classes inheriting from a common element class, but I'd like to store their data in one file. Which means that entries might have variable sizes. Or maybe I could fit them all into one class still... I'd sure prefer a premade storage format that the system already knows how to read, because my efforts at teaching it to read a format proposed by me have been unproductive. On C++.

Ideally, I'd like to have the database so that it's editable and accessible for the developer, but the user can't do anything with it (that's why I don't want to do it in text format).

278
Creative Projects / Re: Bay12 Writers Guild
« on: December 19, 2010, 05:42:53 am »
Hm. Maybe someone could advise me on whether a chemical novel is a good idea. I've got to do something educationally chemical for my undergraduate project, and I'm starting to doubt if I'm going to pull of a game. I think an inspirational novel could do, too. Problem is, I'm not sure how good an idea a gimmicky novel is.

279
So, I gave a (lame) go to Java yesterday, installed NetBeans. Tutorials above starter confusing. So, my question to ILikePie... or Ron, and anyone else in Java, is it a good idea to try to learn and use java DB thingy for my... well, elements, and eventually chemical compounds, databases? Or maybe it's called CRUD. I'm not sure. And if that converts well to mobile edition.

280
Creative Projects / Re: I'm gonna try and write a book.
« on: December 19, 2010, 05:03:50 am »
@Blag: I think the author himself said you don't have to be positive, even costructive, just any critique... Hey, look at that!
In this state I want to say, that with the level of experience displayed, the worst thing about this bit is that filiusenox wants to write a book. I suppose if he sticks to it, there'll be lots of improvement, but the fact that the work will have low-quality alongside with improved writing, is going to be a hindrance and a big demotivator. Writing short fiction would be much more useful.
It appears as if I gave some, if I may, constructive advice.

However, I'd still like to repeat myself, I am sick so head misty.

So, with all that said, it appears to me that the author has not written a lot, so, what Grakelin said, at this stage the best suggestion is to write a lot. And proofread one's work. And never ever ask for criticism when one is half-asleep. Unless one intends to write half-asleep all the time.

281
Hm. That's great. So, to give access to the database to a user on a different computer, I'll need a way to put the ElementsData into their home directory...
Getting the application's directory shouldn't be to hard. The full path to application is stored in argv[0], just save it as a string.

Oh... Why? Does it need it? The math library required by "math.h"?
It's kind of silly really. For some reason, you don't need the -lm flag on Windows, all you need to #include <math.h>. Seems to be a Linux thing.
Can you say how reliable argv[0] is? Google seems to think that it can be pretty random, depending on where and how the application was launched.

On another note, I'm so tired of this bullshit (including not-reading files) that I'm even considering changing the language. Anyone can suggest what I could kind of easily transfer my... newly-acquired knowledge of C++ into? I don't exactly have a lot of time to dawdle around, so even if I solve my current problems, am I going to have to jump through hoops with the intricacies of C++ the rest of the way?

I'm considering going back to Object Pascal, as I programmed in it... like 5 years ago. But I haven't been able to find any good educational sources to supplement my beginner book, and Delphi books I've seen deal mostly with databases which is not exactly up my valley.

282
Creative Projects / Re: I'm gonna try and write a book.
« on: December 18, 2010, 04:29:58 am »
He should try some short stories first. It's something that I did, I gave them to friends who reamed me for them (seriously, they tore everything apart) and it made me a far better writer. It's just one of those things that's necessary.
At that, I'd just like to take this moment to complain that I once had a friend who was very dear to me, although in the end it turned into a long-distance friendship and then completely fell apart. Well, I sent him my writing regularly, and the first time, he said he had read it with his friend and had laughed the whole way through that's how ridiculous it was. He then promised to send me detailed critique, but never did. The times after that, he just said my writing was ridiculous. Well, how is one supposed to get good at writing with friends like this? Not to mention, that everyone else I ever showed my writing to, before I started Bay12 Writers Guild, said it was good and never cared to give any critique. I always had to work by intuition, which meant frequent restarting. >:( Life sucks.

283
Creative Projects / Re: I'm gonna try and write a book.
« on: December 17, 2010, 03:02:35 pm »
I was half asleep at the time but what you guys were saying is what I thought I screwed up most at.
I don't really understand what you're trying to say with that. That you wrote your post while falling asleep and now think that might not have been the best idea? In that case, congrats, nice trolling. You asked people to put effort into coming up with ways to make your writing better, while you didn't care to make it good enough yourself, even though you knew how you could.

284
Hm. I might be wrong, but I believe GCC came with my Ubuntu distribution.
That's fine then. Ubuntu's gcc works great.

I might have found the problem, you seem to be running everything from you're home directory. Open a terminal and type 'pwd' (Stands for print working directory), it should print something like /home/mikhail/. That's the directory you're in currently. Now type 'cd MyseriousConstructions/ChemicalLego'. You'll notice the prompt has changed, so has the output of 'pwd'. This means you are in a different directory. Most applications generate files in the directory the user is in (The output of pwd). Try compiling again from the project's directory, and then running it from it in there. It should work just fine.
Hm. That's great. So, to give access to the database to a user on a different computer, I'll need a way to put the ElementsData into their home directory...
What's -lm there?
-lm tells the compiler to include the math library.
Oh... Why? Does it need it? The math library required by "math.h"?

Edit: Google gives a lot of answers for Windows, using Windows libraries and functions. >:(

285
Er. The title is outdated, actually. Well, the name of the folder. And, I guess, without knowing for sure what and if I'm going to be able to make something of it, there's no point for a real title.

Edit: That's retarded. GCC from the terminal actually makes the executable in the home directory. Why?

Pages: 1 ... 17 18 [19] 20 21 ... 73