|
Thermopyle posted:Does anyone else find that every once in a while they get stuck on a simple problem that you know is a simple problem? After enough times fruitlessly pulling my hair out from 4pm to 6pm, going home for the day, and then solving the problem in five minutes the next morning, I've started just going home at 4 when this happens. (It's nice to be able to do that.)
|
# ? Oct 8, 2013 18:55 |
|
|
# ? Jun 4, 2024 00:04 |
|
GrumpyDoctor posted:After enough times fruitlessly pulling my hair out from 4pm to 6pm, going home for the day, and then solving the problem in five minutes the next morning, I've started just going home at 4 when this happens. (It's nice to be able to do that.) Learning to give up on totally solving stuff TODAY is a big life lesson.
|
# ? Oct 8, 2013 21:02 |
|
Seashell Salesman posted:Learning to give up on totally solving stuff TODAY is a big life lesson. Also learning to schedule your deadline so that it doesn't have to be done TODAY I'm still terrible at predicting how long a task will take me, honestly
|
# ? Oct 8, 2013 21:27 |
This may or may not be a programming question but it does not deserve its own thread! The company I work for is having a problem with a service crashing a lot. It very likely isn't out fault and at this point we just want to monitor it so that if it goes down we know and can get it turned back on. I thought a powershell script might work but I don't think it will monitor in real-time. This wouldn't be a permanent fix, just something to put in place until we can get SCOM up and running. Any suggestions?
|
|
# ? Oct 9, 2013 17:14 |
|
Red Robin Hood posted:This may or may not be a programming question but it does not deserve its own thread! If you want a stop-gap until you get on-premises SCOM up then you can monitor your app using Microsoft Monitoring Agent (http://www.microsoft.com/en-us/download/details.aspx?id=40316). I'll try to dig up a blog post with good instructions on how to use it. Basically it will run the SCOM agent and can either output log files locally or connect to a System Center Manager endpoint to output to a SCOM database. Not sure if this is what you're looking for. For PowerShell you can use the IIS management library [e: Microsoft.Web.Administration.dll was what I was thinking of] to check the status of your app and/or app pool and send off emails in real-ish time? Seashell Salesman fucked around with this message at 18:31 on Oct 9, 2013 |
# ? Oct 9, 2013 17:20 |
|
Red Robin Hood posted:This may or may not be a programming question but it does not deserve its own thread!
|
# ? Oct 10, 2013 19:01 |
|
I don't really know if this question is for CoC or if I should go over to the Haus. I am pretty pathetic with SQL queries beyond a very very very basic point. Problem is, today I've been handed some work my coworker would normally handle. She's out sick. My available resources are pretty limited. I'm turning to you guys for a bit of guidance. I'm sure you'll find this laughably simplistic. I have 475 records in one table which need to be added into another table in addition to several other values. If I was doing this one record at a time, it'd be pretty easy for me -- code:
The sCode column in tblcGenesis will be populated by codes contain in the sCode column from tblzzzzzDA5. I'm guessing this is a join situation? Is left join the way to go? How do I then insert the rest of the new data? Everything needs to be identical with the exception of the new codes inserted from tblzzzzzDA5. I haven't touched this stuff in like five years. I'd like to knock off the rust, though, so I'm not looking for the answer, just a nudge in the right direction. Ugh I feel so dumb for asking at all but seriously I am bad with this.
|
# ? Oct 11, 2013 15:16 |
There is an SQL thread too, but from skimming your question, what you want is an INSERT INTO table (fields, ...) SELECT fields, constants, etc, ... FROM othertable WHERE something.
|
|
# ? Oct 11, 2013 15:31 |
|
nielsm posted:There is an SQL thread too, but from skimming your question, what you want is an INSERT INTO table (fields, ...) SELECT fields, constants, etc, ... FROM othertable WHERE something. Is it titled something odd? I couldn't find it, at a glance. Edit: I worked out my solution and now I feel really dumb. code:
my cat is norris fucked around with this message at 15:40 on Oct 11, 2013 |
# ? Oct 11, 2013 15:37 |
my cat is norris posted:Is it titled something odd? I couldn't find it, at a glance. SELECT * FROM Questions WHERE Type = 'Stupid' Yes.
|
|
# ? Oct 11, 2013 16:36 |
|
The perfect thread for my question on all levels. Thank you.
|
# ? Oct 11, 2013 18:20 |
|
Naturally, as it is an SQL thread.
|
# ? Oct 11, 2013 18:31 |
|
Is there a good alternative to org mode because I am feeling so done with emacs right now.
|
# ? Oct 14, 2013 15:02 |
|
Pollyanna posted:vvvv The problem with C# is that I'm running OSX, which is apparently incompatible with .NET, even for developing it.
|
# ? Oct 15, 2013 15:15 |
|
OK so I have a question about MVC. We have a relatively big web app written in Node.js that we are trying to organize better structurally. It has been proposed that we also abstract our business logic out into a separate domain layer as well. So my question is, if all the business logic is in the domain layer, what are we putting into the Models? Working with Rails it seems like they essentially tell you to put everything into Models. Also what is a good resource to look up questions similar to this?
|
# ? Oct 16, 2013 00:03 |
|
I have a small webapp where the user supplies some information and a plot is generated. The data is sent to my backend (flask + python) via javascript and the resulting JSON is used to generate the plot. I have an option for the user to download a CSV file of the data. Obviously, if I create results.csv somewhere on the server, if someone uses the app prior to another user selecting to download the file, they will get the CSV for the wrong information. What is the best way to handle generating these CSV files? I thought of something like storing the results of the webapp in a database with a unique identifier that is passed back to the webpage within the JSON and then the CSV download link posts the id to the webapp to obtain the results. Is there a much simpler way to go about this? The data being generated and plotted consists of ~50 rows with two columns.
|
# ? Oct 16, 2013 03:13 |
|
That is the standard process when just returning the data directly isn't an option for whatever reason.
|
# ? Oct 16, 2013 03:35 |
|
Modern Pragmatist posted:I have a small webapp where the user supplies some information and a plot is generated. The data is sent to my backend (flask + python) via javascript and the resulting JSON is used to generate the plot. I have an option for the user to download a CSV file of the data. Obviously, if I create results.csv somewhere on the server, if someone uses the app prior to another user selecting to download the file, they will get the CSV for the wrong information. What is the best way to handle generating these CSV files? If you're just generating a csv file just so someone can download it then couldn't you just gather the information to make the csv file and then just render it as a webpage but with the MIME type set to csv?
|
# ? Oct 16, 2013 03:36 |
piratepilates posted:If you're just generating a csv file just so someone can download it then couldn't you just gather the information to make the csv file and then just render it as a webpage but with the MIME type set to csv? Yup I'd go this route. The CSV file never actually has to exist on your server, you just set the mime type (and optionally the content-disposition header so they get the file download dialog) and stream out your CSV data in the response.
|
|
# ? Oct 16, 2013 04:15 |
fletcher posted:Yup I'd go this route. The CSV file never actually has to exist on your server, you just set the mime type (and optionally the content-disposition header so they get the file download dialog) and stream out your CSV data in the response. Expect maybe if the data takes a long time to generate and users would try to hit the download URL several times in a row. (Depending on your hit rate, "a long time" might be at half a second upwards a whole minute, whatever would put too much load on the server.) In that case, you probably should store the generated result. But yeah, start by just returning the data on the fly, you can add caching of the result later.
|
|
# ? Oct 16, 2013 10:18 |
|
Thanks for all of the helpful replies. The processing can take 5-10 seconds depending upon the inputs, so if I'm understanding you guys correctly, it would take 5 seconds to perform the query for visualization and then when the download link is clicked it would perform the same query again prior to outputting a csv? I guess I could try that for now, and I could keep track of how many people go on to download the csv file. I presume most users will just visualize the results in the browser.
|
# ? Oct 16, 2013 13:11 |
Seems reasonable enough. The alternative is to generate the CSV file when they visualize it in the browser, but use a unique filename for the CSV like a UUID. Then when they download it you could optionally give it a filename that is more friendly looking. But then you have to deal with cleaning up those temporary files after a certain amount of time, so they don't accumulate.
|
|
# ? Oct 16, 2013 15:07 |
|
fletcher posted:Seems reasonable enough. The alternative is to generate the CSV file when they visualize it in the browser, but use a unique filename for the CSV like a UUID. Then when they download it you could optionally give it a filename that is more friendly looking. But then you have to deal with cleaning up those temporary files after a certain amount of time, so they don't accumulate. I actually thought about this and using time stamps for filenames then clear them out based on the oldest one.
|
# ? Oct 16, 2013 16:12 |
fletcher posted:Seems reasonable enough. The alternative is to generate the CSV file when they visualize it in the browser, but use a unique filename for the CSV like a UUID. Then when they download it you could optionally give it a filename that is more friendly looking. But then you have to deal with cleaning up those temporary files after a certain amount of time, so they don't accumulate. I would really suggest using a structured front-end cache then, something like memcached or possibly redis. Just cache the raw results of the query using the user's session id and/or hash of query parameters for key, a reasonable expiry time (maybe 5-10 minutes) and be over with it. No need to manage temporary files and risk all kinds of oddities then. (Setting up a front-end cache is a hassle the first time, but saves you the hassle of making and managing web-server writable directories in the long run.)
|
|
# ? Oct 16, 2013 16:17 |
|
Is there a thread in SHSC or CoC where we discuss text editors for coding? I'm on Windows and am using Sublime 3 (after having switched from Notepad++, Komodo Edit and Textpad) but am wondering about other options/what people are using?
|
# ? Oct 16, 2013 16:31 |
|
mister_gosh posted:Is there a thread in SHSC or CoC where we discuss text editors for coding? There used to be one here but I'm pretty sure it's in the archives, might have been a year or so ago? edit: Show off your development environment, there's also been Vim and Emacs threads but come on. piratepilates fucked around with this message at 16:47 on Oct 16, 2013 |
# ? Oct 16, 2013 16:36 |
|
My vote is IDE: Visual Studio, Text editor: (g)Vi(m).
|
# ? Oct 16, 2013 17:01 |
|
piratepilates posted:There used to be one here but I'm pretty sure it's in the archives, might have been a year or so ago? Wow, thanks!
|
# ? Oct 16, 2013 17:24 |
|
I have a long list of RPM packages that contain multiple versions and architectures of the same thing. For instance:code:
code:
|
# ? Oct 16, 2013 18:35 |
|
stubblyhead posted:I have a long list of RPM packages that contain multiple versions and architectures of the same thing. For instance: Maybe for each package/architecture combo (assuming they all start on package & end on architecture, they should be easy to group), you could sort those combos alphabetically & take the last in each group?
|
# ? Oct 16, 2013 21:18 |
stubblyhead posted:I have a long list of RPM packages that contain multiple versions and architectures of the same thing. Do you only have the filenames, or do you have the option to actually open and look inside the files? Because if you do, I'd suggest using the metadata present inside the files. There should be some libraries available to work with RPM files that can give you the information you want. Otherwise, start from the back of the filename. First make a list of all legal architecture names, that will make it easy to chop those off the end of a filename. After that, you know the version number is the last thing in the name. Build a regular expression to match those, it shouldn't be too hard I'd say. In the case of the OpenJDK Javadoc package, the version number is probably 2.3.8.0.el5_9, which is version of the package. What the actual package name is, no idea. You might need to make special cases for some packages you want to sort together, e.g. if you want to groun Java 6 JDK Javadoc packages with OpenJDK 1.7 Javadoc packages.
|
|
# ? Oct 16, 2013 21:34 |
|
I guess I should just shorten my question since I didn't get any replies: What is a good resource about learning MVC? (past just basic concepts for someone who has an understanding of how Rails does it)
|
# ? Oct 16, 2013 21:56 |
|
Strong Sauce posted:I guess I should just shorten my question since I didn't get any replies: What is a good resource about learning MVC? (past just basic concepts for someone who has an understanding of how Rails does it) "MVC" is a wishy-washy name, and it can represent a lot of different architectures. Let's go back to your first question: Strong Sauce posted:OK so I have a question about MVC. Basically, what this advice means is to put your "business logic" away from the part that serves the web pages. I don't know much about your case specifically, so I can't give you much advice about how to implement this, but the idea is that inputs from a web page get translated into a plain model, and then these models get operated on and validated in something that has no idea about the web, even, and then errors/successes get passed back up to something that aggregates the results back into a web page. I know that's extremely generic, so let's give a simple example. Let's say you're building a calendar app, and you're building the "Add Event" page. There's a form where a bunch of things (date/time, event name, participants) are selected. When you get the request on the server, you translate all that data into a series of models, and then have another layer like a Calendar object that has an addEvent(String eventName, DateTime time, List<Person> participants) method. This addEvent method does not know anything about the "web page" front end -- somebody also could have written an app that used it by replying to an email, or from an IRC client, or a desktop app, or from a REST API. The idea is that you have an underlying "business layer" which has all the real important stuff, and your web interface just talks to that API.
|
# ? Oct 16, 2013 22:05 |
|
This is a ding-dong question that is completely tripping me up. So I have this XML file full of parameters that we're editing by hand at the moment (yep). Here's an example of what I'm working with:code:
A. contains a "table" parameter AND B. contains either a "Required" parameter set to "TRUE" or no "Required" parameter at all Element to add: code:
<section name=.*?>(?:table)(?:"Required">True)(?!"Required").*?</section> breakdown: code:
|
# ? Oct 17, 2013 18:41 |
|
no. Nope. NOPE. NOPE.
|
# ? Oct 17, 2013 18:47 |
|
Yeah I know, I just don't feel like crapping out a program for such a simple change.
|
# ? Oct 17, 2013 18:53 |
|
You're crapping one out. You came to us mid-poo poo. We're advocating exactly the opposite: take an XML parser off the shelf.
|
# ? Oct 17, 2013 18:57 |
|
I thought you wanted the Required element to be set to TRUE. But then you want it set to True. Which is it? Edit: It's a good thing you have those paramct attributes. Otherwise you'd never be able to traverse the tree.
|
# ? Oct 17, 2013 19:10 |
|
shrughes posted:Edit: It's a good thing you have those paramct attributes. Otherwise you'd never be able to traverse the tree. Haha didn't notice those at first. Someone should spend some time learning how to XML!
|
# ? Oct 17, 2013 19:26 |
|
|
# ? Jun 4, 2024 00:04 |
|
Just because I post XML doesn't mean I wrote what creates it you big mean jerks! For the record no one here has any idea who stuck paramct in there and nothing we use does anything with it. Edit: shrughes posted:I thought you wanted the Required element to be set to TRUE. But then you want it set to True. Which is it? Note that the element being set to TRUE if the "Required" element is TRUE is called "Dump", not "Required". Jared592 fucked around with this message at 20:02 on Oct 17, 2013 |
# ? Oct 17, 2013 19:58 |