Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb
Is it more common to write variables as someVariable or some_variable? I can't decide which to use. I like using someMethod() instead of some_method(), so I'm thinking it would make more sense to use some_variable.

Adbot
ADBOT LOVES YOU

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb

nbv4 posted:

Is there an easy way to debug javascript on IE? My site works fine in mozilla browsers, but literally none of the javascript functions work in IE. All IE gives me is a vague "invalid argument" type error which makes it hard to figure out whats wrong.

IE8 has a development mode that is like a lovely version of Firebug. You can also emulate IE7 with it.

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb
If I have a class with 3 members: id, name, parentId, and I want to print out the hierarchy like:

something
-here
--there
--every
--where
-zing
--ding
---wing
-test
--this

How would I go about doing it? It seems like recursion would be appropriate here, but I have very little experience with recursion.

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb

Incoherence posted:

You're not being clear on your problem. I am guessing that you have a map of IDs to these structures somewhere, and that id and parentId are keys into that map, thus forming some sort of N-tree of IDs. The thing I can't guess is whether you want to print the tree from children up (so, "here" would be the parent of "something") or from the parents down (so, "something" would be the parent of "here"). The latter is somewhat more complicated, since if you want to do that, what you really want is to know all children of a given parent, at which point you do a preorder tree traversal.

Sorry, I want to print the tree from the parents down

parent
-child1
--subchild1
--subchild2
-child2

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb

Waltzing Along posted:

We have a wiki set up and are planning on creating a page for every office. The page would include everything from the workstation serial and asset tag to the office phone numbers and address to the networking equipment, including pictures of certain key pieces of equipment.

I don't think a wiki would be the best solution in this case. Have you guys thought about using a program based specifically on inventory? There are a lot of them out there and it makes it way easier to run reports and stuff, that seems like it would be nearly impossible with a wiki.

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb

Waltzing Along posted:

They favor the wiki because it is free. Management is learning of its limitations but likes the price.

You should do more to convince them that it will be worth it, because it will be, without a doubt. The amount of money you will spend on extra time trying to do simple things with the wiki will far outweigh the couple thousand dollars you spend on a nice inventory application. Not to mention skimping on a critical and inexpensive piece of a potentially multi-million dollar project (not sure of the size of your company) is just stupid.

What if you want to figure out how many Dell D620 laptops were purchased before a certain date? Good luck doing that with a wiki.

If the requirements aren't too much more than what you posted earlier you could write this webapp yourself with a minimal amount of time, or pay to have somebody write it for relatively cheap.

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb

rugbert posted:

I need something for webpages that lets you drag and drop supplied images onto an image with a predefined perimeter. Specifically, I wanna make something like
this

but not nearly as complex. So what language would I have to teach myself to do that, or does anyone know of some free code I can grab?

I'd go with the same thing that page uses, Actionscript. You should be able to find plenty of drag & drop tutorials. You can use FlashDevelop and the Free Flex 3 SDK to do this for free without having to buy Adobe Flash CS3. You could also probably do it in javascript, but it will be painful.

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb

csammis posted:

look around on Sourceforge

Kinda off topic, but why is the message board software they use on sourceforge so horrible?

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb

Ashex posted:

I'd like to create a script of some sort that would basically take a folder of images, and generate a custom html page with it. It would be a pretty basic window, scroll through the images, click on it, and javascript would fill a field in another window (would be spawned from that one).
I'd like to schedule this to run on a windows server. I'm not entirely sure what language to use, or where to start. Should I use VBscript for this? I did some searching on this and everything I found was using perl.

If someone can point me in the right direction with this, I'd appreciate it.

Not exactly what you are looking for, but if you have php available, picKLE is a great minimalist image gallery.

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb
How trivial is it to compromise a newer default OS install that a typical server provider would give you out of the box? Windows? Redhat? Ubuntu? I wouldn't even know where to begin to try to get in aside from very basic things.

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb
What tools should I look into for taking video from a USB webcam and doing something useful with the data like persistent object detection? I noticed MATLAB has some video capture stuff built in. Anybody have any good resources on that sort of thing?

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb

socialsecurity posted:

I am trying to make a web form for a customer, I've made plenty in Php before but this guy is wanting nearly spreadsheet capabilities. Like if they put 20 of an item in a spot he wants it to calculate the price right there on the same window right then. I've seen this done before but am not exactly sure what I should be looking for to make it happen, even a point to the right programming langlauge would be helpful.

Javascript

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb
I want to parse a human readable string of time spans, not really sure how to approach this to make it clean. I'm sure I could come up with something that works, but I have a feeling it will be a sloppy mess of poo poo if I don't go in with a plan of attack. I'll be using Java for this.

The basic format is:
1:00pm to 2:00pm and 3:00pm to 4:00pm

It can come in other variations:
1:15-2
1-2 3-4
1-2 and 3-4
1 to 2 and 3-4
1300-1400

I also want to handle overlap:
1-2 and 2-3 turns into 1-3

Can anybody give me a nudge in the right direction?

fletcher fucked around with this message at 21:07 on Mar 18, 2009

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb

L:ordSilent posted:

stupid question:

Is it possible to make a program to access a website and do whatever it is that you do on that website without the site having an api? (im not sure if thats the best way to ask this..)

Yea, typically this is possible to do. I've used cURL to do this. Google for things like "http post <language>" and you can find all kinds of examples in php, python, java, etc

fletcher fucked around with this message at 03:59 on Apr 23, 2009

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb
I really like the little outline ruler to the right of the scroll bar in Eclipse, where it will show you where in the file you have a //TODO or if you highlight a variable name it will mark all occurrences of it in the file on the ruler. I'd like to be able to do this for javascript as well. I tried the JSDT plugin for eclipse but it doesn't seem very good. Is there maybe a Outline Ruler like plugin for Notepad++?

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb

ErIog posted:

Though, this is probably because I just needed very simple things from the XML in the first place.

That's how the project always starts and before you know it it will have grown into some mammoth thing that is impossible to maintain. Using the regexp may work for the really simple tasks, but the library works for both the simple tasks and the complex.

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb
What regex pattern do you guys use to validate an email address?

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb

Avenging Dentist posted:

code:
(?:(?:\r\n)?[ \t])*(?:(?:(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t]
)+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:
\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(
?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ 
\t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\0
31]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\
](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+
(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:
(?:\r\n)?[ \t])*))*|(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z
|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)
?[ \t])*)*\<(?:(?:\r\n)?[ \t])*(?:@(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\
r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[
 \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)
?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t]
)*))*(?:,@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[
 \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*
)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t]
)+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*)
*:(?:(?:\r\n)?[ \t])*)?(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+
|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r
\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:
\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t
]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031
]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](
?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?
:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?
:\r\n)?[ \t])*))*\>(?:(?:\r\n)?[ \t])*)|(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?
:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?
[ \t]))*"(?:(?:\r\n)?[ \t])*)*:(?:(?:\r\n)?[ \t])*(?:(?:(?:[^()<>@,;:\\".\[\] 
\000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|
\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>
@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"
(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t]
)*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\
".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?
:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[
\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*|(?:[^()<>@,;:\\".\[\] \000-
\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(
?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)*\<(?:(?:\r\n)?[ \t])*(?:@(?:[^()<>@,;
:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([
^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\"
.\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\
]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*(?:,@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\
[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\
r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] 
\000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]
|\\.)*\](?:(?:\r\n)?[ \t])*))*)*:(?:(?:\r\n)?[ \t])*)?(?:[^()<>@,;:\\".\[\] \0
00-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\
.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,
;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?
:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*
(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".
\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[
^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]
]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*\>(?:(?:\r\n)?[ \t])*)(?:,\s*(
?:(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\
".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(
?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[
\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t
])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t
])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?
:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|
\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*|(?:
[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\
]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)*\<(?:(?:\r\n)
?[ \t])*(?:@(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["
()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)
?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>
@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*(?:,@(?:(?:\r\n)?[
 \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,
;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t]
)*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\
".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*)*:(?:(?:\r\n)?[ \t])*)?
(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".
\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:
\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\[
"()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])
*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])
+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\
.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z
|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*\>(?:(
?:\r\n)?[ \t])*))*)?;\s*)

hey thanks that worked great!

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb
I ended up using this for help with validating an email address. I don't really care if the email address actually exists or not, I just don't want to bother storing an email address that isn't even valid in the db.

The application is a spambot designed to target CoC users, if anybody cares.

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb

Flamadiddle posted:

Probably a really stupid question, but I have a question about for-each loops.

I fully understand how to use them and what they do, but is there any reason (above readability) to use one in place of, say, a for loop stepping through an array? Is there a performance improvement either way?

Edit: I'm more specifically talking about Java here, if that makes any difference.

wikipedia posted:

Unlike other for loop constructs, however, foreach loops [1] usually maintain no explicit counter: they essentially say "do this to everything in this set", rather than "do this x times". This can potentially avoid off-by-one errors and make code simpler to read.

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb
I'm trying to think of a simple set of rules to determine if "6-1" should be interpreted as 6:00AM-1:00PM or 6:00PM-1:00AM. The one closer to normal business hours is the 'correct' one. I feel like this should be really simple, but I just can't think of what it is.

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb

Avenging Dentist posted:

Distance in hours between centers of time (a la center of mass).

As in, the distance between the center of the input time and the center of the business day? What about for an input of something like "5-6" ?

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb
Awesome! Thanks guys!

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb

ThatNateGuy posted:

So far, I understand that it's essentially a class that adds various 'standard' methods and fields when instancing a class which implements the interface. What I don't get is what use that is. Wouldn't it be just as easy to modify or extend the class to include any new code?

Yeah, you could do it, but it just wouldn't be quite as formal and well defined. Having it implement the interface forces it to have all those methods implemented, and throws up one one of them isn't.

http://java.sun.com/docs/books/tutorial/java/concepts/interface.html

http://java.sun.com/j2se/1.4.2/docs/api/java/util/Set.html

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb

Avenging Dentist posted:

Trying to secure PHP code is like trying to drink through a sieve. It's possible, but you'd spend more time wrapping it up to be watertight than you would have taken just to go get a glass.

Having a consistent way of interacting with a HashSet, LinkedHashSet, and TreeSet just makes it easier to use them. Interacting with them is consistent because they all implement the same interface.

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb

dyn posted:

I'm trying to create a regular expression in use with split in perl that will grab the base site from ARGV, but I have yet to find one that will work. Example: When the user enters http://www.google.ca I want to be able to extract google from the variable. Any ideas?

You could do it with a regex but most languages have a URL class to assist with something like this, you may want to look for one.

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb
If an application is completely controlled by different key/values in a JSON object, what's the best way to document all the different parameters you can use?

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb

Avenging Dentist posted:

By... listing the valid keys? I'm not sure what you're asking here.

I guess I'm looking for a good example that is already out there of what I'm trying to do.

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb

haveblue posted:

It's not really a complex problem. You can probably get away with a simple two-level list.

  • Key 1: [text]
    • Value 1: [text]
    • Value 2: [text]
  • Key 2: [text]
    • Value 1: [text]
    • Value 2: [text]

Some of the values should be other JSON objects, some should be an array of values, etc, so it is a bit more involved. I guess I should have mentioned that, my bad!

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb

Avenging Dentist posted:

By... listing the valid keys? I'm not sure what you're asking here.

Still looking for suggestions on this. Basically I want to see if I can improve this.

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb

Avenging Dentist posted:

Well, step one would be to make the actual options better designed. Since this is presumably meant to be used in a browser, you should be using the already-existing browser names for things. "colour?" "background-colour"? "on-click"? "alpha"? (this last one should be "opacity").

Step two would be cleaning up your quotation marks.

Step three would be to get rid of the bold red (it is really annoying) and to just add a "compatibility" column.

Also drop the "Object" column, format the example better, add hyperlinks to cross-reference the sub-objects, and add some headings in there.

For extra credit, stop using OpenOffice to write your documentation and get a tool designed for writing documentation. Sphinx works well for Python, but you might be able to make it work for this too (or just use plain-Jane ReST).

That page I linked isn't mine, it is what I intend to replace. Unfortunately I don't have enough control over the source code (yet) to rename all those attributes, otherwise I would. Is there nothing else out there that uses a JSON formatted object like this so I can see how they documented it?

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb
I've got a situation where data is stored in two different RDBMS's and I need to essentially do a simple JOIN between two tables that are in the different systems.

I started out by just grabbing all the info from one and doing a giant IN () clause when I query the other database, which gave me the "Packet too large" once my query got over 1MB. The biggest the query will ever be is about 2MB. Should I simply raise the max_allowed_packet variable to allow for my massive IN()? Should I load the data into a temp table and then do a JOIN? What is the fastest solution here? This is in Java and the db server I have control over is MySQL.

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb
How do you ask a senior developer about the formatting of their code without offending them?

It's so hard to read when it's 5,000 lines of:

code:
function getAccRes()
{
if (something) {
              doThis()
}
else
{
      doThat()
}}

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb
code:
if ((max == null) || (value > max))
vs

code:
if (max == null || value > max)
GO

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb

Triple Tech posted:

Depends on the priority of the operators. Usually operators of equality would bind tighter than operators of logic. So... my guess is equivalent, the first one is just being more explicit. It really depends on the language.

So assuming they are equivalent, which would you use?

I prefer the first one, but that may just be because I've used a TI-89 for so many years I'm obsessed with parentheses.

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb
I'm thinking about rewriting The Awful Yearbook. I've been writing a bunch of Java lately and going back to the dynamically typed PHP is a bit frightening. Am I crazy for just wanting to rewrite the whole thing? I'm also a huge fan of Eclipse now, I never was able to find a PHP IDE I really liked. Am I going to regret this?

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb
PHP supercomputing cluster :science:

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb

Uziel posted:

Was curious if anyone was aware of a website/project for adding user data to a google map with SA user authentication. I've seen something similar before but can't for the life of me find anything about it. I know it would need to interact with the SA user auth system, or scan user profiles or something, then use the google maps API, etc.

Specifically, in the W&W subforum, there is a sticky thread where people post where they are from, if they are male or female, what gym they go to, their contact information and a brief summary of what they are looking for from a gym buddy.

To me, this is begging to be put into a Google Map, but with a web front end based on SA user profiles or whatever.

Any ideas or suggestions of where to get started?

http://awfulyearbook.com has a google map integration, and you can filter by people that chose W&W as their faction

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb
Anybody know of a simple tool I can use to record/playback mouse & keyboard input?

Adbot
ADBOT LOVES YOU

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb

Munkeymon posted:

How simple? The first thing that comes to my mind is AutoHotKey, but it's a clunky interpreted language.

Yeah that came up when I was googling around for something but I didn't like the sound of it.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply