Stories
Slash Boxes
Comments

SoylentNews is people

Log In

Log In

Create Account  |  Retrieve Password


My Photography Blog

Posted by mechanicjay on Thursday March 16 2017, @11:09PM (#2265)
10 Comments
/dev/random

Photography has been a hobby of mine for a long time. I'm going through, curating my images and chucking them on a blog. I don't know if they're worth it artistically, but keeping what I think are my "best" shots together, will hopefully let me see if I'm getting any "better" over time.

Feel free to check it out and drop some comments!

http://photography.smbfc.net/

Retro Data Structures

Posted by mechanicjay on Thursday November 03 2016, @05:38AM (#2125)
5 Comments
Code

Reposted from my blog: Operation Sysadmin | Retro Data Structures

One of the more fun things I do with my spare time is to play around with old computers. Specifically, I enjoy my Atari 800. I recently started thinking about a small game to write on the machine, something with a small map, which you can explore. Think Zork, on a very, very limited scale. This is mostly an exercise for me to see if I could pull this off in Atari BASIC.

If you were to make, say a 3x3 grid with a bunch of data attached to it, without getting all Object Oriented, you might choose simple data structure such as a 2-dimensional array, to retrieve data associated with your particular x,y coordinates on the map. A graphical representation of this data might look like this:
      1             2                3
  1 The start   A treasure!        A river.
  2 A monster!   Inscribed Rock   The wizard.
  3 A forest.   A bird.           Home

Atari BASIC, has three basic data types, number, character, and boolean. It also has arrays, you can make an array of numbers which is a standard thing, even today, or an array of letters. You may be tempted to call this a string, and it is referred to as such, but if you think of strings in Atari BASIC as character arrays, you're life starts getting easier. You can also make a mufti-dimensional array of numbers. A think that you absolutely cannot do, however, is make a mufti-dimensional character array, a matrix of strings if you will, at least not in a basic straight forward way. This limitation hit me pretty hard. Living in the modern age, I'm used to slamming together data-types in a multitude of different structures, without worrying too much about it.

So, given this limitation, how do you get all that string data into a data structure that you can reference by some sort of position? One place where Atari BASIC helps us out is that I can reference positions in strings and substrings quite easily, which turns out to be the ugly key we need.

Say, I want an array to hold 3 things. myarray$="Mary Bob I really like dogs, they are my favorite." If I wanted to get the word "Bob" out of this, I'd call for myarray$(6,9). Mary would be myarray$(1,4), the sentence would be myarray$(9,51). The issue of course is that all the lengths are irregular. I can't simply retrieve the nth element without knowing it's position in the larger string. But, what if we make the string lengths regular? First determine what the longest string you're going to allow is. In this case the sentence about dogs is 42 characters. Then, multiple, by the number of elements you'll be holding. 3*42=126, so declare a string 126 characters long. Something like the following BASIC code:

10 ELEM=3
20 MAXLEN=42
30 DIM MYARRAY$(ELEM*MAXLEN)

Now, you can reference the different elements by using MAXLEN as a multiplier to get the proper positions. Bob would be MYARRAY$(43,84), or MYARRAY$(MAXLEN,MAXLEN*2-1)
Mary, would be (1,MAXLEN-1). We can wrap the whole idea in a subroutine (No functions here kids!) make the positional calculations:


40 REM GET THE 2nd ELEMENT
50 GET=2
60 GOSUB 100
100 REM ELEMENT RETRIEVAL SUBROUTINE
110 START=GET*MAXLEN-MAXLEN
120 END=START+MAXLEN-1
130 PRINT MYARRAY$(START,END)
140 RETURN

The interesting thing to me about this approach is how incredibly space inefficient it is, especially noticeable when you're working on a machine with 48K of memory. It's also an good reminder about the kind of stuff that has to go on under the covers in our nice modern languages to make them so comfortable to work with.

Remember though, I'm interested in a matrix of strings! It turns out that with a little math you can extend this scheme to make a 2 dimensional array of strings as well. All it takes is another multiplier in there, which incidentally makes this an order of magnitude less efficient.

10 ROW=3
20 COL=3
30 MAXLEN=50
40 DIM MYMATRIX$(ROW*COL*MAXLEN)
50 REM POSITION
60 X=2,Y=1
70 GOSUB 100
100 REM MATRIX RETRIEVAL SUBROUTINE
110 START=X*MAXLEN-MAXLEN+Y*MAXLEN-MAXLEN-1
120 END=START+MAXLEN-1
130 PRINT ARRAY(START,END)
140 RETURN

In this way by manipulating the X and Y variables, and calling the subroutine we can retrieve different "cells" of data in our matrix.

Go ahead and stare at that second basic program for a few minutes until the math sinks in. The start position is calculated just like in the 1 dimensional example, with an additional Y position offset.

This approach will work decently well, for smaller grids with not too much data. Say a 3x3 grid, with each "cell" containing 255 characters or so, results in a use of just under 2.5K. What if you wanted a larger map though, say a 9x9, well that's 20K, almost 1/2 your memory.

The strategy for dealing with this, is to break your 9x9 down into 9 different 3x3 grids. Since this, in theory a map that we are traversing, imagine another variable to hold your current "grid" number, and subroutine to calculate what grid you'll be in when you move. If it's different, load the new grid grid information from disk. In this way, you can keep the memory foot print pretty small, and 2.5K loads pretty quick from a floppy drive.

When I finish up this exercise I will post the code so you can bask in its glory.

Proxy war with Russia?

Posted by mechanicjay on Sunday September 18 2016, @05:03PM (#2072)
13 Comments
/dev/random

First, watch the Russian member of the UN security counsel make his statement: https://www.youtube.com/watch?v=bID01gIEIOY/

There are some pretty damning charges here, I'm interested to hear a US rebuttal which consists of more that just, "oops, we're looking into it." If anyone has a link to such, please share.

Basically though, his response boils down to "wtf, guys?" Which seems like a completely reasonable response...one that I share. I honestly have a hard time believing that the "best military in the world" can accidently blow up the wrong people. If that is the case, we have no right to that title, should take our ball and go home unt we can clean house and clean out the rot in the system which allowed us to make this kind of mistake. Otherwise, I can't see any reasoning that leads to anywhere good. Proxy war with Russia, supporting ISIL for our own purposes when it's convenient, and so on.

Can I please vote for a viable anti-war candidate in November?

Thought on Sanders Endorsement

Posted by mechanicjay on Tuesday July 12 2016, @10:10PM (#1964)
29 Comments
/dev/random

I will preface this by saying that I have been a staunch supporter of Bernie Sanders.

There is a lot of anger on my feeds today at feeling betrayed by the good Senator for his endorsement of Hillary Clinton. My basic response is, "Well, what the hell did you expect him to do, go rogue? We love the guy because he has integrity. I continue to love him, because he still does."

The other thing to note is that we're talking about an adept parliamentarian who knows how to play a strategic game. The last 8 weeks or so, he's used the HUGE amount of leverage we, his supporters, gave him during the primary season to pressure Democratic Party insiders to reject business as usual. As a side note, it seems that some establishment figures, perhaps, have felt safe to do so as well. In some cases, serious primary challenges to entrenched Democrats have exerted the best kind of pressure on these folks.

More generally though, since he's failed to secure the Democratic nomination (sure lots of reasons for it, both legit and shady), he's limited in what he can do. Here's the key thing though, he's done more as a runner-up than any primary candidate in any party than I've seen in my life time Change is hard and it can take some time, but our foot is quite literally in the door at this point, let's not squander it with temper tantrums.

I saw a comment in one my Bernie Facebook groups from someone complaining about how he wasted his $27 on this guy. To that I say, "Go fuck yourself, seriously. And when you're done, go do it again."

First, you helped fuel a progressive awakening across the nation, was that not worth $27?
Second, your $27 bought people at the top, calling for a $15 min wage, Free public college and some pretty hefty healthcare reforms -- this stuff could really end up being a HUGE return on investment for you.
Thirdly, there were never any guarantees, it was always a long shot, and now you're pissed that what, you backed the wrong horse? Clearly, you failed to internalize the entire ethos of Bernie's message, "It's not about him (or you), it's about all of us."

Please don't take any of the above to say that I'm now a Clinton supporter because Bernie says so. On the contrary, I think she's terrible for a host of reasons much like all US Political Dynasties. That is to say she's probably no worse than 1 or 2 standard deviations from your Average Politician. The bigger problem is how awful an Average Politician is. This is one of the core problems we should focusing our energies on. Lean hard on the system to make our elected officials truly accountable to us, not to corporate money. It will take *your* continued involvement to root out the snakes and charlatans AT THE LOCAL LEVEL, as this will naturally flow upwards to the national level.

We CAN claw this place back from the brink -- $diety willing we'll be able to do it without guillotines.

Should Soylent use MaidSafe?

Posted by Barrabas on Thursday May 08 2014, @03:22PM (#365)
2 Comments
Soylent

[[Ask Soylent]]

In response to rampant internet surveillance, the imminent demise of network neutrality, and problems with the certificate authority system, MaidSafe is designing new protocols to access the internet in a decentralized, cryptographically secure manner.

Briefly, the project is an open source app development platform based on client-side encryption and redundant online storage. Websites using the system would be immune from mass surveillance and censorship, and provide anonymous login and site verification without a certificate authority.

Should SoylentNews run under MaidSafe?

SoylentNews was formed to show people how good things might be without the abuse, as push-back against ruining "our garden", but the scope has narrowed considerably due to the change in management. Without a "product distinction", something that marks this site as "better" (or at least, "different") it runs the risk of being "just another news aggregator".

Throwing weight behind MaidSafe would give momentum to their project, while giving us product distinction and help solve some of the abuse. As early adopters we would help set the direction of their project, and we bring an enormous amount of technical insight and debugging ability. It would empower both projects.

MaidSafe is just getting started, so there will be kinks and issues. Also, SN should be dual interface until the new system gains momentum - perhaps "read-access" to the general internet using the existing protocols, but with user registration and login using MaidSafe.

SoylentNews is also just getting started, and there's been talk of house-cleaning some of the code. This is an opportunity to be an agent of change - to take back a measure of control - while at the same time becoming demonstrably different and better.

My daughter is recovering from emergency surgery

Posted by mattie_p on Friday April 04 2014, @08:10AM (#252)
19 Comments
/dev/random

As the title says. An injury two days ago apparently requires surgery. I will be on hiatus for as long as I need to be.

Mattie_p

EDIT: surgery is complete, she is in recovery right now. She and I are both pretty tired right now. I'm home to care for my son and my wife took over at the hospital. I'll try to keep everyone posted but there is a lot I don't know at this point.

Known Main Page Issues

Posted by mechanicjay on Thursday March 20 2014, @08:15PM (#212)
1 Comment
Soylent
Are you seeing unexpected results on the main index when you're AC vs logged in?

There are 3 possible things going on that you should be aware of before you think that SN is *completely* borked. They are presented below in order of probability.
  1. Corrupted User Settings
    There is currently a bug with the way slash handles TimeZone information and user settings. Basically, it seems that user settings are somehow getting corrupted in the database leading to unexpected results. One of those unexpected results is that slash doesn't show you new stories in a consistent fashion. In order to fix it, visit your Homepage (link in the sidebar) -> Restore Defaults -> Set Time Zone -> Revisit the front page. We are aware of this issue and is in the dev pipeline. Please email dev@soylentntews.org if you're interested in helping out the development effort!
  2. Static Page generation and caching.
    Anonymous users get statically generated pages for the main index and article pages. This is run by some cron-like process in the backend slash daemon. The particular job that regenerates the static pages and updates the comment counter on the main index along with some other stuff, is "freshenup". This runs on some interval, (I believe its configured to run every 5 minutes currently). Combine that with a Varnish caching server sitting in front of Slash's Apache instance, which will cache for 5 minutes and Anonymous users can see up to a 10 minute lag in some information on the front-page vs. Logged in users, who get dynamically generated content all the time. This is an artifact of our current configuration and can be re-evaluated in the future, but for now, given the site load and the hardware we're running on, it seems to be working well.
  3. The "freshenup" task looses it's mind. (ie. SN is actually borked).
    There are times however, when the "freshenup" task goes wrong. At this point, static page generation and comment count updates stop occuring. A sysadmin needs to go bounce slashd at this point. This has occurred approximately 2 times in the month that site has been live. The symptoms are that when browsing as AC, stuff is more than 30 minutes out of date, story links are broken and comment counts are frozen in time (for all users), it could be that the "freshenup" process has hung, but a lag of up to 10 minutes is expected for AC. Please email dev@soylentnews.org if you think this is happening or hop into the #Soylent irc channel -- there are usually a bunch of staff and devs hanging out there.

Hopefully this will help to alleviate some confusion about when you should see differences and give everyone a little bit better idea of all how SN is put together.

Windows Registry

Posted by mechanicjay on Monday March 17 2014, @03:55PM (#197)
5 Comments
/dev/random
I just had to hack my windows registry in order to update VMware tools. I haven't had to touch the windows registry in years. I forgot how much it sucks. Maybe if the interface was better it might be tolerable, but seriously, regedit -- still in 2014?

Is it wrong to prefer the *nix approach, of each piece of the OS having it's own small and mostly manageable config file?

I'm gone

Posted by Barrabas on Monday March 10 2014, @07:46PM (#171)
11 Comments
Soylent

The domains are sold, the linode account is transferred, it looks like I'm out of here. This was a bad action to take, but the purpose was to get me out fast. In that regard it worked very well.

I could have stayed with the project and remained positive and upbeat were it not for the constant meanness shown by members of the staff.

Keep this in mind the next time you contemplate a palace revolt. Putting the dirty laundry out for everyone to see is hurtful and disruptive.

I wish everyone the best of luck in the new adventure.

Fuck beta!

Am I the bad guy?

Posted by Barrabas on Monday March 10 2014, @09:54AM (#167)
21 Comments
Soylent

Am I the bad guy here?

They say that Al Capone couldn't understand why the press hated him. He thought of himself as the "good guy", who had done so much for Chicago that the city should be grateful.

I understand how he must have felt.

To date I've tried to be positive, upbeat, and helpful during the transition - turning over accounts and passwords, answering questions, providing help where needed. I initially gave Michael passwords for everything about the project, including the registrar.

SoylentNews was pushing probably 7 million pageviews a month. Some acceptable [to the community] advertizing and it could have net $10,000/month. Despite this, Michael doesn't want to reimburse me $2,000 for startup costs.

Michael's behaviour is so *rotten* that I just cannot fathom it. I'm also baffled as to why the staff is being mean. Because of this I've taken back some of the account access: the registrar and my three linode accounts. I'm tired of being shat upon, and I need to look after my own interests.

Since the change in ownership, the site worth has dropped from $2700 to $470, the stark reality of the "palace revolt".

The truth is, no one wants to see dirty laundry. I crafted my resignation in a politically neutral manner because I was taught that it's not appropriate to say bad things in public. Michael's hit piece came as a complete shock.

This whole thing started because one person didn't like someone else's choice of OS, and couldn't let it go and couldn't put it off, even for 2 weeks. I've read about these types of religious wars, choice of editor being another one, but I never thought that people would go to these sorts of extremes. I wonder if "can't let it go" will be a recurring theme.

Throughout the transition, only a *single* staff member showed integrity, and only two showed any sense of loyalty.

I did my best to accommodate people, to give them important positions with interesting tasks, encouraging them to experiment and be creative, and most of all to grow. As an example, Michael originally declined being head of dev. He wanted the position, but felt that his people skills were not up to the task (he said this in so many words). After much thought and deliberation I came up with a plan to pair him with Mattie, a professional manager, to work on his management skills and help him grow into the position. I made special arrangements to give Michael the best seat in the house because he deserved it.

It came as a complete surprise that none of the editors were happy (per Michael's piece). No one had complained, I had several conversations with the head of that section and sat in on their group meeting.

Overlords had specific authority to decide split consensus, they were told this when they were made overlords (per my script). At the time of the revolt, none of the overlords had complained or even asked about this. Mattie had full authority to resolve disputes between groups, it was stated in so many words in the E-mail. I don't know how Michael thought otherwise, especially in light of the E-mail record. Michael was an overlord and was specifically told all of this.

This sordid affair has left me soured on the entire community. Slashdot users think we're a bunch of spoiled crybabies, and 'ya know what? I agree. I'm not a member of this community, and now that I'm an outcast I see that I don't *want* to be a member.

I'm not a nerd, I'm a scientist. Go do your own thing, I wash my hands of you.

UPDATE

I've had several offers for the site - thank you. I'm contacting the first one and then I'm gone.