« first day (1174 days earlier)      last day (3139 days later) » 

20:01
55
score
10
10 examples
31 contributors
I didn't see a share link, but you can simply copy the first part of whatever thing you're on at the moment and drop that in chat.
@Phrancis that guy looks familiar
@Quill Must be the hat
0
Q: python script to calculate the interval between 2 consecutive packets

Denzel Whiteclass FlowDict(object): def __init__(self): self.TCPactiveFlow = dict() self.TCPcompleteFlow = list() self.UDPactiveFlow = dict() self.UDPcompleteFlow = list() self.currenttime = -1 self.lastupdate = -1 self.difference = self.currenttime - self.lastupdate self.th...

Welcome to Code Review! As it currently stands, this is a code dump. What is your intention with the code? Does it work as expected? What are your concerns? Are there any other things we should keep in mind? — Mast 20 secs ago
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: Using Rails concerns for validation in models
20:24
@DanPantry:
Preview of async/await working in Chrome. 👍 for code that looks sync on the surface but is async under the hood 🔥 https://t.co/s0BfEIxsJ0
20:44
@Quill oh damn
The two that are mine, if you still have them
@syb0rg Fixed.
Thanks!
let's try and avoid creating some documentation review ring here, okay :)
@Quill We are Code Review... ;)
2
20:54
wait.... this isn't the pub.
Exactly. I know which regulars are proficient in which languages.
Halp
I haz c++ question
So I can see with a quick skim whether it's decent or not.
no une anzer me
halp
TTQW, early weekend for me too. Have a good weekend everyone!
20:55
@BernardMeurer Go Python. Win.
Did that zolve problem?
If my code loads a couple of XML files (OpenCV cascades) is there a way to embed them onto the compiled bytecode so I don't need separate files all the time?
@Mast I need low level magic :)
You want to do what? On what?
Yea, I know.
What are you using the XML for?
And how do you want to embed it on bytecode?
It's the format for Cascades for OpenCV feature detection with classifiers
20:57
Ok, sounds familiar.
Oh, you want to embed the classifier into your compiled program?
Idk, I just want to not need the things to be in separate files to the executable
the Cascade file
Create an object which fits the entire file. Load the file during compilation. Make the program reference the object instead of the file.
I'd assume such a class already exists in the OpenCV, don't ask me which.
You could even hardcode the XML into the object in a .hpp file.
I'm not saying it's good, but it works.
I asked on the OpenCV irc, but the sweet people who always help me aren't on apparently
OpencvClassifierHoldingClass myHolder;
myHolder = <XML HERE>
Wait, wait, I'm stupid let me process
2
I'm basically a Pentium III
2
with 1GB of DDR ram
21:01
tries not to star above statements
and an AGP-based GPU
Star away, I take pride in that :v
@Mast But then how'd I load the XML like I'm doing in faceCascade.load("cascades/frontal_face.xml");
I'm an AI experiment from the 90's that went wrong
@BernardMeurer Is that a stand-alone function or is it assigned to a variable?
@Mast Standalone, that's the whole like there, after that the CascadeClassifier faceCascade will have loaded that cascade file
In other words: where does it return to?
Can you do multiline code here? Like 4 lines?
21:06
Here
Be
Many
Code
Paste it
Paste and hit 'fixed font' to the right if it doesn't auto indent correctly.
CascadeClassifier faceCascade;
CascadeClassifier smileCascade;
faceCascade.load("cascades/frontal_face.xml");
smileCascade.load("cascades/smile.xml");
Ah yes, the joy of OpenCV...
There, that's everything in this code that involves static outside files
Actually, I'm not even using the nose one anymore
21:08
Ah optimization at work
There, that's it
I'd take a chunk from the load function and re-write the required part into it. But that would involve modifying the library, which would be bad.
@Mast Yeah I want to avoid that if possible :v
I have a talent for breaking everything I touch
In JavaScript one would simply extent the class a bit and get it over with...
Lame
Where's the fun if solving your problem doesn't include crying
21:10
28 degrees in my room, help :|
(Celsius, not Fahrenheit)
@skiwi I get 50 here during summer, toughen up
(40 is far more common though)
Yes, Celsius
@Mast no ideas?
0
Q: Higher performance parsing shorts from binary file

Javier Ventajas HernándezA few months ago I got rejected at the technical interview for a position. The problem that they gave me is the following: From a binary file, parse two shorts, x and y and build a Point object with these coordinates. Repeat the process until there is no more shorts to parse. From all those po...

0
Q: K&R C - print horizontal histogram of the length of words in input

Lúcio CardosoI'm reading K&R C book, and I did exercise 1-13. I want to know how to improve this code, and also, would it be better to use arrays to do this? Because the book chapter is about arrays, and I didn't use them. #include <stdio.h> ...

@BernardMeurer I'm thinking.
@Mast Ah, I've heard of that before, complex art
If the part where the classifier stores it's data is Public, it's doable.
Otherwise, you're literally working against the language.
You're not supposed to be able to get the data in there directly.
21:15
@Mast le docs
I'm reading
Can a FileNode be an object?
@Mast It's public!
@Mast What's that?
@BernardMeurer There you go. Just write a custom function duplicating the logic from load but from a variable instead of a file. Make the variable a const in a header somewhere and you're set.
@skiwi It's only 24 Celsius here, but I live along the coast, supposed to be about 35 inland.
@Mast But the logic inside load is absolutely bizarre
21:18
@BernardMeurer FileNode
@BernardMeurer Yes, it's probably optimized into unreadability.
@Mast CV_WRAP bool load( const String& filename );
if I GOTO definition that's all there is there
> File Storage Node class.

The node is used to store each and every element of the file storage opened for reading. When XML/YAML file is read, it is first parsed and stored in the memory as a hierarchical collection of nodes. Each node can be a “leaf” that is contain a single number or a string, or be a collection of other nodes. There can be named collections (mappings) where each element has a name and it is accessed by a name, and ordered collections (sequences) where elements do not have names but rather accessed by index. Type of the file node can be determined using FileNode::type m
@note The file may contain a new cascade classifier (trained traincascade application) only.
 */
CV_WRAP bool read( const FileNode& node );
I guess read can receive a fileNode!
read does, load doesn't. But the result is pretty much the same by the looks of it.
But what does that does for me? I mean, the filenode will still need to read the files right?
21:30
Unless you can initialize the data it holds in another method, yes.
But as you said, it's stored publicly. So simply write your own load function and you should be good to go.
Since it happens all at compile time, it's not a problem for the end-user if it isn't the fastest.
Just write it, post it at Code Review and optimize it :-)
@Mast Currently I can't even find how they load their stuff
@BernardMeurer Do you have a debugger available?
@Mast GDB and valgrind
and I'm using Clion as an IDE
@BernardMeurer 220 and down.
@Mast Yeah, 239
but still that doesn't seem to really do anything
the actual function must be somewhere else
@Mast AHA
Wait, aha?
21:40
892 and 897 look like they do something relevant.
@Mast If I try and create my own load I can't reference the variables they do in their code :/
as in oldCascade.release();
@BernardMeurer Those aren't public?
If they are, there's a way.
@Mast Ayayay this thing is being too much of a pain in my butt
OpenCV usually is.
It's a great concept, but the entire library is filled with constructs which are odd at best and impossible to understand at worst.
0
Q: How to write nested joins with Laravel Query builder?

mnvI have SQL query with next join order (two JOIN's are nested in LEFT JOIN): SELECT * FROM mytable LEFT JOIN table1 JOIN table2 ON table2.id = table1.document_id JOIN table3 ON table3.content_id = table2.id ON table1.link_id = mytable.link_id How to write this query with Laravel Query build...

0
Q: Designing stack and queue from scratch in C

ph03n1xas a beginner and curious guy I'm interested in implementing data structures and algorithms from scratch that is a fun to me. Here's an implementation of Stack and Queue, the most fundamental data structures. Now I want the veterans' direction and guideline if there are any mistakes/ memory lea...

0
Q: Contra - 30 More Lives

8protonsJust for the fun of it, I wanted to have a hidden keypress function on my website that performs an event when the user types in the Contra code for thirty lives. I'm curious how the implementation for this simple piece of code holds up and where it could be improved. Note: keypress doesn't seem...

21:55
@Mast Yeah their constructs are obscure
@Mast Thanks a lot for the help though :)
Remonking
@BernardMeurer Np
@Vogel612 Remonking @Vogel612
22:15
0
Q: Add multiple instances of a property to a list

speedycorndogI'm a novice programmer asking first question here although I've gotten tons of help from previous questions. The following code is abstracted from what I currently have working. List<decimal> teamAverage1 = new List<decimal>(); List<decimal> teamAverage2 = new List<decimal>(); List<decimal> t...

22:30
This question is more appropiate for codereview.stackexchange.comyuriy636 10 secs ago
0
Q: Fade out text, then show again repetadely in JQuery

JamesHey I'm new to JQuery and want my website to look nicer by having a repeated fade out effect with the text, and maybe eventually fade in also. So I set up a system that is called when Fade out Is complete it runs through a switch statement and looks for what text to display like this: $(function...

For questions about optimising code that already works, you might want to ask on codereview.se. However, I encourage you to read this first. — bcsb1001 47 secs ago
22:56
I leave the documentation for 2 hours and all these people made bad edits
UGH
@syb0rg ^^ that .. so much
Java has topic requests for the builder pattern, because that's obviously only a java thing and no other language could ever have it
People with too low of rep are changing things they don't understand and they have the power to do it
it will take months to clean this mess up
I lost my power for the day trying to keep up with them
Why can a guy with 178 rep approve a massive edit in one go?!
WTH
I managed to submit a rollback to a good version: stackoverflow.com/documentation/proposed/changes/22566
possible answer invalidation by speedycorndog on question by speedycorndog: codereview.stackexchange.com/posts/135543/revisions
23:38
0
Q: Reduce redundancies in my code? Simple form validation (JS)

Felipe Felix de LucaI'm not a pro in js so, my code is a mess (but it's working!). I would like to ask your help to reduce some redundancies in two cases. Those two are codes are affecting these two forms: <form action="contact.php" method="post" name="form1" onsubmit="return validateForm1()"> <input type="text...

23:49
0
Q: Text Based Java Fight Arena

user112056I am using eclipse mars.1 and am not able to get this code to run. package finalProject; import java.util.Scanner; import java.util.Random; public class Main { public static void main(String[] args) { // TODO Auto-generated method stub System.out.println("Hi! Welcome to the Battle Ar...


« first day (1174 days earlier)      last day (3139 days later) »