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
Golbez
Oct 9, 2002

1 2 3!
If you want to take a shot at me get in line, line
1 2 3!
Baby, I've had all my shots and I'm fine
Not sure if this counts as programming, but... is there any way to automatically export a table from a MS Access database to CSV? The only methods I can find so far require going through the application and doing it manually, or using a third-party program that appears to dump the whole database.

Adbot
ADBOT LOVES YOU

TasteMyHouse
Dec 21, 2006

Golbez posted:

Not sure if this counts as programming, but... is there any way to automatically export a table from a MS Access database to CSV? The only methods I can find so far require going through the application and doing it manually, or using a third-party program that appears to dump the whole database.

This might be something you can do in Powershell? check out the powershell thread.

baquerd
Jul 2, 2007

by FactsAreUseless

Golbez posted:

Not sure if this counts as programming, but... is there any way to automatically export a table from a MS Access database to CSV? The only methods I can find so far require going through the application and doing it manually, or using a third-party program that appears to dump the whole database.

This page (https://www.aspfaq.com/2482) describes a way to do this through ASP (cache given as page appears down)

http://webcache.googleusercontent.c...=www.google.com

The quicker you get out of Access and into something supporting bcp, the better.

Golbez
Oct 9, 2002

1 2 3!
If you want to take a shot at me get in line, line
1 2 3!
Baby, I've had all my shots and I'm fine

baquerd posted:

This page (https://www.aspfaq.com/2482) describes a way to do this through ASP (cache given as page appears down)

[url]http://webcache.googleusercontent.com/search?q=cache:qG2ju9fNuXIJ:https://www.aspfaq.com/2482+ms+access+bcp&cd=11&hl=en&ct=clnk&gl=us&client=firefox-a&source=www.google.com[/url]

The quicker you get out of Access and into something supporting bcp, the better.

This is sadly a program we have to use; it dumps a few hundred MDBs a day and we're looking into converting those to MySQL and popping them into our website. That part, I know how to do, but it's the automation of MDB->CSV that is halting me at the moment.

And the key of it being "dumps a few hundred MDBs" is that I can't edit them to add a particular script that could dump it for me.

baquerd
Jul 2, 2007

by FactsAreUseless

Golbez posted:

This is sadly a program we have to use; it dumps a few hundred MDBs a day and we're looking into converting those to MySQL and popping them into our website. That part, I know how to do, but it's the automation of MDB->CSV that is halting me at the moment.

And the key of it being "dumps a few hundred MDBs" is that I can't edit them to add a particular script that could dump it for me.

Why do you need them in CSV anyway? Google is filled with Access to MySQL DB converters.

Golbez
Oct 9, 2002

1 2 3!
If you want to take a shot at me get in line, line
1 2 3!
Baby, I've had all my shots and I'm fine

baquerd posted:

Why do you need them in CSV anyway? Google is filled with Access to MySQL DB converters.

I suppose you're right; I did CSV before because my last project needed a ton of modification of the incoming data but being more familiar with the subject now I can use temp tables, etc. Looks like http://www.bullzip.com/products/a2m/info.php could be good...

Sleepstupid
Feb 23, 2009
I guess I'll start here before trying to go directly to more specific threads...

I'm looking to build a simple (I hope) site that can do the following:

1) Allow a customer to login and upload a static html file.
2) Once the file is uploaded it needs to show up on that customer's page as clickable link.
3) The link then needs to be able to be opened by anyone (no login required). But it needs to open just like any other html document and not downloaded when clicked on.
4) This html file will periodically be overwritten by a new file.

I was hoping I could do this with either wordpress or drupal as I've toyed around with each in the past, but trying to google for file uploading examples/modules/plugins returns an assload of results.

If neither of those are an option, I am also not opposed to building something myself as long as it's something fairly simple.

Any suggestions to get me going in the right direction?

baquerd
Jul 2, 2007

by FactsAreUseless

Sleepstupid posted:

1) Allow a customer to login and upload a static html file.
2) Once the file is uploaded it needs to show up on that customer's page as clickable link.
3) The link then needs to be able to be opened by anyone (no login required). But it needs to open just like any other html document and not downloaded when clicked on.
4) This html file will periodically be overwritten by a new file.

The simplest method if you don't want to use those extensions (why is a ton of results a problem?) would be one page that does a file upload with overwrite based on name after authentication, then another page that does a directory listing with an .html mask. There are going to be a ton of examples for each with any modern scripting language you want to use (e.g. ASP, PHP).

The possible security holes are huge though if you're not careful you can basically give an attacker a vector to completely trash your site if not your server.

nielsm
Jun 1, 2009



baquerd posted:

The possible security holes are huge though if you're not careful you can basically give an attacker a vector to completely trash your site if not your server.

Even if you make sure the user's upload would never be able to run code on the server, there's still massive XSS holes there, and I don't think those can be plugged.

baquerd
Jul 2, 2007

by FactsAreUseless

nielsm posted:

Even if you make sure the user's upload would never be able to run code on the server, there's still massive XSS holes there, and I don't think those can be plugged.

Depends on your authentication method (assuming authentication equals full trust).

DICTATOR OF FUNK
Nov 6, 2007

aaaaaw yeeeeeah
I dunno if this is deserving of its own thread or not so hey, I'll post it here.

At work we're using Zenoss for networking monitoring and SNMP event trapping. Right now, I'm trying to set up a way for Growl notifications to be fired off whenever Zenoss traps a 911 call.

So far, all the configuration works; Zenoss, however, is being a tremendous bitch and I dunno if this is our fault or just how the program works:

- It won't capture an event JUST ONCE so far as I can tell.
- When you "delete" the SNMP trapped event, it comes back. However, Zenoss thinks it's something different, and therefore assigns it a new ID, new creation timestamp, and pretty much no unique information that links it to the original event

So far, I've managed to write a transform that fires off the script at every 911 call, which is working fine. However, there doesn't seem to be any way to stop the fucker from capturing after the event is removed... anyone know anything?

hippieman
May 8, 2004

Butcher of Song
I'm working on a project and I've come up against a GPL issue that I don't know if I can get around.

I can't say what the project is, but here is a vague version of what is going on.

The Company GPLed its source under version 2 of the GPL. That was back in 2000.

Now The Company wants to release the software (for free) packaged up through a software distribution service.

But they also want to make improvements to it. One of these improvements involves allowing the user to transmit data from the software up to the Companies servers (which will then crunch the data and display it in awesome ways). However The Company does not want to GPL this additional code. They are not concerned about the code being used for attacks against the servers as much as the PR story of "Look at The Companies upload methods, why LulzSec could simply do A, B and C and hack them (even if it's not a real hack".

(and yes, LulzSec would want to hack them, even if that's just a DDoS or just loving with them).

So what I'm asking is, can I get around the GPL and release this awesomely updated software but not release this bit of code that allows it to do this data upload (even if it's dirt simple to reverse engineer, or sniff it out with a packet sniffer, again this is less about security, and more about Lawyers and PR).

I do not work for The Company, but I am doing work on their behalf.

nielsm
Jun 1, 2009



As long as The Company has not integrated code from anyone else into the main codebase they are free to relicense it however they want.
That could involve adding an exception to the GPL that the program may be linked with a specific binary object without that object having to be covered by GPL as well. Or you could simply dual-license it so there is the Open Source version covered by GPL, and the Awesome Proprietary version which also has the upload functionality but doesn't have source available.

Of course you should probably get a lawyer to look over whatever is decided, and write the license exception clause if you decide to walk that path.

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
Assuming that they've actually accepted external contributions and can't simply relicense the code, then the simplest method is to put the non-GPL code in a seperate program, ensure that the main program remains functional when the upload executable is missing, and don't use shared memory to communicate between the programs.

hippieman
May 8, 2004

Butcher of Song
Thanks, its looking like realistically the best action is to make the new stuff GPL'd right along side the old stuff.

zelgadis
Sep 5, 2004

Doesn't that just beat all
So let's say I wanted to have a small, cheap computer, which automatically executes some program and outputs it to a monitor. I'm thinking in the direction of installation art here. It seems a small linux computer would work, but where do you get a small computer that is very cheap because it's very unpowerful? Since let's also say it being stolen or damaged is a high probability. I think this is common thing, with people using small specialized computers to monitor the temperatures in their house, for example. Also, does this thing have a name?

TasteMyHouse
Dec 21, 2006

zelgadis posted:

So let's say I wanted to have a small, cheap computer, which automatically executes some program and outputs it to a monitor. I'm thinking in the direction of installation art here. It seems a small linux computer would work, but where do you get a small computer that is very cheap because it's very unpowerful? Since let's also say it being stolen or damaged is a high probability. I think this is common thing, with people using small specialized computers to monitor the temperatures in their house, for example. Also, does this thing have a name?

depends on how much power you need. I just got one of these http://beagleboard.org/ and it owns. Might be a little overpowered though.

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slćgt skal fřlge slćgters gang



Well a small stolen computer will cost you about fifty bucks. If you pay more, you got robbed. Also, are you serious?

ToxicFrog
Apr 26, 2008


In addition to the aforementioned Beagleboards, there's Gumstix and Arduino.

Carthag posted:

Well a small stolen computer will cost you about fifty bucks. If you pay more, you got robbed. Also, are you serious?

He's saying that there's a high risk of the finished project being stolen or damaged, so he'd rather not spend a lot of money building it.

rolleyes
Nov 16, 2006

Sometimes you have to roll the hard... two?
Ebay, craigslist or freecycle.

pathetic little tramp
Dec 12, 2005

by Hillary Clinton's assassins
Fallen Rib

pokeyman posted:

I guess I could be more helpful.

Better template languages: jinja, liquid, mustache (all have ports for many languages so poke around).

Thanks and thanks to the two posters above you as well. It was indeed some crazy faux language thing that got created by someone who worked here for 3 months in 1999. Our head programmer doesn't even understand it, only understands some of the variables in it...

I'm using some of the terminology from learning about template languages to basically converse with the programming team and the head of my department about why we need to either get something different or make sure everyone knows how the ugly works.

Thanks again!

rsjr
Nov 2, 2002

yay for protoss being so simple that retards can win with it
Hey, not a CS major, but doing a personal project. Just a quick question:

Can a binary search fail before the maximum amount of probes? If I had an array of 50 (6 probes max), can a search for an element conclude the item isn't in the array before 6 probes or does it have to go through all 6 probes?

TasteMyHouse
Dec 21, 2006
It may be possible to infer in some specific cases that the search is going to fail before it 'normally' would, but the cost of checking for those indicators (whatever they may be) is going to be less efficient in the common case, so there's no reason to do it.

e: I should note that I'm being so vague because I haven't thought of any situation where it would be possible to tell it was going to fail early with a standard binary search but I also haven't proved to myself to my satisfaction that it can never happen.

TasteMyHouse fucked around with this message at 14:15 on Aug 30, 2011

rsjr
Nov 2, 2002

yay for protoss being so simple that retards can win with it
I should probably reword my question.

I'm trying to verify my results with a standard binary search. Some search terms are returning not found (which is right), but they're not going through the maximum amount of probes before doing so. Is that normal in a binary search or do fail searches have to go through max probes before concluding that the item doesn't exist?

For example, if I had an array of 100 items, could it ever return not found after 6 probes instead of the max 7 probes?

Contra Duck
Nov 4, 2004

#1 DAD
Yes it could because sometimes there aren't an equal number of elements on each side of your test element. With your 100 element example you would be testing the 50th element first, there are 49 elements below that and 50 elements above. If your tests end up having you take the shorter branch enough then you'll end up needing one less iteration. It should only be one iteration shorter at best though, you'll never have your example finishing in only 2 iterations.

TasteMyHouse
Dec 21, 2006
Man, I hate being the guy with the Y answer to an X question.

Satire Forum Mom
Oct 4, 2003
MY CUNT DRIPS BROWN REFUSE LIKE A DIRTY HOOKAH. PS. THE BACK OF MY THIGHS ARE RIDICULOUS - COTTAGE CHEESE ANYONE?
What're the best books to learn/brush up on HTML/CSS?

TheresaJayne
Jul 1, 2011

TasteMyHouse posted:

depends on how much power you need. I just got one of these http://beagleboard.org/ and it owns. Might be a little overpowered though.

you could also try a guru display they are cheap small and have HDMI output.
http://www.globalscaletechnologies.com/p-40-guruplug-display-devkit.aspx

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Contra Duck posted:

Yes it could because sometimes there aren't an equal number of elements on each side of your test element. With your 100 element example you would be testing the 50th element first, there are 49 elements below that and 50 elements above. If your tests end up having you take the shorter branch enough then you'll end up needing one less iteration. It should only be one iteration shorter at best though, you'll never have your example finishing in only 2 iterations.

If he's searching for a specific element in a sorted array, as I think his question implies, he could happen to find the element he wants sooner than the maximum tree depth is reached.

A binary search for 5 in [1,3,5,20,23] is over after one check, to give a trivial example.

If he's actually using a tree, then nevermind

edit: I am captain reading comprehension

Munkeymon fucked around with this message at 18:07 on Aug 30, 2011

TasteMyHouse
Dec 21, 2006

Munkeymon posted:

If he's searching for a specific element in a sorted array, as I think his question implies, he could happen to find the element he wants sooner than the maximum tree depth is reached.

A binary search for 5 in [1,3,5,20,23] is over after one check, to give a trivial example.

If he's actually using a tree, then nevermind

he specifically said he was talking about a negative result.

1337JiveTurkey
Feb 17, 2005

If you start off with a bounds check on the first and last elements (this may be cheaper in some cases than naively jumping right in) then you can rule out any elements totally outside of the interval from the start. Otherwise there is always some subinterval it can exist on until you've ruled out the smallest subinterval—the singleton.

more falafel please
Feb 26, 2005

forums poster

rsjr posted:

I should probably reword my question.

I'm trying to verify my results with a standard binary search. Some search terms are returning not found (which is right), but they're not going through the maximum amount of probes before doing so. Is that normal in a binary search or do fail searches have to go through max probes before concluding that the item doesn't exist?

For example, if I had an array of 100 items, could it ever return not found after 6 probes instead of the max 7 probes?

A normal binary search won't check the bounds of the sub-haystack, but if this one does, it could early out as soon as it finds that the needle is outside the bounds of the sub-haystack.

Example in a weird search pseudocode i just made up:
code:
search({1 2 3 10 100 1000 10000}, 50)
50 > 1, 50 < 10000, so
50 > 10 so 
    search({100, 1000, 10000}, 50)
    50 < 100 so not found

1337JiveTurkey
Feb 17, 2005

more falafel please posted:

A normal binary search won't check the bounds of the sub-haystack, but if this one does, it could early out as soon as it finds that the needle is outside the bounds of the sub-haystack.

That's actually still an exhaustive binary search with the endpoint check being a partition into two subintervals of length n-1 and 0.

clockwork automaton
May 2, 2007

You've probably never heard of them.

Fun Shoe

Satire Forum Mom posted:

What're the best books to learn/brush up on HTML/CSS?
I've heard Bulletproof Web Design is pretty good. Learning Web Design is also apparently decent. For HTML5 I like Dive into HTML5.

Doc Faustus
Sep 6, 2005

Philippe is such an angry eater
Hopefully this is the right thread for this... I'm trying to throw together a little script that can run in greasemonkey/chrome. It only needs to do one thing: make the font Comic Sans. Depending on how I set my parameters, it either doesn't run at all, or runs on every webpage everywhere. I need (OK, want) it restricted to https://courses.lis.illinois.edu/

Any ideas what's going wrong?


code:

// ==ComicMoodle==
// @name          ComicMoodle
// @namespace     derp
// @description   example script to alert "Hello world!" on every page
// @match *://courses.lis.illinois.edu/*
// @include [url]https://courses.lis.illinois.edu/*[/url]
// @unwrap
// ==/ComicMoodle==

function addGlobalStyle(css) {
    var head, style;
    head = document.getElementsByTagName('head')[0];
    if (!head) { return; }
    style = document.createElement('style');
    style.type = 'text/css';
    style.innerHTML = css;
    head.appendChild(style);
}

addGlobalStyle('* { font-family: Comic Sans,Comic Sans MS,cursive !important; }');
EDIT: Solved my own problem. The ==UserScript== I was seeing in templates is not, in fact, a prompt to put your own script name there, but is in fact a required element.

Doc Faustus fucked around with this message at 04:08 on Sep 1, 2011

hippieman
May 8, 2004

Butcher of Song
I have a strange SVN type situation.

I have Company A and Company B working together on a project, with me in the middle, coordinating between A and B.

Company A and B know about each other, and are happy to work with each other.

The project is kept on Company A's SVN server. I have access to this server. Company A does not want Company B to have access to the SVN server. A has no problem with B having the source code, just don't want to give them access.

Is there anyway I can update my working copy from Company A's SVN server, and then at the same time point our SVN server at that copy as a working copy, so I can then "commit" the changes from A, so B can then update from our SVN server to get the changes?

I know it's a retarded setup, but it's annoying to upload full FTP drops of the source every time they want to check out the latest build.

ToxicFrog
Apr 26, 2008


^^ I don't know myself, but the version control megathread probably would.

double sulk
Jul 2, 2010

Since I work in the IT field and want to improve my own personal skills, I'd like to finally buckle down and pick up a language, but I'm not sure of what to go with. I have some experience with C++ but I'd likely prefer to learn Java, C#, or Objective C. I have a book on C# but I feel that its uses are not in anything I'd want to be a part of, whereas with the other two you have fast-growing languages that are extremely important and perhaps more versatile (at least Java is).

I feel like it comes down to whether I want to work on more traditional software versus having the ability to design iOS applications, but does anyone have more insight? By looking at code alone, Java seems the less complicated of the two and is probably the better option, but I'm not sure.

baquerd
Jul 2, 2007

by FactsAreUseless

Sulk posted:

Since I work in the IT field and want to improve my own personal skills, I'd like to finally buckle down and pick up a language, but I'm not sure of what to go with. I have some experience with C++ but I'd likely prefer to learn Java, C#, or Objective C. I have a book on C# but I feel that its uses are not in anything I'd want to be a part of, whereas with the other two you have fast-growing languages that are extremely important and perhaps more versatile (at least Java is).

Python would be a good supplement to general IT operations work you may be doing already and will expose you all of the needed concepts of modern programming.

If you'd like to start learning Java/C#/Objective C, that's great too but there's a big world of theory and application between you and a full time job writing software. Years worth. They're generally much less suited to general IT operations work (moving files around, running other scripts, doing data integrity checks) than a scripting language like Python, Perl, or even shell scripting in *nix.

Adbot
ADBOT LOVES YOU

double sulk
Jul 2, 2010

I definitely wasn't looking for anything at an enterprise level or even a full time job right now, but for general knowledge and functionality, I suppose. I do wonder if Perl would be a better choice than Python, but as far as my creative side goes, I feel like Objective C might be useful. Just not sure which is why I thought to ask.

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