Computer Science: Theory and Application

Subscribe to Computer Science: Theory and Application feed
Computer Science Theory and Application. We share and discuss any content that computer scientists find interesting. People from all walks of life welcome, including hackers, hobbyists, professionals, and academics.Computer Science: Theory and Application
Updated: 11 min 46 sec ago

Senior project

5 hours 9 min ago

Guys in your senior project, what did you put in the presentation?

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

Visual UI for calculation functions

5 hours 35 min ago

I would like to implement sum of two step-functions.

To calculate for every number, would be tedious.

Is there a tool which can generate function and calculate for you with UI input and output ?

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

Compression Algorithms

8 hours 46 min ago

Hey! Does anyone have any video file compression algorithms that I can use for a research paper on Computer Science? I'm looking at the different effects of compression algorithms on one video file. As many algorithms are appreciated, just as long as there are no restrictions on copyright and that they are free to use. Thanks!

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

Does anyone have the chaiOS HTML?

Wed, 01/17/2018 - 22:51

chaiOS is an iOS exploit that was recently discovered. It was a webpage that that caused iPhones to shutdown and start heating up if you sent them a link to it in a text message. The website was hosted on GitHub by the person who discovered it, but it has since been removed and returns a 404 now.

I was interested in seeing the source code. Does anyone have a copy of it, or know how it works? I'm trying to wrap my head around how a piece of HTML can do that much harm to what's supposed to be a high-end commercial operating system.

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

Entity Relation Diagram Check

Wed, 01/17/2018 - 22:45


I've been trying to create an entity relation diagram which follows these instructions.

Here is my attempt.

I apologize for the chicken-scratch in advance. If it is too hard to read, please let me know and I will redo it so that it is easier to read.

Any advice is appreciated.

Thank you for your help

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

Help verifying Linear Congruential Generator uniqueness for user ids

Wed, 01/17/2018 - 21:46

Id requirements:

  • Short (# of characters for user to type)
  • Allow as many ids as possible
  • Seemingly random (so no one can easily guess user count by id)
  • No mixed case characters (easier for user to type)
  • No swear words generated


So I've chosen to go with a 6 character upper-case string, without vowels generated by a linear congruential generator sequenced on the user count. I learned about LCGs from wiki, and I would like to verify that my code is correct as I made up the coefficients in the LCG myself and would hate for there to be a collision of ids. I tried testing for collisions myself, but I ran out of heap space when storing the ids in a map after 2 million. I think the math checks out, but really would appreciate a second (or thousand) set of eyes. (Also not really that experienced with JS so if there's a more efficient way of swapping out the vowels, would love to know).


// UserId generated from stored userCount key in redis, sequenced by a Linear // Congruental generator, and stringified with a radix of 31 (all numbers and // letters besides vowels = 10 + 26 - 5 = 31). // // The equation we will use to generate the sequence is: // userVal = (a * userCount + c) % m + minVal // To guarantee each userId is at least 6 characters, we need: // minVal = 31^5 = 28629151 // // To guarantee that our userId is at most 6 characters, we need: // log31(minVal + maxVal + 1) = 6 // => 31^6 = minVal + maxVal + 1 // => maxVal = 31^6 - minVal - 1 = 858874529 // // So our LCG needs to have: // 1) m < maxVal // 2) m and c relatively prime // 3) a-1 is divisible by 4 if m is // 4) a-1 is divisible by all prime factors of m // // m = 858062848 = 2^16 * 13093 // c = 1 // a = 3351809 = 2^8 * 13093 + 1 // // This means we can support 858062848 unique userIds (>850 million). // If we ever cross that amount, it will be a good problem to solve :) this.getUserId = function(){ var userCount = Spark.getRedis().incr("unique-id:user"); var a = 3351809; var c = 1; var m = 858062848; var minVal = 28629151; var userVal = (a * userCount + c) % m + minVal; return userVal.toString(31) .toUpperCase() .replace(/A/g, 'V') .replace(/E/g, 'W') .replace(/I/g, 'X') .replace(/O/g, 'Y') .replace(/U/g, 'Z'); }; submitted by /u/fnayr
[link] [comments]

Reducing a set of numbers to one number that can be reversed?

Wed, 01/17/2018 - 16:22

I'm not sure where to ask this because it doesn't necessarily pertain to CS directly, but in the context of my problem it does.

Let's say I am given 5 unique numbers I need to retain for later, but I cannot store them directly. The only way I can store them is by combining them into a single number using basic operations. Is it possible to do this such that the single number can be disassembled to yield the original 5 numbers? If not with basic math operations, is it possible otherwise?

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

Nervous for school

Wed, 01/17/2018 - 13:14

Hey Everyone I just completed my first semester of comp sci, really enjoying it and I have a decent gpa (3.20/4) I'm really nervous for semester 2 though, I just barely scraped by java 1 with a 65 in the class and bombed my final really hard (40%), only reason I passed was cause I got 80 on my other tests, I just can't seem to grasp classes and objects and it's really worrying me for semester 2(java 2) I've been trying to learn with YouTube and such before next semester starts but that's only a week away, any tips? Thanks.

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

AI or HCI?

Wed, 01/17/2018 - 06:58

Hey everybody,

I'm currently a Computer Engineering student (completed my second year but currently on a break due to some health issues). I'm trying to get into a specialization in this field, however due to the vast number of specializations, I'm having a hard time trying to figure it out.

I've managed to narrow down my choices to two : Artifical Intelligence & Human-Computer Interaction. However for the love of God I'm unable to decide which to pick.

I'd really be grateful if someone could help me out here. Thank you.

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

Algorithm Advice

Tue, 01/16/2018 - 21:37

So, I just started learning Java and I was wondering if anyone had just some general advice for coming up with algorithms, like maybe ways of approaching/ thinking about the problem? It's an area I'm having a little difficulty with. Thanks!

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