• Breaking News

    Tuesday, February 25, 2020

    It's Claude Shannon memorial day Computer Science

    It's Claude Shannon memorial day Computer Science


    It's Claude Shannon memorial day

    Posted: 24 Feb 2020 10:50 PM PST

    Every now and then, the human race produces someone who does something so differently it makes me wonder how they made that mental 90 degree turn. Like the first guy who looked at an egg and decided to separate the white from yoke to make mayonnaise. In lieu of information indicating otherwise, I like to think Claude Shannon is one such person. The underappreciated father of comp hardware and programming. Whom looked at electric circuits and wondered, what if we used electricity to solve math problems at the speed of light, and in turn used math to juggle balls.

    Those familiar with his work knows he is the one whom gave us information theory. The idea that information is both quantifiable and measurable. He also designed some of the first logic circuits, which became the foundation of the device you're currently reading this post on. When we think about scientists in comp, many of us think Von Neumann and Turing. But it was Shannon's work that made theirs possible.

    His accomplishments are many, I encourage you to do your own reading. He also lived an interesting life, some points i enjoyed are:

    • Like most scientists of his time, he was involved in the war against the Nazis, specifically in cryptanalysis
    • He proved one time pad is unbreakable, placating all my fellow tinfoil hat enthusists, and that all perfect encryption schemes has the same limitations of OTP, satisfying my perf obsessed brethren.
    • Built one of the first juggling robots ever
    • He was into unicycling
    • Built one of the first "useless" machines (the currently attributed inventor is an associate of his)
    • Built a flamethrower trumpet

    Most importantly, or one would say fortunately, his life did not appear to be a tragic one. He wasn't betrayed by his government like with Turing. His life wasn't cut short by cancer like with Von Neumann. He died on Feb 24th 2001 at the age of 84, a father, a grandfather.

    I propose we take a moment out of our day to remember the light speed calculating, robot ball juggling, unicycling scientist that made the mental 90 degree turn that made both our careers and hobbies things.

    01000110 for Dr. Claude Elwood Shannon.

    submitted by /u/UnreadableCode
    [link] [comments]

    Math is your insurance policy | Bartosz Milewski's Programming Cafe

    Posted: 24 Feb 2020 09:35 PM PST

    The general value of typed functional programming lies in leaving no edge cases

    Posted: 24 Feb 2020 12:30 PM PST

    Would You Notice if Your Calculator Was Lying to You? The Research Says Probably Not

    Posted: 25 Feb 2020 04:15 AM PST

    Algorithmic complexity of parallelized algorithms on GPUs? Does such thing exist?

    Posted: 25 Feb 2020 05:23 AM PST

    Consider a for loop which is adding 1 to all the elements of an array size N. Therefore the time-complexity can said to be N (as N steps to add 1 for each element).

    Since this problem can be easy parallelized, assuming I have large number of cores on a GPU and hence now with each thread one can add 1 to each element. Therefore it happens in 1 time-step, hence constant time.

    Isn't the algorithmic complexity becomes different on a cpu and gpu? Many algorithms can be parallelized on gpu. For instance K-d tree can be parallelized and has a worst-case complexity of O(k*n*log(n)) on a cpu, is it right to think that time complexity of K-d tree is different on GPU when parallelized?

    I couldn't find any help on the internet on this. Perhaps I am thinking wrongly kindly help to clarify.

    submitted by /u/amitoz_azad
    [link] [comments]

    Why do people call programmers "developers"?

    Posted: 25 Feb 2020 12:58 AM PST

    Why do people call programmers "developers"?

    Where does this term originate from?

    submitted by /u/mavavilj
    [link] [comments]

    How to Keep Your Research and Sources Safe in the Age of Surveillance

    Posted: 25 Feb 2020 02:58 AM PST

    Is creating a programming language a viable idea for my final Bachelor's project?

    Posted: 24 Feb 2020 08:05 AM PST

    Hello guys! I'm a first year Computer Science student and i have another 2 years before I graduate, but I was wondering whether that's actually a doable task for someone like me (given the fact that I still have about 2 years to study and work on this.

    Thank you!

    submitted by /u/ForkyTheEditor
    [link] [comments]

    algorithm to assign employees to a 5-day work week

    Posted: 24 Feb 2020 03:28 PM PST

    Hey,

    <post edit> this came out really long, I will be very grateful if anyone takes the time to read this :D

    So I was trying to think of a way to automate the process of creating a weekly schedule for employees at the hospital where I work, I wanted to write it in python but solutions in pseudo code / other programming languages are very welcome as well)

    Here is the problem:

    We have 5 employees that work once a week in a 5-day work week (sunday through thursday). on each day, only a single employee is working (e.g. Jeff works on sunday, Arnold on monday, Bob on tuesday, Charlie on wednesday and Dylan on thursday).

    The way the days are assigned is the following:

    Towards the end of each month, every employee will send their availabilities for the month to come, for example, towards the end of March, Jeff (and all other employees) will declare the dates where he knows he will be able to work in april in this format : 1,3,5,7,12,14,16,20,23,30 (no date should be a friday or saturday but that doesn't really matter for the algorithm).

    now we take a look at each week seperately, and try to assign each employee to a different day such that no employee works more than once a week (if the group's availabilities allow it, otherwise they will work as less as possible) and the only days left unaccounted for are those where no employee declared as availabilities.

    My idea at the moment is the following (although, being a beginner in python I found it hard to come up with a good and *efficient* implementation in code, also feel free to suggest a completely different approach):

    create a function that takes 2 arguments:

    1. the month we are talking about (turned to a list where each element is a list of work days in a single week , e.g. [[1,2,3,4,5],[8,9,10,11,12],[15,16,17,18,19],[22,23,24,25,26],[29,30]].
    2. the employees and their availabilities (perhaps as dictionaries e.g. {'name': 'Jeff', 'availabilities': [1,2,3,8,9,15,23,24,30].

    and returns:

    1. list of work days for every employee.
    2. the work days where no employees were available.

    algorithmically, a perhaps we could go over each week seperately, the week is represented as a matrix where the top row is the days of the current week (e.g. in the first week of april from the previous paragraph): [1,2,3,4,5]

    and then 5 rows (one for each employee) with a made-up boolean value where '1' represents available and '0' unavailable, so in total the matrix should look something like that:

    the week in question : [1,2,3,4,5]

    Jeff:---------------------------[1,1,1,0,0]

    Arnold:----------------------[1,0,0,0,1]

    Bob:--------------------------[1,0,1,0,1]

    etc...

    Now if we were to sum all employee rows and all employee columns and save the values in a new column ('column sums') and row (the last row of the matrix) respectively, then our new matrix is:

    the week in question : [1,2,3,4,5,X]

    Jeff:---------------------------[1,1,1,1,0,4]

    Arnold:----------------------[1,0,0,0,1,2]

    Bob:--------------------------[1,0,1,0,1,3]

    column sums:-----------[3,1,2,1,2,X]

    etc....

    • the last row values will only be used in the end. for now we will only look at column sums.

    FINALLY, we can iterate over this matrix like so:

    - go through 'column sums' and search for '0' values, these mean the day is unaccounted for (can be added to the 2nd output of our function)

    - search for the first '1' value in 'column sums' if such value exists (which is the first '1' in our column sums row, indexed: 1, which corresponds to the 2nd of April in our example) this means that the corresponding date was marked as availability by one employee only (Jeff) and he is assigned to work on that date, now we can disregard the '2' column for the rest of our iteration of this week.

    - search for the next '1' value in 'column sums' if such value exists(which is the second '1' in our column sums row, indexed: 3, which corresponds to the 4th of April), this also belongs to our beloved Jeff and so unfortunately Jeff has to work twice that week. we assign the 4th of April to Jeff and the '4' column can be disregarded for the rest of our iteration of this week.

    now things are a bit different:

    - now we can safely remove jeff from the table and disregard him, by doing that our 'column sums' will be different, but none of them will be 0 excepts the days we already assigned to Jeff (marked as 'X' clarity), our new matrix is thus:

    we are very close, bear with me please, loveya:

    the week in question : [1,2,3,4,5,X]

    Jeff:---------------------------[1,1,1,1,0,4]

    Arnold:----------------------[1,0,0,0,1,2]

    Bob:--------------------------[1,0,1,0,1,3]

    column sums:------------[2,X,1,X,2,X]

    - again, go through the '1' values in our 'column sums', and assign the corresponding date to the only employee available that day, we are left with this:

    the week in question : [1,2,3,4,5,X]

    Jeff:---------------------------[1,1,1,1,0,4]

    Arnold:----------------------[1,0,0,0,1,2]

    Bob:--------------------------[1,0,1,0,1,3]

    column sums:------------[2,X,X,X,2,X]

    - go through the next smallest value in 'column sums' (which is the first '2' in our column sums row, indexed: 0, which corresponds to the April fools day), now who should we assign the 1st of April to? Bob or Arnold? we finally get to use our 'last row in the matrix'! we choose the employee with the least available days marked that week, in this case Arnold has 2 days of availabilities, where Bob has 3, so Arnold is assigned to work on the 1st of April (if both had 2 days marked that week a random assignment would be made).

    the week in question : [1,2,3,4,5,X]

    Jeff:----------------------------[1,1,1,1,0,4]

    Arnold: --------------------- [1,0,0,0,1,2]

    Bob: -------------------------[1,0,1,0,1,3]

    column sums: -----------[X,X,X,X,2,X]

    I'll stop here, to preserve mental health, if you reached here, big thanks!

    do you have any idea? let me know.

    I have a hunch that someone with a stronger background in linear algebra could come up with a way more elegant solution :\

    <3

    submitted by /u/BarbDart
    [link] [comments]

    why are methods (instance methods or class methods) not serialized, when an object is serialized?

    Posted: 24 Feb 2020 12:19 PM PST

    In Coulouris' Distributed Systems book about Java object serialization:

    To serialize an object, its class information is written out, followed by the types and names of its instance variables.

    I was wondering why the methods (instance methods or class methods) are not serialized, when an object is serialized?

    The book later says

    The use of reflection • The Java language supports reflection – the ability to enquire about the properties of a class, such as the names and types of its instance variables and methods. It also enables classes to be created from their names, and a constructor with given argument types to be created for a given class. Reflection makes it possible to do serialization and deserialization in a completely generic manner. This means that there is no need to generate special marshalling functions for each type of object, as described above for CORBA. To find out more about reflection, see Flanagan [2002].

    Java object serialization uses reflection to find out the class name of the object to be serialized and the names, types and values of its instance variables. That is all that is needed for the serialized form.

    For deserialization, the class name in the serialized form is used to create a class. This is then used to create a new constructor with argument types corresponding to those specified in the serialized form. Finally, the new constructor is used to create a new object with instance variables whose values are read from the serialized form.

    Does "reflection makes it possible to do serialization and deserialization in a completely generic manner. This means that there is no need to generate special marshalling functions for each type of object" means that reflection allows that

    • the deserializing program does not necessarily need to know the class/type of the deserialized object, and
    • can create its class/type from the serialized representation,
    • which requires serializing program to seralize both the object and its class/type?

    Thanks.

    submitted by /u/timlee126
    [link] [comments]

    Notes on linear transformations

    Posted: 24 Feb 2020 07:24 AM PST

    Sudoku: The compact version

    Posted: 24 Feb 2020 12:15 PM PST

    No comments:

    Post a Comment