« first day (2525 days earlier)      last day (2646 days later) » 

15:00

I have a bunch of legacy .dll interfaces for USB and network devices. Can I call these .dlls using node?
I tried using something like var libCom = ffi.Library(....)
and it terminates my app like this
Process finished with exit code -1073741819 (0xC0000005)
If it is going to be too hard, should I just build a simple C++ windows app & run the binary using my js app /
I can't think of any real situations in which you'd want to actually reuse a test case
I have a bunch of almost identical error classes to use with type/pattern matching, and loop over a list of classes to run the same tests on each.
Well, they're immutable for the purposes of the unit tests
@Daruchini If the objects are not inherently immutable, don't reuse them, recreate them.
Also, it's more important to have a list of tests that cover as many possibilities as possible, rather than just a huge number of tests.
The metric for that is "code coverage"
Ideally every line of your code would, if changed, cause a unit test somewhere to fail.
15:02
Well, not always a fail.
You should be able to change implementation details without breaking tests, so long as you maintain the contract.
If your tests break every time you tweak things slightly, they're getting too deep into the class and testing the specifics, not the agreed upon API.
I really need to give those design pattern books a read too. I've got a site atm but the code structure sucks xD
@ssube You're right of course, but especially for the purposes of regression tests, testing specifically for existing code can be useful.
And yeah, regression tests and unit tests can serve different purposes
That's true. I also think that having a small suite of tests for an external "unit" (a library you depend on) to verify they continue meeting the contract is nice.
Never thought of that, that's a good idea
I have a few tests against external code that look for bugs I've run into
it broke stuff once, to make sure it doesn't pop back up on their side, I have a single test file for the library
15:05
@ssube Luxury :P
You just have to be careful you treat it as a single unit and test the contracts you're using from it.
@OliverSalzburg Tests, like documentation, are a luxury now that become a necessity later.
@KendallFrey Well said
Kendall is a wise man.
Also o/ America/canada
I wouldn't go that far, maybe a Weiß man.
15:09
You should always write tests first no matter how small the project is :)
lol
I should, but do I? Fuck no.
// Expected to say 'Hello world'
You should not write tests first, they will be mostly useless.
because everything starts small then it grows.
15:11
Write your interfaces first, then your tests, then your code, then your docs, then repeat.
you can make them useful by writing the actual code
@ssube You're gonna throw out the entire discipline of TDD just like that?
@KendallFrey yep
I've explained this at length a few times before, lemme find one
writing tests before you know the contract you're testing is a waste of time
Aug 25 at 13:13, by ssube
@KamilSolecki TDD slows down development, if anything.
TDD creates tests from contracts, does it not?
design requirements for example
Mar 17 '15 at 19:06, by ssube
TDD has you imagine what could go wrong, and test for it.
15:13
I'm not actually familiar with TDD in-depth
@KendallFrey nope, you write tests, then implement code to pass the test
@ssube And that's a bad thing?
@ssube Yeah but by contracts I mean the desired behaviour
it's supposed to be "leaner" because you "only write what you need," but you end up rewriting tests and missing whole error cases because you didn't think of them.
i find that process fascinating
There's a lot more churn when any API update means changing the implementation and the tests. If you can avoid that early on, perhaps by writing the API first, you can avoid a lot of unnecessary test refactors.
15:14
@ssube Which is? non-TDD?
TDD is
@ssube @ssube Do you have real world example of your process?
That seems backwards
@BenFortune sweet mother of futilness 0.o I'm almost tempted to also write an answer saying "the closest attempt has been documented in <link to the first answer of the question> and <some info>", as a joke
@GokhanDilek most projects?
@KendallFrey How often do you refactor an interface as you're working on it? More than a few times? While you're working on the first implementation, how often do you refactor the interface?
15:16
TDD can be done with these steps: 1. If possible, write a test that should pass but does not. 2. Write enough code to make that test pass. 3. Goto 1.
@ssube is there a general X-DD you recommend?
ofc depends on what you're trying to do, but still
X-DD?
<something>DD
@ssube If you mean as part of a public API, maybe a couple significant times early on, but usually it's pretty stable
15:16
oh, you mean like a wildcard. Uh, no.
@KendallFrey Are you working on mostly existing code?
In practice, yes.
TDD is less costly when you have a large codebase and you're extending it.
At least professionally
@KevinB deontological driven development: only write what god said to write
With greenfield code, it's extremely expensive to constantly refactor your tests.
15:18
the only tests i've written that i thought actually helped me in any way were integration tests: testing the endpoints of an api to make sure they actually make the data changes expected.
Especially if you write any fixtures early on and change your data schema (which will happen).
and that's the kind of thing that very well could be written after the fact
@ssube Indeed, the aim of TDD is to reduce technical debt to make development more scalable (I think)
For a weekend project, I don't write tests, and I think that's just fine.
@KendallFrey I can see TDD breaking even on large projects and, if you're completely in maintenance mode, even being easier than anything else.
am I a dick if I think that it's better to enforce great specifications and make sure all programmers read the relevant parts before starting a project, instead of writing tests for things? This is with the assumptions that the programmers won't just make a bad program
15:19
For my personal stuff, I write tests alongside the code. Usually literally, I keep the two files up next to each other and occasionally collapse all the methods and write tests.
2
What do you think is a large project?
I'm guessing my job counts as one
@KendallFrey depends on what kind of pasta it is.
50-150kloc, minimum?
I have no idea how to measure loc
50kloc of spaghetti blows, so I'd call that large
!!wiki loc
15:21
We've got ~1500 tests, mostly unit-ish tests, with a few hundred regression and integration tests
@towc lines of code
oh
heh, by the wc -l method, my game project is 15 or 20kloc, but by coverage's method (excluding whitespace, comments, and lines that don't run) it's only 1600
Our main solution currently has 94 projects, almost exclusively C# projects.
That sounds big, especially if it's a monorepo.
it's one branch
(TFS)
We've got maybe 4 teams working on different areas of the solution
15:24
heh, nice
so crosstalk is sometimes a thing
@ssube it's enterprise as fuck
lol
our main app, the API and the old pre-React frontend, has 910 branches. Startup as fuck. :P
user1596138
@rlemon drive a package to me plz lol
user1596138
A big one
ooh
@Jhoverit keep your sexting to a private chat :P
s/to/into/
user1596138
15:27
Lol I need the 500lb package baby
@ssube git branches? What's even in those? Are they ever merged?
user1596138
Haha how is that useful
user1596138
Every change is a PR in it's own branch?
git branches, most of them are small features, most have been merged but weren't deleted
oh that way
15:29
ah so no cleanup
I'd worry the code was the same
I thought you meant there were 900 heads
we changed it a month or so ago to clean them up
however github was set up, it didn't delete branches, gitlab does now
So it was PR debris?
Hello guys, pls tell me who knows, is it possible to simulate meta or ctrl key pressed and click to link, to open link in a new background tab
I mean, not all of it. There's probably some gems hidden in there, but I already searched for the good words and didn't find much.
but yeah, mostly it's just gitflow detritus
15:32
eli5, what's gitlab? Like, in-house github?
in-house github with more of an emphasis on the workflow/issues stuff
@David Do you mean whenever a link is clicked open in a new tab? Just add a target to your a tags
does good docker/kube CI too
<a target="_blank">
@Daruchini yes, but target blank opens in new window. I need in new BACKGROUND window
15:34
Ok, can you tell me what a BACKGROUND window is
like when you press ctrl key on keyboard and click on link it will open in new BACKGROUND tab
try it right now )
so just a tab
I meant tab, not window! I'm sorry )
Are you trying to make annoying popup ads?
Hate those ads
popover, popunder
15:36
@KendallFrey never!
hate any ads
resizes your window
Also, what do you really mean by background tab?
ctrl+clicking a link opens a new tab for me, and doesn't switch to it
try removing the underscore
no no no! I will never do any annoying popup tabs with add! hate it
@KendallFrey exactly what I need
15:37
Ads don't typically bug me, except new ones that I've seen pop up where when you scroll half way down a page a fuck huge ad takes over your entire screen.
I'm not buying it David
you're up to no good
@David Then you don't need to do anything...
@KendallFrey dude pls. I know what I need to do !)) Just tell me how it to do if you know
_blank will open in a new window, blank will open and direct you to a new tab
15:39
@David I do know. Step 1: Make a link. Step 2: You're done!
the point is not to focus on the new tab, though
I need to open "new background tab" not self not blank
9
Q: Open a new tab with javascript but stay on current tab

Daniel HIs it possible to open a new tab in Firefox using the window.open("http://www.google.com"); function, but open it in the background and remain on the current page? Thanks for any help

@David My browser already does that by default
^ yeah lol
15:40
It's google ultranationalist, isn't it
maybe the user in question changed their own settings
You can't programmatically alter browser settings with JS, it's a massive security risk to allow that
Ffs autocorrect
Google ultron*
That's why you can't also close tabs you did not open as well
s/security risk/party/
IE6 wasn't a problem, it was a party
@SterlingArcher You may be able to with Chromium :) it is a bit more flexible
why would anyone want to click on a link but not go to that page anyway? Seems odd
@GokhanDilek you can't
ok, lets try another way. How can I simulate holding key ?
@Daruchini reporting tools, print jobs, all kinds of boring shit
@David Why do you want that?
any time I click a PDF, I'd rather have it load in the background, but it foregrounds
because the default in most browsers is stupid
@David check out dispatchEvent
can't you wait until the pdf loads and then display
15:42
@ssube ha, mine is background!
@KendallFrey I got kind of blog, it aggregates bunch of posts from other sources, so when client click on the post card, he should open this post in new background window and stay on my page and see animation of postcard flipping and rate it
@David You mean like open a new tab ?
@David If the user clicks on a link, they usually want to see the contents behind that link. Why are you trying to go against what the user most likely wants?
@KendallFrey dude I'm not talking about user experience you are not helping at all. rly, if you have no suggestions or ideas do not turn to me, what matter why? I got task to do!
And I think it's a silly task
15:51
what kind of libraries and design pattern would you guys follow to create something like this: demo-app.mtechaccess.co.uk/demos/diabetic-foot.
I do not care what you are thinking anymore, sry
@Daruchini A login page? That mainly depends on how the rest of the app is designed
wait its not letting you start?
bootstrap
start what?
15:53
the big start button in the bottom right? Can you not see it?
oh
thats odd
never mind then
16:31
How awesome it must feel to spend upwards of $4200 on a laptop whose manufacturer now claims is slower than a phone… https://twitter.com/i/web/status/908366872499965952
a 1000$ phone at that
> an emoji strip
DUE TO COMPANY PASSWORD POLICY WE WILL BE REQUIRING ALL STAFF WHO GET THE NEW IPHONE TO HAVE THEIR FACE SURGICALLY ALTERED EVERY 90 DAYS
i assume they tested it with people who grow beards occationally
nope, and if it sees a bear coat, it never works. Jordan is boned.
16:41
i rather have the touch auth
To be fair, macs run pretty well on the hardware
Macbook pros are 4200 dollars? jesus
for 16GB, usually
I have stacks of memory on my kitchen table that can put any apple product to shame :P
and for what I do, at least, memory is pretty important
@ssube how much in your laptop/desktop?
this beast is maxed out at 4gb
work gave me a 16gb MBP, just pre-emoji bar. Desktop has 32gb (it's my workstation, i7 and a vega card). I'm building a storage array/kube box for the basement that will have another 24 or 32 and move some stuff over there.
16:53
if you have to pass a property from a parent to a series of children arbitrarily, do you guys prefer the function as a child pattern, or a decorator + context pattern?
So when are we going to put a stop to corvid's extreme vamping? :P
user1596138
That's not vamping? He asked an opinion
Though that one doesn't count
ya got me
user1596138
Opinion: Screw context
user1596138
There are always more options. So I won't choose the one that isn't explained
17:00
Sometimes I help, I just kinda suck at JS
user1596138
lmao
pretty obvious yo
So glad I went back to arch, AUR is so great
17:28
If I was that kind of person, I'd be weeping
My entire setup involved "gem install sinatra" and including jquery in my layout file. Sometimes I don't even include jquery
I'm a huge fan of sinatra
you're a bad person
17:46
every day
tar xzf - tar xtract zipped file
well aren't we a day saver
nerd
tvf to list, cvf to make one, etc
yyyh naming help please
areValidConfigs <-- sounds bad for a function name, right?
17:56
@KamilSolecki That depends on what the function does
returns bool based on wether the configs are valid :D
configsValid
maybe just validateConfigs?
No that implies action
yah, right
17:57
are implies boolean return. That's good
okai then, it will stay so. danke.
areTheseConfigurationsValidPlease seems fine to me
Probably wrap the method in a singleton while you're at it
doTellYouAllMightyAndWiseAreTheConfigsValid()
also, it might be just my C# background screaming at me, but generally in JS its absolutely fine to export/import funcs, right?
my C# brain part screams wrap it in an unnecessary class
but that just seems wrong
it is wrong
18:00
good.
because JS has first-class functions, exporting them is no big deal
tbh it screams something like: wrap it in an unnecessary class, but make it do something so that it seems at least necessary :P
they are immutable objects that you can manipulate and pass like anything else
yeah so instantly my first idea was to make a ConfigValidator class, do something in the ctor and export a property areConfigsValid
but I can just export a func
the downside of that is the overhead, but then again I aint gonna worry about 0.1ms lol
Classes are just functions as well, so the whole thought is pointless :P
18:02
Classes are not, they throw if you call them without new.
yeah, the old JS style function-classes are just funcs
I am trying to get my head around this regExp
Yeah, well, don't ruin my point!
:D
@KendallFrey emergency regex needed
cc @adardesign
I am trying to find from the (\<\!DOCTYPE htm)([^]+)(\d{2}-\d{2}-\d{4})([^]+)
18:04
/91{2}/
are we parsing HTML with regex?
4426
A: RegEx match open tags except XHTML self-contained tags

bobinceYou can't parse [X]HTML with regex. Because HTML can't be parsed by regex. Regex is not a tool that can be used to correctly parse HTML. As I have answered in HTML-and-regex questions here so many times before, the use of regex will not allow you to consume HTML. Regular expressions are a tool th...

look at first answer ^
cc @adardesign
18:05
Thx
But what are you actually trying to do?
I am trying to get 2 groups from this entire HTML soucre
first group (Offer ends 10/28/2017)
second group (your-price">$1,199.00)
date and price should be a dynamic value
its good for scraping
(traversing HTML jQuery-like)
I am trying to use it in a A/B testing platform.. no lib's
just find/replace
18:09
heh, I remember that answer
also, xpath is a thing...
the only option is regExp
if you say so
its a A/B testing platform which allows you to try different variants
so I am trying to move things up by regExp find replace
18:13
Why is regex your only option?
All there is a "find" and "replace" fields
and the platform doesn't offer any DOM traversal tools?
If you want to match on some stuff in the body, why is your regex starting with the doctype tag?
sorry, That was just a wrong version of that regEx101
was fidling
18:15
you'd think they'd at least have some support for css selectors or something
There is exactly 1 match for /Offer ends 10\/28\/2017/
Seems fine
from:
product-info-container

group 1
Offer ends 10/28/2017


group2:
your-price">$1,199.00

till
sell-points-hr
ok, 1 it still shows a error in reg101
2. I want the dates and price dynamic (e.g data - \d{2}-\d{2}-\d{4})
> I am trying to use it in a A/B testing platform.. no lib's
This is text within a tag
not to find elements
18:19
so what options does said platform have other than regex?
@adardesign I think, usually, people would place easily detectable markers in their HTML to dictate A/B pathing. Maybe that's an option
@ol
ok, but in this case there isn't :(
if the platform only gives regex as an option and nothing else, when modifying html, ... something seems off.
@adardesign Oh well, just wanted to mention it
thats all there is
18:22
and what does the hint tell you?
find another platform
ok, thx all! :)
but is there no way with regExp?
!!zalgo nope
@ssube n̸͈̮̬͚̼̲̳̼̼͎̝̥̞͙̞ͦͯ͒ͭ́̑ͮͪ̿͛ͪ̕͞ͅo̶̷͇̠͓̺̙̻̳̿͋͂ͪ͛̇͊͌͗̍̍̊͊̚͟ͅp̶̨̨̡̛͖̫̗̤̹͔̩̺͍̦̬̓͊̅́̈ͪ‌​e̶̴̶̳̭̯̮͕̲̺̹̜̗̜͇͍̼̮̓͛̓ͭ̑͟ͅ
thanks again
18:28
oh, once in my life function currying would make things nicer
an exception-al day it is.
you can always ramda
if you want to take on that responsibility
I aint gonna do that for 2 functions :D
Or I can go all the way
and make a configValidator, that you will supply only config names, and it will try to find corresponding schemas for them, and map reduce to single boolean result
I've got a function that does that :D
well, somewhat
my idea was to find a config by configname + 'schema'
it's still rough, but it type/value/pattern checks a tree of objects, for config loading and (de)serialization from untrusted sources
18:32
oh so its smart.
I can post it, but I can't guarantee it works. 😛 I might finish it tonight, but I have some prod changes to push and my gf is leaving town around midnight.
nah, its ok. Ill make my own and then we can compare :P
18:56
what problem was vue trying to solve?
Angular was too boring but React was too complicated.
or was it the other way around?
probably more of a angular and react were too popular
so a 3rd option was needed
i tried the dishonored 2 demo last night and liked it, so i decided to move to the full version. but i f'd up, doing so means the demo is unplayable, and i have to wait 4 hours for the full to install
shoulda waited till i was done for the night before doing it

« first day (2525 days earlier)      last day (2646 days later) »