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
tripwire
Nov 19, 2004

        ghost flow
In case anyone ever has imagemagick and python installed and is too lazy to whip up their own script for finding busted images:
code:
#takes a directory as an argument and advises of corrupt jpgs within
import os, subprocess, sys
assert len(sys.argv) == 2
assert os.path.isdir(sys.argv[1])

def is_image(path):
    if path[-4:].lower() in [".jpg","jpeg"]:
        return True
    return False

identify_path = r'C:\progra~1\ImageMagick-6.5.1-Q16\identify.exe'
images = filter(is_image,os.listdir(sys.argv[1]))

for image in images:
    command = identify_path + ' -verbose ' + image
    p = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    output = p.communicate()
    if len(output[1]) > 0:
        print image, " is broken, chump!"

tripwire fucked around with this message at 14:34 on Jun 27, 2009

Adbot
ADBOT LOVES YOU

spiritual bypass
Feb 19, 2008

Grimey Drawer
I want to write a program to grab output from a USB webcam and write it to disk as a video file. My target OS is Linux. I intend to write it in C, but I wouldn't mind using something else.

Anyone in here tried this before? Got any recommended libs?

loud-bob
Feb 11, 2004

AHHHHHHHH
I would like to find a programmer for a project I've started. The project is related to NAS and file sharing. I'm a user experience/visual designer who is project managing. I've got designers but I need a programmer who would be interested.

Any advice on finding programmers?

tripwire
Nov 19, 2004

        ghost flow

loud-bob posted:

I would like to find a programmer for a project I've started. The project is related to NAS and file sharing. I'm a user experience/visual designer who is project managing. I've got designers but I need a programmer who would be interested.

Any advice on finding programmers?

Can you provide any more details? What experience level are you looking for, which existing software is this going to be using/which platform are you targeting, that kinda thing?

That Turkey Story
Mar 30, 2003

Don't ask what the project is!!!

yippee cahier
Mar 28, 2005

royallthefourth posted:

I want to write a program to grab output from a USB webcam and write it to disk as a video file. My target OS is Linux. I intend to write it in C, but I wouldn't mind using something else.

Anyone in here tried this before? Got any recommended libs?

You can almost certainly do this with one of the major media players' command line interfaces. Is the webcam a V4L2 device?

spiritual bypass
Feb 19, 2008

Grimey Drawer

sund posted:

You can almost certainly do this with one of the major media players' command line interfaces. Is the webcam a V4L2 device?

It does use V4L2 and I've been able to get video from it using Cheese (Ubuntu). I really just wanted to roll my own. I've looked at V4L a little bit. It seems lower-level than what I want, but if that's what's available then that's what I'll use.

The main reason is that I'd just like some interesting C programming to do at home as a break from my boring PHP bullshit at work. I really miss solving difficult problems like I did in college, but I don't actually like CS enough to dive into one of my textbooks.

The practical reason I have for this is that my dog is somehow stealing my cat's food and I have no idea how she's able to reach it. With a webcam constantly monitoring the area and writing to disk only when there is motion, it would show me exactly what happened without me needing to search through hours of video. I know that detecting the motion is a whole other can of worms, but I figured I'd start somewhere.

loud-bob
Feb 11, 2004

AHHHHHHHH

tripwire posted:

Can you provide any more details? What experience level are you looking for, which existing software is this going to be using/which platform are you targeting, that kinda thing?

It would be running on a linux. There would be some web front-end coding as well as some backend file management work.

Here are my feature bulletpoints:

--------------------------
Access your home storage anywhere...
The device creates a web portal for you to access your home files from. Nothing new.

Keep your downloads running constantly...
Manage your downloads remotely through an easy-to-use web portal. Your plug is always running and running your bittorrents and downloads.

Start transfers on your home storage from anywhere...
Enter a URL or upload a torrent to start a transfer from anywhere.

Share your files automatically with your friends and family...
A user can create a private group and invite friends to it. Each member configures a directory (or creates a partition?) on their drive that is reserved for the group. This directory is mirrored for each member of the group. This creates an automatic private repository of your groups most relevant files for you to all share in watching/listening/viewing.
----------------------

huhu
Feb 24, 2006
I can't figure out why the third picture box is being targeted only for every link that is clicked. Can anyone help out? Also, does anyone know of a more user friendly picture type thing. I'm uploading a bunch of albums and I'm not super familiar with html. My method of learning is tinkering through trial and error not by starting from scratch. This siteisn't going to be some fancy huge income kinda thing so I don't need like a deep knowledge.

http://www.ruskullhouse.com/photo-albums is the website.

<script type="text/javascript">
function changeInfo(picsrc){
var picture = document.getElementById("eventPic");
picture.src = "/sites/default/files/images/events/" + picsrc;
}</script>
<div align="center"></div>


<h4>Poker Tournament</h4> The rushes came out to the house and participated in a poker tournament while getting to know the brothers. This event is a part of a week long period at the begining of the semester where potential members get a chance to meet the brothers, check out the house, and learn what it means to be a brother.
<table width="500" align=center scrollbar=no>
<tr>
<td valign="top" width="400">
<img src="/sites/default/files/images/events/spring2009_pokerrush/1.jpg" id="eventPic" border="2" alt="Photo of Event" width=350>
</div>
</td>
<td width="100">
<div id="brotherList">
<div class="current">
<a onclick="changeInfo('spring2009_pokerrush/1.jpg')">Picture 1</a><br />
<a onclick="changeInfo('spring2009_pokerrush/2.jpg')">Picture 2</a><br />
<a onclick="changeInfo('spring2009_pokerrush/3.jpg')">Picture 3</a><br />
<a onclick="changeInfo('spring2009_pokerrush/4.jpg')">Picture 4</a><br />
<a onclick="changeInfo('spring2009_pokerrush/5.jpg')">Picture 5</a><br />
</div>
</div>
</td>
</tr>
</table>
</center>
<hr><br>

<script type="text/javascript">
function changeInfo(picsrc2){
var picture = document.getElementById("eventPic2");
picture.src = "/sites/default/files/images/events/" + picsrc2;
}</script>

<h4>Rutgers Day 2009</h4> The brothers woke up bright an early to help make Rutgers Day 2009 a success. Volunteer events are a great part of being a brother and allow for a chance to give back to the community.
<table width="500" align=center scrollbar=no>
<tr>
<td valign="top" width="400">
<img src="/sites/default/files/images/events/spring2009_rutgersday/1.jpg" id="eventPic2" border="2" alt="Photo of Event" width=350>
</div>
</td>
<td width="100">
<div id="brotherList">
<div class="current">
<a onclick="changeInfo('spring2009_rutgersday/1.jpg')">Picture 1</a><br />
<a onclick="changeInfo('spring2009_rutgersday/2.jpg')">Picture 2</a><br />
<a onclick="changeInfo('spring2009_rutgersday/3.jpg')">Picture 3</a><br />
<a onclick="changeInfo('spring2009_rutgersday/4.jpg')">Picture 4</a><br />
<a onclick="changeInfo('spring2009_rutgersday/5.jpg')">Picture 5</a><br />
<a onclick="changeInfo('spring2009_rutgersday/6.jpg')">Picture 6</a><br />
<a onclick="changeInfo('spring2009_rutgersday/7.jpg')">Picture 7</a><br />
<a onclick="changeInfo('spring2009_rutgersday/8.jpg')">Picture 8</a><br />
<a onclick="changeInfo('spring2009_rutgersday/9.jpg')">Picture 9</a><br />
<a onclick="changeInfo('spring2009_rutgersday/10.jpg')">Picture 10</a><br />
<a onclick="changeInfo('spring2009_rutgersday/11.jpg')">Picture 11</a><br />
<a onclick="changeInfo('spring2009_rutgersday/12.jpg')">Picture 12</a><br />
<a onclick="changeInfo('spring2009_rutgersday/13.jpg')">Picture 13</a><br />
<a onclick="changeInfo('spring2009_rutgersday/14.jpg')">Picture 14</a><br />
<a onclick="changeInfo('spring2009_rutgersday/15.jpg')">Picture 15</a><br />
<a onclick="changeInfo('spring2009_rutgersday/16.jpg')">Picture 16</a><br />
<a onclick="changeInfo('spring2009_rutgersday/17.jpg')">Picture 17</a><br />
<a onclick="changeInfo('spring2009_rutgersday/18.jpg')">Picture 18</a><br />
<a onclick="changeInfo('spring2009_rutgersday/19.jpg')">Picture 19</a><br />
<a onclick="changeInfo('spring2009_rutgersday/20.jpg')">Picture 20</a><br />
<a onclick="changeInfo('spring2009_rutgersday/21.jpg')">Picture 21</a><br />
<a onclick="changeInfo('spring2009_rutgersday/22.jpg')">Picture 22</a><br />
<a onclick="changeInfo('spring2009_rutgersday/23.jpg')">Picture 23</a><br />
<a onclick="changeInfo('spring2009_rutgersday/24.jpg')">Picture 24</a><br />
<a onclick="changeInfo('spring2009_rutgersday/25.jpg')">Picture 25</a><br />
<a onclick="changeInfo('spring2009_rutgersday/26.jpg')">Picture 26</a><br />
<a onclick="changeInfo('spring2009_rutgersday/27.jpg')">Picture 27</a><br />
<a onclick="changeInfo('spring2009_rutgersday/28.jpg')">Picture 28</a><br />
<a onclick="changeInfo('spring2009_rutgersday/29.jpg')">Picture 29</a><br />
<a onclick="changeInfo('spring2009_rutgersday/30.jpg')">Picture 30</a><br />
<a onclick="changeInfo('spring2009_rutgersday/31.jpg')">Picture 31</a><br />
<a onclick="changeInfo('spring2009_rutgersday/32.jpg')">Picture 32</a><br />
<a onclick="changeInfo('spring2009_rutgersday/33.jpg')">Picture 33</a><br />
<a onclick="changeInfo('spring2009_rutgersday/34.jpg')">Picture 34</a><br />
<a onclick="changeInfo('spring2009_rutgersday/35.jpg')">Picture 35</a><br />
<a onclick="changeInfo('spring2009_rutgersday/36.jpg')">Picture 36</a><br />
<a onclick="changeInfo('spring2009_rutgersday/37.jpg')">Picture 37</a><br />
<a onclick="changeInfo('spring2009_rutgersday/38.jpg')">Picture 38</a><br />
<a onclick="changeInfo('spring2009_rutgersday/39.jpg')">Picture 39</a><br />
<a onclick="changeInfo('spring2009_rutgersday/40.jpg')">Picture 40</a><br />

</div>
</div>
</td>
</tr>
</table>
</center>
<hr><br>

<script type="text/javascript">
function changeInfo(picsrc3){
var picture = document.getElementById("eventPic3");
picture.src = "/sites/default/files/images/events/" + picsrc3;
}</script>
<div align="center"></div>

<h4>Dance Marathon</h4> Several brothers and pledges came out to Dance Marathon 2009 to help raise money for <a href=http://www.embracekids.org/>Embrace the Kids Foundation</a>. Check out the <a href=http://marathon.rutgers.edu/about/>Dance Marathon</a> website for more info.
<table width="500" align=center scrollbar=no>
<tr>
<td valign="top" width="400">
<img src="/sites/default/files/images/events/spring2009_dm/1.jpg" id="eventPic3" border="2" alt="Photo of Event" width=350>
</div>
</td>
<td width="100">
<div id="brotherList">
<div class="current">
<a onclick="changeInfo('spring2009_dm/1.jpg')">Picture 1</a><br />
<a onclick="changeInfo('spring2009_dm/2.jpg')">Picture 2</a><br />
<a onclick="changeInfo('spring2009_dm/3.jpg')">Picture 3</a><br />
<a onclick="changeInfo('spring2009_dm/4.jpg')">Picture 4</a><br />
<a onclick="changeInfo('spring2009_dm/5.jpg')">Picture 5</a><br />
<a onclick="changeInfo('spring2009_dm/6.jpg')">Picture 6</a><br />
<a onclick="changeInfo('spring2009_dm/7.jpg')">Picture 7</a><br />
<a onclick="changeInfo('spring2009_dm/8.jpg')">Picture 8</a><br />
<a onclick="changeInfo('spring2009_dm/9.jpg')">Picture 9</a><br />
<a onclick="changeInfo('spring2009_dm/10.jpg')">Picture 10</a><br />
<a onclick="changeInfo('spring2009_dm/11.jpg')">Picture 11</a><br />
<a onclick="changeInfo('spring2009_dm/12.jpg')">Picture 12</a><br />
<a onclick="changeInfo('spring2009_dm/13.jpg')">Picture 13</a><br />
<a onclick="changeInfo('spring2009_dm/14.jpg')">Picture 14</a><br />
<a onclick="changeInfo('spring2009_dm/15.jpg')">Picture 15</a><br />
</div>
</div>
</td>
</tr>
</table>
</center>
<hr><br>

baquerd
Jul 2, 2007

by FactsAreUseless
You keep overriding your function every time you declare it. You need separate function names for each image, or you need to pass the image id to the function like so:
code:
function changeInfo(picName, picID){
    var picture = document.getElementById(picID);
    picture.src = "/sites/default/files/images/events/" + picName;
}
Also if you don't start properly indenting your code, the programming gods will slowly disembowel you over a fiery pit for all eternity.

Mustach
Mar 2, 2003

In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.
Uhhhh, didn't you just post that in it's own thread yesterday and get an answer?

baquerd
Jul 2, 2007

by FactsAreUseless

Mustach posted:

Uhhhh, didn't you just post that in it's own thread yesterday and get an answer?

Acutally, it looks like they gave him an obtuse answer and then a wrong answer.

csammis
Aug 26, 2003

Mental Institution
And then he posted it in the wrong megathread :v:

e: Sorry, this post was pretty useless. The first post in this thread has a link to the megathread you want, and next time you post code, use the [code][/code] tags.

csammis fucked around with this message at 02:29 on Jun 30, 2009

baquerd
Jul 2, 2007

by FactsAreUseless
So I've encountered an issue with Javascript switching tabs using WebFX tabpanes (http://webfx.eae.net/dhtml/tabpane/tabpane.html) containing complex applets using Tapestry and builds of Java 1.5 before 1.5.0_15. It hardlocks the browser and bluescreens after a bit in Windows XP. 1.5.0_15 through 1.5.0_18 work fine, and we don't support 1.6 at all, so gently caress that anyway.

For our users, we have a corporate mandated release version of 1.5.0_13. Assuming we can't change this, and assuming that we can't change the HTML/JavaScript for the tabs, how would I even start to look for a fix to the issue?

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

quadreb posted:

For our users, we have a corporate mandated release version of 1.5.0_13. Assuming we can't change this, and assuming that we can't change the HTML/JavaScript for the tabs, how would I even start to look for a fix to the issue?

What exactly do you propose that you would change other than those two things? (Except maybe what browser you use).

baquerd
Jul 2, 2007

by FactsAreUseless

Avenging Dentist posted:

What exactly do you propose that you would change other than those two things? (Except maybe what browser you use).

I can change the Java code, so if I can figure out what's causing the crash, I could possibly fix it by rewriting some class(es) there. Mostly I just wanted to whine about it though.

(I solved it by installing 1.5.0_18 for users who needed to use the application :ssh:, it's really a security layer.)

Junji Eat More
Oct 22, 2005

You don't know it, but you are full of stahs
I'm having issues using tcpdump in my rc.local file on Fedora. The script runs just fine if I manually execute it as root, if I put it in a script I make on the spot, or even if I copy rc.local to the same folder with a different name and execute it.

The offending snippet:
code:
tcpdump -w /capdata/data/test -Z root port 9100
This gives a 'permission denied' error. Removing the write to file aspect prevents the permissions issue, but that's not really acceptable.

I've tried:
setting the destination folder to be owned by tcpdump, chmod 0777
removing or changing the Z parameter
adding 'sudo' and 'su root' in front
runuser --shell=/usr/bin/python root /capdata/processtest & (the python script that's actually calling the command)


I'm kind of at a loss as to where to go next with this.

Standish
May 21, 2001

Necronomiconomist posted:

Fedora.
SELinux?

Junji Eat More
Oct 22, 2005

You don't know it, but you are full of stahs
Yep, that was it. Thanks!

I've gotten used to the SElinux notifications popping up on my desktop, didn't think of them occurring while in a terminal window.

Alcohol Kills
Feb 29, 2008

by Peatpot
today i learned that all the nonsense going on in the console in games is the important part of what's going on

currently i am on a mission to turn python into a nonsense-spewing machine

grid computed

map popped

default heights mapped

whee

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

Alcohol Kills posted:

today i learned that all the nonsense going on in the console in games is the important part of what's going on

currently i am on a mission to turn python into a nonsense-spewing machine

grid computed

map popped

default heights mapped

whee

Oh. Ok.

baquerd
Jul 2, 2007

by FactsAreUseless
Always, always remember to reticulate splines.

Dicky B
Mar 23, 2004

Relative to a class, what is the correct term for an object that instantiates it?

Triple Tech
Jul 28, 2006

So what, are you quitting to join Homo Explosion?
A factory?

baquerd
Jul 2, 2007

by FactsAreUseless

Dicky B posted:

Relative to a class, what is the correct term for an object that instantiates it?

An object is by definition an instance of a class.

Dicky B
Mar 23, 2004

Sorry I suck with words. Have a diagram...



Is there a term to describe the relationship between George and building?

Dicky B fucked around with this message at 19:42 on Jul 1, 2009

baquerd
Jul 2, 2007

by FactsAreUseless

Dicky B posted:

Sorry I suck with words. Have a diagram...



Is there a term to describe the relationship between George and building?

If you mean george has-a building, then it would be referred to as a member field, an instance variable, a top-level field, or quite a few other terms.

http://en.wikipedia.org/wiki/Has-a

baquerd
Jul 2, 2007

by FactsAreUseless

Dicky B posted:

Sorry I suck with words. Have a diagram...



Is there a term to describe the relationship between George and building?

With this new image, you could call george a building factory as TT said.

Dicky B
Mar 23, 2004

Ok thanks a lot :)

WalletBeef
Jun 11, 2005

Is there a goon recommended (free) sequence diagram editor?

smith7800
Sep 25, 2004
I've got this problem that I've been banging my head against for a few hours now.

I've got an array of integers. As I traverse the array in order, if an integer <= to 5, never reaches 0, then exceeds 5 again, an event is triggered.
This is probably very simple, buy my mind is battered. Can someone help me out with some psuedocode or something?

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

smith7800 posted:

I've got this problem that I've been banging my head against for a few hours now.

I've got an array of integers. As I traverse the array in order, if an integer <= to 5, never reaches 0, then exceeds 5 again, an event is triggered.
This is probably very simple, buy my mind is battered. Can someone help me out with some psuedocode or something?

This doesn't even make sense.

smith7800
Sep 25, 2004

Avenging Dentist posted:

This doesn't even make sense.

How so?
Say this array is (33,22,11,8,5,3,5,19...) it will have reached 5, not reached 0, then exceeded 5.

smith7800 fucked around with this message at 06:47 on Jul 2, 2009

baquerd
Jul 2, 2007

by FactsAreUseless

smith7800 posted:

I've got this problem that I've been banging my head against for a few hours now.

I've got an array of integers. As I traverse the array in order, if an integer <= to 5, never reaches 0, then exceeds 5 again, an event is triggered.
This is probably very simple, buy my mind is battered. Can someone help me out with some psuedocode or something?

code:
int [] array = { ... };
boolean foundMin = false;
boolean foundZero = false;

for (int i = 0; i < array.length; i++) {
    if (!foundMin && array[i] <= 5) {
        foundMin = true;
    } else if (foundMin && !foundZero && array[i] <= 0) {
        foundZero = true;
    } else if (foundMin && !foundZero && array[i] > 5) {
        foundMin = false;
        foundZero = false;
        triggerEvent();
    }
}
I hope this is 101 homework.

smith7800
Sep 25, 2004

quadreb posted:

code:
int [] array = { ... };
boolean foundMin = false;
boolean foundZero = false;

for (int i = 0; i < array.length; i++) {
    if (!foundMin && array[i] <= 5) {
        foundMin = true;
    } else if (foundMin && !foundZero && array[i] <= 0) {
        foundZero = true;
    } else if (foundMin && !foundZero && array[i] > 5) {
        foundMin = false;
        foundZero = false;
        triggerEvent();
    }
}
I hope this is 101 homework.

Thanks, and no, I'm a CS grad working for a client, unfortunately.

baquerd
Jul 2, 2007

by FactsAreUseless

smith7800 posted:

Thanks, and no, I'm a CS grad working for a client, unfortunately.

:cry:

You should've just played along.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh
I hope for your sake you are just drunk out of your mind right now.

blorpy
Jan 5, 2005

Good God man, have you never even heard of a finite state machine in your life? Which 'university' gave you your diploma?

smith7800
Sep 25, 2004
My intellect just operates at such a high level that such trivial problems seem impossible. Kinda like how Einstein couldn't count out change for a dollar.

Adbot
ADBOT LOVES YOU

Alcohol Kills
Feb 29, 2008

by Peatpot
this thread is making me feel a lot better about my chances of landing a job as a codemonkey somewhere

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