Quantcast
Channel: Hacker News 50
Viewing all 9433 articles
Browse latest View live

Extremely Rare color film shows How London looked in 1927 | Neon Nettle

$
0
0

Comments:"Extremely Rare color film shows How London looked in 1927 | Neon Nettle"

URL:http://neonnettle.com/videos/40-extremely-rare-color-film-shows-how-london-looked-in-1927


Original Biocolour Film Enhanced by BFI

By: Steve McQueen

 on&nbsp11th January 2014 @ 10.31pm

 

Photographer and Film maker Claude Friese-Greene shot some of the first ever colour film footage in London, this particular piece is from way back in 1927.

 

Film pioneers are usually associated with French names like Lumiere and Melies, but Friese-Greene’s style captures London in acute detail for its time. Most people in the video may well have passed, but what is noticeable is how things look largely similar today (see below)

The British Film Institute have used computer enhancement to minimise the flickering and low quality of the original bicolour film.

 

Source deathandtaxes

Photo Credit: Youtube/TheBritishFilmInstitute


Egor Homakov: Token Fixation in Paypal

$
0
0

Comments:"Egor Homakov: Token Fixation in Paypal"

URL:http://homakov.blogspot.pt/2014/01/token-fixation-in-paypal.html


Remember OAuth1 session fixation? No? Read writeup from Eran Hammer (the guy who hates OAuth2 as much as I do).

Guess what - there's exact same vulnerability in Paypal Express Checkout flow (they will not fix it). Furthermore, tons of other payment-related providers can be vulnerable to the same attack. How does it work?

OAuth1-like flows are based on request_token/invoice id (for example https://bitpay.com/invoice?id=INVOICE). Before using %PROVIDER_NAME% your CLIENT is supposed to make API call with all parameters (client_id, client_secret, redirect_uri, amount, currency, etc). Provider will respond with request_token=TOKEN1. This is your token and it's tied to your Client account.

Wow, secure! - no URL parameters tampering like we have in OAuth2 (browse my blog a bit to find kilobytes of rants about it). But OAuth2 returns "code" which is not guessable. OAuth1 returns the same request_token it received in initial URL. Voila, fixation.

Thing with Paypal is: no matter who pays this invoice - you will only need to visit Client-Return-URL?token=TOKEN1 to add funds someone paid.

How can we trick a victim into paying our TOKEN1?
1. John, you must buy this book! (x=window.open('BOOK STORE'))
2. John clicks Pay with Paypal and gets redirected to Paypal?token=TOKEN2
3. our opener-page should somehow detect that John is about to pay. Hash-based cross domain URL detection can help. We fixate x.location to Paypal?token=TOKEN1
4. Payment is done, user is redirected to Client-Callback?token=TOKEN1 and doesn't get the book. TOKEN1 was issued for other Client session and only attacker can use it on callback.
5. Attacker uses TOKEN1 on return URL, Client does API call to make sure TOKEN1 is paid = Attacker gets the book.

Successfully tested this hack on Namecheap. This is what victim sees on first step (valid and trustworthy page)

Error after paying for TOKEN1


Attacker visits Callback?token=TOKEN1 to get victim's funds

Mitigation
Provider should issue another oauth_verifier random nonce to make sure the user using callback is the payer.

Is it really severe bug? I don't think so, but it should be fixed for sure.

P.S. researchers complain a lot about paypal's bounty program. E.g. they refused to fix obvious headers injection https://www.paypal.com/.y%0dSet-Cookie:x=1

ARM immediate value encoding

$
0
0

Comments:"ARM immediate value encoding"

URL:http://alisdair.mcdiarmid.org/2014/01/12/arm-immediate-value-encoding.html


The ARM instruction set encodes immediate values in an unusual way. It's typical of the design of the processor architecture: elegant, pragmatic, and quirky. Despite only using 12 bits of instruction space, the immediate value can represent a useful set of 32-bit constants.

What?

Perhaps I should start with some background. Machine code is what computer processors run on: binary representations of simple instructions. All ARM processors (like the one in your iPhone, or the other dozen in various devices around your home) have 16 basic data processing instructions.

Each data processing instruction can work with several combinations of operands. For example, here are three different ADD instructions:

ADDr0,r2,r3; r0 = r2 + r3ADDr0,r2,r3,LSL#4; r0 = r2 + (r3 << 4)ADDr0,r2,#&4F0000; r0 = r2 + 0x4F0000

The first is easy to understand: add two registers, and store in a third. The second example shows the use of the barrel shifter, which can shift or rotate the second operand before performing the operation. This allows for some fairly complex single-instruction operations, and more importantly lots of fun optimising your assembler code.

But the instruction I want to describe in more detail here is the third and simplest one: adding a register to a constant value. This value is encoded in the instruction, so that it's immediately available.

Immediate value encoding

ARM, like other RISC architectures MIPS and PowerPC, has a fixed instruction size of 32 bits. This is a good design decision, and it makes instruction decode and pipeline management much easier than with the variable instruction size of x86 or 680x0. However, it means that any instruction with an immediate value operand cannot represent a full 32-bit number.

Here's the bit layout of an ARM data processing instruction:

Any instruction with bits 27 and 26 as 00 is data processing. The four-bit opcode field in bits 24–21 defines exactly which instruction this is: add, subtract, move, compare, and so on. 0100 is ADD.

Bit 25 is the "immediate" bit. If it's 0, then operand 2 is a register. If it's set to 1, then operand 2 is an immediate value.

Note that operand 2 is only 12 bits. That doesn't give a huge range of numbers: 0–4095, or a byte and a half. Not great when you're mostly working with 32-bit numbers and addresses.

Compare it also to the equivalent instruction in MIPS, addi:

Or the similar PowerPC, also called addi:

Both have 16-bit immediate values: 0–65535, or two bytes. This is much more reasonable. Unfortunately, because of the 4-bit condition field in every ARM instruction, the immediate field has to be smaller. And therefore less useful.

The clever part

But ARM doesn't use the 12-bit immediate value as a 12-bit number. Instead, it's an 8-bit number with a 4-bit rotation, like this:

The 4-bit rotation value has 16 possible settings, so it's not possible to rotate the 8-bit value to any position in the 32-bit word. The most useful way to use this rotation value is to multiply it by two. It can then represent all even numbers from zero to 30.

To form the constant for the data processing instruction, the 8-bit immediate value is extended with zeroes to 32 bits, then rotated the specified number of places to the right. For some values of rotation, this can allow splitting the 8-bit value between bytes. See the table below for all possible rotations.

Examples

The rotated byte encoding allows the 12-bit value to represent a much more useful set of numbers than just 0–4095. It's occasionally even more useful than the MIPS or PowerPC 16-bit immediate value.

ARM immediate values can represent any power of 2 from 0 to 31. So you can set, clear, or toggle any bit with one instruction:

ORRr5,r5,#&8000; Set bit 15 of r5BICr0,r0,#&20; ASCII lower-case to upper-caseEORr9,r9,#&80000000; Toggle bit 31 of r9

More generally, you can specify a byte value at any of the four locations in the word:

ANDr0,r0,#&ff000000; Only keep the top byte of r0

In practice, this encoding gives a lot of values that would not be available otherwise. Large loop termination values, bit selections and masks, and lots of other weird constants are all available.

But what I find really compelling is the inventiveness of the design. Faced with the constraint of only having 12 bits to use, the ARM designers had the insight to reuse the idle barrel shifter to allow a wide range of useful numbers. To my knowledge, no other architecture has this feature. It's unique.

Play with it

Here's an interactive version of an ARM assembler's immediate value encoder. Requires JavaScript and a modern browser.

Choose an immediate value and see its encoding. See which values can't be encoded. Rotate the constant to see what happens.

Try these examples: 0x3FC00, 0x102, 0xFF0000FF, 0xC0000034

31302928272625242322212019181716151413121110987654321011010111110101111101011111010111

1110987 65432101011110101110xB0xD7

Encoding requires JavaScript.

Sayanee | Quick start projects

$
0
0

Comments:"Sayanee | Quick start projects"

URL:http://blog.sayan.ee/quick-start/


Often we have about 3 to 4 active projects. I am using a simple bash script with tmuxinator to fire up all the related elements of a single project so that it is ready to code in less than 10 seconds.

Let's say we have 3 to 4 active projects at any one time. These projects might include, a couple of client projects, a side project or even a blog. Every time when starting each of these projects, typically the following applications need to be opened:

Text editor with different folder paths Command line with various panes and tabs Some native applications Browser with various tabs

For each of the projects, the exact requirements to the above 4 applications definitely differs. For example, the browser needs to be opened in a different localhost port for different projects along with links to Github or Trello.

For the past few months, I have been automating the opening up of various project related elements with a single command - the project name itself. Here's how the effect looks like when I open up various application with a single command to work on my blog:

What you need

Alfred app (optional) for launching a shell command Simple Bash scripting to create a script project-name Tmux and Tmuxinator installation to create a tmuxinator project file project-name.yml brew install tmux gem install tmuxinator

With AlfredApp, we can call the shell command without launching any command line application with a simple prefix of >. The bash script that we will create will open up various applications, url and paths in the Finder. Tmux is a terminal multiplexer and I use it more oten to layout the arrangement of windows and panes that are running different commands.

Let's take the example of this blog itself and create the 2 files:

blog (bash script) blog.yml (tmuxinator project file)

Create the script file

Usually, I just name the file as the project. In this case, it will be simply blog. As this file needs to be an executable, we will also change the file permission with the command chmod. Lastly, we will symlink this file to a file in a directory where all such automated scripts are stored. This directory has to be found in your path variable$PATH. Now, this script can be run from any location.

$ touch blog
$ ls -al blog
-rw-r--r-- 1 sayanee staff 0 Jan 11 22:24 blog
$ chmod u+x blog
$ ls -al blog
-rwxr--r-- 1 sayanee staff 0 Jan 11 22:24 blog
$ ln -s blog /current/path/blog

The exact contents of the script file will vary project to project, but it generally consists of the following:

path to the source code is defined open the source code in window and text editor open some native applications and they might include: version control database visualiser graphic editing software open project management tools or remote repository in browser. I have used the following: open the project url in the browser production url development url - might include admin / testing / documentation url open the tmuxinator project

Here is an example of the blog script file.

#!/bin/bash
# USAGE in the command line:
# blog
app="/Users/sayanee/Sites/blog/app" # path to source code
open $app # open in Finder
subl $app # open in text editor
cd _posts && open `ls -tr | tail -1` # open last modified file (latest post)
open /Applications/Tower.app # open version control visualiser
open https://github.com/sayanee/blog/issues/assigned/sayanee?state=open # open git remote repo assigned to me
open http://localhost:4000 # open in development
open http://blog.sayan.ee # open in production
tmuxinator blog # open tmuxinator project

Create the tmuxinator project

Next, we will create the tmuxinator project file that will define the various window, panes and commands to fire when starting the project. Let's first create the file blog.yml and create a symlink to the ~/.tmuxinator folder.

$ touch blog.yml
$ ln -s blog.yml ~/.tmuxinator/blog.yml

In the Tmuxinator project, I will define various windows for the following purpose depending on the project:

frontend server e.g. sudo nginx with Nginx backend server e.g. rails server for Rails automated testing continuous build tool e.g grunt for GruntJS ssh into the production server e.g. ssh production && cd path/to/source repl e.g. node for NodeJS or irb for Ruby

For this blog, the Tmuxinator project is pretty simple consisting of 1 window with 3 panes.

name: blog
root: /Users/username/path/to/blog
windows:
 - blog:
 layout: main-vertical
 panes:
 - git pull origin gh-pages && clear && ls
 - jekyll serve --watch --config _dev_config.yml
 - grunt

With the command tmuxinator blog, a tmux session will be started that will look like this:

And that's all! With these 2 simple files, now whenever we trigger the command blog all the project related elements will open up within seconds!

Another example

The blog command is pretty simple, so I thought of giving another example for a project called todo. This project consists of full stack development with frontend and backend.

Here's the content of the bash script todo:

#!/bin/bash
# USAGE in the command line:
# todo
app="/Users/sayanee/Workspace/todo"
backend="/backend"
frontend="/frontend"
apidocs="/apidocs"
open $app
subl $app$backend
subl $app$frontend
subl $app$apidocs
open /Applications/Postgres93.app # db
open /Applications/Tower.app # git management
open http://localhost:8000 # frontend
open http://localhost:4000 # api documentation
open http://localhost:3000 # backend
open https://github.com/username/todo-frontend/issues/assigned/sayanee?state=open 
open https://github.com/username/todo-backend/issues/assigned/sayanee?state=open
open https://trello.com/b/xxxxxxx/todo-board-overview # trello tasks
tmuxinator todo

And here is the tmuxinator project file todo.yml with 4 windows opening up the development for frontend, backend or api documentation and lastly even the production server. When starting to code, I also usually like to do a git pull to sync my code base with the remote repository.

name: todo
root: /Users/sayanee/Workspace/todo
windows:
 - backend:
 layout: main-vertical
 panes:
 - cd backend && git pull
 - cd backend && rails console
 - cd backend && rails server
 - frontend:
 layout: main-vertical
 panes:
 - cd frontend && git pull
 - cd frontend && grunt
 - cd frontend && sudo nginx
 - apidocs:
 layout: main-vertical
 panes:
 - cd apidocs
 - cd apidocs && npm start
 - cd apidocs && redis-server
 - production:
 layout: even-vertical
 panes:
 - ssh production-server && cd path/to/frontend
 - ssh production-server && cd path/to/backend

Fast context switching

One of the challenges of getting into the zone of creativity is how fast and easily we can launch the various applications and commands to get started, especially if we are spending some time launching them often. Here are some other projects that I found that helps in launching current projects fast:

Anvil for mac Yeoman Brunch Apple Automator

Would love to know if there is a better or alternative way to launching applications other the current method that I am using. What are your thoughts?

How do you quick launch your various active projects?

meanwhile, at code.org

$
0
0

Comments:"meanwhile, at code.org"

URL:http://worrydream.com/MeanwhileAtCodeOrg/


from Seymour Papert: What’s the big idea? Toward a pedagogy of idea power (2000)

Reopening the debate: Should children program computers?

In Mindstorms I made the claim that children can learn to program and that learning to program can affect the way they learn everything else. I had in mind something like the process of re-empowerment of probability: the ability to program would allow a student to learn and use powerful forms of proba- bilistic ideas. It did not occur to me that anyone could possibly take my statement to mean that learning to program would in itself have consequences for how children learn and think. But I reckoned without idea aversion. When the reference to ideas was filtered out of my claim that Logo could help children by car- rying ideas, what was left was a claim I never made that Logo would help children, period. I was amazed to find that experiments were being done in which tests of “problem-solving ability” were given to chil- dren before and after exposure to 20 or 30 hours of work with Logo. Papers were written on “the effects of programming (or of Logo or of the computer)” as if we were talking about the effects of a medical treatment.

The difference between these two conceptions of the role of programming is of the same kind as the dif- ference between the two interpretations of Piaget: in both cases the crucial difference is between pri- macy of the epistemological (talking about ideas) and primacy of the psychological (talking about how a person is affected by a treatment). I do not mean to dismiss the “treatment” studies as without value. For many children the opportunity to program a com- puter is a valuable experience and can foster impor- tant intellectual development. 16 But encouraging programming as an activity meant to be good in it- self is far removed, in its nature, from working at identifying ideas that have been disempowered and seeking ways to re-empower them. It is even further removed from picking up the challenge to expand and deepen the theory of idea power sketched in the previous section. In my discussion of Michael, I sug- gested that what would benefit him would be better support for idea work. What I am suggesting here is a program of idea work for educators. Of course it is harder to think about ideas than to bring a pro- gramming language into a classroom. You have to mess with actual ideas. But this is the kind of hard that will make teaching more interesting, just as idea work will do this for learning.

Papert’s goal was to give children a path to powerful mathematical ideas, and he saw programming as a better carrier of the ideas than pencil-and-paper.

Others misinterpret him as making the dubious claim that simply learning to program will make you think better. Papert is astonished that anyone would think he was saying that.

Papert explains that programming can serve as a medium in which powerful ideas can be brought within reach. But the focus, of course, must be on the powerful ideas, not programming itself.

Meanwhile

at code.org, the high-profile advocacy site for widespread programming education, our nation’s thought leaders explain why all children should learn to program.

Your country needs a lot of code for some reason. Also, college is vocational training.

Programming will make you rich.

Simply learning to program will make you think better.

Industry needs you to be a cog in the corporate machine.

You can be an informed citizen and gain an understanding of the world around you.

You can be a soldier in our war with Eastasia. (We've always been at war with Eastasia.)

This is the depth of thought that powers nationwide policy decisions.

But hey, congratulations to musician and entertainer will.i.am for at least having an educational philosophy that’s not completely unreasonable or horrifying.

A Coder, a Programmer, a Hacker, a Developer, and a Computer Scientist walk into a Venn Diagram - Scott Hanselman

$
0
0

Comments:"A Coder, a Programmer, a Hacker, a Developer, and a Computer Scientist walk into a Venn Diagram - Scott Hanselman"

URL:http://www.hanselman.com/blog/ACoderAProgrammerAHackerADeveloperAndAComputerScientistWalkIntoAVennDiagram.aspx


A friend recently said: "I want to learn how to code. How and where do I start?"

I want to learn how to code - Do I go to Ikea or grow my own tree?

It's like woodworking. You can START by growing a tree, then chopping it down and finishing it, sanding it, before you make a table. Or you can go to Ikea. More likely you'll try something in between.

Modifying a WordPress theme is going to Ikea. Writing you own web framework is growing a tree first because you don't like the existing trees. You have to decide where on the spectrum you want to be, from being a custom furniture maker from the Woodright's Shop or someone who assembles prefabricated pieces made by someone else.

Ok, where do I start?

Very cool. I'm always happy when folks want to learn to code. The Facebook thread continued with the usual suggestions:

Then the more interesting questions started to get to the root of the matter.

What's the difference between a Coder, a Hacker, a Programmer, a Developer, and a Computer Scientist?

These words might all mean the same thing to you. Perhaps you hear geek, nerd, and dweeb, but we all know these have very important differences. Knowing the differences also can give you a sense of how deep you want to go on your coding adventure.

  • Coders - Can pretty much figure out it. It'll work, but it won't be pretty.
  • Hackers - usually low level folks, skillful, with detailed understanding of some area deeply, often scarily deeply.
  • Programmer - Write code and understand algorithms. Often work alone and well.
  • Developer - Are the best generalists, can use lots of different systems and languages and get them to talk to each other. Are true and broad professionals, work with people, and communicate well.
  • Computer Scientist - Need to be able to prove how computers work, at a theoretical level. Are usually math people also.

If you are closer to one of these already you can get an idea of which direction to head.

Are we assuming web programming?

Everyone on the thread assumed some kind of web programming, which makes sense, since nearly everyone's on the web in 2013. However, just a few years ago we might have sat our friend down and made a Hello World app at the console, or perhaps loaded up Visual Basic, dragged a button, and MessageBox'ed Hello World.

Is Markup Code? Lots of people said "learn HTML and CSS," but I don't think that's coding in the classical sense. As a gateway to JavaScript and Web Services, I think it's a good place to start. The thing is, though, that while not every app is a web application that makes HTML in a browser, most applications are connected applications in some way. Apps consume data from services, send notifications, texts, emails and tweets. Nearly every application is distributed in some way, even if it's just a simple app that calls a web server for some data.

If you want to be a coder today, or, let me go further and say if you want to be an effective coder, you will want understand the web and what really happens when you type twitter.com in your web browser. Just like you should understand how trees grow if you want to be a carpenter, how engines work if you want to be a race car driver, or where the water comes from if you want to be a plumber. Heck, you should really understand all of these things if you want to be an effective human. ;)

What do we really mean by "I want to learn to code?"

What's the question under the question? Does she want to make websites? Design them? Does she want to make mobile applications and take them on the go? Does she want to create a gadget that will text her when she leaves the garage door open too long? These are all very different endpoints and there's lots of great ways to get started if we dig in a little.

You can totally jump in to the web, learn a little JavaScript and start making web apps, and you should.  But as with everything, if you've got deeper interest, there are a few different paths to going further. Do a little research into the breadth of possibilities available to you, and you just might try a slightly different path.

Related Links

You Have to Play This 1,600-Year-Old Viking War Game — War is Boring — Medium

$
0
0

Comments:"You Have to Play This 1,600-Year-Old Viking War Game — War is Boring — Medium"

URL:https://medium.com/war-is-boring/cef088ae4e2d


Viking warriors storm into the torch-lit camp of a rival clan. Outnumbered, the ambushed Norsemen are far from their boats. Their one goal: flee to a nearby castle while keeping their king alive.

At first glance, Hnefatafl (prounounced “nef-ah-tah-fel”) might just look like a knock-off version of chess with Norse helms and impressive beards, but the game is at least 600 years older—already well-known by 400 A.D.—and is perhaps a lot more relevant to the conflicts of the 21st century.

“I love the asymmetry in this game. To win in this game, you absolutely have to think like your opponent,” emails Kristan Wheaton, a former Army foreign area officer and ex-analyst at U.S. European Command’s Intelligence Directorate. “Geography, force structure, force size and objectives are different for the two sides. If you can’t think like your opponent, you can’t win. I don’t know of a better analogy for post-Cold War conflict.”

The game is similar to chess, but with several important differences. Instead of two identical and equal opponents facing each other, Hnefatafl is a game where one side is surrounded and outnumbered—like a Viking war party caught in an ambush.

The game might seem unbalanced. The attacking black player has 24 total pieces—known as “hunns”—to white’s meager and surrounded 12 hunns. But white has several advantages.

White has an additional unique unit, a king, which must be surrounded on four horizontal sides to be captured. Hunns require being surrounded on two sides, and that’s pretty hard by itself. White’s goal is also simple: move the king to one of four corner squares known as “castles.” Black’s goal is to stop them.

Other rules? All pieces move like chess rooks. Black makes the first move. Black cannot occupy a castle, which would end the game in short order. But black can block off several castles by moving quickly, forming the equivalent of a medieval shield wall.

“If the king goes as hard as he can as early as he can for the corner and the other side is not really on its toes, the non-king side typically loses in just a few turns,” adds Wheaton, who now teaches intelligence studies at Mercyhurst University. “Among experienced players, however, this rarely happens.”

Hnefatafl starting positions with four corner castles. Kenneth Beckhusen/War is Boring photo

If lines are solid, they have to be flanked. Thus, it’s in black’s interest to force a symmetrical battle to force a likely win. If white can avoid engaging in a battle on black’s terms, then white’s chances of winning improve.

This was especially true at the time period this game was played, when battles were largely skirmishes and sieges, and before heavy cavalry arrived on the scene. Two warring sides would sit opposite each other, hacking away until the loser was either exhausted or flanked.

“Hnefatafl seems to teach a number of lessons to young Viking warriors,” Wheaton explains. “For example, it takes two soldiers to ‘kill’ an enemy (elementary battle tactics?), the king is the most important piece on the board (reinforcing the social order?), and, surrounded and cut off, it is easier (in novice games) for the smaller force to win (morale booster?). Someone analyzing the Vikings might learn a good bit about how they fight and what they value (and what they fear) by playing this game.”

That’s how, Wheaton notes, the game gives insight for generals, diplomats and spies tasked with fighting, besting—or at least—understanding what an enemy or rival thinks.

Hnefatafl is a Viking’s worst case scenario: Outnumbered, cut off from their boats—and on the verge of being massacred. Understanding the game played by Viking war parties on the way to raid England of its booty meant understanding something about the way the Vikings saw themselves. The total time spent playing the game may have been more than any individual warrior spent sacking the Anglo-Saxons, for instance.

“I think the games cultures play can help intelligence professionals understand something about the way cultures think about strategy. Much of the language of strategy gets re-cast as the language of the game,” Wheaton adds.

“There is no U.S. military officer who would not know what his or her boss meant if the boss said, ‘we are going to do an end-run on them’ and no U.S. official would misunderstand ‘It’s fourth and 10 and we have to punt.’ These kinds of games produce a common strategic language that cuts across bureaucratic lines. The military and the State Department may not understand each other but they both understand American football.”

More than that, understanding the games people play might help you learn more about how they operate.

Maybe Wheaton is overthinking it … or maybe not. “[Barack Obama’s] got the personality of a sniper,” journalist Michael Lewis said after watching one of Obama’s pick-up basketball games for a Vanity Fair profile. A commentary on drones, perhaps? George W. Bush used his co-ownership of the Texas Rangers baseball team to boost his business credentials during his first presidential campaign. And what about Vladimir Putin? He has a black belt in judo.

“I don’t want to make more of this than it deserves,” Wheaton wrote, “but it seems logical to me, if I am very interested in a senior leader of a foreign country, to ask, ‘What game does he like to play?’”

Sign up for a daily War is Boring email update here. Subscribe to WIB’s RSS feed here and follow the main page here.

feedopensource

$
0
0

Comments:"feedopensource"

URL:http://feedopensource.com


We need another way to fund software. All the other ways arebroken or unscalable. We need to align the interests of the users with developers. We need to feed developers, and the software needs to be freely distributable.

The Problem

Software only needs to be written once.
Bugs need to be patched, but a bug only needs to be patched once.

Why do we pay for software many times, or not at all?
Software should be paid for exactly once.

You can't sell software like you sell physical items, software is too easy to copy.

But here is something you can sell: a promise to write software

The Vision

Take agile consulting to the crowds.

Work is funded in iterations, on a fixed time basis, a week or two at a time. Clients and developers negotiate what features they are most need in the next iteration. The developers implement that, and the clients evaluate it. Repeat. Every one is constantly in the loop.

feedopensource is different to agile consulting because "the clients" are a crowd of people.feedopensource is different to crowd-funding platforms because clients will have real power to influence a project, and keep it on task.

A client does not commit all their money at once, so the developers must keep them satisfied to receive funding in the future. For the client, most of the uncertainty about the project is removed, because they see it improve at each stage.

Less uncertainty means clients can fund more, because they know the value they are getting.

This is not a startup.

This is not Anything as a Service.
This is not an Anything-Platform.

This is just an open source tool for feeding open source projects.

feedopensource has a liberal open-source license.

You may use feedopensource to fund your own projects, as feedopensource feeds itself with feedopensource

The Prototype

You are looking at a very simple prototype.

As deposited fund reach the target $1000 USD, this progress bar fills. then I will begin the next iteration.

bitcoin

btc into 1PTAwipYpP63uNrcxfm5FewxRdZyar6ceu

Please post a comment here with your transaction id.

Not sure how to buy bitcoin? Learn how you can buy bitcoin in your country Also see this issue

credit-card

If you would rather fund this with normal money please comment with the amount you'd like to give on this issuethis issue

The Plan

Clients and Developers post issues to Tasks and plan Iterations. (on github or similar)

feedopensoure will be implemented as a bot that posts to and scrapes/apis Github. This avoids the problem of having to implement a fresh discussion platform, Notifications, User system, etc!

Please comment on the first iteration!

The Workflow

In the future you might use feedopensource like this:

  • Clients post issues requesting features or bug fixes. ("Tasks")
  • Tasks are grouped into an Iteration (an "Iteration" is just an issue that links to a set of Tasks with aprogress bar)Clients and Developers can discuss that iteration, and decide to fund it or not.
  • progress can be tracked by posting to the Iteration issue, or to the Task issues. as the Tasks progress (are closed) the progress bar updates, this time to show work done.
  • There will be progress bar pngs representing project status and history which can easily be added into github issues and readmes.
  • Users will have a way to associate a bitcoin wallet with a github account, so they canclaim their payment

Feed me

Please fund the first iteration by making a payment to:1PTAwipYpP63uNrcxfm5FewxRdZyar6ceu (check balance here) and discuss here: Iteration 1


Goodnight. Sleep Clean

Awful app-review trend among Turkish users: This is why your app gets so many one star reviews!

$
0
0

Comments:"Awful app-review trend among Turkish users: This is why your app gets so many one star reviews!"

URL:http://blog.appwared.com/awful-app-review-trend-among-turkish-users-this-is-why-your-app-gets-so-many-one-star-reviews/


Here are the first reviews shown when you visit Where is My Water 2 Google Play page. Believe it or not, 11 out of 15 reviews here are actually 5 STAR reviews!

So What is Going On?

Let's look what some these users actually say:

Tülay Sahillioglu: Good, a very good game! I gave 1 star so that my comment gets seen. Canan Evran: The game is an example of how a good game should be! Don't bother that I gave 1 star, it's because I want my comment gets seen. İrem Şanlı: Super! I gave 1 star so that my comment is shown first but I actually liked the game.

Interesting, right?

The pattern is obvious. There is a trend among Turkish users who feel like their comment is the best comment of all time and must be seen by wider audience and this trend is to rate the games 1 star and beat the system.

This is not a secret for the Turkish users. Let's look at another comment:

Kubilay Tekin: I hadn't gave 1 star just because I want my comment gets shown on top, I actually think that the game is aweful aqws.w.wew..ws

Because of the way Google selects "the most helpful comments" users who really want their comment be seen are easily exploiting it.

This hurts the ratings of the apps(especially the good ones) so it hurts their developers, it hurts the users who are looking for the best app, it hurts the users who want to read some intelligent comment before installing the app.

update:

The article enjoyed lot's of attention, particularly on Hacker News and r/Android. The issue was featured on Android Police too.

The discussions there contain some very informative comments and the Android Police described Google's sorting algorithm as "score that contrasts with the majority is given much better visibility" .

Some valid questions have been risen, such as if this behavior is limited to the Turkish users or how much prevalent actually is. I don't want to bloat the post with examples(also translating these comments is killing me) because it's easy to check it by clicking this link to the Turkish store and searching for the apps you want to examine(Google Translate seems good enough to translate from Turkish). Also if somebody is indexing the comments can actually review them much more thoroughly.

If you have comments or thing to add, you can contact me through my twitter account: @mrtksn
Thanks to everybody!

How to stop feeling lonely | will's blog

$
0
0

Comments:"How to stop feeling lonely | will's blog"

URL:http://wtsui.org/blog/how-to-stop-feeling-lonely/


I spent a lot of my early 20s feeling lonely. I didn’t want to feel lonely, but I often had trouble feeling like myself around others.

I’m not lonely anymore and this is why:

1. Listen to what your body has to say

A big part of my loneliness was I refused to accept that I am actually a pretty introverted, non-verbal person. Ideas that are meaningful seem to come from my body, not my mind. They begin as feelings, not words.

In conversations with others I started to ask myself, “How do I really feel in my body right now?” I would wait for the response, let the feeling come into words, then share those ideas in the conversation. In this way I started to feel a lot more present in my interactions with others. Eventually this became second nature.

In order to hear your feelings, you have to give them time to surface – they cannot be rushed.

When you share what’s meaningful to you, others will find you more interesting, and they’ll feel invited to share too.

2. Find people who give you time to speak

New ideas that have yet to find words are delicate. If the person you’re talking to is quick to jump in at every lull, it’s impossible to give yourself time to verbalize your ideas. There are lots of people who can sense this process at work. They are able to read your body language and give you the moments you need to find what you have to say. Make friends with these people. They will appreciate you being able to offer the same to them.

3. Be around people who know you every day

Get into a daily rhythm of being around people who know and care about you. They might be friends, roommates, classmates, or coworkers.

If you have a job, don’t just isolate yourself in your tasks. Find bits of time to chat about non-work stuff with coworkers and let yourself be authentic.

4. Share your secrets with the right person

If you have secrets and no one to talk with about them, it’s easy to feel ashamed and alone. Maybe it’s an insecurity you have or something that happened in the past. Find someone who will be able to listen to you and accept you with your secrets. Make this person a part of your life – you’ll feel a world of difference.

Sometimes there’s no way to escape feeling lonely. As painful as it is, accept that you feel lonely, don’t be ashamed of it, and have faith that time will make things change.

Do these ideas help you? Share your thoughts in the comments.

I’m @wtsui on Twitter. Thanks to @eugeneotto for feedback.

benvanik/xenia · GitHub

$
0
0

Comments:"benvanik/xenia · GitHub"

URL:https://github.com/benvanik/xenia


Xenia - Xbox 360 Emulator Research Project

Xenia is an experimental emulator for the Xbox 360. It does not run games (yet), and if you are unable to understand that please leave now.

Come chat with us about development topics in #xenia @ irc.freenode.net.

Currently supported features:

Coming soon (maybe):

Disclaimer

The goal of this project is to experiment, research, and educate on the topic of emulation of modern devices and operating systems. It is not for enabling illegal activity. All information is obtained via reverse engineering of legally purchased devices and games and information made public on the internet (you'd be surprised what's indexed on Google...).

Quickstart

Windows:

# install python 2.7 and VS2013
git clone https://github.com/benvanik/xenia.git
cd xenia
xb setup
# open build\xenia\xenia.sln and start xenia-run

When fetching updates use xb pull to automatically fetch everything and update gyp files/etc.

Building

See building for setup and information about thexenia-build script.

Contributors Wanted!

Have some spare time, know C++, and want to write an emulator? Contribute! There's a ton of work that needs to be done, a lot of which is wide open greenfield fun. Fixes and optimizations are always welcome (please!), but in addition to that there are some major work areas still untouched:

See more projects good for contributors.

FAQ

Can I get an exe?

NO. I am not releasing binaries - at least not for awhile. Don't be an idiot and download a binary claiming to be of this project. In fact, don't be an idiot and download any binary claiming to be an Xbox 360 or PS3 emulator from any source, especially not YouTube videos and shady websites. Come on people. Jeez.

What kind of machine do I need to run this?

You'll need 64-bit Windows 7 with a processor supporting at least SSE4. It's only tested on Windows 8 and that may become a requirement as several of the APIs exposed there are beneficial to emulation. In general if you have to ask if your machine is good enough to run games at a decent speed the answer is no.

What about Linux/OSX?

The project is designed to support non-Windows platforms but until it's running games it's not worth the maintenance burden. If you're a really passionate Linux/OSX-based developer and want to help out, run Bootcamp/VM and contribute an OpenGL 4 driver - that'll be the most difficult part in porting to non-Windows platforms.

What kind of GPU do I need?

DirectX 11 support is required. To get full speed and compatibility Mantle may be required in the future (which means R9 AMD cards and up).

(some argument over an unimportant technical choice)

In general: 'I don't care.'

Here's a short list of common ones:

  • 'Why Python 2.7? 3 is awesome!' -- agreed, but gyp needs 2.7.
  • 'Why this GYP stuff?' -- CMake sucks, managing Xcode projects by hand sucks, and for the large cross-platform project this will become I'm not interested in keeping all the platforms building any other way.
  • 'Why this xenia-build.py stuff?' -- I like it, it helps me. If you want to manually execute commands have fun, nothing is stopping you.

Known Issues

Use of stdout

Currently everything is traced to stdout, which is slow and silly. A better tracing format is being worked on.

15-819 Homotopy Type Theory

$
0
0

Comments:"15-819 Homotopy Type Theory"

URL:http://www.cs.cmu.edu/~rwh/courses/hott/


Synopsis

This is a graduate research seminar on Homotopy Type Theory (HoTT), a recent enrichment of Intuitionistic Type Theory (ITT) to include "higher-dimensional" types. The dimensionality of a type refers to the structure of its paths, the constructive witnesses to the equality of pairs of elements of a type, which themselves form a type, theidentity type. In general a type is infinite dimensional in the sense that it exhibits non-trivial structure at all dimensions: it has elements, paths between elements, paths between paths, and so on to all finite levels. Moreover, the paths at each level exhibit the algebraic structure of a (higher) groupoid, meaning that there is always the "null path" witnessing reflexivity, the "inverse" path witnessing symmetry, and the "concatenation" of paths witnessing transitivity such that group-like laws hold "up to higher homotopy". Specifically, there are higher-dimensional paths witnessing the associative, unital, and inverse laws for these operations. Altogether this means that a type is aweak ∞-groupoid.

The significance of the higher-dimensional structure of types lies in the concept of a type-indexed family of types. Such families exhibit the structure of a fibration, which means that a path between two indices "lifts" to a transport mapping between the corresponding instances of the family that is, in fact, an equivalence. Thinking of paths as constructive witnesses for equality, this amounts to saying that equal indices give rise to equivalent types, and hence, by univalence, equal elements of the universe in which the family is valued. Thus, for example, if we think of the interval I as a type with two endpoints connected by a path, then an I-indexed family of types must assign equivalent types to the endpoints. In contrast the type B of booleans consists of two disconnected points, so that a B-indexed family of types may assign unrelated types to the two points of B. Similarly, mappings from I into another type A must assign connected points in A to the endpoints of the interval, whereas mappings from B into A are free to assign arbitrary points of A to the two booleans. These preservation principles are central to the structure of HoTT.

In many cases the path structure of a type becomes trivial beyond a certain dimension, called the level of the type. By convention the levels start at -2 and continue through -1, 0, 1, 2, and so on indefinitely. At the lowest, -2, level, the path structure of a type is degenerate in that there is an element to which all other elements are equal; such a type is said to be contractible, and is essentially a singleton. At the next higher level, -1, the type of paths between any two elements is contractible (level -2), which means that any two elements are equal, if there are any elements at all; such as type is asub-singleton or h-proposition. At the next level, 0, the type of paths between paths between elements is contractible, so that any two elements are equal "in at most one way"; such a type is a set whose types of paths (equality relations) are all h-prop's. Continuing in this way, types of level 1 are groupoids, those of level 2 are 2-groupoids, and so on for all finite levels.

ITT is capable of expressing only sets, which are types of level 0. Such types may have elements, and two elements may be considered equal in at most one way. A large swath of (constructive) mathematics may be formulated using only sets, and hence is amenable to representation in ITT. Computing applications, among others, require more than just sets. For example, it is often necessary to suppress distinctions among elements of a type so as to avoid over-specification; this is called proof irrelevance. Traditionally ITT has been enriched with an ad hoc treatment of proof irrelevance by introducing a universe of "propositions" with no computational content. In HoTT such propositions are types of level -1, requiring no special treatment or distinction. Such types arise by propositional truncation of a type to render degenerate the path structure of a type above level -1, ensuring that any two elements are equal in the sense of having a path between them.

Propositional truncation is just one example of a higher inductive type, one that is defined by specifying generators not only for its elements, but also for its higher-dimensional paths. The propositional truncation of a type is one that includes all of the elements of the type, and, in addition, a path between any two elements, rendering them equal. It is a limiting case of a quotient type in which only certain paths between elements are introduced, according to whether they are deemed to be related. Higher inductive types also permit the representation of higher-dimensional objects, such as the spheres of arbitrary dimension, as types, simply by specifying their "connectivity" properties. For example, the topological circle consists of a base point and a path starting and ending at that point, and the topological disk may be thought of as two half circles that are connected by a higher path that "fills in" the interior of the circle. Because of their higher path structure, such types are not sets, and neither are constructions such as the product of two circles.

The univalence axiom implies that an equivalence between types (an "isomorphism up to isomorphism") determines a path in a universe containing such types. Since two types can be equivalent in many ways (for example, there can be distinct bijections between two sets), univalence gives rise to types that are not sets, but rather are of a higher level, or dimension. The univalence axiom is mathematically efficient because it allows us to treat equivalent types as equal, and hence interchangeable in all contexts. In informal settings such identifications are often made by convention; in formal homotopy type theory such identifications are true equations.

Requirements

The class is open to any PhD student, and to undergraduate or other graduate students with permission of the instructor. The course will be self-contained. A well-prepared student will have some background in formal logic and some prior experience with simple type theory.

No letter grades will be assigned for this class. It should not be taken with the expectation of fulfilling any course requirement or degree credit. Full participation is required of all students to pass the course.

All students are required to complete assigned homework in a timely manner (no later than one week after assigned) for review by the teaching assistant. (Please send your homework as a PDF to Favonia.)

All students are required to participate in the weekly note-taking process. Each week two students are responsible for preparing typeset course notes to be distributed before lecture each Monday.

Please register yourself as a student on the Piazza web page linked above.

Academic Integrity

Unless explicitly instructed otherwise, all homework and exam work is to be solely your own, and may not be shared with or borrowed from any other person in the course. You are not permitted to draw upon assignments or solutions from previous instances of the course, nor to use course materials (such as assignments or programs) obtained from any web site or other external source in preparing your work.

You may discuss homework assignments with other students in the class, but you must adhere to the whiteboard policy. At the end of discussion the whiteboard must be erased, and you must not transcribe or take with you anything that has been written on the board during your discussion. You must be able to reproduce the results solely on your own after any such discussion.

Trust but Verify

Kingston displays 384GB of DDR4 in top-secret Intel server at CES | TweakTown

$
0
0

Comments:"Kingston displays 384GB of DDR4 in top-secret Intel server at CES | TweakTown"

URL:http://www.tweaktown.com/news/34788/kingston-displays-384gb-of-ddr4-in-top-secret-intel-server-at-ces/index.html


CES 2014 - It's always fun to find a few diamonds in the rough at CES, and luckily this year held a few as usual. Kingston was demonstrating a whopping 384 GB's of its new DDR4 running in a blacked-out server. For those in the know, there currently isn't a publicly released CPU/chipset combination that supports DDR4 memory.

 

 

In order to recieve clearance for this demo, Kingston had to black out key areas of the chassis, which means essentially everything other than the heat sinks and DDR4 sticks. We speculate this is Grantley-EP and Wellsburg PCH. If so, the server supports Thunderbolt and features DDR4 speeds of 2400 and 3200MHz. However, these specs are pure conjecture.

 

 

Of course we tried to 'play the angles' to get a view underneath at the new unnannounced chipset. Unfortunately, Kingston delivered on their promise to Intel by making a more detailed analysis of the chipset impossible through use of the large black covers underneath the plexiglass cover.

 

 

Of course, we have the picture of the DDR4 actually up and running during the demo.


gen - a generics library for Go

$
0
0

Comments:"gen - a generics library for Go"

URL:http://clipperhouse.github.io/gen/


gen alpha

A library for bringing generics-like functionality to Go

gen is an attempt to bring some generics-like functionality to Go, with inspiration from C#’s Linq, JavaScript’s Array methods and the underscore library. Operations include filtering, grouping, sorting and more.

The pattern is to pass func’s as you would pass lambdas in Linq or functions in JavaScript.

Concepts

gen generates code for your types, at development time, using the command line. gen is not an import; the generated source becomes part of your project and takes no external dependencies.

The generated code implements the methods described below. To make this possible, a new slice type is generated for the struct types you specify. We call it the plural type. For example, if you gen an existing type Thing, a new plural type will be created:

type Things []Thing

…and you’ll use this wherever you would otherwise use a slice.

myThings := Things{...}
otherThings := myThings.Where(func).Sort(func)

Installation

Of course, start by installing Go, setting up paths, etc. Then:

go get github.com/clipperhouse/gen

To see usage, simply type:

gen

Create a new Go project, and cd into it. Create a main.go file and define a struct type in it. To quickly create the gen methods:

gen package.Thing

…using your package and type names. You should see a new file, named [your struct]_gen.go. Have a look around. Try out that plural type.

Usage

After installation, you should have access to a new gen command. cd into the directory containing the type(s) you wish to gen. Simply type gen to see usage.

package.TypeName *package.TypeName Generate plural type & methods for specified type name within the specified package. Prepend with optional * to operate on pointers (recommended) or omit it to use values. -all -*all Generate plural type & methods for all struct types discovered within the current directory. Prepend with optional * to operate on pointers (recommended) or omit it to use values. Abbreviate -a. -exported Limit generation to exported struct types, i.e., those starting with capital letters. Useful with -all. Abbreviate -e. -force Force generation to continue even if errors. Abbreviate -f.

Methods

Signatures use the example type *Thing.

Where

Returns a new slice (plural type) whose elements return true for passed func. Comparable to Linq’s Where and JavaScript’s filter.

func (rcv Things) Where(fn func(*Thing) bool) Things

Example:

shiny := func(p *Product) bool {
 return p.Manufacturer == "Apple"
}
wishlist := products.Where(shiny)

Count

Returns an int representing the number of elements which return true for passed func. Comparable to Linq’s Count.

func (rcv Things) Count(fn func(*Thing) bool) int

Example:

countDracula := monsters.Count(func(m *Monster) bool {
 return m.HasFangs()
})

Any

Returns true if one or more elements returns true for passed func. Comparable to Linq’s Any or underscore’s some.

func (rcv Things) Any(fn func(*Thing) bool) bool

Example:

bueller := func(s *Student) bool {
 return s.IsTruant
}
willBeHijinks := students.Any(bueller)

All

Returns true if every element returns true for passed func. Comparable to Linq’s All or underscore’s every.

func (rcv Things) All(fn func(*Thing) bool) bool

Example:

mustPass := func(t *Thing) bool {
 return !t.IsEternal
}
cliché := things.All(mustPass)

First

Returns first element which returns true for passed func. Comparable to Linq’s First or underscore’s find.

func (rcv Things) First(fn func(*Thing) bool) (*Thing, error)

Example:

come := func(c *Customer) bool {
 return c.IsHere
}
served, err := people.First(come)

Returns error if no elements satisfy the func.

Single

Returns unique element which returns true for passed func. Comparable to Linq’s Single.

func (rcv Things) Single(fn func(*Thing) bool) (*Thing, error)

Example:

id := request.Id
byId := func(t *Thing) bool {
 return t.Id == id
}
item, err := things.Single(byId)

Returns error if multiple or no elements satisfy the func.

Each

Invokes passed func on every element. Comparable to underscore’s each.

func (rcv Things) Each(fn func(*Thing))

Example:

update := func(s *Score) {
 s.Recalc()
}
scores.Each(update)

Sort

Returns a new slice (plural type) whose elements are sorted based on a func defining ‘less’. The less func takes two elements, and returns true if the first element is less than the second element.

func (rcv Things) Sort(less func(*Thing, *Thing) bool) Things

Example:

byRank := func(a, b *Player) bool {
 return a.Rank < b.Rank
}
leaderboard := player.Sort(byRank)

SortDesc works similarly, returning the elements in reverse order. Its implementation negates ‘less’, so is effectively Sort(equalOrGreater).

IsSorted(Desc) uses a similar idiom, returning true if the elements are sorted according to the ‘less’ comparer.

Distinct

Returns a new slice (plural type) representing unique elements. Comparable to Linq’s Distinct or underscore’s uniq.

func (rcv Things) Distinct() Things

Example:

snowflakes := hipsters.Distinct()

Keep in mind that pointers and values have different notions of equality, and therefore distinctness.

DistinctBy

Returns a new slice (plural type) representing unique elements, where equality is defined by a passed func.

func (rcv Things) DistinctBy(func(*Thing, *Thing) bool) Things

Example:

hairstyle := func(a *Fashionista, b *Fashionista) bool {
 a.Hairstyle == b.Hairstyle
}
trendsetters := fashionistas.DistinctBy(hairstyle)

Min

func (rcv Things) Min(less func(*Thing, *Thing) bool) (*Thing, error)

Returns the element containing the minimum value, when compared to other elements using a passed func defining ‘less’. Returns an error when invoked on an empty slice, considered an invalid operation.

Example:

byPrice := func(a, b *Product) bool {
 return a.Price < b.Price
}
cheapest, err := products.Min(byPrice)

In the case of multiple items being equally minimal, the first such element is returned.

Max

func (rcv Things) Max(less func(*Thing, *Thing) bool) (*Thing, error)

Returns the element containing the maximum value, when compared to other elements using a passed func defining ‘less’. Returns an error when invoked on an empty slice, considered an invalid operation.

Example:

byArea := func(a, b *House) bool {
 return a.Area() < b.Area()
}
roomiest, err := houses.Max(byArea)

Subsetting

By default, all of the above standard methods are created when you gen a type. If you would prefer only to generate specific methods, you can include a specially-formatted “tag” comment, which follows the convention of struct tags.

// gen:"Count,Where,Sort"
type Thing struct {
 Name string
 Year int 
 Sales float64
}

Give the comment its own line adjacent to the type defintion as you would with (or in addition to) godocs, and avoid spaces.

(Note: previous versions of gen put the comment within the type definition.)

Custom methods

Note: Custom methods are likely to be deprecated in favor of more-flexible “projection methods”. See this GitHub issue for details.

Custom methods use struct tags to project fields of a struct.

Given an example type:

type Thing struct {
 Name string `gen:"Select,Aggregate"`
 Year int `gen:"GroupBy,Select,Min"`
 Sales float64 `gen:"Sum,Max,Average"`
}

You can infer the format from above. (Avoid spaces between methods.)

Below, {{Name}} and {{Type}} represent the name and type of a tagged field. The actual name will be substituted when you gen.

Select

func (rcv Things) Select{{Name}}() []string

Returns a slice of a specific field. Comparable to Linq’s Select or underscore’s pluck.

Example:

names := myThings.SelectName() // => ["Thing One", "Thing Two"]

GroupBy

func (rcv Things) GroupBy{{Name}}() map[{{Type}}]Things

Groups elements into a map keyed by the tagged field’s value. Comparable to Linq’s GroupBy or underscore’s groupBy.

Example:

report := myThings.GroupByYear() // => { 1995: ['Thing One', 'Thing Two'], 2007: ['Thing Three', 'Thing Four'] }

Sum

func (rcv Things) Sum{{Name}}() {{Type}}

Sums a field over all elements of Things. Comparable to Linq’s Sum.

Example:

revenue := myThings.SumSales() // => 68885.74

Average

func (rcv Things) Average{{Name}}() {{Type}}

Sums a field over all elements and divides by len(Things). Comparable to Linq’s Average.

Example:

avg := myThings.AverageSales() // => 30005.74

Max

func (rcv Things) Max{{Name}}() {{Type}}

Selects the largest value of a field in Things. Comparable to Linq’s Max.

Example:

bigmoney := myThings.MaxSales() // => 685698.99

Min

func (rcv Things) Min{{Name}}() {{Type}}

Selects the least value of a field in Things. Comparable to Linq’s Min.

Example:

earliest := myThings.MinYear() // => 1995

Aggregate

func (rcv Things) Aggregate{{Name}}(fn func({{Type}}, {{Type}}) {{Type}}) {{Type}}

Iterates over Things, operating on each element while maintaining ‘state’. Comparable to Linq’s Aggregate or underscore’s reduce.

Example:

var join = func(state string, value string) string {
 if state != "" {
 state += ", "
 }
 return state + value
}
list := myThings.AggregateName(join) // => "Title One, Title Two, etc"

FAQ

First off: we’re alpha! Caveat emptor. Feedback welcome.

Why?

Go doesn't (yet) offer generic types, and we are accustomed to many of their use cases. Perhaps you are similarly accustomed, or would find them useful.

Code generation, really?

Yes. We do it to ensure compile-time safety, and to minimize magic. It’s just code, and you can read it.

Codegen is not without its risks, we understand. But keep in mind that languages which do support generics are in fact doing something like code generation, so perhaps gen’s approach is not that far out.

gen creates a new slice type for your selected struct(s) because method receivers cannot be slices. It’s clearer and less verbose to type myThings.Where(fn) than package.Where(myThings, fn). Not to mention, the latter wouldn’t work for multiple struct types in the same package.

You re-implemented sort?

Yes. Go’s sort package requires the fulfillment of three interface members, two of which are usually boilerplate. If you want to sort by different criteria, you need to implement multiple ‘alias’ types.

gen’s Sort requires a single argument defining ‘less’, and no interface implementation. You can call ad-hoc sorts simply by passing a different func.

gen’s implementation is a strongly-typed port of Go’s implementation. Performance characteristics should be similar.

Could some of this be achieved using reflection or interfaces + type assertions?

Perhaps! It’s early days and the focus is on the API and compile-time safety. We’ve no doubt that more idiomatic approaches will reveal themselves.

What about imported types?

gen doesn’t support imported types that might be members of your struct, reason being that we’d have to resolve those dependencies and include them in the generated code. This isn’t impossible, we may get there.

As a workaround, you might create a local ‘alias’ type, something like:

type MyType otherPackage.Type
// or...
type MyType struct {
 otherPackage.Type
}

Why didn’t you implement X method?

Most likely:

  • We haven’t gotten to it yet, or
  • We haven’t found an idiomatic way to do it, or
  • It doesn’t save you any code, or
  • It duplicates something that Go does well.

Here are some design criteria.

Can I use it?

We’d be thrilled if you would test it out and offer feedback. It’s still very early alpha bits, caveat emptor for production use. The API will likely be volatile prior to 1.0.

Can I help?

Sure, the code is here.

Who is ‘we’?

Matt Sherman, mostly. You can reach him @clipperhouse on GitHub or Twitter. Matt Jibson is helping out as well.

Bitcoin Price Touches $1,000 Again as Overstock Sales Hit $130,000

$
0
0

Comments:"Bitcoin Price Touches $1,000 Again as Overstock Sales Hit $130,000"

URL:http://www.coindesk.com/bitcoin-price-1000-again-overstock-sales-130000/


The price of bitcoin reached $1,000 again today on Japan-based bitcoin exchange Mt. Gox, following the news this week that online retailer Overstock.com had started accepting bitcoin as a payment method.

The peak this time around was $1,011 on Mt. Gox. Not a record but surely a notable threshold to surpass once again. The last time it broke through to four digits was back on 5th January amid news that Overstock would embrace bitcoin at some point later in the year– but it turned that around faster than everyone expected.

On 7th January, the Gox price reached $1,041.99. Around the same time, social gaming company Zynga also began testing bitcoin on its platform, likely a contributing factor to that particular price spike.

Overstock’s Announcement

It is clear that the decision by Salt Lake City-based Overstock to accept bitcoin is leading to increased interest in the digital currency. Previously, Overstock had announced that it would begin accepting bitcoin in the second half of 2014.

Those plans were accelerated, and the retailer started accepting BTC for all its items. The company, started in 1999 by CEO Patrick Byrne, is publicly traded on the NASDAQ stock exchange. Byrne told CoinDesk recently that he believes in the possibilities that bitcoin can present in the free market.

“In an ideal world we’d go back to gold so you’d have a monetary system based on something that government mandarins can’t expand at the stroke of a pen,” he said. “We’re not going to go back to gold, but bitcoin shares that virtue. It is mathematically if not physically constrained.”

Payment Success Influences Price

Byrne’s belief in bitcoin is paying off, even within 24 hours of the announcement. Overstock, the largest organization to ever accept bitcoin, had made $130,000 in BTC sales spread over 840 orders after its first day of accepting it.

#Bitcoin‘s first full day on @overstock.com was a huge success: 840 orders, $130,000 in sales. Almost all new customers. #stunned— Patrick M. Byrne (@OverstockCEO) January 10, 2014

Such great success in short order is sure to lead to other companies accepting bitcoin. A popular vertical would be online retailers. In fact, there have been rumblings that electronics retailer Newegg is planning to accept bitcoin sometime soon, and that company is certainly paying attention to Overstock’s triumph.

It’s a possibility, #staytuned :)RT @thedatascape: @Newegg Do you have any plans to add Bitcoin as one of your payment methods?— Newegg (Official) (@Newegg) November 23, 2013

It seems that a pattern has developed in terms of merchant acceptance of bitcoin. In the case of Overstock’s news, the BTC price goes up as a well-known and large retailer joins the bitcoin fold. But we’ve also seen the opposite: bitcoin prices took a big slide on negative China news back in December when Baidu and China Telecom both stopped accepting BTC.

Volatility

When we see bitcoin succeed as a payment mechanism, we see the value of bitcoin rise. Recent good news coming from Overstock as well as the Coinbase partnership with BitMonet to enable in-app bitcoin transactions on Android are positive signs that payment transactions will grow in volume.

Nevertheless, a recent research report submitted to members of Congress entitled “Bitcoin: Questions, Answers, and Analysis of Legal Issues” discussed the possibility that bitcoin could undermine the US dollar at some point. The news of that report mixed in with positive payment news for bitcoin has likely led to a good degree of volatility in the past few days.

However, even that report pointed to network externalities like the adoption of bitcoin as a payment method as a way the bitcoin currency could become successful.

“An important force that is likely to hinder such growth in Bitcoin use is the strong preference for dollar use generated by what economists call network externalities (i.e., the value of a product or service is dependent on the number of others using it).”

The CoinDesk Bitcoin Price Index, which is a blend of several different exchange prices, has been hovering around $920, peaking at $934 today.

Bitcoin’s all-time price high occurred on 29th November 2013, when it was valued at $1,242 on Mt. Gox.

The price is clearly contributing to increased Wall Street interest. Fortress Investments, for example, has been reportedly planning a bitcoin-related fund. And the New York State Department of Financial Services has planned a hearing to discuss virtual currency-based policies, and perhaps the idea of issuing BitLicenses for virtual money transmitters.

Coin image via Shutterstock

neweggOverstockPatrick Byrne

Banks Say No to Marijuana Money, Legal or Not

A Worst Case for Functional Programming?

$
0
0

Comments:"A Worst Case for Functional Programming?"

URL:http://prog21.dadgum.com/189.html


Several times now I've seen the following opinion: For anything that's algorithm-oriented or with lots of math, I use functional programming. But if it's any kind of simulation, an object-oriented solution is much easier. I'm assuming "simulation" means something with lots of moving, nested actors, like a battlefield where there are vehicles containing soldiers who are carrying weapons, and even the vehicle itself has wheels and different parts that can be damaged independently and so on. The functional approach looks to be a brain-teaser. If I'm deep down inside the code for a tank, and I need to change a value in another object, how do I do that? Does the state of the world have to get passed in and out of every function? Who would do this?

In comparison, the object-oriented version is obvious and straightforward: just go ahead and modify objects as needed (by calling the proper methods, of course). Objects contain references to other objects and all updates happen destructively and in-place. Or is it that simple?

Let's say the simulation advances in fixed-sized time steps and during one of those steps a tank fires a shell. That's easy; you just add a shell object into the data structures for the simulation. There's a catch, though. The tanks processed earlier in the frame don't know about this shell, and they won't until next frame. Tanks processed later, though, have access to information from the future. When they run a "Were any shells recently fired?" check, one turns up, and they can take immediate action.

The fix is to never pollute the simulation by adding new objects mid-frame. Queue up the new objects and insert them at the end of the frame after all other processing is complete.

Now suppose each tank decides what to do based on other entities in the vicinity. Tank One scans for nearby objects, then moves forward. Tank Two scans for objects and decides Tank One is too close. Now it isn't actually too close yet; this is based on an incorrect picture of the field caused by Tank One updating itself. And it may never be too close, if Tank Two is accelerating away from Tank One.

There are a couple of fixes for this. The first is to process situational awareness for every actor on the field as a separate step, then pass that information to the decision/movement phase. The second is to avoid any kind of intra-frame pollution of object data by keeping a list of all changes (e.g., that a tank moved to a new position), then applying all of those changes atomically as a final step.

If I were writing such a simulation in a functional style, then the fixes listed above would be there from the start. It's a more natural way to work when there aren't mutable data structures. Would it be simpler than the OOP version? Probably not. Even though entity updates are put off until later, there's the question of how to manage all of the change information getting passed around. But at one time I would have thought the functional version a complete impossibility, and now it feels like the obvious way to approach these kinds of problems.

(If you liked this, you might enjoy Turning Your Code Inside Out.)

Not Wanted

$
0
0

Comments:"Not Wanted"

URL:http://ninjasandrobots.com/not-wanted/


Make something people want.Paul Graham

I’ve made a lot of stuff no one wanted.

Trying to grow my first business, Inkling, I did what good Lean Startup followers would do. I turned some of our technology into a small “project management software” prototype and used Quora and LinkedIn to set up meetings with project managers.

One thing became clear fast. These project managers weren’t impressed. I was often told the prototype would need to do at least everything their current tools and processes already did, before they’d consider using it with their team. They were reluctant to switch.

There’s a great story in Esquire Magazine this month about the history of Irish whiskey. 130 years ago there were almost 30 Irish whiskey distilleries. Fast forward 100 years and there was just one: Irish Distillers Ltd (IDL). IDL was a hodgepodge of brands including Jameson and Tullamore Dew. They made good products, but Irish whiskey wasn’t doing well. When you asked whiskey experts what they thought of Jameson, Esquire magazine reports, “they weren’t impressed.”

But then in 1988, a company named Pernod Ricard bought IDL and had an interesting idea…

Stop selling whiskey to whiskey drinkers. Sell it to vodka drinkers, instead.

And the rest is history. Jameson hadn’t impressed the whiskey drinkers, but the people used to drinking light tasting spirits, like vodka and white-rum, couldn’t get enough.

A mistake I made with that project management software was spending too much time obsessing about what project managers thought. Those project managers were already well over-served by their current tools and workflows.

I started making that same mistake with Draft when I first started. I contacted famous authors and journalists, and I talked with them about their processes and what they thought of Draft. The feedback was eerily similar to that project management software. I’d hear how these authors already had all these workflows they’d use with their editors and their publishers. The tools were already in place. Draft would have to do everything these other tools already did before they’d give it a good look.

So I went down a different path.

Instead of focusing on trying to sell more stuff to people who have plenty of that stuff, I focused on the people who don’t yet have these tools or experiences.

Instead of focusing on famous authors, I focused on people like me - folks just starting to eke out an audience with a new blog. Instead of selling more writing software to writers, I focused on selling version control software to people who’ve never even heard of popular version control software like Git before. Instead of trying to sell yet another copyediting service, I called mine “Ask a Pro”, so that people who didn’t understand what a copyeditor even does might still be interested in this. And sure enough, I have a bunch of people buying Ask a Pro who have never considered hiring a copyeditor to look over their writing.

Today, Draft’s user base is diverse. But the core user who helped propel this product into a real business wasn’t a professional writer or a famous author. It was a person who didn’t yet have a taste for writing tools.

God - and my source code repository - knows I’ve made a lot of stuff that no one wanted. But it probably wasn’t the stuff that was the problem. It was me not spending enough time with people who didn’t have a taste for that stuff to begin with.

P.S. I’d love to meet you on Twitter: here.

Or please let me send you my latest newsletter.

  879 Kudos   879 Kudos
Viewing all 9433 articles
Browse latest View live