|
MySQL QUESTIONcode:
code:
code:
|
# ? Jan 9, 2011 10:18 |
|
|
# ? May 22, 2024 20:44 |
|
This'll probably do it http://dev.mysql.com/doc/refman/5.0/en/group-by-functions.html#function_group-concat
|
# ? Jan 9, 2011 15:10 |
|
Nice, thanks. I was using CONCAT() but it didn't seem to do what I wanted to do.
|
# ? Jan 9, 2011 21:41 |
|
This is going to be stupidly easy for someone I'm sure, but I don't know the first thing about batch scripting so I have to ask here instead! At my work we have a bunch of directories set up like this: code:
a) The 2010 folder exists AND b) The 2010 folder IS NOT empty Bonus points if you could make it remove any empty 2010 folders. Sorry if this is an inappropriate place to post this request - I looked for the custom apps thread but it must've been archived or something?
|
# ? Jan 10, 2011 05:50 |
|
I'm sure someone will swoop in and gift you some script, but maybe you could share what you've tried yourself? For example, the rmdir command will remove an empty directory, and Microsoft has a suggestion for testing for the presence of a directory. See what you can come up with!
|
# ? Jan 10, 2011 08:35 |
|
Woofington posted:I would guess its running a linux distro... Then you're looking for cron for simple scheduling. Type crontab -l at the prompt and see what you get.
|
# ? Jan 10, 2011 09:26 |
|
What is the term that I need to use to search for different algorithms for adding and subtracting polygons by knowing the vertices of the different polygons. Basically what Photoshop does for selecting a region with say a box then "subtracting" another box region from it, or "adding" a oval region. It is really easy if I discretize everything to take integer values and just add and subtract binary maps, but I really want a continuous solution. I hope that makes sense.
|
# ? Jan 10, 2011 21:51 |
|
Modern Pragmatist posted:What is the term that I need to use to search for different algorithms for adding and subtracting polygons by knowing the vertices of the different polygons. Basically what Photoshop does for selecting a region with say a box then "subtracting" another box region from it, or "adding" a oval region. I think what you're looking for is boolean operations, Constructive Solid Geometry is an example of a 3D version of it. Google gives me: http://www.cgal.org/Manual/3.3/doc_html/cgal_manual/Boolean_set_operations_2/Chapter_main.html http://www.cs.drexel.edu/~david/Classes/CS430/HWs/p214-weiler.pdf
|
# ? Jan 10, 2011 21:57 |
|
Quick question. Does anyone know a windows script/batch file command that will change the last accessed date on a file to a specified date/time? Basically I need to be able to quickly update an entire directory of files/folders with new accessed dates so they won't be caught by the company's auto archiver. I'd like to be able to work it into a script that I can run ever month or so on folders that have documents that we can't afford to have picked up by the archiver (they are way too hard to get when archived), but I'd also like to have the date/time be somewhat random so that all the files don't have the exact same accessed date. Thanks in advance.
|
# ? Jan 10, 2011 22:25 |
|
Modern Pragmatist posted:What is the term that I need to use to search for different algorithms for adding and subtracting polygons by knowing the vertices of the different polygons. Basically what Photoshop does for selecting a region with say a box then "subtracting" another box region from it, or "adding" a oval region. I've had to wrangle CGAL on Windows if you have to do that and run into any trouble.
|
# ? Jan 10, 2011 23:33 |
|
Plinkey posted:Quick question. echo "" >> filename.ext or copy /b filename.ext +,, work for current time. For arbitrary times grab a Windows port of touch, maybe from unxutils.
|
# ? Jan 11, 2011 15:50 |
|
This is probably too simple for this place (or the incorrect location, sorry!), but I have an excel macro question to ask of you all. I'm working on a wedding list in excel, and there's some sorting functionality I'm trying to macro and assign to a big button for my fiancee. Basically, the list has these headers: Lastname, family designation, head of household, firstname, party invite, party rsvp, wedding invite, wedding rsvp Click here for the full 1104x137 image. Basically, the goal is for the macro to sort last name first, then order members of different families with same name (ie, jones) by a numerical designation (jones 1, jones 2), then it will place heads of the households at the top of the list (for that specfic name) so they can appropriately be addressed in the invitations, then sorted lastly sorted alphabetically by first name. I've got it set up so we can also filter from the headers so that my fiancee and check off people who've gotten invites to the party/wedding, and then filter the list to see who needs what, and how many are coming, etc. TLDR So, now the point. I can go through the sorting steps fine myself, and everything works how I intend. I then go to record the macro in excel, and it works, but as soon as more names are added, the macro does not work. It may work randomly after mashing the hotkeys a thousand times, or they may not. Does anybody any idea what may be happening? *Edit* This is crossposted in the Small Excel Q thread. I didn't realize there was an up to date one, as the one in the megathread was dead. Dead Pressed fucked around with this message at 23:28 on Jan 11, 2011 |
# ? Jan 11, 2011 23:24 |
|
--- moved to Goons for Hire thread.
VirtuaSpy fucked around with this message at 20:43 on Jan 12, 2011 |
# ? Jan 12, 2011 02:11 |
|
Quick (and no doubt ridiculously trivial) C# question from a non-C# developer: I have a form. I click a button on that form and it creates another form. I need the "OK" button to be clicked on this form before the code continues. Looks something like this: code:
|
# ? Jan 12, 2011 09:02 |
|
slotbadger posted:Now, if I click "OK" on the form, it works fine. However, if I hit Enter/Return it doesn't work. The key listener is set-up properly, I just need to know what event to call / how to ensure ShowDialog() returns as DialogResult.OK. First, make sure whatever is getting focus when the form opens has the event listener set up for it as well. If the button is getting focus when the form opens but the listener is only set up to work for the form, it won't work. And to return the correct result, just use the form's DialogResult property, and set it to whatever you want (DialogResult.OK in this case). That will return the desired result and close the form for you. e: To clarify, setting DialogResult won't close it instantly, so follow it up with Close() if you want the form to close right then and there. Mr.Hotkeys fucked around with this message at 09:19 on Jan 12, 2011 |
# ? Jan 12, 2011 09:13 |
|
Mr.Hotkeys posted:First, make sure whatever is getting focus when the form opens has the event listener set up for it as well. If the button is getting focus when the form opens but the listener is only set up to work for the form, it won't work. Ta. Did the trick, and I feel a bit stupid now. For reference, I just added: code:
Thanks! slotbadger fucked around with this message at 09:33 on Jan 12, 2011 |
# ? Jan 12, 2011 09:29 |
|
I was not really sure where to put this. Anyways, I am about to complete my undergraduate degree in computer science. And am wondering if you all have any advice on where to gain leads on developer jobs. Granted I will not be graduating until may, and many jobs posted online are looking for immediate hires. What I have done so far is contacted any company I have worked for in the past to inquire about full time opportunities, as well as applying online to a few larger contractors in the dc area.
|
# ? Jan 12, 2011 16:02 |
|
Have you asked all of your professors? Does your school have a career counselor? They can help. indeed.com is my favorite job search site because it aggregates jobs from lots of sources.
|
# ? Jan 12, 2011 18:13 |
|
DholmbladRU posted:I was not really sure where to put this. This thread has some Get A Job resources / suggestions / advice
|
# ? Jan 12, 2011 18:43 |
|
What do you guys usually do for authentication / authorization with web apps and web services? In the past, I've always created the auth scheme myself, and now I find myself wanting a more general-purpose solution: something that can be used to provide a single sign on regardless of what sort of application I'm developing. My background is not in system administration, so I've got a lot of research to do-- and as part of that, I'm hoping you folks might be willing to share your own opinions on the subject, particularly in regards to how you've solved this problem in your own work.
|
# ? Jan 13, 2011 00:03 |
|
Not sure if this belongs here or in the "Small Math Questions" thread, so I'll just ask it in both! Say I have a list of n jobs. A job has a start time and an end time (just say they're integers). I want to know if any of the jobs conflicts with any other (ie, is overlapping). It doesn't matter to me which job it is in conflict with which other job or how many other jobs - all I want is, for every job, a yes-no answer to the question "is there a conflict?". Put a more computing science-y way, I have a collection of objects: struct Job { int start; int end; bool is_conflict; }; Assuming start and end are defined, correctly set is_conflict for all these objects. I'm having trouble coming up with a solution that isn't O(n^2) in the worst case.
|
# ? Jan 13, 2011 02:21 |
mr. unhsib posted:I'm having trouble coming up with a solution that isn't O(n^2) in the worst case. Sort them by start time. (O(n log n)) Then for each job, if the start time is smaller than the end time of the previous, those two conflict. (O(n)) O(n log n) + O(n) = O(n log n)
|
|
# ? Jan 13, 2011 03:02 |
|
nielsm posted:Sort them by start time. (O(n log n)) start: 1 end: 5 start: 2 end: 3 start: 4 end: 6
|
# ? Jan 13, 2011 04:21 |
|
I suspect that if you revise the algorithm to "if the start time is earlier than the latest recorded end time" rather than just the end time of the previous event, it'll work (and still be O(nlogn)), but I don't have a proof.
|
# ? Jan 13, 2011 04:39 |
ToxicFrog posted:I suspect that if you revise the algorithm to "if the start time is earlier than the latest recorded end time" rather than just the end time of the previous event, it'll work (and still be O(nlogn)), but I don't have a proof. Yeah, oversight. code:
python posted:1 -> 5 (o)
|
|
# ? Jan 13, 2011 04:42 |
|
MariusMcG posted:What do you guys usually do for authentication / authorization with web apps and web services? At my company we use a combination of OpenID and OAuth. OpenID is used for user accounts while OAuth is used for "system accounts" (i.e. application-to-application authentication) and actions taken on behalf of a user. Unlike many uses of OpenID on the web, we restrict the relying parties we develop to only accept authentication from our identity provider(s), similar to Google's suite of applications. Having the option for federated identities is nice because it allows us to segregate portions of our user-base that have conflicting identity requirements (e.g. one group needs to be self-service registration, another needs to have accounts manually provisioned and verified) into separate identity realms. One of the biggest benefits we've seen from this approach is that many popular languages have open source libraries/clients already written for these protocols, so it's fairly straightforward for anyone in the company to interface with our service using their language of choice. Centralizing identity management has lots of benefits of its own since you solve common problems (e.g. attack prevention, account registration, email address confirmation, etc.) once, rather than for each application. This solution has only been in place for about six months, so we haven't encountered any major architectural problems yet. One problem we have run into recently is handling authentication for applications that aren't browser-based. Since OpenID is a web protocol, there isn't an easy way to handle native apps without having the app circumvent some of the benefits of the protocol. If you need to support such applications, you might want to look at alternative (or at least additional) authentication mechanisms.
|
# ? Jan 13, 2011 05:23 |
|
mr. unhsib posted:Put a more computing science-y way.: I have an interval graph, and I want to know if it is proper. iirc you should be able to find the maximum independent set (largest set of non-overlapping jobs) in nlogn too. (also this is used for dna sequence similarity )
|
# ? Jan 13, 2011 05:35 |
|
ToxicFrog posted:I suspect that if you revise the algorithm to "if the start time is earlier than the latest recorded end time" rather than just the end time of the previous event, it'll work (and still be O(nlogn)), but I don't have a proof.
|
# ? Jan 13, 2011 06:24 |
|
The question was "Does this specific job conflict with any other job in this set?" not "Does at least one job in this set conflict with another job?"
|
# ? Jan 13, 2011 06:36 |
|
ToxicFrog posted:I suspect that if you revise the algorithm to "if the start time is earlier than the latest recorded end time" rather than just the end time of the previous event, it'll work (and still be O(nlogn)), but I don't have a proof. Yup, I didn't see this step. Ugh, stupid. Thanks all. Edit - I just stood at a whiteboard and spent 10 minutes coding an O(N^2) algorithm for this problem in C++ at a job interview, mr. unhsib fucked around with this message at 07:03 on Jan 13, 2011 |
# ? Jan 13, 2011 06:55 |
|
pseudorandom name posted:The question was "Does this specific job conflict with any other job in this set?" not "Does at least one job in this set conflict with another job?"
|
# ? Jan 13, 2011 07:21 |
|
Plorkyeran posted:"It doesn't matter to me which job it is in conflict with which other job or how many other jobs" quite explicitly says the opposite. Of course, he does go on to contradict that so I guess I should not assume that when someone restates a problem five times that they will all say the same thing. Dangling modifier error. I meant that i don't care how many other jobs a given job is in conflict with.
|
# ? Jan 13, 2011 07:29 |
|
A more impractical but neat in a conceptual sense method would be to sort the jobs by start time and then create an array twice as long as the number of jobs. Fill the array with the start time of the first job, then the end time, then the start time of the second and so forth. If you sort that array with an insertion sort, the number of exchanges you make should equal the number of conflicts.
|
# ? Jan 13, 2011 18:49 |
|
I wrote this code to convert RGB color to HSI as a first programming project. It's slow as poo poo. I'm told it's because of all the If and Which statements, etc. and that I should look into alternatives. Knowing nothing about computer science, I don't know what a replacement would look or feel like. I don't grasp the concept that there exists something different that is faster and serves the same purpose. What is the substitute for loops like For and If and Which?code:
|
# ? Jan 15, 2011 01:03 |
|
You have multiple If statements with exactly the same test, and exactly the same loop statement inside. Just combine them. For example, instead of: code:
code:
|
# ? Jan 15, 2011 01:28 |
|
mr_jim posted:You have multiple If statements with exactly the same test, and exactly the same loop statement inside. Just combine them. I wanted to do this, but didn't know it was syntactically legal. Thanks. I'll replace the other areas with similar code. Anything else? Is there some sort of complete replacement for For/If language? Jam2 fucked around with this message at 02:02 on Jan 15, 2011 |
# ? Jan 15, 2011 01:53 |
|
Jam2 posted:Is there some sort of complete replacement for For/If language? What
|
# ? Jan 15, 2011 02:21 |
|
tripwire posted:
I dunno either man. In computing, when I'm told there's a better/faster way to do something, I don't attempt to disprove it, especially when my algorithm takes several minutes to an hour to process large 1920x1200 images. I always feel like there must be a better way.
|
# ? Jan 15, 2011 02:34 |
|
Jam2 posted:I wanted to do this, but didn't know it was syntactically legal. Thanks. I'll replace the other areas with similar code. Anything else? Some languages have constructs that allow you to specify program logic at a "higher level," in the sense that you describe more what the program is doing than how the program is doing it. (This was what I thought of when I read your question, anyway.) You won't necessarily get any better performance - some people just find it easier/more efficient/more fun to work this way.
|
# ? Jan 15, 2011 03:05 |
|
|
# ? May 22, 2024 20:44 |
|
Jam2 posted:I wanted to do this, but didn't know it was syntactically legal. Thanks. I'll replace the other areas with similar code. Anything else? I'm not sure if it is syntactically legal, or if you need to group the statements together with braces or Begin/End. I'm not familiar with whatever language that code is in. However, regardless of language, running what is essentially the same nested loop multiple times is likely to be less efficient that doing everything in a single nested loop. Loops and conditional statements are fundamental to most programming languages, so you aren't going to find something to replace them. The goal is to compose them correctly and efficiently to solve the problem at hand.
|
# ? Jan 15, 2011 03:08 |