« first day (1068 days earlier)      last day (2941 days later) » 

1:00 PM
array]i[
typing is hard
 
@Pimgd Great, now that I said that out loud, my coworker is pointing nerf gun at me. Thanks!
 
@MathiasEttinger I would like to work in a place where we casually had nerf guns avaliable for use.
Disagreement on sprint priorities? NERF GUN FIGHT
 
how does that help
 
Kaz
@DanPantry I occasionally have my LARP Katana nearby. Great for letting off steam.
 
The winner gets to decide the priorities
@Kaz Today has made me realise I need a punch bag
 
1:04 PM
@DanPantry That kind of things happens
I still need to buy my own, though
 
the chat went from off-topic to really off-topic very fast
 
Kaz
I only have 1 star left for the whole day now :(
 
Kaz
And I'm out ^^
2
 
lol
 
Kaz
1:05 PM
#WorthIt
 
@Kaz ★
 
@MathiasEttinger Why does he have a nerf gun next to his desk?
★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
 
@Mast pew
 
Why don't you have a nerf gun next to your desk? @Mast
 
to shoot people who ask stupid questions
 
1:06 PM
"Hey, Jim isn't answering Slack again"
 
0
Q: JavaScript Brainfuck interpreter

thepiercingarrowI wrote in Brainf interpreter in JavaScript, however it is quite buggy and I can't figure out what I'm doing wrong. It words for programs I've written, but fails on most programs I find on the internet. It seems that the while loop doesn't work correctly when it is supposed to skip over. When deb...

 
"Here, take this"
 
@Mast I don't really know from where it originates, I'm pretty new in here
 
*writes "oi, knobhead" on a piece of paper, attaches it to nerf gun bullet, fire it at Jim*
 
@CaptainObvious it's probably easier to write a javascript interpreter in brainfuck
 
1:07 PM
@MathiasEttinger Are you saying all your colleagues have a nerf gun within arms length?
pun intended
 
ahh man I can't find this calvin and hobbes strip where they screw pretend silencers on pretend guns everytime something annoying happens
 
@Mast They do
(didn't get the pun, though)
 
Kaz
@MathiasEttinger Me neither
 
same here
 
1:11 PM
A weapon, arm, or armament is any device used with intent to inflict damage or harm to living beings, structures, or systems. Weapons are used to increase the efficacy and efficiency of activities such as crime, law enforcement, self-defense and warfare. In a broader context, weapons may be construed to include anything used to gain a strategic, material or mental advantage over an adversary. While just about any ordinary objects such as sticks, stones, cars, or pencils can be used as weapons, many are expressly designed for the purpose – ranging from simple implements such as clubs, swords and...
 
@Malachi yeah, you did beat me
I have like five unfinished drafts in my drafts folder
 
@Quill I have a couple as well...lol
 
This seems like it'd fit better on CodeReview.stackexchange, with some edits — Zach Saucier 29 secs ago
 
I have an app on my phone, I should start using that. I always have ideas floating around, but they are no where to be seen when I actually sit down and start typing
 
Wow, just found a 159-page document about an interoperability process... only 15 pages of it is actual documentation, the rest of it is just copy-paste of the code
 
1:12 PM
@Kaz that sounds like blasphemy
@Phrancis lol
 
@MathiasEttinger I've never seen any workplace like that.
 
Makes me wonder if they go an update the code in the document when they make changes in the code base (of course not)
 
anyone here play Age of Ascent when they have their beta tests?
 
Greetings, Programs.
 
hey there
 
1:15 PM
Greetings, User
 
0
Q: Code optimization for getting price for one firm by weak

Hein PauwelynI've a lot of data whit prices of a product from different firms by weak. I've a class named WeakPrice witch contains a list of firms. Here you've my class structure. Here you've a little part of the data in JSON format: [ { "ID": 1, "NumberOfWeak": 1, "Year": 2016...

 
@Mast Oh, nice :)
 
Good grief, some of the code base is in this language
Caché ObjectScript (COS) is a part of the Caché database system sold by InterSystems. The language is a functional superset of the ANSI-standard MUMPS programming language. Since Caché is at its core a MUMPS implementation, it can run ANSI MUMPS routines with no change. To appeal as a commercial product, Caché implements support for object-oriented programming, a macro preprocessing language, embedded SQL for ANSI-standard SQL access to M's built-in database, procedure and control blocks using C-like brace syntax, procedure-scoped variables, and relaxed whitespace syntax limitations. The language...
 
@CaptainObvious by they, by weak, by moanth, by jeer, pick your periad
 
Class Redacted.SingleDocument Extends (Ens.Request, Ens.Response)
{
Property vendorClientOrderId As %String;
Property mappedID As %String;
Property taskGUID As %String;
}
 
1:18 PM
ooh redacted
 
NumberOfWeak, first I thought he was just having a half-fabricat price or something, an indication.
A weak price.
 
Kaz
Also, pretty sure it's not
 
@Kaz You mean you don't type your VBA code in all caps? ;)
 
> An answer in either language is OK since I work with the three of them.
Which 3...
 
1:33 PM
Right. Somebody should've removed the part about 3 languages at the same time.
Not going to do that now though, it's closed and should stay closed.
 
Kaz
Should it not be deleted as well?
 
I VTD it
need 4 more (or a hammer)
 
I can't VTD.
 
done
and it is 3 votes to delete
 
0
Q: Manage InputBox method reference entry

Máté JuhászExploring a bit VBA Application.InputBox method I've realized that catching user cancellation is tricky when type is reference, so return value is a range object. As cancellation's return value is False I can't assign it to an object with Set, so I've created a UDF to return Nothing when user p...

 
1:37 PM
wtf, node-sass is installing the 32x version of sass but trying to load the 64 bit.
wat
 
> The ngClass directive allows you to dynamically set CSS classes on an HTML element by databinding an expression that represents all classes to be added.
lies lies lies lies lies lies lies
 
lol, what's up? @Pimgd
 
trying to make something that will spit out what I currently put in my html
data-ng-class="{hidden: vm.hideFooter}"
 
hm, that should work.. unless your vm or vm.hideFooter is undefined.
 
1:41 PM
I wish I could put that in my code and have it be like data-ng-class="vm.myCssClassList"
 
you can do that
if myCssClassList is an array
I have done that several times in my code :-)
 
or data-ng-class="{{vm.myCssClassList}}", your choice
where the class list contains...
 
{{ }} doesn't make sense because ngClass already accepts an expression.
 
hidden: vm.hideFooter
not true, not false, but an expression
 
ng-class='{hidden: vm.hideFooter}' will work.
 
1:43 PM
yes but now I have a css selector for active element instead
 
wat
 
var onBlurCallbackFunction = function(){
                                           if(angular.isDefined(self.cssSelectors[selector]))
                                           self.cssSelectors[selector].state = false;
                                       };
                                       var onFocusCallbackFunction = function(){
                                           if(angular.isDefined(self.cssSelectors[selector]))
                                           self.cssSelectors[selector].state = true;
self.cssConditions[cssClass] = "vm.cssSelectors["+selector+"].state";//yeah, good luck with that
                                       console.log(self.cssConditions);
 
wtf
that won't work
 
I can see that
 
that "expression" in self.cssConditions[cssClass] will be evaluated as a class name
 
1:44 PM
the cssClass is the key
it should get evaluated as css class name
the "expression" will get evaluated as string, probably
and cuz it's not empty,
it's true
I wish I could just double evaluate
 
no i mean
the string you assign to that
will be evaluated as a class name
hold on give me 5
 
data-ng-class="vm.cssConditions"
 
Right
self.cssConditions[cssClass] = "vm.cssSelectors["+selector+"].state"
when you do
data-ng-class="vm.cssConditions"
the element with ngClass on will receive the class vm.cssSelectors[whateverSelectorIs.state]
as in, it will receive that as the class. It will not receive the result of vm.cssSelectors... but it will get vm.cssSelectors... as a class name.
so you will end up with <div class='vm.cssSelectors...>
 
hmmh
 
you should just do this
self.cssConditions[cssClass] = vm.cssSelectors[selector].state
 
1:49 PM
but state changes over time
 
race ya?
 
Well, yes, that's the problem with ngClass being used like that (and Angular as a whole).
 
What's the best way (considering readability and compactness) of doing something like this?
if (a) {
   if (b) {
      return "zzxc";
   } else {
      return "sdgdsgds";
   }
} else {
   if (b) {
      return "se3wewtew";
   } else {
      return "gddfhd";
   }
}
 
@SimonForsberg in what language? JS or java?
 
i.e. given two booleans, return a unique String depending on the result.
 
1:51 PM
@SimonForsberg lookup table?
 
but if you need a language, Java.
 
i'd also go with some kind of lookup table
 
@Pimgd yeah, my first though too, but how would you write it?
 
[true][false] = "a"...
 
painfully
2
 
1:52 PM
ints
bitshift
 
@Pimgd considered that, but don't know if it's considered readable enough for Mr. Maintainer.
 
then deeeeal with itttttt
 
// you're not expected to understand this
Put that above the bit shifting. Job done
/s
 
looks good what you got up there with the whole if structure
if you have 4 cases that you need to handle you're gonna run into this whether you like it or not
 
1:53 PM
Bitshifting is a usual approach.
 
private readonly IDictionary<Tuple<bool,bool>, string> _lookups = new Dictionary<Tuple<bool,bool>, string>
{
    { Tuple.Create(true,true), "zzxc" },
    { Tuple.Create(true,false), "sdgdsgds" },
    { Tuple.Create(false,true), "se3wewtew" },
    { Tuple.Create(false,false), "gddfhd" }
};
 
winrar
 
@Mat'sMug You and your C#..
 
Map<Pair<Boolean, Boolean>, String> for java, I think
 
except the C# version won't box any value types :p
 
1:55 PM
How would you write the bitshifting for Java?
 
0
Q: UnitOfWork without repository and transaction

RodI'm create a unitofwork class below public class UnitOfWork : IUnitOfWork { private AppDbContext _context { get; set; } private IDbTransaction _transaction { get; set; } private ObjectContext _objectContext { get; set; } private bool _isDisposed; public UnitOfWork(AppDbCo...

0
Q: merging json object

Juneyoung OhHi I am trying to merging json objects which has common value. This is original JSON { "setA":[ { "setId":"setA" ,"prodId":"A" ,"price":"5" ,"delivertCost":"1" ,"name":"Set_Prod01" } ,{ "setId":...

 
ugh. in my case it's "you don't write bitshifting. bitshifting writes you."
 
This is about the same but with one less nesting?
if (a && b) { return "asdlkhf }
else if (a) { return "adslkfjh" }
else if (b) { return "xcmnb" }
return "weioy"
 
that's not bad actually, @Phrancis.
 
I wanted to make a directive that you can give css selectors -> css class to that will apply the css classes to the transcluded element if the last element that had focus (document.activeElement) matches the selector
@DanPantry
 
1:57 PM
Java and C# may be too high to allow bitshifting, I'm not sure. But in C it's with >> and <<.
 
Java has bitshifting just fine
 
@Mast << and >> in C# as well. but you gotta be too high to use them.
 
^^ bitshifting fun in Java
 
My main problem with the bit-shifting is that I'd go from two booleans to an integer.... do I have to use two ternaries?
 
2:00 PM
@Phrancis Is that a good book to learn from?
 
@SimonForsberg Maybe the fact you are asking that is an indicator that it's not KISS enough for Mr. Maintainer?
 
I find bit masking is more useful than shifting
 
@Mat'sMug It Depends(TM).
 
probably, yeah
 
@Mast If you're an absolute beginner with Java/programming (which I was when I started it), yes it is. If you've been coding for a while though you might find it too basic
 
2:02 PM
@Phrancis Good point. Bye bye bitshifting approach.
 
public int boolToInt(boolean bool){ return bool ? 1 : 0; } public String getString(boolean a ,boolean b){ return strings.get(boolToInt(a)*2 + boolToInt(b)); }
look, it's a one liner-ish
 
s/look/look ma/
 
@Pimgd uh.. okay
that sounds pretty complex
transclusion sounds like you want a component, not a directive.
 
okay if you want you could solve my XYXYXYXYXYXY problem
 
@Phrancis I've done a lot of programming in a lot of languages, but nothing Java-esque. Well, C#, a bit, and that never got much.
 
2:04 PM
Try looking at a component. They have a lifecycle method called $onChanges that will let you watch for changes to bindings
 
my sticky footer comes above the keyboard on android
 
@Pimgd It's Java, not Python.
Don't make it a one-liner if you don't have to.
 
that's why I need to apply a css class to hide a footer when an input field has focus on mobile
so yeahhhhhhh
 
Mobile development is a PITA.
 
@Pimgd
export default {
  transclude: true,
  template: '<ng-transclude ng-class='$ctrl.classNames'></ng-transclude>,
  bindings: {
    // insert thing that changes here
  },
  controller: class {
    $onChanges(bindings) {
      if (bindings.someBindingChanged) {
        this.classNames = ..
      }
    }
  }
}
 
2:05 PM
One of these days I'll just get myself a Wordpress-esque framework to throw my pages in and get done with it. No JavaScript, no mobile funny stuff, no bullsh*t.
 
I misunderstood ^^
 
@DanPantry $scope.$watch('vm.focusCounter', self.updateCssClassList)
 
@Pimgd That could also work
 
they're gonna hit me with a club for using scope watch
 
2:08 PM
$scope.$watch is fine, used sparingly.
ngClass uses $scope.$watch.
Any directive (that is, an attribute-based one) has to use $scope.$watch.
I would recommend doing this instead though, that way you have static analysis:
 
@Mast Well, all I can say is it has helped me "catch up" to understand a good bit of what people on this site talk about (except for @DanPantry because JavaScript is magic)
 
$scope.$watch(() => $scope.vm.focusCounter, ....)
 
:()
 
@Phrancis JavaScript isn't magic, I just make no sense 99.9% of the time.
2
 
Kaz
@Mat'sMug I only need to out-answer you by a rate of 2:1
 
2:09 PM
I am not very good at articulating words myself. :-)
 
"only"
 
Kaz
 
@Kaz pan camera to the leeeeft
the header is out of shot and you've got whitespace on the right =/
lrn2screensnip
 
@Phrancis Angular is pretty magic, though. React at least makes sense. Grumble grumble
 
ScreenshotReview
 
2:11 PM
@Kaz see you at the finish line gold badge :)
 
I think this question is better suited for codereview.stackexchange.comFlown 59 secs ago
 
Kaz vs Mug
 
> Does this XML make my ass query look fat?
I hate this crap :|
 
@Kaz Now give us progress bars for the badge itself :P
 
@Pimgd or how about strings.get((a ? 1 : 0)*2 + (b ? 1 : 0)) ? (or did that become too unreadable?)
 
2:15 PM
@SimonForsberg you're gretting very close to regex territory right there :P
 
@SimonForsberg If someone would pass me that for review, I'd nuke it.
That deserves a comment explaining exactly what it does and why or it shouldn't be in the codebase at all.
 
You guys surely know how to turn down code :)
4
 
I'm voting to close this question as off-topic because it's a performance question, meaning it belongs on Code Review, not Stack Overflow. codereview.stackexchange.comArtOfWarfare 9 secs ago
 
@SimonForsberg We're Code Review.
Of-course we do.
 
well it works, I guess, but the mapping 0 1 2 3 is not clear
 
2:16 PM
Learned from the best ;-)
 
@Mast yeah yeahyeah, whatever :)
 
all the other examples you have seen are 2d
 
22333ms to look up rows from one single table is unacceptable - stop storing XML in SQL rows PLZ KTHX BAI
 
@Mast Exactly which is why I came here in the first place ;)
 
@Phrancis <response>no</response>
 
2:16 PM
this is 1d and it sucks because you know 0 and 3, but 1 and 2 are hard to understand
 
@Mast IIRC user profiles don't track tag badges until you get to 20K
 
22 months to get to 200 answers for kaz
but then only 883 score
26 months to get to 1000 pts
 
Kaz
@Pimgd I think if you allow for gradual upvotes on historical questions (as indicated by total average so far) it should be enough.
 
@Mat'sMug Oh yes they do.
 
2:19 PM
hmm
oh nice, there's a toggle
 
 
wasn't there when they launched it
 
:P
It has been like this for quite some time now, can't remember.
 
0
Q: Suggest me some improvements so that i could reduce the execution time less than 4 sec for any testing value

RobinHere is the Code. this code is for calculating the perfect squares between two given numbers. User can add the interval as well like for how many intervals he want to check the perfect squares. For example if user enter 4, it means there are 4 different intervals and after that he will insert the...

 
@CaptainObvious I can suggest you a few improvements, though I'm afraid most of them would be correcting your title in less than 4 seconds.
 
2:22 PM
oh wow
 
just got an advert for a junior developer in central london
maximum salary £30k
must have 2 years experience in iOS and Android dev
This is why we cannot have nice things.
 
That seems a bit low...?
 
30k for london is very low
just ask @Kaz
he lives there IIRC
 
You can probably stock shelves in a department store and make about that much
 
Uhhhhhh
no :P
30k is still quite high for most people - well above national average (average salary is 26k)
 
2:26 PM
National average is irrelevant in London.
 
But, yeah, this is London.
You wouldn't be able to rent anywhere on 30k
The place is in Croydon
1 bedroom studio flats there start at £780/mo. I'm on £26k a year and I pay £650 for a one bedroom in Cardiff.
I can't imagine paying an extra £100 to live in a smaller flat, before council tax, while only earning 4k more. You'd end up basically earning the same as I do now after bills but living in a smaller flat in a nasty part of london
 
Yikes
 
There's a reason the normal wage in London is about 2x more than what I earn.
 
This is very broken. This requisition was marked as approved and sent to the vendor by a SQL job, yet the XML payload never got created
 
> XML
> This is very broken
Sounds about right
 
2:30 PM
It's also MS BizTalk, if that tells you anything
 
It sounds familiar but I've not used it
 
You're not missing much
@CaptainObvious is down-voter in here? I was just curious what the reasoning was behind the DV
 
@Phrancis Probably either for being low-quality, a cross-post or both.
 
Kaz
Yeah, IIRC average salary for all jobs in London is ~£35k. I don't quite live in London, but that's not much help when Average house prices here are the most expensive in the entire country
On the plus side, it is very nice here.
 
@Kaz Ew. It's one of those sites that denies content if you have an ad blocker
Amusingly, you can just view source of the original article. lol
 
Kaz
2:55 PM
@Mat'sMug 118 : 47 now ^^
 
@DanPantry abandoned the idea of using the transclude directive & dynamic css classes
 
@Kaz yeah yeah ;p
 
just gonna have to duplicate 8 lines of code for each directive that wants the functionality
 
0
Q: How do I make this loop of 35,000 elements more efficient?

DarbyMThe entire purpose of this code is to arrange the data that was dumped into CommRef_ into the required structure of "ResObj". The issue is, some of the "CommRef" arrays can have as many as 35,000+ elements in them. This causes the operation to take upwords of 13 seconds on current hardware. So ...

 
3:00 PM
> document
Uncaught ReferenceError: document is not defined(…)
oh snap?
if you do a google search via chrome's address bar then document and window are no longer defined in the console
 
Kaz
I don't think this question deserves to be in the negative. The code is horrible and the OP obviously struggles with english, but it is On-Topic and reviewable: codereview.stackexchange.com/q/112146/81541
 
> The code is broken into parts to help make clearer what I am doing with it.
1 endless stream of unindented code
Uh-huh
 
@Pimgd Uh, I think you screwed up somewhere :P
 
@Andy I also took your advice and posted it to codereview.stackexchange.com I was unfamiliar with that resource. — DarbyM 43 secs ago
 
@Kaz posted mine
FWIW I don't agree that there's not much room for improvement ;-)
 
Kaz
3:11 PM
@Mat'sMug I only said that *I* couldn't see much. Your VBA experience is, after all, far superior to mine ^^
 
put that in your toolbox:
Private Function HasFlag(ByVal value As Integer, ByVal flag As Integer) As Boolean
    HasFlag = (value And flag) = flag
End Function
 
Kaz
@Mat'sMug What, no upvote? :p
@Mat'sMug Cool.
 
there, for sportsmanship :)
 
lol, I didn't mean the badge haha
 
3:20 PM
0
Q: What is the preferred pattern to use for handling the non-default behaviour of a function

Yannis P.I am new to CR, but let me start with a Code Review question that has been revolving in my mind for a few time. Let's say we have a function that checks if a given pattern occurs in a string. The default behaviour is that if the pattern matches, then it returns the pattern. So far so good but w...

 
Surely that Java code is not working
class node{
    private int a;
    private int b;
    node(int a, int b){
        this.a = a;
        this.b = b;
    }
    int getA(){return a;}
    int getB(){return b;}
}
// snip...
int size = scanner.nextInt();
node a[] = new node[size];
 
monking
 
monking
Wait, it does work... weird
 
why would it not work
@CaptainObvious off topic as "pls define best practice"?
 
Constructor for node looks like it's expecting 2 ints, but the call only passes 1 int...
 
3:29 PM
what call
it's new array
 
Oh. DUH
 
We'll pin that one on your evil twin Pin Crash
6
 
lol
4
 
SO isn't a code review site, there is a different stack exchange site for that very purpose — redFIVE 1 min ago
I was a bit confused whether this belonged here or on codereview. Can I move it there or do I need to delete this here & re-post there? — AgentX 42 secs ago
 
CSS modules are weird
.entitySelector {
  composes: entitySelector from './entitySelector.scss';
}
 
3:40 PM
does intellij have a control shift t
oh found something like it
shift shift ... enter will do
provided its for 1 tab
 
@DanPantry CSS is weird.
 
in other news...
 
Bernie won last night.
 
in VBA Rubberducking, 13 hours ago, by Mat's Mug
TIL git push origin hotkeywatcher != git push origin HotkeyWatcher ...dammit
why are git clients NOT case sensitive, when git itself is?
 
git good
 
3:45 PM
0
Q: Small improved std::list to manage doubloons and pointers

P. RodriguezI am extending std::list in order to have access to convenience member functions that simplify my everyday developments (e.g. ways to deal with doubloons, delete all the stored pointers, etc.). I removed some of these member functions, but I kept the essential ones. Here is the code, thank you f...

0
Q: Java - Creating a Paginated List

AgentXI need to create a Class which acts as a paginated list. My use case is like this: I am writing a library which makes a service call to fetch a List<obj>. Since the List<> can be large, the service expects me to call with a PAGE_SIZE. The service has also provided me with a TPS of 'x' which I ne...

 
git newbettergit
aka not git
 
<span class="edit-count unread-count">10</span>
caching, sure, but 10 things in review?
 
it's more like code review post instead of a question. You should try codereview.stackexchange.comBraj 1 min ago
 
also I gotta go home so have funnnn
 
0
Q: vlookup in python

Matt O'NeillI wrote a little function that does, I think, what the Excel function does: Given a value and a table (matrix) Search for the row that has value closest to but not greater than the given value Returns the value of a column in the matrix Is there something I'm missing here? It work but seems ...

 
4:18 PM
0
Q: OAuth2 Implementation draft

Maruf ManiruzzamanThis is my first submission to code review. So, please pardon my ignorance about any rules I may have violated and let me know. I am trying to implement a oauth2 service. I am not planning to use it anytime soon (like will write unit tests). This is my fun project I do to practice. I have used t...

0
Q: Anybody knows why line 39 does not change the value of weights[0] in my code?

user102216I ported a machine learning algo in C++ : https://github.com/reubencapio/machinelearningalgorithms/blob/master/neural_perceptron.cpp but it seems this line: weights[i] += l_rate * (out_exp - out_act) * input[i]; does not change the value of weights[0] only weights[1]. Can anybody tell me why?...

0
Q: Call similar functions using same code structure but different number of arguments

PunDefeatedI have an instance of a Java class that I need to call some functions on, using the API exposed by another party. For each call, I need to both check for thrown exceptions, and check the value of the returned boolean. If the boolean is false, I need to read the errorMsg object to see what went wr...

 
4:38 PM
@PaulBoddington that's also a proper answer for me, at least I'd have something to support me during code review when they start complaining — Michal Kordas 15 secs ago
 
> @Hosch250 this is fantastic. And i think this code would be great to point people at as an example of how to write great, cross-language, features for Roslyn. I also appreciate the nice test suite. I can't wait to get this in! :)
 
200 just recently got the first Illuminator badge! --> codereview.stackexchange.com/help/badges/156/illuminator
11
 
Awesome.
 
4:56 PM
0
Q: Bundle data into Object...obj instead of seperate data types, bad practice?

Gala@Override public void progressPublished(Object... obj) { long totalBytes = (long) obj[0]; int percentage = (int) obj[1]; long remoteSize = (long) obj[2]; { ... } // Update UI } Im cheating here, and using a undefined number of objects for the UI method ...

 

« first day (1068 days earlier)      last day (2941 days later) »