« first day (931 days earlier)      last day (3100 days later) » 
00:00 - 19:0019:00 - 00:00

7:00 PM
Edge now works without crashing on my phone.
It is much nicer there than on my desktop.
Probably the best mobile browser I've used.
 
```
while (!fencedCodeBlocks) {
    monkey.bug(StackExchange);
}
```
Maybe we can get on that one after graduation is fully completed
@CaptainObvious OEN MOAR CLOZ VOAT
 
Zak
@Phrancis Done
 
7:18 PM
Do our guidelines anywhere describe that we are not expecting an SSCCE unlike SO does?
 
> Make sure you include your code in your question

This site is for code reviews, which are hard to do when the code is behind a link somewhere out there on the Internet. If you want a code review, you must post the relevant snippets of code in your question. It is fine to post a "see more" link (though, do be careful — very few reviewers will be willing to click through and read thousands of lines of your code), but the most important parts of the code must be placed directly in the question.
 
@Phrancis The JSON deserialization in question is the most relevant part of his code though...
 
Would include post code for deserializing JSON in your main? I think Vogel's point is that it lacked context as to what the real code is
 
I agree with that point, but I can see the reasoning of the OP as to why he posted it like this
 
7:29 PM
Well, there's always meta if OP wish to discuss/argue
 
0
Q: University Database

Hosch250I am building a database for a hypothetical university. This is my SQL definition, with generated data added for my future use, such as demonstrating queries: Create Table Semesters ( Semester varchar(6) Primary Key Not Null, ); Insert Into UniversityDatabase.dbo.Semesters Values ('Spring'...

 
@Phrancis I think that if we would change the wording of the guidelines a bit then we could prevent off-topic questions... But to test that we would first need to know if the OP actually read the guidelines before posting his off-topic question
 
^^^^^^ the latter point
 
@skiwi - sorry, only now realizing that you asked about automation in linux.
There are a number of schools of thought... and, it depends.
What are you automating?
I should also probably turn on notifications at some point again..... I disabled them a few months back.
 
If anyone catches something really serious in that database, I'll give a bounty.
@rolfl The time they woke your wife up?
 
7:41 PM
Nah, I turned off all notifications, e-mails, etc. when I stepped down as mod.
 
Oh.
 
@rolfl I don't know yet, all I know is that I'll be working (hopefully - if I get the job) with Linux servers in the future, and I've had some experience with them half a year ago
For automating continious integration builds I can live with Bash if it's mostly running commands, but once you start writing if statements, for loops or even more dangerous constructs then I get scared of Bash
 
@skiwi - in that case, do both. Learn all about shell scripting - bash is a good start. Then, also learn one of the management tools. There are 4.5 of them.
You will need to learn bash for anything you do related to Linux, so suck it up, be "a man", and make it happen.
 
Is there no scripting language like Python or Ruby that'd give better results?
 
People who program Python or Ruby would tell you that they are not scripting languages.
3
I tried to explain the "domain" of scripting languages to some IBM folk the other day, and tried to explain why it's different from something like Python.
Consider you want to run a python program that computes pi .... right?
You do .... what?
(your program is called mypi.py.
 
7:50 PM
python mipy.py
I guess ^^
 
Yeah, how did you run that?
From a shell..... right?
 
Right click and choose Run.
 
By "typing it in the console"
 
Now, instead of printing th eoutput to the screen, you want to attach it to an e-mail.
python mipy.py | sendmail -s "My value of PI" rolf@myaddress.com
 
That seems fine... yes?
 
7:55 PM
You are writing shell scripts.....
| is a shell concept, the calling of python is a shell concept the exit handling is python, etc.
 
Yes, but the logic happens in the Python script
 
No, it does not.
 
No, indeed
Why does the Python script not have the logic in it as well?
And let the script run shell commands
 
OK, now, you put #!/bin/python as the first line of mypi.py .... what does that do?
 
Then you can execute mypi.py directly
Via the python interpreter
 
7:58 PM
That's the shell (bash) doing it for you.
 
@skiwi You don't have to do that to execute Python directly.
 
@skiwi - if a file is excutable, and you "call" it from bash (./mypi.py) and it starts with the two characters #!, then bash will do the following:
- It reads the rest of the line after the #!
- It calls the program, with the specified arguments that happen on that line (in this case, /bin/python )
- it takes the rest of the file, and passes it as "standard input" to the program
That's why so many UNIXy languages use the # as a "comment" marker..... so that the #! line is treated as a comment line....
Time to cut some more wood.
 
Sorry was called away
Yeah I understand all of that... but I don't understand yet why Python should not be used for the logic over Bash, if I understand correctly
 
Ah, somebody is learning the might of the hashbang.
 
@skiwi Other than making things easier, the shebang makes your script's able to be called just like normal programs. Say you have foo and bar in your PATH, and say you wrote those in Python or Bash or something but you're not sure which. The shebang lets you call them just by naming them, regardless of which scripting language you used.or whatever else.
 
8:20 PM
Hello.
 
Hello.
 
Hi.
 
Hey.
 
8:24 PM
@skiwi - if you have a job you need to do, and there's a tool that already exists that can do most of it, and another tool that can do most of the rest of it, then all you need to do is "wrap" and "sequence" the two programs in to one script.
(wood cut).
You could do that via python, or ruby, but, it is HARD to do that correctly.
For example, I have to ensure that a system is correctly installed with "ansible" (an automation tool).
The process for doing it is to install python, then add a new repository to ubuntu, and then install ansible from that repository.
The user has to be root for the process to work.
That is a 4-line script in bash.
5 if you count the #!
#!/bin/bash
apt-get install -y python
apt-add-repository -y ppa:ansible/ansible
apt-get update
apt-get install -y ansible
 
Right, but that's just a bunch of linear commands, so not much reason to use anything different than Bash
 
And there you have it ^^^^^^ exactly - not much reason to do anything different.
 
But let's say you want to calculate normalized = sqrt(x*x + y*y)
 
But, the "problem", is that, if you have one script that can ensure ansible is installed like above......
 
If stuff gets a bit more complicated than that, then it seems reasonable to write some Python/Ruby script that takes it as input and outputs the result
 
8:30 PM
it seems reasonable, yes, but, you would be amazed at how, if you are judicious about how you create shell scripts, that you can get a better, faster solution.
So, if you are calculating something mathematical, use a mathematical language... but, if you are just running things, and organizing where the output goes, and checking to make sure things worked, then use bash.
Now, you may be surprised at a bunch of things that are unexpected.... like....
> ldd prints the shared libraries required by each program or shared library specified on the command line.
if you compile a program and it uses shared libraries, you can see what libraries they are by running ldd.
Guess what, it's a shell script!
 
So... shell scripts are awesome?
 
No, shell scripts are not just awesome, they are the right tool for many jobs.
Consider the program.... gunzip - it unzips a file.zip file
case $1 in
--help)    exec echo "$usage";;
--version) exec echo "$version";;
esac

exec gzip -d "$@"
 
@skiwi If your script is 99% scripting, but then you all of a sudden need something that Python can do you can call it with the -c switch. E.g.
x=2
y=3
r=$(python -c "from math import *; print sqrt($x*$x+$y*$y)")
 
You can also use C# scripting
Because you can
 
gunzip is a simple wrapper around gzip -d which pre-validates the arguments, and gives a custom help message.
 
8:38 PM
And, ergo, you should
 
Bash supports piping, backgrounding, stream redirection using a convenient syntax. In Python you can do it but have to use various APIs for this.
 
Hmm right, but what do we do about if or loop constructs in shell scripts? They seem very error prone
 
Heh, easy:
for i in `seq 1 100` ; do echo $i ; done
Notice that seq is a different command.
 
Bash has a dictionary based looping system. Notice that seq 1 100 just is a convenient program which generates an appropriate number of output arguments (100 arguments) in this case.
You could also write your own seq in Bash if you wanted. Use a while loop and the $((...)) syntax to perform arithmetic.
 
Yeah. @skiwi - a more complicated example, is the following "program" I recently wrote.
I needed to create a custom version of an Ubuntu CDRom that installs stuff that is not normally installed.
I cannot use some of the other "network based" systems out there.
There are existing tools that can:
- get an ubuntu image from the internet
- copy the contents of that image in to a different directory
- change those contents
- re-build the image with the altered contents
In there somewhere is pulling a complete git repository of stuff to "add".
So, should I just write a hundred lines of bash that does it all in sequence, or should I write a python program?
 
8:45 PM
The only uniquely error prone thing I found about Bash is the following
```
example=foo
echo "You entered $exmple"
```
In most other languages including C Shell, reading from the nonexistent $exmple would be an error. But in Bash it is assumed you wanted to create a new variable with an empty string.
 
I like csh for a bunch of things (tcsh actually), and I prefer many things over bash, but I got stuck once on a multi-pipe exit code that only bash could solve.
Anyway, @skiwi - despite what you may think, sure you cna do "everything" in python, but, if you use linux, you will need to learn bash anyway.
 
You can write whole bash/shell scripts as files and call from command also line right?
(not sure if "call" is the right lingo, but I'm sure you get what I mean)
 
that's pretty much how you typically use them
 
If your script is called foo then you call it with args a1, a2 and a3 like this
`bash foo a1 a2 a3`
Or add a shebang line so that you can write
`foo a1 a2 a3`
 
codereview.stackexchange.com — Bill Lynch just now
This question could be suitable for Code Review, as long as (a) your code works as intended, (b) your code is real code, rather than example code, and (c) your code is included in the body of the question. If you wish for a peer review to improve all aspects of your code, please post it on Code Review. — Phrancis 33 secs ago
 
8:56 PM
0
Q: An implementation for the double factorial

james42I have written this piece of code that implements the double factorial in Python both iteratively and recursively; the code works without problems, but I'm interested in improving my overall programming style. Here's the code: def semif_r(n): #recursive implementation if n ==...

 
I'm voting to close this question as off-topic because it belongs on Code Review. — Peter Wood 25 secs ago
This question has now been cross-posted on Code Review. — Phrancis 22 secs ago
 
@Hosch250 I don't know if I will see anything "really serious", but seeing some things that could be improved. I'll be posting a review at some point fairly soon, I'm having to make a few changes to your script so I can run it (I don't have CREATE DATABASE permissions so I'm moving it down to schema level)
 
OK.
 
9:13 PM
0
Q: 'cout' after 'strtok' in C++ doesn't work

Shashank SabniveesuThis code prints the 'line' initially read,as expected - std::getline(std::cin, line); line_array = strdup(line.c_str()); i = 0; tokens[i] = strtok(line_array, " "); do{ tokens[++i] = strtok(NULL, " "); }while (tokens[i-1]); std::cout << line << std::endl << std::endl; but not this (after th...

0
Q: Angular directive test

BakiI'm learning how to write tests in Angular (these are my first tests in general). There are a lot of tutorials out there but each one of them has a different approach. I'm a bit confused if I'm doing things the right way. I made a simple directive for testing purposes and I've called it tooltip ...

 
I don't think you will find anything really serious either, BTW.
BTW, are you on your work computer or you personal computer? I would think you could use Create Database either through SQL or through the GUI context menu if you were on your personal computer.
BTW, Bing updated their algorithm. Searching 'connect' used to pull up McGraw-Hill's Connect site, but it doesn't anymore.
 
This is the worst celebratory firework ever
 
I'm trying to teach it to bump it higher. Maybe it'll do it again in a couple months.
@JeroenVannevel What is?
 
The first shot sounded like an explosion because it was a very low sound with an abrupt ending and no followups in the first minute
@Hosch250 Firework that I hear but can't see
 
Maybe a gun?
 
9:17 PM
Barcelona won El Classico a few hours ago
 
Oh, OK.
 
@Hosch250 I'm on home computer, running on someone else's instance that they let me use a database catalog on. On my work PC (which I don't have right now) I could just run it on localhost though
 
You can get SQL Server Express for free, if you want your own instance.
 
Not on a Mac ;)
 
Maybe you should partition your disk and get a Hackintosh.
I've heard they are really good.
 
9:20 PM
Meh, my disk is too small as it is :\
 
My mom just upgraded hers.
She got a bigger SSD than her previous HDD.
She also upgraded her RAM.
 
Oh crap, I just realized I have 40 GB partitioned to BOOTCAMP that I was going to use ages ago
No wonder I'm so low on disk space
 
Anyway, I've got some finance work to do. TTYL.
 
Have fun with that
 
Have you ever heard of Code Review ? — Yassin Hajaj 16 secs ago
 
9:24 PM
jvns.ca/blog/2015/10/31/… I'm really enjoying this blog, take a look at it
 
@Duga yeesshhhh... it's ugly, that would not be well received as it is
 
This question would not be well received on Code Review in its current state. The author would want to include a plain English explanation of what the code does, and that it does it correctly. Also, a title that says something about the code in a few words, as the desire to improve code is implied on all questions there. — Phrancis 31 secs ago
 
0
Q: insert method in binary search tree java

JW2I am having trouble understand what my professor wants. He provide me this code and ask us to complete //TODO portion. Which I do, but the code has errors and does not compile. Then I email him and he said I need to import a library and create another class. But I believe half the node class is i...

 
@CaptainObvious broken
 
9:41 PM
@CaptainObvious Closed.
 
@rolfl Hmm okay, I think I'll try to adapt to survive then
 
@skiwi - don't lament. You will discover that you will like bash. It really is an enabler, not a hinderance.
 
Bash is awesome.
 
I'm first going to bash my head onto something before I like bash
2
 
@skiwi What do you use instead of Bash
 
10:00 PM
0
A: Reading from file, changing characters and writing to another file with FileInput/OutputStream

WorldSEnderI propose the following improvements (see below for some explaination): import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; public class Codigo extends Codificador { @Override void codifica(String[] args) { File file...

 
10:11 PM
@skiwi Stop bashing bash
hahaha
haha
haaah
:-)
 
You're funny, for a Belgian.
5
 
Sticks and stones may break my bones but we're number one on the FIFA ranking so suck iiiiiiiit
4
 
Greedy algorithms are still difficult, their reasoning seems so circular
 
1
Q: Decide if 4 lengths form a square, rectangle or neither?

sadpandaSo I have a list of lists of 4 integers, each representing the length of one side of a tetragon in clockwise order (so each number is the length of the side of the right-hand-adjacent-side of the previous one). Integers can be negative or positive or 0. My idea is that if any of the sides are l...

 
11:08 PM
-2
Q: Cant get the circumfrance method to work (OOP)

UniverseThis may seem a newb question but how do i get to get the .circumfrance question. Thanks. import java.util.*; import javafx.scene.shape.Circle; public class Checking { /** * @param args */ static ArrayList<Character> rowsandColums = new ArrayList<Character>(); static Ci...

 
@CaptainObvious the what?
 
0
Q: Infinite patterned ASCII dice

Joe WallisAfter seeing Pretty print dice faces from multiple rolls of multi-sided dices, I decided to make an infinite ASCII dice generator. There was one requirement, it to follow a normal dice face. And so I decided on making two classes, the Dice and Rings. Dice outputs the ASCII dice, holds the rings,...

 
@Phrancis What is really interesting is that they spelled it correctly in part of the code...
 
11:40 PM
 
00:00 - 19:0019:00 - 00:00

« first day (931 days earlier)      last day (3100 days later) »