Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror
User Journal

Journal Journal: FizzBuzz in Swift

The following is my prepared answer for anyone who asks me this stupid fucking question in any interview in the future.

extension Int
{
  func modBool(modulus: Int) -> Bool
  {
  return (self % modulus).boolValue
  }
}
 
for x in 1...100
{
  print((x.modBool(3) ? "" : "Fuck ") +
    (x.modBool(5) ? "" : "You") +
    ((x.modBool(3) && x.modBool(5)) ? "\(x)" : ""))
}

-jcr

User Journal

Journal Journal: Trump vindicates damn_registrars 7 7

"Wisconsin is in turmoil," Trump told a boisterous crowd at a rally in Iowa. He pointed to the state's roads, schools and hospitals, which he said were all "a disaster."
Walker, who is leading polls in Iowa, remains one of Trump's biggest rivals in the race.
"I hear the only person beating me in Iowa is Scott Walker," he said. "I can't believe I'm in second place. Folks, will you please put me in first place so I feel better?"
Trump told the crowd Saturday that he had helped Walker win his race because he admired the candidate's "fight," but didn't know what he was fighting for. "I've been very nice to him," he said.
But after Walker's fundraising email went public, Trump declared: "I can finally attack."

I think Trump is a buffoon, but, if the Vichy GOP put up JEB, I'll cheerfully vote for His Donaldness.

User Journal

Journal Journal: CuBox Wifi Streaming Solved

I believe I have mentioned before that every bit of media I purchase I digitize and store the files on a central server. That includes over 300 movies and over 100 television episodes, plush a few hundred audio tracks. Everything is available anywhere in my home via wireless streaming, however I had been having problems with reliably streaming 1080p HD video over WiFi to my main television units.

My back end device is simply a Buffalo AirStation AC 1750 running DD-WRT build 27456. It is configured for WiFi AC-only in the 5.8 GHz band, and G/N/AC in the 2.4 GHz band to accommodate some older devices.

A Western Digital My Passport Ultra 2 Tb USB 3.0 drive is plugged into the back of the wireless router, which acts as a NAS and makes media available via SAMBA shares.

Over all I like this set-up, though after several months of use I can't really recommend the Buffalo AirStation for the simple reason that it doesn't have any external antennas. It really suffers in coverage area because of this. DD-WRT is great, as is the little 2 Tb WD drive, but I'll never again get a wireless gizmo that doesn't use an external antenna.

The front end to my televisions scattered throughout the house is a CuBox i4-Pro running OpenELEC. This is a fantastic combination that has been almost -- but not quite -- perfect for me. It is also easy to use for my non-technical wife and future geek 7-year old child.

The one issue has been reliably streaming 1080p HD videos to a CuBox. Even with the unit less than 10 meters away from the access point, with no obstructions, it would routinely have such a poor connection as to not be able to keep up with the playback. Watching the dashboard of DD-WRT showed me it had less than 30% signal strength and constantly would drop to 5.5 Mbps connection rates.

To eliminate interference I got up in the middle of the night and shut off everything that used wifi except the CuBox and it still performed poorly.

The short answer is the built-in wireless on the CuBox is abysmal. Again, no external antenna and 2.4 GHz only. Further investigation showed it would not work with channel bonding, thus not use 40 MHz channels in 802.11n. I don't know if it is a chipset limitation or a driver issue. Either way, it sucks.

My answer was to buy a USB wifi adapter with an external antenna. This one is tiny, totally plug-and-play, and absolutely does the trick. And for $12.99, including Prime shipping, a bargain. It is marketed towards the Raspberry Pi, which is what I bought it for. It uses the Realtek RT5370 chipset and is supported at the kernel level (no extra drivers needed) in Android, OpenELEC, Raspbian and lots of other Linux flavors.

It support 802.11n and bonded, 40 MHz channels and, more importantly, handles HD streams without breaking a sweat. I just ordered 2 more to outfit my 2 other CuBox devices so I can stream everything to the TVs in bedrooms without running wires.

(Note: I'm in a fairly low-population subdivision and not a lot of 2.4 GHz wireless around. I'm not stepping on any of my neighbors with my signal.)

User Journal

Journal Journal: Shout out to the Nematodes 25 25

I'd like to ask the worms on here to defend that scumbag Chisholm, but such would require vertebrae.

It is utterly clear that the special prosecutor has employed theories of law that do not exist in order to investigate citizens who were wholly innocent of any wrongdoing. In other words, the special prosecutor was the instigator of a "perfect storm" of wrongs that was visited upon the innocent Unnamed Movants and those who dared to associate with them. It is fortunate, indeed, for every other citizen of this great State who is interested in the protection of fundamental liberties that the special prosecutor chose as his targets innocent citizens who had both the will and the means to fight the unlimited resources of an unjust prosecution.

I rarely feel genuine shame over my country, but this is an example of a source thereof.

User Journal

Journal Journal: No wonder the Left foams at all orifices 168 168

Imagine winning three elections (one being a recall election that public sector unions poured thousands upon thousands of dollars into) in four years in the deeply divided blue-collar progressive Utopia of Wisconsin. Imagine breaking the back of the organized heart and soul of the Democrat party and dispatching AFL-CIO leader Richard "Morrie The Wig Salesman" Trumka back to the White House to show the President the "W" shaped scar carved into his forehead as a warning to anyone else who stepped foot in the state.

Imagine doing all this after Democratic state legislators fled for the safe harbor of Illinois to avoid voting on your legislation. Imagine having woken up every day to phone calls relating tales unionized shock-troops on your parentsâ(TM) front lawn and threats not only on your life but the lives of your kids. Now imagine having the real heroes, the brave national media, mock and ridicule you over this. Imagine accomplishing all of this while a partisan Milwaukee District Attorney authorizes the illegal invasion of the homes of your friends, supporters and aides, lawlessly confiscating private property, all while colluding with Lois Lerner and the IRS.

I happened to catch his announcement speech live on OANN yesterday. The Left will be invoking Cthulhu in most maniacal tones trying to call down some unfortunate demise on this Walker.

User Journal

Journal Journal: It just keeps getting WI-IRS 32 32

The two most egregious examples of government interference in recent elections may share a link. More than two years after it got exposed, the IRS' partisan probes of conservative groups applying for tax-exempt status remains unresolved, thanks to the obstruction of the IRS in producing the relevant records to Congressional investigators--and the refusal of Lois Lerner, the central figure in the scandal, to testify. The status of the John Doe probe in Wisconsin that also attempted to derail conservative groups from participating in elections is similarly unresolved, but has been halted by judges who may end up killing it and the law on which itâ(TM)s based altogether.

Stipulate that
- There Is Nothing To See Here, Move Along, and
- Nuremberg Defense, and
- Conservatives Are Just Lightweight Metallic Headwear Aficionados, and
- If The Tea Parties Hadn't Worn That Short Skirt To The Bar Where The Violent Illegal Alien Was Cleaning The Federal Agent's Hog-Leg, The Tea Party Probably Wouldn't Have Been Ventilated.
Those zany conservatives. Always going for the victim narrative.

User Journal

Journal Journal: Leveling up with python 2 2

$ py
Python 3.4.3 (default, Jun 14 2015, 02:11:57) [MSC v.1800 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> dat="http://docs.aws.amazon.com/IAM/latest/UserGuide/Using_ManagingMFA.html"
>>> print(dat.split("/"))
['http:', '', 'docs.aws.amazon.com', 'IAM', 'latest', 'UserGuide', 'Using_ManagingMFA.html']
>>> print(dat.split("/")[1:])
['', 'docs.aws.amazon.com', 'IAM', 'latest', 'UserGuide', 'Using_ManagingMFA.html']
>>> print(dat.split("/")[2:])
['docs.aws.amazon.com', 'IAM', 'latest', 'UserGuide', 'Using_ManagingMFA.html']
>>> print(dat.split("/")[3:])
['IAM', 'latest', 'UserGuide', 'Using_ManagingMFA.html']
>>> print(dat.split("/")[3:-1])
['IAM', 'latest', 'UserGuide']

I hadn't ever used the python REPL to work on a bit of code, but it sure makes exploring the slicing notation easier.

If you think the system is working, ask someone who's waiting for a prompt.

Working...