|
Kim Jong III posted:Really the problem is that your question is so vague that it is impossible to answer. Are you trying to store properties for off the shelf services, or for something you wrote? What are the "user interface" issues you are having? We have a variety of applications (all in-house) with key/value properties, most of which have multiple environments, which may or may not share properties between themselves at the environment level. This is already all organised into single database that this property management application controls, and we have another application that provides web service based access to the application properties. This allows us to point every application to the web service and let it pull it's properties out in a fairly standard way. The problem is the software that manages the property store is extremely bare bones (essentially just a split view of the database tables that allows row updates). I'll probably end up just extending the functionality while keeping backwards compatibility, but I wanted to check to see if there were any gold standard application property management software packages I was unaware of.
|
# ? Mar 8, 2012 20:36 |
|
|
# ? May 29, 2024 21:33 |
|
baquerd posted:We have a variety of applications (all in-house) with key/value properties, most of which have multiple environments, which may or may not share properties between themselves at the environment level. This is already all organised into single database that this property management application controls, and we have another application that provides web service based access to the application properties. This allows us to point every application to the web service and let it pull it's properties out in a fairly standard way. Aaah, OK, I see what you're going for. I've heard from some friends who do a lot of administration/operation that Chef works really well in the configuration space. I've never used it myself, and these guys do administration for a large enterprise so it might be overkill for your needs, but they swear by it.
|
# ? Mar 8, 2012 20:52 |
|
shrughes posted:Also [tail call optimization is] really only particularly helpful in event-loop based code with callback functions. And state machines, and probably a few other cases I can't think of right now.
|
# ? Mar 8, 2012 21:43 |
|
Alright, I'm not a regex person by any means (and I don't know if there is a general regex thread), but I have the following regex string that is used to match entries in the Windows Hosts filecode:
Let's just say I'm such a noob with regex that I can't figure out how to do this. Any tips?
|
# ? Mar 9, 2012 19:01 |
|
Wicaeed posted:Alright, I'm not a regex person by any means (and I don't know if there is a general regex thread), but I have the following regex string that is used to match entries in the Windows Hosts file That... doesn't look like the right way to do this in general. e: What exactly are you trying to match the entries for? And shouldn't the hosts file just be comments and valid IPs/URIs? Look Around You fucked around with this message at 19:16 on Mar 9, 2012 |
# ? Mar 9, 2012 19:11 |
|
Look Around You posted:
http://regexr.com?3098q Seriously, this is me and regex: How would you approach the problem? Details: This is going to be used by a Nessus file check template to make sure that the contents of the windows hosts file have not been changed to allow users to get around our URL web filtering software. Wicaeed fucked around with this message at 19:17 on Mar 9, 2012 |
# ? Mar 9, 2012 19:14 |
|
Wicaeed posted:http://regexr.com?3098q What are you trying to do here that you (think you) need a regex for? e: Oh, ok. So you have a reference file that you're comparing it to then that they all need to be the same? e2: I'm actually going to defer here because I don't know anything about Nessus. That monster regex is probably not the best way to do this though. Look Around You fucked around with this message at 19:22 on Mar 9, 2012 |
# ? Mar 9, 2012 19:17 |
|
Look Around You posted:What are you trying to do here that you (think you) need a regex for? hahaha, being able to upload/check vs. a reference file would be too easy. The "reference file" in this case would be a standard windows hosts file (with only the commented out section). I'm (trying to) use regex to return only entries that have been added after the commented out section, that way if the file fails our audit we won't have to go to each computer and inspect the hosts file individually to find out what is there. e1: Well with Nessus you can do file content scanning for PHI, CC#'s, SSNs, etc etc that all rely on regex Wicaeed fucked around with this message at 19:28 on Mar 9, 2012 |
# ? Mar 9, 2012 19:25 |
|
Doesn't this sound more like you need a diff function than a regex matching.. whatever it is that is matching? Essentially you diff on the current file and reference file and have it return you the difference. Edit: If you want to go the regex way, what you need to do is to use ^ to check to see if the start of the line matches the number so something like... code:
Strong Sauce fucked around with this message at 19:36 on Mar 9, 2012 |
# ? Mar 9, 2012 19:30 |
|
You could look into "negative lookbehind" matches, although it is probably easier to use two regexes. Just start by filtering out all lines that match ^\s*# (ie they start with zero or more whitespace, then a comment hash).
|
# ? Mar 9, 2012 19:35 |
|
Strong Sauce posted:Doesn't this sound more like you need a diff function than a regex matching.. whatever it is that is matching? Honestly I was thinking of using a diff tool as well, that's what my question was leading to. I also fail to see how just matching regexes is going to do anything, unless you're comparing the matched results to a predefined list. Given that the Hosts file should be only valid URIs, couldn't you just do string comparisons to a given list (and therefore just use diff)? Carthag's solution of using two regexes is probably the easiest way to handle this if you can only do regex matching for whatever reason though.
|
# ? Mar 9, 2012 19:39 |
|
Wicaeed posted:hahaha, being able to upload/check vs. a reference file would be too easy. I mean there's nothing wrong with regexes but you really want to perform a difference between the original host file & the new one. Does Nessus let you call an executable? You could ship diff.exe & just call that.
|
# ? Mar 9, 2012 19:41 |
|
The problem is that I don't have a reference file, or rather Nessus doesn't expect you to have one to use this feature. What it is doing is getting the contents of a file, then running regex to see if any contents match a certain string, for example, the following audit entry checks for cc #'s when scanning a computer. Obviously this takes a boatload of time:code:
|
# ? Mar 9, 2012 19:52 |
|
Wicaeed posted:I'm just trying to use it for a slightly different purpose. right but we're asking if you can put down the hammer for a minute and look through your toolbox for a screwdriver instead because it's gonna be a lot easier for you. I mean if it's not possible to just look at the SHA of the hosts file, or you can't call a diff program, then you don't have a choice. But if there's an easier and much better way to do this you should look at that first. Like here's a really basic file integrity check: https://discussions.nessus.org/thread/4273 I can't find any good nessus docs, it seems. :/
|
# ? Mar 9, 2012 20:02 |
|
Wicaeed posted:The problem is that I don't have a reference file, or rather Nessus doesn't expect you to have one to use this feature. What it is doing is getting the contents of a file, then running regex to see if any contents match a certain string, for example, the following audit entry checks for cc #'s when scanning a computer. Obviously this takes a boatload of time: So all that does is look to see if there's any CC#s at all? It's just gonna blindly go through and pull out every card number then, which is what it's doing with your IP addresses. I don't think this will be useful at all because you expect the Hosts file to have IPs and URIs.
|
# ? Mar 9, 2012 20:03 |
|
Kim Jong III posted:right but we're asking if you can put down the hammer for a minute and look through your toolbox for a screwdriver instead because it's gonna be a lot easier for you. poo poo that didn't even occur to me to do that. While of course it wont get me the actual entries, I could see that working a whole lot better. edit: Actually this would present it's own set of problems, such as deploying a custom powershell cmdlet on each computer I want to run that command on. Look Around You posted:
Actually for our audit purposes (Domain Workstations where users SHOULDN'T have admin privileges) it would work very well, I think. Wicaeed fucked around with this message at 20:43 on Mar 9, 2012 |
# ? Mar 9, 2012 20:16 |
|
Wicaeed posted:hahaha, being able to upload/check vs. a reference file would be too easy. If an expected file contains only comments then surely your regex just needs to match lines that don't start with a hash? ^[^#].*
|
# ? Mar 10, 2012 01:53 |
|
Wicaeed posted:hahaha, being able to upload/check vs. a reference file would be too easy. I didn't see this earlier. If this is the case than literally all you need to do is get the MD5 (or SHA or w/e) of the individual machines and compare it to the hash of the standard file. If you want to see what changes were made (if any) then you could use a diff. Either way, there's absolutely no reason you need to use a regex here. e: Kim Jong III even gave a link on how to do a check with an md5 or whatever.
|
# ? Mar 10, 2012 02:24 |
|
Goat Bastard posted:If an expected file contains only comments then surely your regex just needs to match lines that don't start with a hash? That doesn't do what you think it does. Generally when you're trying to get rid of comments etc, it's better to blacklist than wwhitelist. That regex will whitelist stuff that shouldn't be.
|
# ? Mar 10, 2012 09:47 |
|
Not really a programming question, but how does Portland compare to Seattle in terms of decent programming jobs available? I would assume there'd be a fair bit more in Seattle but who knows.
|
# ? Mar 10, 2012 15:34 |
|
I need a pointer on something cause I'm really not even sure what to google for. I want to download a large number of files from a site. Usually I would just wget but the files I need are queried by the site for download, so there aren't URLs. Here's an example of a query from the site that fetches a particular document: www.reginfo.gov/public/do/eAgendaViewRule?pubId=200910&RIN=1904-AA92&operation=OPERATION_EXPORT_XML I know python and am decent with the bash terminal so those are my tools. I will need to generate thousands of queries and I can handle that part. The part I don't really get is literally just how to request that file in bash or python and have it appear on my desktop. Could anyone point me in the right direction?
|
# ? Mar 11, 2012 00:25 |
|
Sidpret posted:I need a pointer on something cause I'm really not even sure what to google for. I want to download a large number of files from a site. Usually I would just wget but the files I need are queried by the site for download, so there aren't URLs. Why not shell out from bash/python to wget?
|
# ? Mar 11, 2012 00:41 |
|
floWenoL posted:Why not shell out from bash/python to wget? Wget doesn't work. Or maybe it would with appropriate options? I don't know wget that well. But like if you just wget that link I gave it will not fetch the appropriate file, and will instead return their 404 page.
|
# ? Mar 11, 2012 01:07 |
|
wget won't work at the shell prompt if you're not quoting the URLs; those &blah=blah will get cut off.
|
# ? Mar 11, 2012 01:09 |
|
pseudorandom name posted:wget won't work at the shell prompt if you're not quoting the URLs; those &blah=blah will get cut off. Oh wow that was it. Thanks guys
|
# ? Mar 11, 2012 01:17 |
|
Carthag posted:That doesn't do what you think it does. How do you mean? An invalid line is a line that isn't a comment (this doesn't guarantee that the file hasn't been edited, but does guarantee that any edits don't actually DO anything). A comment is a line that starts with a hash (a comment starting partway through a line is still an unexpected line). That regex matches any line that starts with a character other than a hash. Since he described the problem as "I want to write a regex to match unexpected lines", this sounds exactly like a blacklist to me. Not saying I haven't missed something, but other than new comments (which aren't dangerous - he stated he is looking for people using the host file to circumvent their proxy, which to my knowledge you can't do by writing a bunch of comments) I don't see how this will allow any lines that he doesn't want.
|
# ? Mar 11, 2012 03:55 |
|
I'm trying to write a macro for Word. I have done some before but I ended up working out how to do everything I needed in find and replace and then just recording it. I have no experience with VB at all, but it seems like the only way of getting this done the way I want it. Each document is made up of mini reports, laid out as a table but in text. I want to search through the document, find a specific report, copy a specific column (because the number of rows fluctuates day to day) and then copy that into a separate document. So from this example code:
I mean in terms of just recording one, I know that (From LONDON to LEEDS)*(Bake?)*(end of report.) replaced with \2 would get me close to what I want, is there a way of getting all instances of (Bake?) in that specific report selected as one and then deleting the rest?
|
# ? Mar 11, 2012 13:54 |
|
Fat Guy Sexting posted:I mean in terms of just recording one, I know that (From LONDON to LEEDS)*(Bake?)*(end of report.) replaced with \2 would get me close to what I want, is there a way of getting all instances of (Bake?) in that specific report selected as one and then deleting the rest? Run the macro, enter your source and destination cities and it should pull the data from the subreports, dumping column 2 into a new document. I tested it out with a few copy/pastes of the sample data with differing locations and had no issue. You could probably change the input from an inputbox to a drop-down box of locations and select from that. It probably requires some more error-checking (currently if it can't find the "From <city1> to <city2>" line it stops the macro, but if for some reason the subreport has no "end of report." footer it'll select extra text until it finds the next one), but other than that it seems fine. All it does is search for From <term1> to <term2>, sets the start of the range to select as 2 characters after that, then searches for "end of report." and sets the end of the range to select as 2 characters before that. It then converts the text to a table (auto-delimited), selects Column 2 and copies that to a second document. Edit; and here's a copy that you can bind to a key, and (with the cursor inside the subreport you want) run the macro and it'll pull column 2 out of that specific report http://pastebin.com/bgbvtZA6 The Gripper fucked around with this message at 12:42 on Mar 12, 2012 |
# ? Mar 11, 2012 14:56 |
|
To generate random numbers in Java, you'd do something like this:code:
hayden. fucked around with this message at 01:55 on Mar 13, 2012 |
# ? Mar 13, 2012 01:50 |
|
hayden:
|
# ? Mar 13, 2012 01:56 |
|
It also lets you create your own implementations to work for whatever specific requirements you have. Also there is the case where multiple threads are generating random numbers. If there were a single RNG all of them would have to synchronize on that somehow; this way they can each have their own local RNG.
|
# ? Mar 13, 2012 06:04 |
|
Internet Janitor posted:
This. When you create a Random object, you have the option to pass in a seed. If you use the same seed, the generator will pump out the same series of numbers every time. If you don't use the constructor where you pass a seed (or use Math.Random), it uses the current value of the system's clock as the seed so you'll, in theory, never get the same series of numbers ever, which is generally what you want. But, like was said above, having the same values come out makes testing a lot easier and there are other applications where this is desirable, the example at the top of my head being seeding the terrain generator in a Worms game.
|
# ? Mar 13, 2012 10:50 |
|
Would anyone be interested in a Processing thread? It's my language of choice at the moment and I wonder what goons do with it, though I'm not sure if enough people use it
|
# ? Mar 14, 2012 04:50 |
|
In Processing, how do I use super() to create a subclass which inherits the traits of the parent class? Relevant part is at the end:code:
edit: wow just noticed the above post.
|
# ? Mar 15, 2012 05:23 |
|
I don't know anything about Processing, but it doesn't look like you're using super correctly. It should be:code:
|
# ? Mar 15, 2012 05:28 |
|
^^Edit; pretty much this, except you don't want to pass tempScaled into super() The inheritance example in the documentation has the exact solution you're needing - see class SpinSpots extends Spin {} You're using super() correctly but not passing the right variable names in, and not setting Scaled properly. Change the constructor to: code:
This won't magically scale your model down (I don't know what the call to scale() is), so you'll likely need to call scale(Scaled) later The Gripper fucked around with this message at 08:31 on Mar 15, 2012 |
# ? Mar 15, 2012 08:28 |
|
I recently got the worst SDK ever for something with source code examples in C++, C#, Java, and VB of various flavors. The Java code has some actual comments in it, but due to a missing DLL in the installation I can't run it. The other examples simply don't work. I actually was more successful before when I was scraping stuff together from crap online--at least I can connect to the device in my code! I decided to try all the other language examples and it was all the same--if I could compile it at all. In the C++ project, I found a note about the source being generated by AppWizard. I've looked this up and got various things: 1. OGRE's got one for generating projects, as far as I can tell. 2. There's one for app generation on the iPhone. 3. AppWizard is short for application wizard in some part of the normal windows development process, but certainly not for making GBS threads out stuff in different languages. I wondered if anybody had heard of an AppWizard thing that generates code for different languages from some base code. It could be I'm misinterpreting what it's doing. I ask because the SDK comes with demo programs that do work, but they don't have source. I am assuming if I can figure out the base code, then that's likely the one that works of the whole lot. ...but chances are that I'll just have to wing it from the source code because I've already been more successful. I'll have to just suck out all the magic numbers from their source and use them in my stuff.
|
# ? Mar 16, 2012 15:34 |
|
AppWizard is the Visual Studio component that generates a skeleton C++ program. IIRC all it does is set up the project to include precompiled headers, link to MFC, etc.
|
# ? Mar 18, 2012 02:26 |
|
Looking for an alternate way to validate an ISBN 10 using regex. At least everything but the checksum. It must start with a digit and must end with a digit or X. And it can contain exactly 0 or 3 hyphens with none of the hyphens sequential. Using regex, I believe the expression must start with ^\d and end with [\d|X]$. Building the middle I'm becoming stumped getting it to work.
|
# ? Mar 18, 2012 08:16 |
|
|
# ? May 29, 2024 21:33 |
|
calcio posted:Looking for an alternate way to validate an ISBN 10 using regex. At least everything but the checksum. I don't know if this is actually able to be expressed with a regex... it doesn't sound like a regular language to me. Note that I could be wrong though; I don't remember all that much of my formal methods class w/r/t regular languages and the pumping lemma and stuff.
|
# ? Mar 18, 2012 08:37 |