open source science

Something I wish someone had told me a year ago

When you’re thinking of contributing to an open source project, YOU WILL PROBABLY NOT UNDERSTAND THE CODE. Especially, if it is a larger project, or you’re a bit unfamiliar with the programming language.  

Code cannot be read like a book, where you look at it and automatically understand what it does and how it relates to everything else.

I use to never really contribute because I’d start looking at the code and never understand what was happening. I now realize that it actually takes time and effort before you begin to fully understand what the code does. You have to read the documentation, look at comments, google syntax you do not understand, look and multiple files and see how they connect. You’ll probably look at one file, go look at something else, only to have to come back to the first file and look at it again. AND THAT’S OKAY!

If you’re looking to contribute, you have to take the time to understand the code before you can start changing a thing. Sure, this may take some time, but slowly and slowly you will understand. Heck, you might not even understand everything, but you really only need to understand enough to get the job done. 

TumblrCards (Working Title)

Hi all,

So I thought it was probably time I share what I’ve been working on. About 2 weeks ago I began approaching different blogs (per the request of @codingflumps) to gather interest and help in writing a card game! Flumps had been to busy with life at the time to put anything together, so I took it upon myself to spearhead his idea! Well, after spamming a large number of you (some of the most popular Comp Sci blogs have agreed to help), I have about 27 blogs total currently working on this game. But 27 isn’t enough!! My goal is to get as much of the Tumblr community involved as I can. Especially the Comp Sci “fandom”.

The project will be written in C++. We are using GitHub for open source control and Slack for discussion. Below you will find the link to the GitHub project (which can also be found on my blog) as well as the list of blogs that have signed on to help and allowed me to tag them (a few have asked to remain untagged).

If helping is something you would be interested just shoot me or any of these blogs an IM :)

Github: https://github.com/incomingstick/TumblrCards

@2nvtech

@algorhythmn

@caniprogram

@code-bug

@codeforvictory

@codingflumps

@compsciengineergirl

@computers-studying

@comp-sci

@debugmouse

@fangandal

@geekyasian

@javaonthedarkside

@leftistpropaganda

@matrix-inverse

@moonstruckstudies

@pirateprogramming

@racheloutofbounds

@radioactive-bananas-and-potatoes

@rorysglasses

@skeletonstudy

@teenagedintrovert

@tegan-scissor-hands

@theravenstudies

@thisgirlcodes

@what-do-the-skies-see

github.com
balesh2/MathLib
Contribute to MathLib development by creating an account on GitHub.

For the past few months, I have been working on a math library for really big numbers. I wrote this for use in Project Euler problems, and it is based on the class that Caleb designed. It is written in C++ because it makes use of classes and operator overrides, but it mainly reads like C. Now that I have it all commented, you can find the full source on my github.

The bulk of the code is performing operator overrides. This is so that it reads intuitively like regular C or C++ code, instead of looking like a bunch of function calls.

The Class

The math library is based on the class BigInt, which is an integer stored in an array of integers in order to avoid integer overflow. The class was created by Caleb, and I liked the way that he stored the numbers, so I continued implementing the class.

The class itself is fairly simple, with only two properties. The first is the number, which is stored in an array of integers called array. The array can hold up to 100,000 digits, making it optimal for use in Project Euler problems. The other property is digits, the count of how many digits long a number is. This is to decrease the time complexity of getting the most significant digit (MSD). The most complex part of the class is the way in which integers are stored in the array. The numbers are stored in Little Endian notation, meaning that the MSD is “last” in the array, and the least significant digit (LSD) is “first” in the array. Take for example the number 100. When stored in the array, it looks like 001.

source

The reason behind this method of number storage is to decrease the time that it takes to make a number bigger. If the number were stored in Big Endian notation, the entire number would need to be moved over in order to accommodate a new digits, whereas we can just add a new digit to the beginning in Little Endian notation.

The Operator Overrides

The rest of the code in the Math Library is performing operator overrides and providing accessors. The array and digit count are both private, so accessors must be used in order to retrieve the numbers. There is also a function which prints the number in Big Endian. 

So far I have completed the following operator overrides and functions:

= - Assignment operator

Takes a BigInt on the left, and an int, long, string, or BigInt on the right. Assigns the value on the right to the variable on the left.

+ - Addition operator

Returns a BigInt. Takes a BigInt on the left and an int, long, string, or BigInt on the right. Adds and returns the two numbers, digit by digit. The value on the right is first assigned to a temporary BigInt variable.

+= - Addition and assignment operator

Takes a BigInt on the left and an int, long, string, or BigInt on the right. Adds the two values and over-writes the value on the left with the sum. The value on the right is first assigned to a temporary BigInt variable in order to perform digit-wise addition.

- - Subtraction operator

Returns a BigInt. Takes a BigInt on the left and an int, long, string, or BigInt on the right. Subtracts the two numbers, digit by digit. The value on the right is first assigned to a temporary BigInt variable.

-= - Subtraction and assignment operator

Takes a BigInt on the left and an int, long, string, or BigInt on the right. Subtracts the value on the right from the value on the left and stores the result in the variable on the left. The value on the right is first assigned to a temporary BigInt variable in order to perform digit-wise subtraction.

* - Multiplication operator

Returns a BigInt. Takes a BigInt on the left and an int, long, string, or BigInt on the right. Multiplies the two values digit by digit and returns the product. The value on the right is first stored in a temporary BigInt variable in order to perform digit-wise multiplication.

*= - Multiplication and assignment operator

Takes a BigInt on the left and an int, long, string, or BigInt on the right. Multiplies the two values digit by digit and stores the product in the left variable. The value on the right is first stored in a temporary BigInt variable in order to perform digit-wise multiplication.

== - Equality comparator 

Returns a boolean. Takes a BigInt on the left and an int, long, string, or BigInt on the right. Returns a 1 if the two values are equal and a 0 if they are not. First compares the number of digits, then compares the digits if the length of the two numbers are not the same. The value on the left is first be stored in a temporary BigInt variable in order to perform digit-wise comparison.

!= - Inequality comparator

Returns a boolean. Takes a BigInt on the left and an int, long, string, or BigInt on the right. Returns the complement of the == operation.

> - Greater than comparator

Returns a boolean. Takes a BigInt on the left and an int, long, string, or BigInt on the right. Compares the two numbers digit by digit, starting with the MSD and returns a 1 if the left is greater than the right.

< - Less than comparator

Returns a boolean. Takes a BigInt on the left and an int, long, string, or BigInt on the right. Returns the complement of the > operation.

>= - Greater than or equal to comparator

Returns a boolean. Takes a BigInt on the left and an int, long, string, or BigInt on the right. Returns the > or the == operations.

<= - Less than or equal to comparator

Returns a boolean. Takes a BigInt on the left and an int, long, string, or BigInt on the right. Returns the < or the == operations.

print() - Print function

Called on a BigInt. Prints the contents of array in Big Endian format.

push(int) - Push function

Called on a BigInt. Takes an int as input. Pushes the given int into the array as the MSD and increments digits.

peek() - Peek function

Called on a BigInt. Returns an integer. Return the MSD of the array, the digits at digits-1. Does not modify array.

pop() - Pop function

Called on a BigInt. Returns an integer. Returns the MSD of the array, over-writes array[digits-1] with a 0, and decrements digits.

I am still working on/have yet to start:

++ - Increment by one operator

- Decrement by one operator

/ - Division operator

% - Mod operator

pow(int) - Power function

/= - Division and assignment operator

%= - Mod and assignment operator

Please check out and star the Github repo! I hope that this is useful to you, and I would love to see how you use the library, and how you change it. I welcome contributions, just make a pull request and I will review it. Be sure to comment your code though!

Quantum leaps into the public’s hands.

Lasers. Transistors. Flash memory. Quantum theory has led to many technological advances. While we have yet to determine if it really makes time-travel possible, we do know what it can do for computing. Quantum computing has binary bits, just like any computer. But instead of ones and zeros, its quantum bits, or qubits, can represent a one, a zero, or both at once (a phenomenon known as superposition and the beginning of a rather long rabbit hole…)

At first, only a close group of physicists and engineers could participate in quantum computing projects. Now, IBM is opening up the IBM Quantum Experience to the public. In the Quantum Experience, anyone will be able to create algorithms for and run experiments on our quantum processor through personal desktops or mobile devices. Curious minds will also be able to play with qubits, find inspiration and learn about quantum through tutorials and simulations. The race is on to see just what other kind of leaps we can make.

Go to the IBM Quantum Experience →

Contemporary science, by and large, has devolved into nothing more than another bankrupt belief system; a substitute religion for individuals who believe spiritual fundamentalism is somehow more dangerous and damaging than scientific fundamentalism. In the words of Terence McKenna, “Science has great pretensions about itself; it basically regards itself as a meta-theory capable of passing judgment on all other theories. [These theories] are supposed to submit themselves to science to be told whether they are right or not.”

As Rupert Sheldrake, an accomplished biochemist, points out: “There is a kind of materialist ethos in science…when cosmologists come up with the idea that there are multiple universes, billions of actual universes besides our own for which there’s no evidence at all, instead of this causing outrage, it becomes totally mainstream…no one suffers an attack as a result…The reason that gets past the filters is it doesn’t overturn a particular ideology. What’s at stake is not science itself but ideology.”

This entrenched dogmatism that McKenna and Sheldrake refer to is most noticeable in scientists such as Richard Dawkins, who consistently scapegoat supernatural belief for the world’s shortcomings. They outright ignore the more decisive role that egotism, disconnection, and self-deception have played in perpetuating strife. Despite possessing tremendous intellect, Dawkins and others like him are clearly mistaking the map for the terrain. It is of little consequence to them that atrocities committed by Nazi Germany and Stalinist Russia were carried out under an empirical regime guided by a cold, calculated scientific protocol. They cannot sense, let alone acknowledge, their own cognitive dissonance. What is worse, without much thought, we choose to place these people and the flawed belief systems they espouse on pedestals. We elevate them to positions of cultural prominence, and mistakenly label their ideas as worthy of organizing an entire social-order around. We conflate their intelligence with wisdom at our own peril.

We need to realize that this brand of self-defeating extremism, whether scientific or religious, is a byproduct of a deeply flawed cultural psyche. We have become alienated from nature, from ourselves, and in the process become totally deranged.

— 

Exactly. 

source: http://jmag0904.wordpress.com/2012/11/02/the-cosmo-genesis-of-open-source-science/comment-page-1/