I used Handlebars on my last CRUD app, which is essentially Mustache with if / for blocks and other goodies. You can also create your own helper methods / blocks, which I ended up using to do stuff like converting C# DateTime values (/Date(1381332438770)/) into local DateTime strings. It seems to do the trick for relatively simple templates.
Heh. You can tell when someone's been working Government contracts too long. I suggested that I update my Java program to just go through ALL of the SQL files that we have and pull out the DB names. He said that would help but it would take a few days.
Heh. You can tell when someone's been working Government contracts too long. I suggested that I update my Java program to just go through ALL of the SQL files that we have and pull out the DB names. He said that would help but it would take a few days.
15 minutes later I had the output.
He was telling you what he was going to charge the client for it.
Sure I can stock shelves in the supermarket in 10 minutes. Can I do it every day? Maybe. Forever? No. Is it worth my time to always do it fast? Not really.
Another thing most people don't know: companies charge stupidity fees if you act like an ass or waste their time.
not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
Sure I can stock shelves in the supermarket in 10 minutes. Can I do it every day? Maybe. Forever? No. Is it worth my time to always do it fast? Not really.
Another thing most people don't know: companies charge stupidity fees if you act like an ass or waste their time.
My company is doing this. We have a client who raked us over the coals on our last project due to a combination of mismanagement and developer incompetence on our end (both people got fired, and me and my manager took over the client). They asked for all sorts of free work that cost us a lot of money.
So now that they've signed another contract with us, we are padding all the time on our current work by a few hours per item. I don't really like it, but hey man I just do the code. As long as the client is making happy noises at my manager and leaving me the hell alone, I'm cool :P
Probably not my most productive time ever, but my little IMAP listener v2 is now running. The real test is whether 8 hours later it's still ticking along, or if it's died silently.
It's more or less pushing the limit of what I want to put in a single Python file but oh well. What kept tripping me up was the tendency of all the subthreads that I ended up needing to hit exceptions and not die gracefully. And all this is mostly in service to my strong desire to not have any 1 second delays to try and synchronize things - everything blocks or signals when it's done and reacts immediately.
Sure I can stock shelves in the supermarket in 10 minutes. Can I do it every day? Maybe. Forever? No. Is it worth my time to always do it fast? Not really.
Another thing most people don't know: companies charge stupidity fees if you act like an ass or waste their time.
My company is doing this. We have a client who raked us over the coals on our last project due to a combination of mismanagement and developer incompetence on our end (both people got fired, and me and my manager took over the client). They asked for all sorts of free work that cost us a lot of money.
So now that they've signed another contract with us, we are padding all the time on our current work by a few hours per item. I don't really like it, but hey man I just do the code. As long as the client is making happy noises at my manager and leaving me the hell alone, I'm cool :P
Pure business reason for it. If you bill for exactly how long it always takes, if there's ever an issue, you have no float to cover it.
Oh a computer breaks that was our fault? We won't get paid.
Oh a computer breaks that was their fault? We won't get paid.
People like to not pay.
This is why if you're a contractor you don't use your hourly wage you'd get if you were salary. Aside from HR expenses and all that, you'll want to use almost three times your wage because you need to cover lack of work, overhead for getting tools and equipment, and dealing with assholes.
Three times your wage is going lowball in my opinion.
not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
Because I like having my helper classes that spit out Bootstrapified HTML for me. I don't want to have to re-implement it by wrapping every method the helper has to make the template engine happy.
Sure I can stock shelves in the supermarket in 10 minutes. Can I do it every day? Maybe. Forever? No. Is it worth my time to always do it fast? Not really.
Another thing most people don't know: companies charge stupidity fees if you act like an ass or waste their time.
My company is doing this. We have a client who raked us over the coals on our last project due to a combination of mismanagement and developer incompetence on our end (both people got fired, and me and my manager took over the client). They asked for all sorts of free work that cost us a lot of money.
So now that they've signed another contract with us, we are padding all the time on our current work by a few hours per item. I don't really like it, but hey man I just do the code. As long as the client is making happy noises at my manager and leaving me the hell alone, I'm cool :P
Pure business reason for it. If you bill for exactly how long it always takes, if there's ever an issue, you have no float to cover it.
Oh a computer breaks that was our fault? We won't get paid.
Oh a computer breaks that was their fault? We won't get paid.
People like to not pay.
This is why if you're a contractor you don't use your hourly wage you'd get if you were salary. Aside from HR expenses and all that, you'll want to use almost three times your wage because you need to cover lack of work, overhead for getting tools and equipment, and dealing with assholes.
Three times your wage is going lowball in my opinion.
Makes sense. I'm still getting used to this business, it's my first job and I've been out of college less than a year.
I think I got lucky with my company, it's small enough that I can make an impact and feel important, and large enough that we aren't worried about going out of business or anything. Definitely not a corporate culture, the owner used to be the lead singer of a rock band.
Let's just say it's doing the trim lots and lots of times.
0
21stCenturyCall me Pixel, or Pix for short![They/Them]Registered Userregular
edited October 2013
So, I decided to learn this "programming" thing and maybe try and make a game or two while I do it.
Right now, I'm going through CodeAcademy courses on Javascript and I was wondering...
Can you make a timer in Javascript? Because i have this idea for a game in the same vein as Candy Box and A Dark Room and i'd need to take time into account.
So, I decided to learn this "programming" thing and maybe try and make a game or two while I do it.
Right now, I'm going through CodeAcademy courses on Javascript and I was wondering...
Can you make a timer in Javascript? Because i have this idea for a game in the same vein as Candy Box and A Dark Room and i'd need to take time into account.
So, I decided to learn this "programming" thing and maybe try and make a game or two while I do it.
Right now, I'm going through CodeAcademy courses on Javascript and I was wondering...
Can you make a timer in Javascript? Because i have this idea for a game in the same vein as Candy Box and A Dark Room and i'd need to take time into account.
Because I like having my helper classes that spit out Bootstrapified HTML for me. I don't want to have to re-implement it by wrapping every method the helper has to make the template engine happy.
...what is that code block supposed to do? I use twig exclusively, and aside from form rendering (forms are a weak spot with all of Sensio's offerings), don't have any issues with it.
PSN/XBL/Nintendo/Origin/Steam: Nightslyr 3DS: 1607-1682-2948 Switch: SW-3515-0057-3813 FF XIV: Q'vehn Tia
Ah, yeah... twig doesn't have anything like that. Twig's really just a "Write HTML until you need to inject data, or loop, or have a conditional" template engine. Forms are definitely its weak spot.
PSN/XBL/Nintendo/Origin/Steam: Nightslyr 3DS: 1607-1682-2948 Switch: SW-3515-0057-3813 FF XIV: Q'vehn Tia
Blade works fine for me so far. It's essentially just a very lightweight wrapper that turns "{{ ... }}" into "<?php ... ?>" and @if(...) for control stuff in a cached template, with some extra bells and whistles (partials and stuff) beyond that.
This is a simple layout that calls some partials, and page-specific sub-views kick their content into the @yield('content') part.
This morning I wrote my first multi-threaded program since I was in school. It's just a little script to test the concurrent performance of one of our SOAP services that does a lot of heavy lifting. It is running and such, but I'd appreciate a little feedback on how I'm doing it wrong since I'm not used to this whole threading thing.
url_to_test = "http://example.com/poppybutts.wsdl"
service_name = "DoStuff"
valid_response = "<TheImportantStuff>"
input_file = "input_filename.xml"
attempts = 100
class TestThread(threading.Thread):
def __init__(self, url, service, postdata):
threading.Thread.__init__(self)
self.url = url
self.service_name = service
self.post_data = postdata
self.running_time = 0
self.response = ""
def run(self):
start = time.time()
try:
client = suds.client.Client(self.url) # yes, the soap library is called 'suds'
self.response = getattr(client.service, self.service_name)(self.post_data)
except:
pass # failure only needs to be counted, not explained
self.running_time = time.time() - start
if __name__ == '__main__':
with open(input_file, 'r') as f:
data_to_send = f.read()
thread_list = []
success_count = 0
successful_time_total = 0.0
start_time = time.time()
for _ in range(attempts):
current = TestThread(url_to_test, service_name, data_to_send)
thread_list.append(current)
current.start()
for item in thread_list:
item.join()
if valid_response in item.response:
success_count += 1
successful_time_total += item.running_time
print str(success_count) + " of " + str(attempts) + " attempts successful"
print "Average successful response: " + str(round(successful_time_total / success_count, 4)) + " seconds"
print "Total run time: " + str(round(time.time() - start_time, 2)) + " seconds"
It seems to work properly in that it total running time isn't drastically higher than the average thread time for a modest number of requests. Am I doing terrible things here or is this about the right approach?
I think that the internet has been for years on the path to creating what is essentially an electronic Necronomicon: A collection of blasphemous unrealities so perverse that to even glimpse at its contents, if but for a moment, is to irrevocably forfeit a portion of your sanity.
Xbox - PearlBlueS0ul, Steam
If you ever need to talk to someone, feel free to message me. Yes, that includes you.
I am guessing this piece of shit laptop just shit the bed because it's been at 100% CPU usage for 2 hours now. Goddamn it. Fucking multi-billion fucking dollar company and they can't fucking spend any fucking money on giving us software developers any fucking computers.
So, I decided to learn this "programming" thing and maybe try and make a game or two while I do it.
Right now, I'm going through CodeAcademy courses on Javascript and I was wondering...
Can you make a timer in Javascript? Because i have this idea for a game in the same vein as Candy Box and A Dark Room and i'd need to take time into account.
If you wanna check out a really cool application of JavaScript, read through the code to Cookie Clicker. It's pretty messy in places because the game is still in development, but there's some really neat game uses of the language in there.
It's not the computers, it's the heavy handed IT policies that impact all users, regardless of need because Dorthy, the doting 50 year old secretary, can't stop clicking forwards from grandma.
not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
So, I decided to learn this "programming" thing and maybe try and make a game or two while I do it.
Right now, I'm going through CodeAcademy courses on Javascript and I was wondering...
Can you make a timer in Javascript? Because i have this idea for a game in the same vein as Candy Box and A Dark Room and i'd need to take time into account.
If you wanna check out a really cool application of JavaScript, read through the code to Cookie Clicker. It's pretty messy in places because the game is still in development, but there's some really neat game uses of the language in there.
Thanks for that! I didn't think the code would be easily available like that... Dunno why. Cookie Clicker is great.
Posts
Net progress: zero
15 minutes later I had the output.
He was telling you what he was going to charge the client for it.
When you mark something off on your worksheet about taking 15 minutes, I guarantee you they will bill that as at least 8 hours worth of work.
Another thing most people don't know: companies charge stupidity fees if you act like an ass or waste their time.
My company is doing this. We have a client who raked us over the coals on our last project due to a combination of mismanagement and developer incompetence on our end (both people got fired, and me and my manager took over the client). They asked for all sorts of free work that cost us a lot of money.
So now that they've signed another contract with us, we are padding all the time on our current work by a few hours per item. I don't really like it, but hey man I just do the code. As long as the client is making happy noises at my manager and leaving me the hell alone, I'm cool :P
It's more or less pushing the limit of what I want to put in a single Python file but oh well. What kept tripping me up was the tendency of all the subthreads that I ended up needing to hit exceptions and not die gracefully. And all this is mostly in service to my strong desire to not have any 1 second delays to try and synchronize things - everything blocks or signals when it's done and reacts immediately.
Pure business reason for it. If you bill for exactly how long it always takes, if there's ever an issue, you have no float to cover it.
Oh a computer breaks that was our fault? We won't get paid.
Oh a computer breaks that was their fault? We won't get paid.
People like to not pay.
This is why if you're a contractor you don't use your hourly wage you'd get if you were salary. Aside from HR expenses and all that, you'll want to use almost three times your wage because you need to cover lack of work, overhead for getting tools and equipment, and dealing with assholes.
Three times your wage is going lowball in my opinion.
{{ Former::open()->action(URL::route('contest.store')) }}Because I like having my helper classes that spit out Bootstrapified HTML for me. I don't want to have to re-implement it by wrapping every method the helper has to make the template engine happy.
Makes sense. I'm still getting used to this business, it's my first job and I've been out of college less than a year.
I think I got lucky with my company, it's small enough that I can make an impact and feel important, and large enough that we aren't worried about going out of business or anything. Definitely not a corporate culture, the owner used to be the lead singer of a rock band.
Sure. But you don't want erroneous spaces in your strings. Doing it manually isn't going to improve it, at all.
That sounds like the work of replace.
Stupid namespaces!
Yeah you'd see that kind of slowdown with a lot of regex. Which is why I supposed replace/replaceall.
Right now, I'm going through CodeAcademy courses on Javascript and I was wondering...
Can you make a timer in Javascript? Because i have this idea for a game in the same vein as Candy Box and A Dark Room and i'd need to take time into account.
Thanks in advance.
(Learning things is exciting)
Check out my site, the Bismuth Heart | My Twitter
This is the situation where regex is the appropriate answer then. Collapsing whitespace in the middle of a string is an okay use.
@21stCentury
setInterval is what you're looking for.
https://developer.mozilla.org/en-US/docs/Web/API/Window.setInterval
Cool, thanks for the quick response!
My nefarious plot advances!
Check out my site, the Bismuth Heart | My Twitter
...what is that code block supposed to do? I use twig exclusively, and aside from form rendering (forms are a weak spot with all of Sensio's offerings), don't have any issues with it.
Switch: SW-3515-0057-3813 FF XIV: Q'vehn Tia
Former::select('clients')->options($clients, 2) ->help('Pick some dude') ->state('warning')into this
<div class="control-group warning"> <label for="clients" class="control-label">Clients</label> <div class="controls"> <select id="clients" name="clients"> <option value="0">Mickael</option> <option value="1">Joseph</option> <option value="2" selected="selected">Patrick</option> </select> <span class="help-inline">Pick some dude</span> </div> </div>Switch: SW-3515-0057-3813 FF XIV: Q'vehn Tia
This is a simple layout that calls some partials, and page-specific sub-views kick their content into the @yield('content') part.
Also, my totally brilliant debug stuff.
<!DOCTYPE html> <html lang="sv"> <head> <title></title> @include('partial.head') </head> <body> @include('partial.nav') <div class="container"> @include('partial.flash') @yield('content') </div> @if(false) <div class="container container-debug"> @include('debug.input') @include('debug.session') </div> @endif @include('partial.js-footer') </body> </html>url_to_test = "http://example.com/poppybutts.wsdl" service_name = "DoStuff" valid_response = "<TheImportantStuff>" input_file = "input_filename.xml" attempts = 100 class TestThread(threading.Thread): def __init__(self, url, service, postdata): threading.Thread.__init__(self) self.url = url self.service_name = service self.post_data = postdata self.running_time = 0 self.response = "" def run(self): start = time.time() try: client = suds.client.Client(self.url) # yes, the soap library is called 'suds' self.response = getattr(client.service, self.service_name)(self.post_data) except: pass # failure only needs to be counted, not explained self.running_time = time.time() - start if __name__ == '__main__': with open(input_file, 'r') as f: data_to_send = f.read() thread_list = [] success_count = 0 successful_time_total = 0.0 start_time = time.time() for _ in range(attempts): current = TestThread(url_to_test, service_name, data_to_send) thread_list.append(current) current.start() for item in thread_list: item.join() if valid_response in item.response: success_count += 1 successful_time_total += item.running_time print str(success_count) + " of " + str(attempts) + " attempts successful" print "Average successful response: " + str(round(successful_time_total / success_count, 4)) + " seconds" print "Total run time: " + str(round(time.time() - start_time, 2)) + " seconds"It seems to work properly in that it total running time isn't drastically higher than the average thread time for a modest number of requests. Am I doing terrible things here or is this about the right approach?
Thanks!
If you ever need to talk to someone, feel free to message me. Yes, that includes you.
I am guessing this piece of shit laptop just shit the bed because it's been at 100% CPU usage for 2 hours now. Goddamn it. Fucking multi-billion fucking dollar company and they can't fucking spend any fucking money on giving us software developers any fucking computers.
If you wanna check out a really cool application of JavaScript, read through the code to Cookie Clicker. It's pretty messy in places because the game is still in development, but there's some really neat game uses of the language in there.
Thanks for that! I didn't think the code would be easily available like that... Dunno why. Cookie Clicker is great.
Check out my site, the Bismuth Heart | My Twitter