Stories
Slash Boxes
Comments

SoylentNews is people

Log In

Log In

Create Account  |  Retrieve Password


IRC & My night

Posted by xlefay on Sunday April 13 2014, @06:20AM (#288)
10 Comments
Soylent

Hi,

So, my evening/night started like any other until I started having several nosebleeds which all occurred within one or two hours or so not to mention the headache, so like any responsible geek I decided to phone my Doctor, fortunately, he was still awake and told me to go to the hospital... (what I got told there isn't important to this journal entry)

Anyway, so when I came home the IRC server was *seemingly* down, in fact, my entire server was *seemingly* down. After contacting my ISP, I had to go through a few hoops - and as it turns out, it was a faulty switch (you'd think, they would at least be monitoring their own switches right?). They replaced it and it's all back up. Incidentally, I was going to configure Carbon (which was going to be another IRC server) last night but the hospital thing came up.

So all in all, my night sucked big time.

Hopefully, not to many of you were inconvenienced by the downtime, perhaps some of you even managed to see the sun, or at the very least, felt the wind.

Update: webchat was still down, sorry about that.

A $1,499 Supercomputer on a Card?

Posted by martyb on Thursday April 10 2014, @03:59PM (#279)
3 Comments
Hardware

A $1,499 supercomputer on a card? That's what I thought when reading El Reg's report of AMD's Radeon R9 295X2 graphics card which is rated at 11.5 TFlop/s(*). It is water-cooled, contains 5632 stream processors, has 8 GB of DDR5 RAM, and runs at 1018MHz.

AMD's announcement claims it's "the world's fastest, period". The $1,499 MSRP compares favorably to the $2,999 NVidia GTX Titan Z which is rated at 8 TFlop/s.

From a quick skim of the reviews (at: Hard OCP, Hot Hardware, and Tom's Hardware), it appears AMD has some work to do on its drivers to get the most out of this hardware. The twice-as-expensive NVidia Titan in many cases outperformed it (especially at lower resolutions). At higher resolutions (3840x2160 and 5760x1200) the R9 295x2 really started to shine.

For comparison, consider that this 500 watt, $1,499 card is rated better than the world's fastest supercomputer listed in the top 500 list of June 2001.

(*) Trillion FLoating-point OPerations per Second.

Why The Proxy Detection Code Pissed Me Off

Posted by NCommander on Thursday April 10 2014, @12:54AM (#277)
11 Comments
Soylent

Now that I've had some time to clear my head, I want to expand on my original feelings. I'm pissed off about this, and my temper flared through on the original post. I'm leaving it as is because I'm not going to edit it to make myself look better, and because it sums up my feelings pretty succinctly. How would you feel if something you worked on under the promise of building the best site for a community was regularly and routinely causing corporate firewalls and IDS systems to go off like crazy?

You'd be pissed. Had we known about this behaviour in advance, it would have been disabled at golive or in a point release, and a minor note would have gone up about it. Instead, I found out because we were tripping a user's firewall causing the site to get autoblocked. I realize some people feel this is acceptable behaviour, but a website should *never* trigger IDS or appear malicious in any way. Given the current state of NSA/GCHQ wiretapping and such, it means that anything tripping these types of systems is going to be looked at suspiciously to say the least. I'm not inherently against such a feature (IRC networks check for proxying for instance), but its clearly detailed in the MOTD of basically every network that does it.

There wasn't a single thing in the FAQ that suggested it, and a Google search against the other site didn't pop something up that dedicated what was being done; just a small note that some proxies were being blocked. Had the stock FAQ file, or documentation, or anything detailed this behaviour, while I might still have thought it wrong, at least I wouldn't have gotten upset about it. I knew that there was proxy scanning code in slashcode, but all the vars in the database were set to off; as I discovered, they're ignored leading me to write a master off switch in the underlying scanning function.

Perhaps in total, this isn't a big deal, but it felt like a slap in the face. I know I have a temper, and I've been working to keep it under wraps (something easier said than done, but nothing worthwhile is ever easy). CmdrTaco himself commented on this on hackernews and I've written a reply to him about it. Slashdot did what they felt was necessary to stop spam on their site, and by 2008, slashcode only really existed for slashdot itself; other slash sites run on their own branches of older code. Right or wrong, such behaviour should be clearly documented, as its not something you expect, and can (and has) caused issues to users and concerns due to lack of communication. Transparency isn't easy, but I have found its the only way to have a truly healthy community. Perhaps you disagree. I'll respond to any comments or criticisms left below.

aqu4bot getting user tracking

Posted by Subsentient on Tuesday April 08 2014, @02:03PM (#270)
0 Comments
Code
I've been working on my ANSI C IRC bot aqu4bot today, and I'll be adding support for user/channel tracking, so aqu4bot will have a means of knowing what users are in what channels, improving logging (so we can log quits and nick changes) among other things. This could open up new command possibilities! I must admit, the linked list I am setting up will end up taking far more memory than I had hoped, but it could be much worse I suppose. I might take up kobach's advice for a weather command since I recently added a function to get HTTP pages, buuut, I'll need to find a source for that data that I don't hate. We'll see.

My first accepted submission.

Posted by Woods on Tuesday April 08 2014, @01:22PM (#269)
5 Comments
/dev/random

So my first submission ever was accepted (Including /.) and posted yesterday. Unfortunately, all of the comments were lambasting the actual security of the tool I talked about, being from the DOD, almost everyone mentioned that it probably has backdoors strewn about in every crevice of the OS. They are probably right.

I guess I really just wanted to help SN to have more content without just copying some news article that people have already seen. I suppose I should stick to something I actually know, and try to find something in the astronomy/science field. Oh well, now everyone probably thinks I am a DOD/NSA shill.

BEST FIRST SUBMISSION EVER.

SoylentNews Recruitment Poster

Posted by Jaruzel on Tuesday April 08 2014, @10:53AM (#268)
4 Comments
Soylent

A little bored this morning, I suddenly had this wonderful idea :)

How about a recruitment poster for SoylentNews?

http://imgur.com/2zzmiYY

You owe it to yourselves to print off hundreds of copies and stick them up everywhere ;)

Day 8

Posted by Blackmoore on Monday April 07 2014, @07:04PM (#263)
0 Comments
/dev/random

Day 7 has disappeared in a fog. Not sure if fog is real, or due to too much Grog.

Day 8 - the rain has penetrated through our skins and soaked every last crewmember. some have even taken additional time in the bilge to get away from the relentless downpour. the winds have slacked off, but without the stars to navigate by it is hopeless to maintain a heading.

Love how scaring people works

Posted by Khyber on Friday April 04 2014, @09:01PM (#253)
9 Comments
Code

So you finally fixed a couple of the problems I bitched about.

Too bad it took me getting banned and making the promise of utilizing said vulnerabilities to get you to get off your ass and do something, like any RESPONSIBLE programmer would do.

So are you going to listen to me, or am I going to have to break out the kernel-level exploits?

CentOS ain't shit compared to MenuetOS. I can hack both. Better migrate to BSD if you want half a chance of surviving me.

Oh, to ad, the fact you think I'm a 'credible threat' belies your ill-education in programming. Go back to school.

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.

Voting Script 3 - Borda Count

Posted by prospectacle on Sunday March 30 2014, @08:44AM (#241)
0 Comments
Code

Here's a third version of my voting program. Unlike the previous version, it doesn't allow duplicate ranks (you can't rank two candidates as equal first, or equal second, etc).

It can be run on a set of text-based votes, e.g. emails or forum-comments. It recognises and counts valid votes, and filters out invalid data.

It gives a score to each candidate, based on the rank you give it. It is effectively a "Borda Count" voting system (http://en.wikipedia.org/wiki/Borda_count). Version 2 used "Range Voting" and version 1 used "Approval Voting".

I've also tidied the code up a bit, to make it easier to read and simpler to use.

The code below contains example data so you can run it as is, to get an idea of how it works.

<?php

/* How to use this script:

1 - Ask people to write votes that look like this:
    some candidate name = 1
    some other = 2
    another_one = 4
    Any other text will just be ignored.
    Any invalid = votes will be ignored, too
2 - Collect votes. e.g. via email, forum-comments, or a special web-form.
3 - Put all the votes in an array. Each vote should contain its vote-text, and a User ID.
4 - Run this script to filter, parse and count the votes.

*/

// Example candidates:
$valid_candidates = array(
    "candidateone",
    "another candidate",
    "yet another option",
    "somethingelse");

// Example votes:
$votes_array = array(
    // Upper case or lower case doesn't matter.
    array(
        "user_id"=>234,
        "text"=>"
            candidateOne = 1
            Another Candidate = 2
            SomethingElse = 3
        "),
    // Duplicate user. This will be handled properly.
    array(
        "user_id"=>234,
        "text"=>"
            Oops forgot one I like:
            Yet Another Option = 4
            Did I mention:
            CandidateOne = 1
        "
        ),
    // This one contains mostly invalid rankings, and one valid one.
    array(
        "user_id"=>345,
        "text"=>"
            // I hate CandidateOne
            CandidateOne = 6
            Another Candidate = 1
            Yet Another Option = 1
            My friend who's not listed = 3
        ")
    );

// Some options on how the votes are counted.
$allow_duplicate_ranks = false;
$allow_write_in_candidates = false;

// If you allow write-in candidates, specify a maximum possible rank.
// Otherwise the maximum rank equals the number of candidates.
if ($allow_write_in_candidates) $maximum_rank = 10;
else $maximum_rank = count($valid_candidates);

// put valid-user filter in here if necessary
function valid_user($user_id){return true;}

// Arrays to store the counted votes in:
$votes_by_voter = array();
$votes_by_candidate = array();

// Process all votes
foreach ($votes_array as $vote)
{

  // Is it a valid registered user?
  if (valid_user($vote["user_id"]))
  {

    // Process each line of the vote
    $vote_lines = explode("\n", trim($vote["text"]));
    foreach ($vote_lines as $this_line)
    {

      // Does it have an equals sign
      $equals_sign = strpos($this_line, "=");
      if ($equals_sign !== false)
      {

        // Does it have only one equals sign?
        $cleaned_up_line_text = trim($this_line, ";.!\t\n\r\0");
        $parts_of_line = explode("=", $cleaned_up_line_text);
        if (count($parts_of_line) == 2)
        {

          // Get the candidate and rank, make sure they're valid.
          $candidate = strtolower(trim($parts_of_line[0]));
          $candidate_is_valid = in_array($candidate, $valid_candidates);
          $rank = intval(trim($parts_of_line[1]));
          $rank_is_valid = ( ($rank > 0) && ($rank <= $maximum_rank) );

          // Proceed if (it's a valid rank number) and
          // (the candidate is valid, or we're allowing write-in candidates).
          if (($rank_is_valid) && ($candidate_is_valid || $allow_write_in_candidates))
          {
            // Get the score for this candidate.
            // The score is: maximum_rank - (this_rank - 1).
            // For example:
            // - Say there are 5 candidates and the maximum rank is 5
            // - A rank of 1 give it a score of 5.
            // - A rank of 2 gives it a score of 4.
            // - A rank of 5 gives a score of 1.
            // See "Borda Count".
            $score = $maximum_rank - ($rank-1);

            // If this is the voter's first vote, create a voting-record for them.
            // This keeps track of which candidates and ranks they've already voted.
            $voter = $vote["user_id"];
            if (!isset($votes_by_voter[$voter]))
            {
              $votes_by_voter[$voter]["candidates"] = array();
              $votes_by_voter[$voter]["ranks"] = array();
            }

            // Make sure this user hasn't already voted on this candidate
            if (!isset($votes_by_voter[$voter]["candidates"][$candidate]))
            {

              // Make sure the user hasn't already assigned this rank number,
              // or that we're allowing duplicate ranks.
              if ($allow_duplicate_ranks || (!isset($votes_by_voter[$voter]["ranks"][$rank])))
              {

                // Remember that this voter has voted for this candidate,
                // and has used up this rank.
                $votes_by_voter[$voter]["candidates"][$candidate] = true;
                $votes_by_voter[$voter]["ranks"][$rank] = true;

                // Count the vote towards the total for this candidate.
                if (!isset($votes_by_candidate[$candidate]))
                  $votes_by_candidate[$candidate] = $score;
                else $votes_by_candidate[$candidate] += $score;

              } // End of checking if this rank is a duplicate for this voter.
            } // End of check checking if candidate is a duplicate for this voter.
          } // End of check for valid vote values.
        } // End of check for correctly formatted vote
      } // End of check for equals sign
    } // End of for loop for lines of vote text.
  } // of check for valid user.
} // end of for loop for all votes.

print "Who have voters voted for, and which ranks have they used?:<pre>";
print_r($votes_by_voter);
print "</pre><Br>";
print "What score does each candidate end up with<pre>";
// Sort the candidates from highest to lowest
arsort($votes_by_candidate);
print_r($votes_by_candidate);
print "</pre>";

?>