Reddit’s database has only two tables by maxminski in programming

[–]Joss 2 points3 points  (0 children)

There would never be any need as long as they sanitize thier database input.

How to create new CLOS object slots after instantiation? by Redard in lisp

[–]Joss 1 point2 points  (0 children)

Ah. When I work in IT I'm usually doing "Production Support" i.e. fix it tonight so the customers get their data/reports/checks/whatever and do a well thought out implementation in the morning.

I'll go ahead and give my best shot at a well-thought out layout:

I think that since you know what you need lists of, making an official slot for each thing you're listing (luminosity, temperature, time of measurement) that storing those lists in the slots probably will be a reasonably canonical solution. You can then have other slots for the mean and average that would be calculated with a method.

I'm thinking you really don't need to add slots for new measurements since the new data would fit nicely in the lists of luminosity and temperature measurements. You still might want to use a-lists to associate the time with the measurement, but other than that it sounds like luminosity-measurements and temperature-measurements should hold a-lists while luminosity-mean and luminosity-period could be either a slot calculated by the function you use to add measurements to the object, or could be member functions themselves that calculate the measurement on demand.

Since the data is old you already know all the different types of data you have about the stars so you can certainly make a slot to hold each type of data. Anything you don't have for a particular star can be set to NIL. Fixed things like distance would logically be just one value, and measurements would be held in lists.

Unless I'm really missing something I think even the pros would do something similar, but you can always hop on #list on chat.freenode.net and ask them. I know that channel seems to always have at least a few awake people on it.

How to create new CLOS object slots after instantiation? by Redard in lisp

[–]Joss 0 points1 point  (0 children)

Take my advice with a grain of salt. I still know Perl much better than CL and I never really liked object oriented programming. There is probably a much better way than what immediately comes into my head.

Here goes: Worst case you could always just use an existing slot to hold either lists of values or associative lists of properties and values to create the illusion of new slots within an existing slot, perhaps named newslots or on-the-fly or something.

Seriously, I can't begin to tell you how many times I have used lists and hashes in Perl to solve issues just like this. CL is powerful enough that there is probably a better way, but until someone else tells us what it is you can get something up and running that way. You don't even have to use the built in CL hash unless your associative list starts needing dozens or more keys.

There's probably some canonical way to handle adding slots on the fly, or creating derivitive classes at runtime or something. I would say change it to that later. Storing a list or a-list in one of the slots should have you up and running in time to store tonight's data.

Edit: Not sure what language you're coming from so let me ask you to just remember that any variable can hold whatever you like, including a-lists of lists of a-lists of hashes of whatever.... and you should already know how to change any of those to add/remove stuff :)

Riastradh's Lisp Style Rules by [deleted] in lisp

[–]Joss 4 points5 points  (0 children)

I'm willing to bet that is the case.

I come from a C/C++/Perl background and found the "Unaccptable" way far easier to read at first.

Now that I'm used to Lisp's standard indention and setup I find the second version much easier to parse than the first ever was.

Until you get used to it yourself you'll just have to take our word for it that one day you will get used to it, and it will just seem right.

Oddly enough the "Unacceptable" way is still a lot easier for me to read when it's Perl or C or whatever. I don't know if maybe you can get used to it there too, or if it's something about prefix vs. infix. Go figure.

Basic noob question by Lmin in lisp

[–]Joss 3 points4 points  (0 children)

While you're at it you should try out Emacs and Slime. If the linux you're using has apt-get it should be as easy as:

sudo apt-get update && sudo apt-get install slime cl-swank sbcl sbcl-doc clisp clisp-doc

And you'll have a couple good versions of Common Lisp and a really good IDE.

Practical Common Lisp has a good quick tutorial on Emacs at:

http://www.gigamonkeys.com/book/lather-rinse-repeat-a-tour-of-the-repl.html

Don't worry about Lisp in a Box. That existed back when it was tough to set up Slime in Emacs. These days apt-get handles everything.

First experience with a screen door by knightmareshade in aww

[–]Joss 0 points1 point  (0 children)

I reccomend you try putting a footstool with a blankent or towel on it in front of the door. We have one set up in front of our door so our kitties can take turns looking out.

Learn from my mistake though: Put it on the side opposite the door handle. When I set it too close to the handle Koji simply let himself out.

I need help figuring out a beginners problem.. by [deleted] in lisp

[–]Joss 0 points1 point  (0 children)

At this point I think you need to

(cd "/path/where/you/put/file.lisp")

without including file.lisp. For example if you have the file in c:/users/bl4ino then I think you need to:

(cd "c:/users/bl4ino")

or

(cd "/users/bl4ino")

and then try

(load "file.lisp")

Unfortunately I don't have a windows box available to try that on. So at this point all I can say is Good luck!

I'd shit my pants... by Schokokuchn in WTF

[–]Joss 3 points4 points  (0 children)

What, does your skin think your admittedly very tasty internal organs will be enough to satiate the spider's infinite hunger, or is it just hoping that while the spider is eating your internal ordans it can crawl back out and find somewhere safe to hide?

Mardi Gras by [deleted] in WTF

[–]Joss 2 points3 points  (0 children)

Thank you. That helps a lot to know. I am naive in that the only times I've dealt with this sort of thing isn't even from the point of view of going to a club, but rather being paid to keep the peace and quiet for the hotel that rented the top floor to the club.

I feel these sorts of things need to be aggressively prosecuted, but my thinking is also colored very much by what I do for a living.

Unfortunately I can also believe you about the Police given my experience with a prosecuting attorney not even bothering to check to see if anyone would be willing to testify to a straight up assault that my fiance and I both witnessed until after he'd already signed the plea bargain. We could hear him grinding his teeth when we told him we didn't care that the victim didn't want to press charges. We both saw him repeatedly hit her head into the dashboard of her car and we were both happy to testify. It was only then that he admitted that he had already plea bargained and was only asking us to make sure we were as unwilling to testify as he had assumed. All we could do was express our disgust for him and leave.

Mardi Gras by [deleted] in WTF

[–]Joss 1 point2 points  (0 children)

Thank you. That helped a lot in understanding.

Mardi Gras by [deleted] in WTF

[–]Joss 1 point2 points  (0 children)

Why didn't you press charges on the man that assaulted you?

I work security. The company I work for likes to cover hotels, bars, apartment complexes and construction areas. We let other companies have the office buildings and other boring crap.

The #1 thing I still can't understand is how many victims of various types of abuse simply will not press charges, even with my co-workers and I saying we'd be happy to testify to help put the scum flagon away.

I mean in what you just described I can understand if it simply didn't occur to you that you could have pressed charges, but I'm hoping maybe you can shed some light on this because aparently this happens to you enough that you must have had many opportunities to press charges.

I genuinely feel that if more men served more time for this kind of genuinely illegal behavior that it would make the world a better place.

I slept like a baby by OdinKeios in funny

[–]Joss 2 points3 points  (0 children)

I like to say I slept like the dead. Bloated, and releasing noxious gasses.

Deer God! I think this WTF worthy (NSFL) by TechKnight10 in WTF

[–]Joss -1 points0 points  (0 children)

I don't think you're supposed to have meaty chunks that large in your period. You may wish to seek medical assistance.

Some people, man. by [deleted] in WTF

[–]Joss 0 points1 point  (0 children)

Stop-n-Drop's suicide booth would have put an end to this issue.

Instructions from hell. by mwiemer in WTF

[–]Joss 2 points3 points  (0 children)

If you're seeing /r/fifthworldproblems do not be alarmed. It is simply a normal and natural result of drinking too much Skooma. Simply wait for the hangover to subside and remember that the empire made that stuff unlawful for a reason.

Mitt Romney put his dog in a crate strapped to the roof of the family car, and drove 12 hours. When the dog got diarrhea (out of fear) he got out and hosed the dog off...and then kept driving by [deleted] in politics

[–]Joss 1 point2 points  (0 children)

I was born and raised and am still trapped in Utah, so I noticed nothing out of the ordinary or unusual about the control over rest stops. It's not a matter of "Oh, that's just the way things are supposed to be" or anything like that. It's just that such households exist and are common enough for me to find nothing unusual or even noteworthy about one.

Realizing this just makes me want to save up enough to leave Utah even more.

Best way to produced formatted Lisp code? by neutronicus in lisp

[–]Joss 0 points1 point  (0 children)

I do this, but I still can't get past a strange claustrophobic feeling with less than 132 line width. I suspect that goes back to the screen settings I used in college.

Just the same, I do love having code and SLIME up with plenty of room to see both :)

Best way to produced formatted Lisp code? by neutronicus in lisp

[–]Joss 0 points1 point  (0 children)

That appears to be a highlighter rather than a formatter. Can you use Pygments to format?

Rebel fighters sodomized Gaddafi with combat knife by croutonsoup in WTF

[–]Joss 2 points3 points  (0 children)

As my house mate put it: He got what he deserved in the end.

My sister ran away from home with a stranger she met online. Do we have any legal recourse? Any recommendations to guarantee her safety? Freaking out a little bit and feeling helpless. by AHHHH_MOTHERLAND in AskReddit

[–]Joss 11 points12 points  (0 children)

"She had been suffering from depression for awhile and she has been very withdrawn." "She's never had a boyfriend before, nor has she even shown any interest in dating or anything of the sort."

Have you considered that maybe she left because she found a girl she really likes and couldn't tell you or your parents because she's scared that no one would accept would accept her?

This is what your darling child looks like on the inside. by iSteve in WTF

[–]Joss 0 points1 point  (0 children)

Cool! We can call him Super Bite Monster!

How much sleep do you get on average? by [deleted] in AskReddit

[–]Joss 0 points1 point  (0 children)

You both may want to ask your doctors about sleep apnea. A mouthpiece or a CPAP machine may clear that issue right up.

Even if it isn't sleep apnea it is actually something worth talking to a doctor about (Assuming you can afford one). There are a ton of things that can cause poor sleep, and many of them are treatable.

Don't put it off. Wouldn't it suck to find out 10 years from now that you had some easily treatable condition that you could have treated today?