Open Side Menu Go to the Top

05-09-2013 , 01:10 PM
Quote:
Originally Posted by gaming_mouse
Hoping one of you has experience with java profiling.

I want to run an app, and then see a detailed breakdown of time spent by each method, with the ability to drill down. Basically info I could get by hand by putting "System.nanoTime()" calls at the beginning and end of each method and then a lot of manual arithmetic, but done automatically.

I've spent some time searching, but it's a subject that is oddly hard to find practical examples and information on. "visualvm" seems to be the go to recommendation, but I can't figure out how to apply it to my use case: it seems intended for monitoring running applications, as opposed to running an quick application and then viewing results.

Any advice greatly appreciated!
I like visualvm - for cases where I'm profiling a start-to-finish run I just put a sleep in at the start so that I have time to start profiling the app before it does anything.

Edit: I found it kind of unintuitive to use but there was a snapshot or something that you could generate after profiling that would show you the breakdown of where time was spent in your app. It's been a couple of months so I don't remember exactly but if you're having trouble let me know and I'll see if i can figure out what I was doing.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
$25m Guaranteed WPM on CoinPoker
Join the action now
Daily Rewards • Splash Pots • CoinRaces
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
05-09-2013 , 11:12 PM
Speaking of startups, I had an interview at a startup yesterday. I don't know exactly how it happened, but I think I was the only person interviewed, and since I didn't come across as a total basket case dumbass for the first time since forever, I was essentially offered the job on the spot.

Now, I'll state that I have one bad actor issue, which is that my phone isn't working at this moment. I don't have the money to replace the thing, so I couldn't receive a phone call until I got home.

I get home and I learn that I missed a phone call and I call the office back, but the person who interviewed me was out to lunch. I finally look at my email around 3:00 and I see a few emails from the company that go something like this:

11:30 am --> Hey, congrats, you got the job. Can you come in at 1:00.

2:45 pm --> Dude, so sorry, we changed our minds on the project. Is there any other things you can do?

Obviously, this bothered me a bit. I'm a nice guy in real life so I didn't open up the drama bomb, but I was wondering if I was really being tested on such a high standard. I sent back an email (edited for your enjoyment, although there was no curse words in the original):

Quote:
I just now saw these emails.

As my resume says, I blah blah blah

To be frank, I am shocked by these emails. I did not suspect that you'd want me to come in later today, thus I carried on with my day on the assumption that you would want me to show up tomorrow....

I did miss your phone call and I did call the office back as soon as I got home....

I am questioning what would have happened had I shown up at 1:00. Would I have been told you changed your minds?
He immediately calls me and says "Sorry, it was dropped because we decided we couldn't afford the project." He then told me that there was some other critical thing that needs to be done, but that wouldn't be ready for another week and a half, so he'd call me at that time. He asked me if I could do a "graph search," which I asked what he meant: basically he only needs words keyed in for a facet search and I'm guessing the CMS they use isn't so junky that this wouldn't already be set up to go. The original job was basically product entry into their CMS and perhaps at a later time do more product entry and "hook" modules into the CMS for more functionality, and then etc, I'm sure.

In the end he told me that I had the job and I had his word that it would be available in a week and a half. Now, when I say this is a startup, I really mean this is a startup, as in, they don't even have a public URL yet, so how likely did I just get caught up in a messy situation, or is this sort of thing bound to happen in the early stages? I would probably take the job, but how do I protect myself (or should I even take the job at all) and what sort of future should I be predicting?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-09-2013 , 11:51 PM
wow. lol. I'd take the job provided they pay you at the end of every day in dollar bills. Coins would work too.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-10-2013 , 12:38 AM
Yeah, I guess I'd have to be very clear on the money thing. That is one oddball issue about Los Angeles. Just about everyone I've ever met out here has worked at places that eff-balled them out of pay. A few places tried it on me, but I make it very clear that they have x amount of time before I place an order with small claims court, and yes, I've filed before and yes I'll pay $200 for the thrill of taking time out of their life, and yes I've done it before and yes I truly enjoyed the experience.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-10-2013 , 07:18 AM
Wouldn't take the job. Sounds more like they need a fill in. If you work at a startup you want to be 100% committed to it or not work there at all imo
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-10-2013 , 07:20 AM
Yeah, seems super sketchy. Definitely get paid regularly and/or up front.

Edit: I'm assuming you just want the job for the short-term money not for a long term commitment. If you're looking at this as a long term job - I'd run far and fast.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-10-2013 , 07:25 AM
I wouldn't take that job, they sound pretty unorganised.

Also, the "Hey, congrats, you got the job" line bothers me! A much better way would be to offer you the job, "We really liked your interview and would like to offer you the job". Hiring is a two way thing, this perhaps indicates that they're going to be difficult managers to work with.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-10-2013 , 08:21 AM
Quote:
Originally Posted by Gullanian
I wouldn't take that job, they sound pretty unorganised.

Also, the "Hey, congrats, you got the job" line bothers me! A much better way would be to offer you the job, "We really liked your interview and would like to offer you the job". Hiring is a two way thing, this perhaps indicates that they're going to be difficult managers to work with.
+1, stay away at all costs. You're too good for that job, dave
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-10-2013 , 06:20 PM
Anyone in this forum live out in the Denver/Boulder area? I'm up and moving to Boulder in a couple months from Boston... always looking for different perspectives.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-10-2013 , 07:57 PM
Quote:
Originally Posted by Nchabazam
Anyone in this forum live out in the Denver/Boulder area? I'm up and moving to Boulder in a couple months from Boston... always looking for different perspectives.
Been to Boulder a lot. Beautiful place. I have spent a lot time visiting the Denver area. Great place. Seattle area has more congested traffic but traffic can be pretty crazy there too. Winter weather can be an adventure.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-10-2013 , 08:42 PM
It's the best weather in the country, go to Seattle...
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-10-2013 , 08:42 PM
Also, can anyone with angularjs familiarity take a look at this question? http://stackoverflow.com/questions/1...in-a-directive

Basically I've been up since 1:30 am edt and I can't think straight. Need to somehow bind an ng-model to a jquery generated hidden field.

I'm sure I'll figure out the right search terms or stop being a total moron in the morning, but it's annoying me right now.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-11-2013 , 12:43 AM
Quote:
Originally Posted by Gullanian
I wouldn't take that job, they sound pretty unorganised.

Also, the "Hey, congrats, you got the job" line bothers me! A much better way would be to offer you the job, "We really liked your interview and would like to offer you the job". Hiring is a two way thing, this perhaps indicates that they're going to be difficult managers to work with.
I was trying to figure out if, in the early stages when funding is an issue, if this situation isn't too far afield, but apparently this is a large issue.

As for the congrats part, the real quote is "Can you come back at 1pm today? Congratulations, the job is yours." Of course, my representation of the quote betrays my own misgivings.

Regardless, I don't have much faith that I'll get a call back, but if I do, I'll probably take it as a temporary relief. My gut obviously says one thing, but the bank account says another. I also have a terrible employment history, so really, it would be a choice of taking this, something equally crazy like my last job, or sitting with crackheads at Labor Ready waiting to get called up to dig ditches.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-11-2013 , 01:11 AM
Quote:
Originally Posted by Nchabazam
Also, can anyone with angularjs familiarity take a look at this question? http://stackoverflow.com/questions/1...in-a-directive

Basically I've been up since 1:30 am edt and I can't think straight. Need to somehow bind an ng-model to a jquery generated hidden field.

I'm sure I'll figure out the right search terms or stop being a total moron in the morning, but it's annoying me right now.
try something like this in your link function:

Code:
var hash = $('#captcha_hash');
var hashSet = $parse(attrs.modelHash).assign;
scope.$watch(attrs.ngModel, function () {
    hashSet(scope, hash.val());
});
And obviously set model-hash="newUser.captchaHash" in your view.

If this doesn't work, try surrounding the call to hashSet in a $timeout block - I'm assuming the jQuery plugin gets around to changing the hash value before the angular watches get processed, but that's a conjecture as I haven't looked into the plugin. Also, depending on whether the jquery plugin fires a change event when it changes the hash value, you may want to listen on that instead (replace scope.$watch with hash.change) and surround hashSet call in a scope.$apply.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-11-2013 , 05:16 AM
Quote:
Originally Posted by candybar
try something like this in your link function:

Code:
var hash = $('#captcha_hash');
var hashSet = $parse(attrs.modelHash).assign;
scope.$watch(attrs.ngModel, function () {
    hashSet(scope, hash.val());
});
And obviously set model-hash="newUser.captchaHash" in your view.

If this doesn't work, try surrounding the call to hashSet in a $timeout block - I'm assuming the jQuery plugin gets around to changing the hash value before the angular watches get processed, but that's a conjecture as I haven't looked into the plugin. Also, depending on whether the jquery plugin fires a change event when it changes the hash value, you may want to listen on that instead (replace scope.$watch with hash.change) and surround hashSet call in a scope.$apply.
You're my hero, thank you.

Want to respond with that to stack overflow? I can accept it if you want.

Either way I want to update my answer to reflect the working solution.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-11-2013 , 06:55 PM
Quote:
Originally Posted by Nchabazam
You're my hero, thank you.

Want to respond with that to stack overflow? I can accept it if you want.

Either way I want to update my answer to reflect the working solution.
Don't worry about it, I don't really do stack overflow. Does your own answer to stack overflow as of now actually work? Not sure what you're trying to do there.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-11-2013 , 08:34 PM
I love stack overflow. Candybar do you live in LA and want to work as a front end dev for a major media company?

Last edited by suzzer99; 05-11-2013 at 08:35 PM. Reason: I feel like I may have asked you that already
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-11-2013 , 09:27 PM
I've found Github super flaky the last month or so. I currently have no ability to push code - which is super ****ing annoying.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-11-2013 , 09:41 PM
Quote:
Originally Posted by candybar
Don't worry about it, I don't really do stack overflow. Does your own answer to stack overflow as of now actually work? Not sure what you're trying to do there.
This is what I get for sleeping < 6 hours for 10 straight days. I used timeout to ensure the $('#captcha_hash') element had time to be created by the realperson jquery plugin.

I don't know why I threw anything else in there, haha.

edit: but yes, it works
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-11-2013 , 10:14 PM
I have a lot of angular to learn, but I just refactored to this and it works. $('#captcha_hash') is what's generated by the model, so I'm just pulling that value out and assigning it to the other hidden field I created for the captcha directive.

Code:
angular.module('vah').directive("captcha", ($parse) ->
  restrict: "A"
  require: '?ngModel'
  link: (scope, element, attrs, ngModel) ->
    return if !ngModel

    element.realperson({length: 5})

    captcha_hash = $('#captcha_hash').val()

    hashSet = $parse(attrs.ngModel).assign
    hashSet(scope, captcha_hash)


)

  <input id="defaultReal" ng-model="newUser.captcha_input">
  <input captcha ng-model="newUser.captcha_hash" type="hidden">
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-12-2013 , 08:59 AM
someone explain to me this trend of people using plnkr instead of jsfiddle or jsbin. it is easily the worst of the services...
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-12-2013 , 09:04 AM
Quote:
Originally Posted by Nchabazam
I have a lot of angular to learn, but I just refactored to this and it works. $('#captcha_hash') is what's generated by the model, so I'm just pulling that value out and assigning it to the other hidden field I created for the captcha directive.

Code:
angular.module('vah').directive("captcha", ($parse) ->
  restrict: "A"
  require: '?ngModel'
  link: (scope, element, attrs, ngModel) ->
    return if !ngModel

    element.realperson({length: 5})

    captcha_hash = $('#captcha_hash').val()

    hashSet = $parse(attrs.ngModel).assign
    hashSet(scope, captcha_hash)


)

  <input id="defaultReal" ng-model="newUser.captcha_input">
  <input captcha ng-model="newUser.captcha_hash" type="hidden">
oh okay, this makes sense, somehow I thought capcha_hash was a hash of the user's input, but I guess from the above it's just a server-generated hash of the correct answer that the user input is to be compared against? Yeah, in that case you can just set it once.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-12-2013 , 10:18 AM
Quote:
Originally Posted by suzzer99
I love stack overflow. Candybar do you live in LA and want to work as a front end dev for a major media company?
Hahaha, thanks suzzer, but I think I'm pretty happy where I am. I kind of run the show here on the technical side and not horribly underpaid, so it'll take an amazing situation, lots of $$$$ or an incredibly interesting project for me to switch.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-12-2013 , 11:40 AM
suzzer, just offer him this:
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
05-12-2013 , 12:28 PM
Quote:
Originally Posted by gaming_mouse
suzzer, just offer him this:
Amazing.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
$25m Guaranteed WPM on CoinPoker
Join the action now
Daily Rewards • Splash Pots • CoinRaces
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

      
m