« first day (633 days earlier)      last day (3377 days later) » 

4:00 PM
ehh... what if they have only a single element??
 
@Simon - you may find this meta post interesting: meta.ux.stackexchange.com/questions/1773/…
 
hmmhh
writing good javadoc is hard
 
3
Q: An algorithm that finds the number of "lined up columns"

Buk LauI found this question in an old exam in computer science. I solved it in a good way, but I'm not convinced that my solution is the best solution, I believe that there's a better way to solve it. Here's the question: Given N Columns that are lined up, The horizontal distance between two adjacent...

 
@Pimgd Also in that javadoc there should have been note of that it uses the filter predicate, the concrete instantiations indeed to have such note attached
 
@skiwi Documentation that doesn't say anything is one of my peeves
it's the other direction of sloppy coding; checklist coding
 
4:07 PM
Refactoring and documentation is a dangerous combinations
 
/**
 * Returns whether there is a next log entry.
 *
 * @return  Whether there is a next log entry.
 */
boolean hasNextEntry();
I hate things like that the most, but I'm still thinking what to put there.
public class NotReadableException extends Exception  {
Yaaay
I found an edit scar
 
@rolfl thanks, much appreciated
@Pimgd I usually go with @return True if there is another log entry, false otherwise
 
@SimonAndréForsberg ah yeah
Instead of stating the same thing twice, state it in a different way
...
(Not sarcasm!)
 
As said though, writing good JavaDoc is not easy
But there's not really anything else I can come up with for such a one
Also, I'd write it as "Returns whether or not there is a next log entry".
 
I'm also wondering why NotReadableException is thrown when there are no EntryParsers
 
4:18 PM
Isn't "false" otherwise assumed?
 
0
Q: regex to parse URIs for their correctness according to rfc 3986 | code correctness

dot_Sp0TI recently came to write a regex to parse URIs. Now I wonder, did I miss something? Did I make a mistake or could I have written it cleaner? That's why I'm here. In order to write the regex, I took the following paper as a reference http://www.ietf.org/rfc/rfc3986.txt (together with some Wikiped...

 
"returns true in condition x" ... And also returns true for every other condition...
 
@nhgrif I guess it is. Can't think of a better javadoc though
 
I was surprised for a moment to see that the question already had 1000 views (new badge), then I realized it was for another question :p
 
Why is there one com.github.skiwi2.hearthmonitor.logreaders and one com.github.skiwi2.hearthmonitor.logreader package? What's the difference between them? They sound way too similar IMO. — Simon André Forsberg 4 mins ago
eww
I didn't even notice
 
4:22 PM
Welp, Apple uses "otherwise false" in their docs too...
 
I prefer with "otherwise false"
 
@SimonAndréForsberg One contains the base API and the other one contains the concrete log reader instantiations... Also the question had a typo and the former package is called com.github.skiwi2.hearthmonitor.logreader.logreadersskiwi 46 secs ago
 
Why not make it a read only instance variable? Can Java do calculated variables?
Nevermind...
Java doesn't really have properties like some other languages have them.
 
@nhgrif make what a read only variable?
Java has getter methods
 
Monking
 
4:31 PM
monking
 
0
Q: Create table in cassandra

AkavallI am complete beginner to cassandra, and here is my simple session on creating a table, it seems to be working, but am I doing something that is a bad practice in cassandra here? In [49]: from cassandra.cluster import Cluster In [50]: session = cluster.connect() In [51]: session.execute("CREAT...

 
-2
Q: Flag declined for migrating to CodeReview

BoluI met this question yesterday, and vote for close as I think it's more about code review: Closing >Off Topic>Other>"I'm voting to close this question as off-topic because this belongs on Code Review" My reason has been converted to a comment (get deleted now), and the question eventually ...

 
As a member on Code Review, thank you very much for not migrating this! — Simon André Forsberg 1 min ago
@Bolu You are correct; there is no option for you to vote to migrate a question to CR. It is therefore all the more unsurprising that when you voted to close the question, it wasn't migrated to CR. — Servy 6 mins ago
what is he trying to say here...?
 
4:49 PM
A getter method is kind of different from a read only property. Functionally it's basically the same.
 
@SimonAndréForsberg That the user had no reason to think that the question would get moved to CR, because there's no migrate to CR option available for users
 
5:02 PM
0
Q: Code Prettify CSS template

PhrancisI've been working on implementing Google Code Prettify and finally got it to work correctly. You can see my test file here to see what it looks like. I worked from a template and tried to improve it. There is a lot of HTML boilerplate code that apparently is needed (mostly JavaScript links). I t...

 
@CaptainObvious About time!
 
0
Q: Async Scheduler

DaveI wrote a header only scheduler which schedules a task to be run in the future on another thread. #pragma once #include <thread> #include <mutex> #include <condition_variable> #include <future> #include <functional> #include <chrono> #include <vector> #include <memory> #include <algorithm> #incl...

 
@Malachi In case you're interested in CSS question see above. Not sure if you got your badge yet.
 
@Phrancis I'm doing it.
 
5:19 PM
0
Q: Immutable Queue in Java using an Immutable Stack

NarutoI am new to this Immutability concept and I have some coding experience in JAVA. Recently as a part of internship program, they gave me a 5-day task, which was to implement Immutable Queue. After some research I came with a solution which was given below. Can some review the code and tell me wher...

 
WOM
 
?
 
@Phrancis Done.
Be back in a bit.
 
Ok, I was mostly hoping for a review on the layout of the CSS, is it human-friendly etc. but thanks for pointing out those errors I will fix them
 
WOM -> Write Only Memory
I have 4 terabytes of it on my android phone.
 
5:23 PM
wat?
 
It's memory you can write to, but never read from.
 
What use is that??
 
About as useful as an Immutable Queue.....
2
 
hmm... maybe graphic output buffers?
 
Seriously ...?
Write-only memory (WOM) is the opposite of read-only memory (ROM). By some definition, a WOM is a memory device which can be written but never read. Since there should be no practical use for a memory circuit from which data cannot be retrieved, the concept is most often used as a joke or a euphemism for a failed memory device. The first use of the term is generally attributed to Signetics in 1972. Signetics published some write-only memory literature as the result of an inside practical joke, which is frequently referenced within the electronics industry,a staple of software engineering lexicons...
 
5:29 PM
wtf
Travis doesn't schedule builds properly, the build for the last commit ran before the build for the before last commit
 
I'm not sure what I would do if someone asked me to implement an immutable queue, but one thing is for sure, I would definitely start questioning the assignment if a bunch of my methods were throwing exceptions like that...
 
So it actually uploaded the wrong snapshot to sonatype
 
I have written "went wrong" because the there is yet something missing from this part of code which makes it actually immutable. And I can't figure it out. So i was asking for some help from you — Naruto 1 min ago
non-working...
 
No offensive to the person in that question, but I'm glad he didn't get selected for the next round
Imagine the horror if people who write such code get selected for the next round
 
@Vogel612 what do you think of this
 
5:32 PM
in TCG Creation, 10 secs ago, by Simon André Forsberg
perhaps you pushed too quickly. Now I suddenly understand the saying "Don't push it"
 
fracche, You can delete this question, and repost it on Code Review, personly I think your question is on-topic there, but please check all the rules before posting there. — Bolu 37 mins ago
 
hope they formulate their question better over here @Malachi
 
should I flag that comment?
 
no why?
what reason do you have?
 
People are still talking about that question? Surprised it's not been nuked yet.
 
5:34 PM
@Vogel612 I don't think that it really is as non-working as it might sound like. I won't VTC that.
 
It's not working the way OP wants it to work...
 
59 mins ago, by Grima Wormtongue
-2
Q: Flag declined for migrating to CodeReview

BoluI met this question yesterday, and vote for close as I think it's more about code review: Closing >Off Topic>Other>"I'm voting to close this question as off-topic because this belongs on Code Review" My reason has been converted to a comment (get deleted now), and the question eventually ...

 
if you won't, fine by me. I'll stand by my vote
 
@Vogel612 just because it isn't totally immutable doesn't mean that it's not working.
 
0
Q: Pure Python script that saves html page with all images

micgeronimoHere is pure Python script that saves html page without CSS but with all images on it and replaces all hrefs with path of image on hard drive. I know that there are great libraries like BeautifulSoup and others but I would like to try myself with pure Python. Please review this code and provide...

 
5:35 PM
no... but it's not working as intended @SimonAndréForsberg
 
btw... this explains it all...
> I am new to this Immutability concept and I have some coding experience in JAVA.
 
ya looks like it..
 
Note: as a moderator on Code Review, I would suggest you improve your code significantly before posting it to Code Review. Over there, we review the actual code you post, and your code here has some obvious and significant problems (starting with the println in the tight-loop). Even though performance problems are on-topic on Code Review, you will likely not get answers that go to much more detail than "don't do println's in performance-critical code". Code Review is supposed to be for code that is well tested, and 'ready for release'. — rolfl 32 secs ago
 
Thanks for the question, @Phrancis. I'm halfway to an HTML bronze badge answer wise.
 
@Vogel612 the OP wrote this in the question, but removed it, I think it might be related:
> /* Immutable Queue is Implementd using two Immutable Stacks / / A backward ImmutableStack is used to deal with the dequeue operation to provide less time to reverse the Stack / / If say we enqueue a 1000 elemnts and dequeue 2 elements the second dequeue operation is not efficient but the following 998 dequeu are efficient / /
> Reason: Every element is pushed on the backward stack once,popped off the backward stack once and pushed on the forward stack once and popped off the forward stack once */
 
5:39 PM
And slightly over halfway vote wise.
 
a 1-rep user editing a 21.8k user's code. Nice try.
4
 
link?
 
@SimonAndréForsberg That's hilarious!
 
@Bolu please feel free to stop by Code Review and check us out, maybe review some code or post a question or two, we would love to show you what we are all about. maybe even stop in for some chat at The Second MonitorMalachi 5 secs ago
@SimonAndréForsberg especially that user!
 
6:13 PM
0
Q: Select some indexes in a list of lists

TorbjørnI have a record type which holds a list of table rows. Each row is also a list. The first row is assumed to be the header row. In addition the type optionally defines a filter - a list of columns (the actual string value of the column header). Then the type have a member property FilteredRows. I...

 
This proposal is in: Commitment
A successful site needs people to commit to use it. This proposal is 100% complete.
Committed users will be invited to the private beta soon.
vi/vim ^^^
 
Nice!
 
hi fellas
 
hi feller
 
hey @janos
 
6:26 PM
@rolfl yeay!
 
It's never certain though..... ^^^
 
0
A: new StringBuilder is really needed?

Simon André ForsbergI'd just like to make a slight change to the code. When you are instantiating a StringBuilder, you have the opportunity to specify the capacity of it. Using this constructor, we can avoid having it resized more than necessary. public String frontTimes(String str, int n) { StringBuilder strin...

^^ I think that feature of StringBuilder is way under-used.
 
Hi, @janos
 
hey @Hosch250
 
Would you be able to wait about three months for your intern?
My parents want me to ask.
 
6:33 PM
I would, but why?
 
@SimonAndréForsberg - I would agree with your answer more if: make parameters final, take a copy of the str using a ternary, and I would swap times & frontLength order.
You got my +1 already though ;-)
 
Well, my parents want me to apply.
 
And what do you want to do?
 
Do you have any more details anywhere?
 
0
Q: Iteratively process an identically named file all subdirectories and plot analysis to root directory

Krismajean MoonslayerThis script can successfully go through all of the subdirectories in a root directory, and then process a specific file that exists in all of them and output the file in the root directory as a .png named after the subdirectory. I am hoping to get some advice for the end of the script in formatti...

 
6:35 PM
@rolfl you mean String copyString = str.length() > frontLength ? str.substring(0, frontLength) : str; ?
 
yeah.
 
on it
@rolfl happy now? ;)
 
0
Q: Convert to Threading and Queues?

jmcclaireI'm looking to convert this working code to threading and queues instead of thread and global variables, but am not understanding how to do it. #!/usr/bin/python from time import sleep import RPi.GPIO as GPIO import subprocess import time import thread GPIO.setmode (GPIO.BCM) GPIO.setwarnings ...

 
@CaptainObvious tried to figure out a comment for that one, how about this one?
Welcome to Code Review! It seems like you are in more need of general programming knowledge than a Code Review. You already know what you want to do with your code, you have done your own review of it pretty much. I'd recommend figuring out how to rewrite it, then come back here and let us review your new code! — Simon André Forsberg 27 secs ago
 
6:57 PM
monking!
 
hey @Phrancis, well done!
quick question: what unit is MySQL's DATA_LENGTH from information_schema.tables?
I'm collecting metadata from both the MySQL source and the SQL Server Staging db's, and the same tables have massively different figures... I wonder if I did it right at all
 
> Prior to MySQL 5.1.12, MySQL Cluster allocated storage for variable-width columns in 10-page extents of 32 kilobytes each; thus, the DATA_LENGTH for such columns was reported in increments of 320 KB. Beginning with MySQL 5.1.12, the DATA_LENGTH column reflects the true amount of storage for variable-width columns of NDB tables. (Bug #18413)
 
so it's in KB's?
e.g. one table has 65 rows in the source, data length is 16,384. the same table in the Staging db has 56 rows, 88kb
 
No idea ... google being asinine./
 
7:04 PM
I'm being asinine?
I'll take that silence as a yes..........
 
It's MySQL, you can't expect anything logical :p
 
Asinine, adj. synonym MySQL.
 
LOL, guess what I just found
That's an offer for a job position
 
LOL
 
haha BF
 
7:10 PM
@Mat'sMug See:
mysql> SELECT IFNULL(db,'Total') "Database",
    -> datsum / power(1024,pw) "Data Size",
    -> ndxsum / power(1024,pw) "Index Size",
    -> totsum / power(1024,pw) "Total"
    -> FROM (SELECT db,SUM(dat) datsum,SUM(ndx) ndxsum,SUM(dat+ndx) totsum
    -> FROM (SELECT table_schema db,data_length dat,index_length ndx
    -> FROM information_schema.tables WHERE engine IS NOT NULL
    -> AND table_schema NOT IN ('information_schema','mysql')) AA
    -> GROUP BY db WITH ROLLUP) A,(SELECT 1 pw) B;
+--------------------+-------------------+------------+-------------------+
panabox:~# du -s /var/lib/mysql/*
0       /var/lib/mysql/debian-5.5.flag
162924  /var/lib/mysql/gallery23
348     /var/lib/mysql/gallery3
215044  /var/lib/mysql/ibdata1
5120    /var/lib/mysql/ib_logfile0
5120    /var/lib/mysql/ib_logfile1
484     /var/lib/mysql/mantis
1056    /var/lib/mysql/mysql
4       /var/lib/mysql/mysql_upgrade_info
132428  /var/lib/mysql/mythconverg
104     /var/lib/mysql/nagminder
212     /var/lib/mysql/performance_schema
172     /var/lib/mysql/phpmyadmin
152     /var/lib/mysql/roundcube
where du -s reports in kilobytes...
 
ugh... how complicated is it to just select accurate and meaningful metadata into a table?!
 
Bottom line, @Mat's, it reports in bytes, apparently.
 
why the heck obfuscate datsum/1024 into datsum/power(1024,something-that-ends-up-being-1)?
@rolfl yeah... bottom line, my SQL Server query is off then
or the two RDBMS's have massively different ways of storing data
 
^^ That too.
SQL Server is page-based for sure.
You have other things like padding, and so on, in SQL Server.
 
hey @Phrancis, enjoy my edit ;-)
 
7:19 PM
My guess is that SQL server reports probably as much as twice the space?
 
if I remove the unused part, I get 16KB on MySQL and 32KB on SQL Server
so yeah, double
DatabaseName	TableName	TableRows	TableSize
Staging	YYF041	723	512
 
SQL Server likely has a 32KB page ;-)
 
DatabaseName	TableName	TableRows	TableSize
Mine	YYF041	765	320
 
OK, that makes a ton of sense.
8 K pages, limit of 255 rows per page, leading to 4 pages... ;-)
what is the SQL server table-space page-size?
 
I'm sooooo not a DBA.. how do you find that out?
 
7:22 PM
You have the SQL Server GUI thing going?
 
I have both SSMS (GUI thing??) and WorkBench open
something funny:
DatabaseName	TableName	TableRows	TableSize	Collation
Mine	YYF071	39	16	latin1_swedish_ci
all the MySQL tables have a ....swedish collation
DatabaseName	TableName	TableRows	TableSize	Collation
Staging	YYF071	35	16	Latin1_General_CI_AS
I'll go with that
 
@janos Hah ok
 
0
Q: Knowledge is power

syb0rgResurrecting my C++ saga, I was given this project for my CS2 class: This problem considers several ways to compute \$ x^n \$ for some \$ n \ge 0 \$. Write an iterative function power1 to compute \$ x^n \$. Write a recursive function power2 to compute \$ x^n \$ using the following ...

 
Well that was quick @Captain
@rolfl How are the reviews looking with my newer methods of processing them?
 
7:33 PM
Time to run a scan then ;-)
 
I noticed that I am still going through them somewhat fast, but I try to leave a useful comment on one posts that don't have any
 
3.x -> 65.1 - certainly no longer stand out.
 
Good good
 
the C++ saga continues!
 
> of great posts and bad puns
3
 
7:46 PM
@skiwi looks like my kind of job
 
@skiwi had a generous day
 
@janos good day to rep-cap then!
 
ka-ching! thanks skiwi
 
@syb0rg mind you, I'm stuck in a Star Wars theme... I need to break out of that... but I just had to go with "Episode V: The ANTLR Strikes Back"
 
@Mat'sMug I saw that and insta-upvoted
haha
 
7:58 PM
@janos Decided to go through my last 10 questions ;)
 
Quick C# language element question. I'm looking for the language element that is a "Type name" in this, can someone point it out to me?
public static class Evaluate
{
    public static string FizzBuzz(int start, int end)
    {
        return Enumerable.Range(start, (end - start) + 1)
            .Select(FizzOrBuzz)
            .Aggregate(String.Empty, (y, x) => String.Format("{0} {1}", y, x))
            .Trim();
    }
 
@skiwi well, it kinda made my day ;)
 
@janos Nice :p
 
@Phrancis a type name?? like, foo.GetType().Name?
 
@Phrancis What does FizzOrBuzz refer to, to a method?
 
8:01 PM
I don't get what FizzBuzz has to do with type names...
 
Not sure either, perhaps this sample doesn't have that
(just working on Prettify)
 
@skiwi it's a method. the notation is method group syntax, everything but the name is inferred from the compiler
equivalent to .Select<string>(x => FizzOrBuzz(x)), assuming FizzOrBuzz returns a string
in your teeth, Java
 
@Mat'sMug So just like... Evaluate::FizzOrBuzz?
Method reference
 
Ah I think Prettify uses "Type name" like such: Evaluate etc. would be "Type names"
 
@skiwi it's delegated, method is only executed when the result is enumerated
 
8:06 PM
Ok, what is an example of a "Declaration"? What color is it supposed to be, in say, VS or NetBeans?
 
@Mat'sMug That's how whatever Enumerable.Range(...) creates works... doesn't have to do with FizzOrBuzz itself, right?
 
indeed. it's all in the lambda
 
Yay, finally found the root cause of javadoc confusion, I mixed two method javadocs up
 
0
Q: Collage Homework Assignment

JewelA teacher gave my boyfriend the following question, " Write a C++ program that allows the user to enter a time in seconds and then outputs how far an object would drop if it is in freefall for that length of time. Assume no friction or resistance from air and a constant acceleration of 32 feet pe...

 
Erm... wut?
Under what circumstances in Java can I instantiate a class with a protected constructor?
 
8:13 PM
you derive from it and call the base super constructor?
 
@skiwi via static methods. Or as super() in the constructor of a subclass.
 
@amon See, I have a public class and accidentally gave it a protected constructor
One use case is where I extend the class, there I expect it to work and it also works (to call super)
 
@skiwi that's likely to break something if the class isn't meant to be inherited
 
Now I also got this piece of code in a different class in the same package:
public static LogReader fromInputAndExtraLineReader(final String input, final LineReader extraLineReader, final Predicate<? super String> extraReadCondition, final Set<? extends EntryParser> entryParsers) {
    Objects.requireNonNull(extraLineReader, "extraLineReader");
    Objects.requireNonNull(extraReadCondition, "extraReadCondition");
    Objects.requireNonNull(entryParsers, "entryParsers");
    return new DefaultLogReader(entryParsers, createReadIteratorForFromInputAndExtraLineReader(input, extraLineReader, extraReadCondition));
That DefaultLogReader constructor is protected
I shouldn't be able to construct it, or should I?
 
not if the constructor is protected (in contrast to package-protected)
 
8:16 PM
@amon And that's exactly what it is
protected DefaultLogReader(final Set<? extends EntryParser> entryParsers, final Iterator<String> readIterator) {
    this(entryParsers, readIterator, string -> true);
}
Proceeds to pull hair out
 
Gah. Just get rid of the protected, or create an anon subclass if you want to be done with it.
 
I want to know why this is compiling, actually
 
wait, is the class where fromInputAndExtraLineReader is from a subclass of DefaultLogReader?
 
0
Q: Making a scroll function mor efficient in jQuery

Bram VanroyI have the following code, though I'm not sure it is efficient as it could be. $(window).scroll(function() { var scrollT = $(document).scrollTop(); if (scrollT >= 180) { $("#primary-nav-wrapper").addClass("scroll"); $("#primary-nav-wrapper li.front").addClass("active"); ...

 
@amon No
I've got an example here
(Not exactly the same as in my situation)
I'm also wondering why that compiles
 
8:22 PM
854
Q: In Java, what's the difference between public, default, protected, and private?

intrepionAre there clear rules on when to use each of these when making classes and interfaces and dealing with inheritance?

we might be morons
3
C# shares our concept of protected: msdn.microsoft.com/en-us/library/ba0a1yw2.aspx
 
I have never known that protected members are accessible from within the whole package
 
44 secs ago, by amon
C# shares our concept of protected: https://msdn.microsoft.com/en-us/library/ba0a1yw2.aspx
doesn't add up with
37 secs ago, by skiwi
I have never known that protected members are accessible from within the whole package
 
As a side note: Is C# ever going to use descriptive urls for their docs?
 
why? short url's FTW!
so Java protected is like some broken C# internal modifier?
 
I know for sure that I've never used protected to mean also access allowed from within the same package
 
8:26 PM
0
Q: Improving my MVC code but now I'm losing objects

OrtundSo my friend's helping me to improve my code in MVC applications. Before, I would have a lot of CRUD functionality in the Models and those would pass data on to a sort of data layer which would interact with the DbContext. The data layer would contain the LINQ queries and logic to get/add/update...

 
@Mat'sMug it's exactly like protected internal. Java's internal is implicit.
 
so I had almost published a class that nobody could instantiate
 
@amon not if protected stuff is accessible to the entire project....
or I'm missing something
 
@skiwi unless they subclass it
@Mat'sMug project != package
 
@SimonAndréForsberg Yeah ok, would still be hugely unexpected though!
 
8:29 PM
I guess you could say that a Java package is like a C# namespace
 
ah, that's the part I was missing.
 
@skiwi haven't you said that that class is meant to be subclassed?
 
@SimonAndréForsberg True, but it's also perfectly legal to just instantiate it if you want to provide the Iterator<String> yourself
 
I still think it's wrong that a protected member is accessible from anywhere in the namespace/package
doesn't protected mean only inherited members can access it?
 
@Mat'sMug what's wrong with it?
 
8:30 PM
12 secs ago, by Mat's Mug
doesn't protected mean only inherited members can access it?
 
@Mat'sMug nope, package + inherited
 
so wait, you can have a protected constructor in Java, and instantiate that class anywhere provided that you're in the same package?
 
@Mat'sMug yup
 
^^ thoughts?
 
@Mat'sMug ever tried doing the same in C# ?
 
8:32 PM
(on colors)
 
@SimonAndréForsberg hold on
 
It could be worse...
 
@SimonAndréForsberg as expected, compile error - the constructor is inaccessible due to its protection level.
 
1
Q: Snake console game

hackingforgirlsI made a simple C++ snake game, and I want some advice from you: what is good, what I have to improve. One main problem is that flipping (which you'll notice if you play it). #include <conio.h> #include <ctime> #include <iostream> #include "windows.h" const int width = 60; const int height = 15...

0
Q: Representing Objects as strings in VBA

cheezsteakI am working an a more meaningful way to print objects in VBA. The desired result should look something like this. Console.PrintLine List.Create(1, 2, 3) List(1, 2, 3) The concept is that objects implementing an IPrintable interface are printed as their ToString property. Primitive data type...

 
that's sloppy of Java IMO
 
8:35 PM
Access modifiers could be worse. This is the one thing about ObjC/Swift that is horrendous.
 
I'm impressed, mug.
@Mat'sMug I think Java has its reasons.
 
Anyway with the reflection API access modifier does not matter
 
@SimonAndréForsberg JavaScript and PHP also have their reasons......
@Marc-Andre true
 
@Mat'sMug let's not exaggerate, shall we? :)
 
lol
 
8:36 PM
I just can't think of Java's reasons right now...
 
In objc, there's no access modifiers but you can make things private by not putting them in the .h... But you can still call these methods because objc are just passing messages...
 
I guess that's part of what the C# designers had in mind when they said C# "fixes" C++ and Java weirdness
 
It's more difficult to call them though... But it can be done.
 
well, access modifiers are nothing more than "programmer hints" really
3 mins ago, by Marc-Andre
Anyway with the reflection API access modifier does not matter
 
In Swift, there is no protected. And Private only limits to the file... So anything in the same file (different classes) can call the private methods... But if you extend a class in a different file from its original file, you cannot call it's own private methods.
 
8:39 PM
@Mat'sMug Except when you disable reflection from within a security manager ;)
 
The default access level is "internal" which allows access across the entire target but not from outside the target.
Public exposes it outside the target.
 
0
Q: C readline function

VictorI wrote this function for my next learning project (cfg parser). What do you think about it? char readline(FILE *fp, char **line, size_t *size) { *size = 0; size_t cpos = ftell(fp); int c; while ((c = fgetc(fp)) != '\n' && c != EOF) (*size)++; if (*size == 0 && c == EOF) { ...

 
@skiwi that's much harder to do than to say
5
Q: Is it possible to disable reflection from a .NET assembly?

CluelessI would like to run a third party .NET assembly on my API. I want to let it call its own methods and objects as it wishes, but deny it access to anything that my API doesn't explicitly give it. In particular, if my API passes an object to the third party code as IMyObject I don't want them using ...

 
So the right way to write Swift is with lots of targets in your project.
 
This is not possible. — SLaks Apr 11 '10 at 18:20
 
8:44 PM
> Here is how it works. You create an AppDomain, assign limited permissions to it. For example, you allow displaying a UI but don't allow using File System or Reflection. Then you load an assembly into it and let it run.
Isn't that showing that it is possible?
 
it is, but it's a total PITA. And IIRC CAS was deprecated a while ago
 
threatpost.com/… didn't know about this... yet
 
@skiwi But isn't the security manager manage by the user ?
 
Is there still no inherently safe alternative to C available? One that prevents buffer overflows, etc.
@Marc-Andre Actually true... so you also need to ensure that the user cannot change it himself
 
14
Q: .NET Code Access Security: Useful or just overcomplicated?

Brandon see also Is “Code Access Security” of any real world use? I want to get some other opinions on this... I like the idea of Code Access Security for desktop applications. But in the lifetime of .NET I have to admit I've never actually had a situation where CAS has actually blocked something...

 
8:50 PM
@skiwi So you need a lot of effort for someone who wants to anyway bypass what you programmed. There is other alternative to this
 
So, what is the difference between Agile and Waterfall development?
Or, should this be asked somewhere else?
Or researched on my own, maybe?
 
@Hosch250 Agile focuses on low amount of documentation, no specific start/end dates of phases and often includes release cycles of x weeks... Waterfall is very structured, ie. you only advance to the next phase if the previous phase has been completed; Lots of documentation is involved
I better hope I'm correct there... because I'll have it on my exam tomorrow
 
@skiwi Not "last phase has been complicated" -> last phase has been completed
 
@Hosch250 I would answer that with: a lot
 
With Waterfall tests and test plans also get made ahead of time, possibly parallel
@Donald.McLean Thanks! was in time to fix it
 
9:01 PM
Also, that's not entirely correct. Agile focuses on doing the minimum amount of process stuff. If a document is necessary (regulatory, for example) then it is written - otherwise not.
 
correct ^
 
@skiwi I thought WF had the testing phase at the end...
 
Ignore the testing part indeed... I confused it with the V-model
 
isn't Agile also when you do a lot of iterations and receive and incorporate continuous feedback, and waterfall more in the style of "finish everything and then see how it goes"
 
@SimonAndréForsberg Yup, Waterfall makes it difficult to take continuous feedback into account
This question will be annoying if it comes on the exam...
> The ISO 9126 standard defines software quality and uses 6 main categories. The ISO 25010 standard is a newer version. What are the main differences between these 2 standards.
 
9:06 PM
Agile vs Waterfall flamewars are always annoying...
 
@Mat'sMug Have never experienced one yet (Should I be happy?)
 
@skiwi oh dear. You have to know ISO standards? I assume google isn't allowed on the test?
 
@SimonAndréForsberg Nope...
So I suppose the two main differences are that the newer version has more categories (security and maintainability) and that it is newer
Though I'm not sure if they'll accept the reason that it's newer
 
0
Q: i need to fix this tkinter code

Rafeh babarimport sys, types, os from time import localtime from datetime import timedelta,datetime from math import sin, cos, pi from threading import Thread try: from tkinter import * # python 3 except ImportError: try: from mtTkinter import * # for thread safe except ImportError: from Tkinte...

 
@skiwi I don't even know what any of those ISOs are about.
 
9:10 PM
> What is the advantage of using an architectural style? Describe 2 architectural styles?
MVC, I'll never forget you!
 
What other architectural styles can you name?
 
Not many... I just looked up and Client-Server is also one apparently?
 
"architectural style" == "design pattern"??
 
I bet there's a lot ones that you have heard of but didn't thought they were architectural styles.
 
9:12 PM
@Mat'sMug Difficult question... I think the Command pattern for example is not an achitectural style
It is a design pattern however
 
meh, technicalities...
 
> Bug, error, fault, failure, we use all these terms, illustrate the differences between these terms.
also a fun one
 
I'm with mug ^^
What's more important, knowing the differences between bug/error/fault/failure, or knowing how to avoid them all?
2
 
Maybe it helps me to remember that humans make errors, but humans don't make bugs
 
@SimonAndréForsberg stargreed
 
9:14 PM
@SimonAndréForsberg According to any University it is more important to know the differences!
 
@skiwi then who makes the bugs?
 
I think I know about half of the questions for sure... the other half, I hope they're not too difficult
@SimonAndréForsberg In Java the JVM makes the bugs actually, because it executes the errors I've made as human, that resulted in a fault in the code, which when running the fault resulted in a failure, that got observed as a bug
(Still following it?)
 
@skiwi I think I lost you after "In Java the JVM makes the bugs"
so the things we call bugs aren't real bugs?
 
@SimonAndréForsberg is being swallowed by universicalities
 
@SimonAndréForsberg It depends...
If you say that a program throws an unexpected NPE, you may call it a bug
If you look at the source code and see that at some point you dereference a null value, then you're looking at an error
 
9:19 PM
@skiwi but it was caused by errors you made as a human, right?
 
@SimonAndréForsberg Exactly
 
QA guy creates bugs.
 
@skiwi because you're suddenly expecting it? so when you're expecting it then it is an error and otherwise it is a bug?
 
@SimonAndréForsberg No, observes "issues" are called bugs, when looking at the source it's an error
> Companies that develop software for the medical domain have to have their software process at CMM level 3. What is meant by CMM? What do the CMM levels express?
I should know that term.
 
@skiwi so all errors are bugs as soon as you run the code?
 
9:22 PM
@SimonAndréForsberg Almost... All errors are faults when you run the code, only when one fault leads to a failure, it is a bug
 
@Mat'sMug are you following this? ^^
 
not really
 
I feel like I should start to take notes or something...
 
I feel like just calling everything a bug
 
I feel like just calling everything a feature
4
 
9:24 PM
0
Q: Am I thinking functionally

Garry CairnsI'm learning Haskell using the University of Pennsylvania's online materials. I'm a few lessons in and was looking for some feedback about whether I'm thinking functionally enough or porting over my Python background inappropriately. Below are my answers to the problems set out in lesson three (...

 
yep. some wanted, some uncalled for, some undesirable. features.
 
Intended? FEATURE! Unintended? FEATURE! Functionality missing? FEATURE!
 
@Mat'sMug exactly!
 
9:39 PM
@CaptainObvious Am I titling functionally
2
 
OK, thanks.
I was just out for an exam, sorry.
 
nice way of starting a discussion and then just leave, @Hosch250 ;)
 
I'll be throwing some stuff on Meta later, would like to see what some of you all come up with for code formatting!
 
9:54 PM
Monking!
2
 

« first day (633 days earlier)      last day (3377 days later) »