« first day (1515 days earlier)      last day (2926 days later) » 

12:00 AM
I do not know how should it help.
 
own node?
 
Yout representation of data in graph, linked list etc.
function node(data)?
 
am using node in linked list
 
Yes, but not in queue ;)
 
List.makeNode=function(){
 	return {data:null,next:null};
};
queue is implemented using array
/*
	FIFO array
*/
function Queue()
{
 this.stac=new Array();
}

Queue.prototype.dequeue=function(){
  return this.stac.pop();
}
Queue.prototype.enqueue=function(item){
  this.stac.unshift(item);
}
 
12:04 AM
Yes, and I proposed to use named object, to apply prototypes later, and the code you pasted - wrapper over Array
So one day, try to write it without Array ;)
 
named object, you mean object literal?
Can you show me code snippet? what is the advantage?
 
No, named function node, to literal you cannot apply prototype
And adding prototype to Object is very bad idea
function node(data) {this.data = data;} and then node.prototype...
 
ok
What is the advantage of using node to implement queue?
 
Oh, you will actually implement it - this will be advantage to DS course, for usage - it might be slower.
If you write sorting, [4, 2, 8, 1].sort() works, but this is not the same as writing mergesort
And there are more good reasons to write own sorting - like the built-in uses strings out-of-the-box...
 
12:24 AM
ok
 
12:38 AM
@overexchange fast questions: how are variables passed to the function? What prototypes new Object(null) has? What prototypes {} has? What is [] + {}? "3" + 2? "3" - 2?
 
am writing an email
will be bak
 
12:51 AM
variables are passed by reference
new Object(null) object has member __proto__ that points to null
{} has member __proto__ that points to Object.prototype
[] + {} I dont know. what is the implicit type casting? Does it work?
"3" + 2 is "32"
"3" - 2 is 1
 
No, by value copy. No Object.create(null) has no prototype, the ones I gave are equiv and both are using Object.prototype
[] + {} = 0, obviously ;]
 
yes by value copy for primitive datatype objects and by reference for non-primitive type datatype
 
no, they are copied also by value
 
Ask tough question these are easy
no they are not
 
Man, they are copied by value copy, which in reference type is copy by value of the reference
Hence you cannot change this - it would be by reference
 
12:59 AM
[] + {} = "[object Object]"
 
You should add environment and context, because it depends. Quirky, just wanted you to know
So, type casting and overloaded "+" you know, try Object.create(null) this is empty object without prototypes.
Unfortunately in JS everything is copied by value, reference is copied by value (so you have got copy of the pointer, but you cannot change itself when passed to function)
Otherwise function changeMe(d) {this = [];} would change your object to array
Like with [[[5]]] + 4
There are strict rules how types are casted, but this is not symmetric and not always obvious (some people say)
Chrome console behaves differently than Firefox console, than node.js and actual code run.
@overexchange and I am pointing this out because the most of the time people fall for quirks, ask themselves why code is not working or really furiously change language. Also for some reason people really love pointing this out or make questions on interviews strictly from all this documented but not commonly known behaviours
It is like in C, "text"[2] or some array int W[10], 2[W] works, yes?
Good to know why, not exactly easy to read.
 
1:31 AM
My bad, I see it now
[] + {} is different from {} + []
You are right, [] + {} is "[object Object]", {} + [] = 0
 
 
2 hours later…
3:13 AM
why no LaTex on the chatroom?
 
3:23 AM
3
Q: Vertex Disjoint Path Covers of Hypercube-Like Graphs

user340082710This is a followup question relating to an older question I posted, namely: Decomposing the n-cube into vertex-disjoint paths. Given a graph $G = (V, E)$ and sets of distinct vertices $S = \{s_1, \ldots s_k \}$ and $T = \{t_1, \ldots t_k\}$, I am interested in finding a vertex disjoint path cove...

 
 
11 hours later…
vzn
2:43 PM
@overexchange hi! congratulations! leads to so many questions! so have you been out of india before? what is your thinking on leaving? you dont have a job or prospects yet right? do you know anyone else who has moved there? do you just want to work outside of india & try to keep advancing into elite companies? etc
 
Google Doodle celebrating the 100th anniversary of Claude Shannon's birth, today: g.co/doodle/c7n746
 
 
3 hours later…
5:26 PM
@vzn Idea is to enter into UI market of CANADA. I have friends and relatives in canada unlike NZ
 
vzn
5:59 PM
@overexchange so eg web dev? HTML? js? etc? good choice :)
 
@vzn Hey
Are you familiar with coding theory?
 
vzn
@overexchange where is that?
@Evinda somewhat... more school assignments? :|
 
Yes... With Reed Solomon codes? @vzn
 
vzn
@Evinda just ask
@Evinda @overexchange plz +1 this needs tiny )( help :) meta.cs.stackexchange.com/questions/1195/…
@EvilJS {} is a hash. [] is an array. or did you know that? you guys might look into json obj notation for some feel for this area
JSON (canonically pronounced /ˈdʒeɪsən/ JAY-sən; sometimes JavaScript Object Notation) is an open-standard format that uses human-readable text to transmit data objects consisting of attribute–value pairs. It is the most common data format used for asynchronous browser/server communication (AJAJ), largely replacing XML which is used by AJAX. JSON is a language-independent data format. It derives from JavaScript, but as of 2016, code to generate and parse JSON-format data is available in many programming languages. The official Internet media type for JSON is application/json. The JSON filename...
 
I want to find the generator polynomial for the following code and its dual: Reed Solomon with length $3$ and dimension $2$.
We have $q=4$. We pick as $\alpha$ a n-th primitive root of unity.
We get that deg g=1, where g is the generator polynomial.
Then we have that $g(x)=(x-\alpha^{a+1})$. Is it right so far? Is the following the generator matrix? $\begin{pmatrix}
0 & 1 &-a \\
-a & 1 & 0
\end{pmatrix}$ @vzn
@vzn Ok , I gave you +1 :D
 
vzn
6:09 PM
@Evinda =D thx much
are you using an online ref for the reed solomon study?
are you still undergraduate or are you now graduated? youre in greece right?
 
@vzn I have a book in an online version. I have graduated. Yes.
 
vzn
what book? is the online version free? wikipedia has pretty good intro
Reed–Solomon codes are an important group of error-correcting codes that were introduced by Irving S. Reed and Gustave Solomon in 1960. They have many important applications, the most prominent of which include consumer technologies such as CDs, DVDs, Blu-ray Discs, QR Codes, data transmission technologies such as DSL and WiMAX, broadcast systems such as DVB and ATSC, and storage systems such as RAID 6. They are also used in satellite communication. In coding theory, the Reed–Solomon code belongs to the class of non-binary cyclic error-correcting codes. The Reed–Solomon code is based on univariate...
apparently there are many different generation schemes. 1st question is if you are using the original version.
 
Coding theory , A First Course of Ling and Xing. Yes, it is free. Here there is an example:
@vzn
 
@vzn I knew that, I wanted to check if overexchange knows dynamic type casting in JS.
 
vzn
 
6:22 PM
I will send you the link, wait a minute! @vzn
 
vzn
@Evinda my suggestion is to learn the basic theory and then ask questions about the theory instead of asking about the assignment. & try to relate the assignment to the theory.
 
@vzn I have read the theory...
 
vzn
ah and do you understand it now? afaik there are all kinds of different generator matrices. eg wikipedia mentions vandermonde matrices etc
 
I have sent you what I have tried, but I don't know if it is right :/ @vzn
 
@vzn I am not sure if Vandermonde is ok
Kinda overkill
 
6:26 PM
Have you also seen what I have tried? @EvilJS
 
vzn
@Evinda ok thx but that is pirated :(
Library Genesis or LibGen is a search engine for scientific articles and books, which allows free access to otherwise paywalled content. Among others it carries PDFs of content from Elsevier's ScienceDirect web-portal. In 2015, the website became involved in a legal case between it and Elsevier where it is accused of providing pirate access to articles and books. LibGen is reported to be registered in both Russia and Amsterdam, making it unclear which legislation applies, and whether defendants will show up in a United States court hearing. LibGen is blocked by a number of ISPs in the United Kingdom...
anyway the book looks good but maybe a bit theoretical for students.
 
Have you seen the example that I had sent you? There the code is narrow-sense. Can we assume it also in this case? @vzn
 
@Evinda sorry, no. I was lured by vzn, how could I not knew JSON, beyond possible :-/
 
I want to find the generator polynomial for the following code and its dual: Reed Solomon with length $3$ and dimension $2$.
We have $q=4$. We pick as $\alpha$ a n-th primitive root of unity.
We get that deg g=1, where g is the generator polynomial.
Then we have that $g(x)=(x-\alpha^{a+1})$. Is it right so far? Is the following the generator matrix? $\begin{pmatrix}
0 & 1 &-a \\
-a & 1 & 0
\end{pmatrix}$ @EvilJS
 
vzn
@Evinda is that book the one assigned by the instructor? is this a coding class?
 
6:32 PM
He suggested it... Yes.... @vzn
 
vzn
@Evinda so there isnt a standard assigned book for the class? what is the title of the class? am thinking schaums guides or "essentials" guides might be better for basic exercises. looking at that
(interesting cybersynchronicity to be thinking about this problem on shannons btd)
 
He follows this book. Coding theory. @vzn
 
N-th root of unity, Vandermonde, mhm, someone is using DFT ;)
 
DFT ? @EvilJS
 
N^2 FFT
 
vzn
6:49 PM
@Evinda the question seems to make assumptions about which encoding scheme. there are many
 
What do you mean with encoding scheme ? @vzn
 
vzn
7:21 PM
just won/ lost a chess game. 1st game in ~7x2 moves. :|
 
@vzn what?
 
vzn
@#$& schaums lame web site & doesnt even have tocs on it but think this book might be helpful, looking for toc mhprofessional.com/details.php?isbn=0071402284
if you just want to go thru school solving exercises, there may be other approaches than learning lots of theory
 
@Evinda I did my time with error coding, I even used on almost daily basis, and to be honest I find myself as person with need to upgrade math knowledge - but back in this subject, I did not even bothered myself with plenty of books
I got course, lecture notes, several books, and did not bothered back then to read them all, but upon trouble - this is perfectly what should be done.
It was rather straightforward. Anyway, with lack of help (internet, dozens of online courses and beautiful books) it was something managable.
I mean, yes everybody is different and with different needs, but I do not find solving questions from your course twice a week helpful.
 
vzn
@evinda ok heres the toc on amazon "look inside" see ch11 "error control coding" maybe its close? this has many solved problems/ examples. amazon.co.uk/Schaums-Outline-Analog-Digital-Communications/dp/…
 
Not helpful to you anyway. Very ancient but working idea is to do excersises, encode something, understand, compare, but pletora of having tasks solved proved until now that e.g. Yuval is perfectly capable of solving this tasks, but with his generous help, you still are not.
So it is really high time to change learning style.
And I understand that something is not straightforward - but I do not belive that virtually every task is problematic.
If so, maybe asking teacher for help, taking his office hours? More tasks solved on your own?
 
vzn
7:37 PM
@evinda have also used REA "essentials" guides a lot, was just using one. looking rea.com
 
In some good mood I can solve your tasks, what is next? I know how to solve them, you still don't - this is not the best help anyone would offer.
 
vzn
@EvilJS think that edu is often unnecessarily complex. think evinda should be able to handle the tough(er) refs in grad school but her ref seems a bit theoretical for her
 
We haven't solved exercises in class... But understanding the ones that I ask, I will be able to solve similiar exercises...
 
@vzn I know, maybe I am over(something almost polite form of nagging) but I was studying more than I live (taking simultaneous courses on CS and Psy speeded up) and I know that students are really taking shortcuts here and there.
And excersise solved by known scheme - I have been there, worked as charm, and after studies I ended up needing this knowledge - I had to work it out on my own again. If scheme by similar task was not available - I would have learnt it properly [...]
 
8:04 PM
@vzn until I am proved wrong I thing this is cummulative, progressive shortcuts which ended up badly.
 
8:25 PM
@vzn I already received projects from yesterday, of course not all, but I was thinking how from command line one would easily give variable to change. One input is line_number name, another is function_name name etc. There are solutions that are cumbersome, neat, non-obvious covering more than I expected asking if this is good direction. Whoa, and they even covered define refactoring ;}
Keywords table, hint that define change breaks the code etc.
 
9:06 PM
@vzn you lost in chess in 14 moves?
 
vzn
@EvilJS won 1st game in ~14 moves. being challenged by a budding 12yr old prodigy. he won the 2nd game.
@EvilJS evinda somehow got into masters program without having to dig deep into the theory. re "shortcuts", a very loaded phrase. good or bad? depends on the context. reminds me of a story when was a freshman in engr from an age ago...
@EvilJS suggest you at least discuss concept in class of different decompositions of the same problem, how even though functionally equivalent, some are a "mere" matter of taste/ style, but sometimes, the differences are noticeable or more substantial, esp over time if the code exists for a long time.
 
9:36 PM
@vzn yup, you are right
I was thinking about Project Euler - all tasks seems to be solvable by programming but only some are math elegant. I cannot tell if I forgot something or it was never point to be solvable by hand?
There are sites like UVA, SPOJ, PE, topcoder and others, which are obviously programming contests, but PE is a bit different - at least first 100 tasks are below 20 lines of code solveable, but they are not constrained by efficiency, approach or other measures. What is the purpose?
I have read "about" section, registered there, solved some tasks, but I do not see the whole picture. And it is stated that math is not enough.
 
vzn
9:58 PM
@EvilJS am curious about project euler myself, it seems not that old & poked around once & didnt see a lot of info. think its a great idea overall.
@Evinda wasnt able to find a nice easy ref on coding theory, apparently its only covered in advanced refs. saw another intro book on it, there are many books on topic. however this turned up, cites nice refs at end. drdobbs.com/testing/error-correction-with-reed-solomon/…
the overall problem seems to involve GF arithmetic at a minimum.
this ref by haiman tuned up via google seems nice/ concise. ex 11 at end seems close to your question. math.berkeley.edu/~mhaiman/math55/reed-solomon.pdf
 
Hey, can somebody help me with a logic problem in C?
 
vzn
EJS just found this neat link/ profile on project euler
 
10:16 PM
If anyone is familiar with C, I've got this seemingly logical function that appears not to follow its own rules, so to speak.
Here's a clipping of the lines:
http://i.imgur.com/JiNBOJT.png
 
Why do you use declaration one line above the definition? Do you intentionaly use "," instead of ";"? ok declaration only.
Sorry, picture is not fitting mobile screen. Anyway, what seems to be the problem?
 
So its a Tic-Tac-Toe program, right?
When ever you place your marker on the middle space or corners (except for the top-left corner for some bizarre reason), it will automatically return a 1.
In this function, returning a 1 means someone has got tic-tac-toe diagonally (i.e.: they've gotten 3 in a row through a diagonal).
This will happen regardless of whether the condition of the if statement has been met.
Which makes almost no damn sense.
 
Could you remind me the operator precedence of logical "or"?
What do you feed to the function?
 
A 2D array that represents the game board
Here's what the problem looks like in a functional sense:
http://i.imgur.com/vv2XTqS.png
 
Ok. Looking at the code you provided: superflous "(1)", and declaration, but it just adds up cells and lazy evals condition, hard to fail it.
So X, Y and empty are values?
 
10:29 PM
What do you mean by that?
 
What do you return when it was not the tested case?
X = 1, Y = 2, _ = 3 or something?
 
It does really return anything.
 
Your function returns the integer. But not in all cases - that is a flow.
 
As far as I'm aware, that's not a problem.
 
If you are testing something != 1, it is.
 
10:34 PM
Yeah, you were right. Thanks man.
 
If the function returns some value sometimes, and the test of the return value is not conclusive : it was either 1 or 2 (for example), the random output and != 1 test fails the most of the time.
 
Right. Cool.
 
This image posting services are getting worse - I try to read and some ad is bouncing on screen... on mobile =.=
 

« first day (1515 days earlier)      last day (2926 days later) »