Stories
Slash Boxes
Comments

SoylentNews is people

Log In

Log In

Create Account  |  Retrieve Password


A suggestion to mobile browser makers and the W3C

Posted by mcgrew on Thursday May 14 2015, @05:54PM (#1220)
3 Comments
Code

There are an awful lot of pages on my web site, and I've been busy making them all "mobile-friendly". Most of them are little or no problem making them look good on all platforms, but there are three that are especially problematic.

I jumped this hurdle (well, sort of stumbled past it) by making two of each of the pages with a link to the mobile page from the index.

Ideally, I could just check to see if it was a phone or not and redirect phones to the mobile page, but there's no way to make this 100% successful*. Each brand of phone has a different user agent, there are a lot of installable phone browsers. On top of that, is it an Android phone or an Android tablet? With the minimum typeface size and viewport set, those pages are fine on the PC version but the phone version looks like crap.

Apple should have thought of this when they made the first iPhone, and Google should have thought of this when developing Android. The answer is simple, but it can only be implimented by browser makers and perhaps the W3C.

From the beginning of the World Wide Web, browsers looked for index.html, the default front page in any directory. This worked fine before smart phones, but no longer.

Phone browsers should look first for mobile.html, and if it exists display that, and display index.html if it isn't there. Tablets and computers would behave as they always have.

It doesn't have to be mobile.html, it could be any name as long as everyone agreed that it was the standard, like they did with index.html.

Maintaining a web site would be much easier if they did this. What do you guys think?

* A fellow Soylent tipped me to the Apache Mobile Filter. It looks promising, especially since my host uses Apache. I'm looking into it.

Soylent Upgrade user extension for Chrome

Posted by takyon on Tuesday May 12 2015, @01:34AM (#1215)
7 Comments
Code

// ==UserScript==
// @name Soylent Upgrade
// @match http://soylentnews.org/submit.pl
// @match https://soylentnews.org/submit.pl
// @match http://soylentnews.org/submit.pl?op=viewsub&subid=*
// @match https://soylentnews.org/submit.pl?op=viewsub&subid=*
// @match http://soylentnews.org/admin.pl
// @match https://soylentnews.org/admin.pl
// @match http://soylentnews.org/admin.pl?op=edit&sid=*
// @match https://soylentnews.org/admin.pl?op=edit&sid=*
// @match http://soylentnews.org/comments.pl*
// ==/UserScript==

var simplifyChars = true;

var boxes = document.getElementsByTagName("textarea");
for (var x=0; x<boxes.length; x++)
{
    if (boxes[x].name == "introtext" || boxes[x].name == "bodytext")
    {
        var temp = boxes[x].value;
        temp = temp.replace(/<\/p><p>/g,"<\/p>\n\n<p>");
        temp = temp.replace(/<br>\s?<br>/g,"<\/p>\n\n<p>");
        temp = temp.replace(/<\/blockquote><p>/g,"<\/blockquote>\n\n<p>");
        temp = temp.replace(/<\/p><blockquote>/g,"<\/p>\n\n<blockquote>");
        temp = temp.replace(/<blockquote><div><p>/g,"<blockquote><div>\n\n<p>");
        temp = temp.replace(/<\/p><\/div><\/blockquote>/g,"<\/p>\n\n<\/div><\/blockquote>");
        temp = temp.replace(/<\/blockquote><blockquote>/g,"<\/blockquote>\n\n<blockquote>");
        temp = temp.replace(/<p class="byline">\s/i,"<p class=\"byline\">");
        temp = temp.replace(/<p>\s/g,"<p>");
        temp = temp.replace(/\s<\/p>/g,"<\/p>");
        temp = temp.replace(/<\/li><li>/g,"<\/li>\n<li>");
        temp = temp.replace(/<\/li><\/ul>/g,"<\/li>\n<\/ul>");
        temp = temp.replace(/<\/p><ul>/g,"<\/p>\n\n<ul>");
        temp = temp.replace(/  /g," ");
        if (simplifyChars)
        {
            temp = temp.replace(/\u2018/g,"'");
            temp = temp.replace(/\u2019/g,"'");
            temp = temp.replace(/\u201C/g,"\"");
            temp = temp.replace(/\u201D/g,"\"");
            temp = temp.replace(/\u2026/g,"..."); // ellipsis
        }
        boxes[x].value = temp;
        boxes[x].rows = 32;
    }
    var toolbar = document.createElement("div");
    var tempbutton = document.createElement("input");
    tempbutton.setAttribute("type","button");
    tempbutton.setAttribute("value","Blockquote");
    tempbutton.setAttribute("onmousedown","addBlockquote(document.getElementsByTagName('textarea')["+x+"]);");
    toolbar.appendChild(tempbutton);
    boxes[x].parentNode.insertBefore(toolbar, boxes[x].nextSibling);
}

var temp = document.createElement("script");
temp.appendChild(document.createTextNode("function addBlockquote(area) { var sel = getSelection(); if (sel.length != 0) { area.value = area.value.replace(sel,'<blockquote>'+sel+'<\/blockquote>'); } }"));
document.getElementsByTagName('head')[0].appendChild(temp);

function getSelection() {
    return (!!document.getSelection) ? document.getSelection() :
           (!!window.getSelection)   ? window.getSelection() :
           document.selection.createRange().text;
}

VT100 CSS Fix

Posted by takyon on Monday May 04 2015, @11:50PM (#1196)
0 Comments
Code

blockquote {border-left:3px solid #0F0 !important; padding-left:1em !important;}

/* Submissions */

.data .status0 {background:#FFF !important; color:#080 !important;}
.data .status0 a {color:#080 !important;}
.data .status0 a:visited {color:#0A0 !important;}
.data .status0 a:hover {color:#0C0 !important;}
.data .status1 {background:#800 !important;}
.data .status2 {background:#256625 !important;}

How to make "mobile-friendly" web pages

Posted by mcgrew on Thursday April 30 2015, @07:48PM (#1189)
4 Comments
Code

I finally got the full texts of Nobots and Mars, Ho! to display well on a phone. My thanks to Google for showing me how, even if the way they present the information is more like trial and error, but it's actually easy once you jump through all their hoops. I'll make it easy.

First, you need to make sure it will fit on a phone's screen. I've been preaching for years that it's stupid to use absolute values, except with images; if you don't tell the browser the image size and you are using style sheets, your visitors will be playing that annoying "click the link before it moves again" game.

Some of you folks who studied this in college should demand your tuition be refunded, because they obviously didn't teach this.

Giving tables, divs, and such absolute values almost assures that some of your visitors will have that incredibly annoying and unprofessional horizontal scroll (*cough* slashdot *cough*).

None of the elements (images, divs, etc) can be more than 320 pixels wide, and you need to tell the browser to make it fit on a screen. To do this, add this meta tag to your page's head:

<meta name="viewport" content="width=device-width, initial-scale=1.0">

Next, you need to make sure the text is large enough to read without double tapping. The <p> tag does this:

<p {min-height: 16px}>

This needs to be placed after the <body> tag and before anything having to do with text.

To test it, just pull the page up on your phone. If it scrolls sideways, you need to work on it.

If you're worried about your Google pagerank, Google has a "mobile friendly test" here. If you flunk, well, when Google says "jump"...

My main index page fails their test. To make it pass the test I would have to ruin the desktop/tablet design. As it is now, the text is readably large on a phone but it has a sideways scroll, which is tiny if you hold the phone sideways, and I added a link at the very start of the page to a version that will pass Google's test, looks fine on a phone, not bad on a tablet but looks like excrement on a computer. The main index works fine on a tablet, since I've made it as "mobile-friendly" as possible.

I'd have it redirect if it saw Android or iOS, but it's been fifteen years since I've done that and I've forgotten how.

A nu Linux

Posted by meisterister on Monday April 27 2015, @02:52PM (#1185)
10 Comments
OS

I think that it's time to build a new distribution of Linux, one focused on getting the job done. I think that most distros have basically lost the point of building a linux distro: to have your own unique ecosystem which provides for a specific set of needs.

I'm naming my small, hobby-level efforts to build a distro "nu", as it both provides a very nice logo to work with and because it as a symbol is used to represent "Degrees of freedom" in statistics.

Since this is effectively just a hobby-level of effort, don't expect big things of my distro (unlike a certain Debian fork), but if it works, it should provide a fairly decent starting base for the development of a solid server and development OS.

Some intended features of nu are:
1. nupack, a package manager that effectively just wraps shell scripts and data in a gzip'd tarball.
2. nuinit, an experimental (read: based on random speculation/ideas that I have) that uses makefiles to start and stop the system. If this works properly, it should provide all of the benefits of a certain invasive init system (ie. multithreaded execution) and a model for managing dependencies that is already tried and tested. If this doesn't pan out, I'll likely search for another init system starting with Epoch.
3. nubus. I understand that this was the name of a system bus from the late '80s and early '90s, though I'll likely come up with a better name later. This would start as a re-badged dbus with future revisions actually being their own thing.
4. Either the alsa or jack sound systems.

Because the primary aim of this project is to make a serious operating system, I don't intend to include bloat such as KDE or GNOME. The user is, of course, free to build and install these things for themselves, but they shouldn't expect me to support it.

Project status:
I'm currently trawling through Linux From Scratch, which will provide me with a base system to do various experiments and development on. Since LFS is a very small and basic system in and of itself, it will make it far easier to test out various init systems and implement my package manager.

Future work:
I'm going to implement the package manager first, since it should be fundamentally "easier" than the rest. Thankfully my computer can do the LFS Standard Build Unit in about a minute, so builds have been very fast and straightforward.

Sorry I haven't written...

Posted by mcgrew on Saturday April 25 2015, @08:33PM (#1182)
2 Comments
/dev/random

I have two new stories nearly finished, but I've decided to see if I can sell first publication rights to a magazine. If everyone rejects them, I'll post them then. If one is accepted, it will likely be quite a while before I can post.

With three books in the works I've been really busy. Hell, I've been working harder since I retired than I did when I worked! I got the index pages to my three published books and the "coming soon" page for Yesterday's Tomorrows "mobile-friendly". I don't know why I'm bothering; almost nobody surfs in on a phone or from Google. But at any rate, I got the book Triplanetary and the first two chapters of Mars, Ho "mobile friendly" as well. The Time Machine is next; the epub versions of my books are better than the HTML versions, on a phone, anyway. Twain, Dickens, and God are going to be mobile-hostile for quite a while because of all the artwork in them.

I couldn't make the main index "mobile friendly" without making it look like crap on a computer screen, so I made a copy "mobile friendly", posted it as mobile.html and added a link from the main index.

Site stats say Google has spidered, so I tried to find Mars, Ho!" by googling on the phone. Nothing but Marsho Medical Group, Andy Weir's The Martian, and a facebook page for someone named Mars Ho. Googling "Mars, Ho! novel" did bring up Amazon's e'book copy halfway through the page.

"Mars, Ho! mcgrew" brought up Amazon's e'book first, followed by the mobile-hostile main index, THEN the actual Mars, Ho! index which IS "mobile friendly" (it passed their test). And I thought "mobile friendly" was supposed to raise your ranks? What's up, Google?

The second copy of Yesterday's Tomorrows came yesterday. I didn't expect until the day after tomorrow. I went through it twice yesterday and it's almost ready; there is still a little work before it's published, but it won't be long.

It's a really nice book, with stories by Isaac Asimov, John W Campbell, Murray Leinster, Frederik Pohl, Neil R Jones, Kurt Vonnegut, A. E. Van Vogt, Theodore Sturgeon, Poul Anderson, Phillip K Dick, Frank Herbert, James Blish, Lester del Rey, and Jerome Bixby. Covers of the magazines they appeared in are shown, with short biographies and photos of the authors. It's also well-illustrated with illustrations from the original magazines.

Random Scribblings: Junk I've littered the internet with for two decades will probably be next year.

Oh, how do you like my new shirt?

Finally jumped into the MMO snake pit

Posted by Hairyfeet on Sunday April 19 2015, @06:09AM (#1165)
2 Comments
Software

Sigh, with it becoming harder and harder to find decent single player games, as i am not part of the "dudebro" demographic and therefor do not care for your "Medal Of Dooky: Halo Of Killzone Gears Edition" style of games I decided to jump in and try one that looked the least "dude bro"ish and that game is....War Thunder.

I have to give the designers of the game credit, as nearly ever other "FTP" game I've ever played is either so grindtastic its insane or so badly pay to win its not funny but at least in these early tier 1 games? Its really not, hell you can take the default tank (that you get free repairs on forever so you can be as nutty as you like with it, nice) and actually start getting kills in the first few minutes of the first game, its really all about keeping your head on a swivel and remembering to watch your reload times. Nothing will give you a smile quicker than somebody coming to strafe the tank formation you are in and you blow its wing off with the 20mm of your Panzer II lol.

So if any of you are getting sick of the usual fare and want something a little different? Do NOT be put off by the fact its planes and tanks (and soon to be ships) as its beyond easy to drive with a standard keyboard and mouse. If you can play an FPS? You can play War Thunder. Maybe if a few guys here give it a spin and like it we can get a team together, having :"Team Soybeans" roll the tanks while "Run To The Hills" by Iron Maiden plays? That would be a blast.

Product Review: Seagate Personal Cloud

Posted by mcgrew on Wednesday April 15 2015, @05:57PM (#1160)
4 Comments
Hardware

Around the first of the year all three working computers were just about stuffed full, so I thought of sticking a spare drive in the Linux box, when the Linux box died from a hardware problem. It's too old to spend time and money on, so its drive is going in the XP box (which is, of course, not on the network; except sneakernet). I decided to break down and buy an external hard drive. I found what I was looking for in the "Seagate Personal Cloud". And here I thought the definition of "the cloud" was someone else's server!

I ordered it the beginning of January, not noticing that it was a preorder; it wasn't released until late March. I got it right before April.

I was annoyed with its lack of documentation -- it had a tiny pamphlet full of pictures and icons and very few words. Whoever put that pamphlet together must beleive the old adage "a picture is worth a thousand words". Tell me, if a picture is worth a thousand words, convey that thought in pictures. I don't think it can be done.

I did find a good manual on the internet. For what I wanted, I really didn't need a manual, but since I'm a nerd I wanted to understand everything about the thing. Before looking for a manual I plugged it all up, and Windows 7 had no problem connecting with it. It takes a few minutes to boot; it isn't really simply a drive, it must have an operating system and network software, because it looks to the W7 notebook to be another file server. Its only connections are a jack for the power cord and a network jack.

The model I got has three terrabytes. I moved all the data from the two working computers (using a thumb drive to move data from XP) and the "cloud" was still empty. Streaming audio and video from it is flawless; I'm completely satisfied with it, it's a fine piece of hardware.

However, it WON'T do what is advertised to do, which is to be able to get to your data from anywhere. In order to do that, Seagate has a "software as a service" thing where you can connect to a computer from anywhere, but only the computer and its internal drives, NOT the "personal cloud". And they want ten bucks a month for it.

I downloaded the Android app, and I could see and copy files that were on my notebook to my phone, but I couldn't play music stored there on it. I uninstalled the crap. "Software as a service" is IMO evil in the first place, but to carge a monthly fee to use a piece of crap software like this is an insult. Barnum must have been right.

If you're just looking for an external hard drive, like I was, it's a good solution. If you want what they're advertising, you ain't gettin' it. The Seagate Personal Cloud's name is a lie, as is its advertising.

FOSS Games

Posted by meisterister on Sunday April 12 2015, @08:05PM (#1155)
0 Comments
/dev/random

A recent article posted here reminded me of all of the great FOSS games that I've gotten to play over the years.

To be honest, while FOSS games do feel kind of rough and unfinished sometimes (though it really does depend on the game; BosWars and LinCity feel like very well made games), they tend to be on a level of stimulation and creativity that really hasn't been seen since the 1990s.

1. LinCity (as well as LinCity-ng)
LinCity, while likely to draw a direct comparison to a similarly titled game by Maxis, really is in a league of its own. LinCity is a construction and resource management simulator that actually leads its players to think about how to design and build a city at a far more involved level than traditional city planning games.

2. BosWars
BosWars is an awesome RTS game that is absurdly easy to modify and improve (the game engine interprets plaintext scripts written in LUA). While the AI either lands in the categories of "Lacking" or "absurdly hard", I could see that it would be an awesome multiplayer game.

3. Globulation
Yet another RTS game, except that this one puts you in a far more interesting role. All the player can do is set construction and general goals/waypoints for the glob creatures presented. From there, they automatically go about their work and assign themselves to different buildings and waypoints. I think that this game would also be really awesome in multiplayer, though the AI is geared very well for every level of skill ranging from beginners to advanced players.

4. OpenTTD
OpenTTD is a free and open source clone of Transport Tycoon Deluxe. As such, it inherits its parent game's features while adding a wide variety of tweaks and improvements, such as a built-in modding utility/package manager.

5. OpenArena
This is a fork of the classic Quake III Arena, and thus inherits that game's fast paced action. While I'm not really too much of a fan of FPS games, this one is really fun to play. Please note that the character models used have quite a few polygons, so it is worthwhile to roughly double the system requirements listed on their page for a playable experience (though I would expect someone with SLI'd Voodoo 2 graphics cards to do pretty well on the processor listed).

6. KSpaceDuel
This is a clone of Space Duel. Nothing more need be said except that it has quite a bit of customization options available.

These are just the games that I have personally played and enjoyed. Wikipedia has a far larger list, and I encourage anyone reading this journal to check it out and reply if they so wish:

http://en.wikipedia.org/wiki/List_of_open-source_video_games

Let's Play NetHack (2, 3 and 4) & Dwarf Fortress

Posted by NCommander on Sunday April 12 2015, @05:32PM (#1154)
13 Comments
Code

It's been a busy week between class, and doing my Let's Play series; I've found doing Let's Plays a good way to unwind after a stressful day, and I've also done a bit more livestreaming. To avoid spamming the journal list, I'll likely just do weekly updates until I have communities implemented properly in rehash.

Dwarf Fortress
For those who missed it, I've started a livestreaming series where I play one of my favorite games of all time, Dwarf Fortress. I'm keeping a recap thread going alive on the official DF forums at Bay12. For those who are fans of the game are recommended to check it out. My schedule is somewhat fluid from week to week, and is complicated by a trip to New York City Sunday-Tuesday, but I will try and stream at least once week, or two; I'll usually announce streaming times 24-48 hours in advance, and on Twitter.

I'll name dwarves after those who commit story snipits, or those in the Livestream chat. My next broadcast date is tentatively late Wednesday, but that's subject to change.

NetHack
I have uploaded episodes 2, 3 and 4 (scheduled to go live at midnight tonight), with hope of having regular updates on Monday, Wednesdays, and Fridays. I have footage through episode 7 recorded, but episode 5 requires considerable editing as I do Sokoban in that, and I edited out most of the boring parts (which will be uploaded as a "special" video) with, or soon after 5.

Episode 2
  - On this episode of Let's Play NetHack, we wander our way through the Gnomish Mine's, groaping our way through the dark in hopes of finding Minetown.

Episode 3
  - As our first character meet an unfortunate end, a shocking revelation is revealed that sending our poor host into a mental breakdown.

Episode 4 (goes public at midnight)
  - We learn that Barbarians can fight well in the dark as multiple events conspire to drive us crazy.

If you enjoy my videos, please, leave comments, and subscribe to my channel. Furthermore, I'll offer shoutouts and credits to anyone who'd be up for creating titlecards for my series, and perhaps offer them an exclusive chance to choose a game to me livestream or do a LPs. Given requests, I'm also going to record a special video at some point that goes more into detail on how to play NetHack specifically.