|
Is there a simple way to take information from one website as it updates and input it into a form in another? Maybe something with Greasemonkey? I've never programmed anything.
|
# ? Apr 24, 2012 00:39 |
|
|
# ? Jun 8, 2024 20:42 |
|
So someone at work asked me if saving a jpeg over and over will introduce compounding compression artifacts and I said 'yes' without really thinking. I then decided to do a test where I open an image, save out at 50% jpeg quality, reopen the new image and save out a new copy with 50% quality so on and so forth for a few hundred iterations. I played the image sequence in motion and after the initial pop in quality from the original image to the first 50% quality image the artifacting didn't change at all for the hundreds of frames that followed. Is this normal for jpeg algorithms?
|
# ? Apr 24, 2012 01:06 |
|
Shaocaholica posted:So someone at work asked me if saving a jpeg over and over will introduce compounding compression artifacts and I said 'yes' without really thinking. I then decided to do a test where I open an image, save out at 50% jpeg quality, reopen the new image and save out a new copy with 50% quality so on and so forth for a few hundred iterations. I played the image sequence in motion and after the initial pop in quality from the original image to the first 50% quality image the artifacting didn't change at all for the hundreds of frames that followed. Is this normal for jpeg algorithms? Wiki says: "JPEG is also not well suited to files that will undergo multiple edits, as some image quality will usually be lost each time the image is decompressed and recompressed, particularly if the image is cropped or shifted, or if encoding parameters are changed – see digital generation loss for details. To avoid this..." Are you sure your procedure "decompressed and then recompressed" the JPEG after the first pass (in which you reduced the quality)? I am pretty sure that if you make actual changes to a JPEG, re-saving it as JPEG each time, the quality will get progressively worse.
|
# ? Apr 24, 2012 01:14 |
|
Hammerite posted:Wiki says: "JPEG is also not well suited to files that will undergo multiple edits, as some image quality will usually be lost each time the image is decompressed and recompressed, particularly if the image is cropped or shifted, or if encoding parameters are changed – see digital generation loss for details. To avoid this..." I didn't make any changes but I did make sure it wasn't doing anything tricky by saving each iteration as a tif after the compression. I guess I could try altering a random pixel(s) each iteration. edit: I was trying to produce something like this (http://vimeo.com/3750507). My current work setup doesn't have the python Image module installed so I resorted to calling 'convert' with the '-quality' flag. Shaocaholica fucked around with this message at 01:33 on Apr 24, 2012 |
# ? Apr 24, 2012 01:16 |
If you use JPEG encoders and decoders from the same suite for every recompression, chance is they will perform exactly the same quantisation etc. meaning that the image the encoder gets will compress "perfectly" at the given settings. I haven't actually worked out the maths, but I have a hunch it will end up that way. If you are fine with lots of manual work, try cycling through maybe three different encoders, or just adjust the quality factor a bit each time. For extra fun, start out with a low quality factor and raise it repeatedly, e.g. 50%, 55%, 60% etc., that will probably show progressive degradation.
|
|
# ? Apr 24, 2012 01:48 |
|
I'd imagine that if you didn't change any pixels or compression level, the optimal pixels for that compression level would be the existing pixels (as they have been compressed at that level already). It's possible that there would be slight variations that would probably be more pronounced in pictures with a lot of blended color (this article seems to show that in 10 iterations), though I have no clue if the artifacting could build to a subtle (low) level and from there stay fairly constant, which your "artifacting didn't change at all for the hundreds of frames" seems to hint at.
|
# ? Apr 24, 2012 01:48 |
|
If you really wanted to, you could make a lossless JPEG. The only lossy step of JPEG is quantization (well, besides integer roundoff of the DCT components). It comes with a standard quantization table, but you could define your own with the DQT command. EDIT: The Gripper posted:I'd imagine that if you didn't change any pixels or compression level, the optimal pixels for that compression level would be the existing pixels (as they have been compressed at that level already). That's not how lossy compression works. You're asking it to lossily compress an already lossily compressed source.
|
# ? Apr 24, 2012 01:50 |
|
JPEG compression is relatively stable if you decode and then re-encode under the original parameters, because it works by reducing entropy within blocks, and as long as the blocks and thresholds are held fixed, entropy is already going to be pretty low. Very small changes, like shifting the image coordinates by cropping, can force the algorithm to minimize over different block extents and therefore lose more information.
|
# ? Apr 24, 2012 01:52 |
|
Suspicious Dish posted:If you really wanted to, you could make a lossless JPEG. The only lossy step of JPEG is quantization (well, besides integer roundoff of the DCT components). It comes with a standard quantization table, but you could define your own with the DQT command. Edit; I guess I made it sound like I meant as an absolute "hey it's already done let's not redo it" way, but I just mean that compared to compressing the image the first time, consecutive compression would need to make less changes because things have already been adjusted. (in thinking about it it doesn't make a ton of sense though). The Gripper fucked around with this message at 02:07 on Apr 24, 2012 |
# ? Apr 24, 2012 02:01 |
|
Maha posted:Is there a simple way to take information from one website as it updates and input it into a form in another? Maybe something with Greasemonkey? I've never programmed anything. Without knowing what you want to do you can try If This Then That. If you post what you are trying to do you will get more help.
|
# ? Apr 24, 2012 02:30 |
|
gariig posted:Without knowing what you want to do you can try If This Then That. If you post what you are trying to do you will get more help. Sure. I'm trying to figure out a way to scrobble a stream to last.fm without having to mess around with Streamripper, so my idea was to find something that could take artist and song information from here and input it to here. Beautiful Soup with Python's been suggested to me, but, well, I can't code. I'll have a look at If This Then That! e: ifttt on its own doesn't seem to do what I'm looking for - it can trigger off somafm's twitter feeds, but can't do anything useful with the results. Maha fucked around with this message at 03:06 on Apr 24, 2012 |
# ? Apr 24, 2012 02:46 |
|
As a note for people thinking of bundling pCap/WinpCap with anything, the binary distribution it gets detected by a lot of anti-spyware/anti-virus stuff out there. Just a note for all the budding network spies out there.
|
# ? Apr 25, 2012 04:05 |
|
Maha posted:Sure. I'm trying to figure out a way to scrobble a stream to last.fm without having to mess around with Streamripper, so my idea was to find something that could take artist and song information from here and input it to here. Don't use BeautifulSoup. Use lxml.html instead. BeautifulSoup is dead (the author stopped development) and it has various bugs (NavigableString being the main cause of issues). lxml.html can handle most HTML pages, sometimes even better than BeautifulSoup. Looking through the code for SomaFM (ugh this is not good code), it seems like there's something easily scrapeable here: http://somafm.com/recent/spacestation.html Hook that together with the Track.scrobble API from Last.fm. It seems you're new to programming, so if you have any more questions (even if they seem super stupid), just ask them here. Good luck!
|
# ? Apr 25, 2012 04:34 |
|
Scaramouche posted:As a note for people thinking of bundling pCap/WinpCap with anything, the binary distribution it gets detected by a lot of anti-spyware/anti-virus stuff out there. Just a note for all the budding network spies out there. As it should do. Packet capturing isn't really something that should be necessary for any sort of deployable solution. It's mostly for reverse engineering and debugging.
|
# ? Apr 25, 2012 04:35 |
|
Suspicious Dish posted:As it should do. Packet capturing isn't really something that should be necessary for any sort of deployable solution. It's mostly for reverse engineering and debugging.
|
# ? Apr 25, 2012 07:45 |
|
The Gripper posted:Any decent AntiVirus will pick up the actual virus, not the libraries it's using. Crappier malware scanners will pick it up with their scorched earth approach (Malwarebytes and SAS both don't, as far as I know), though. Except that doesn't help target threats against new viruses. Packet sniffers shouldn't ever be running on your computer for legitimate purposes (besides debugging and reverse engineering, but if you're smart enough to do that, you're smart enough to configure your AV tool), so it's worth pointing out the very real possibility and preemptively stopping a threat before it's too late. Sometimes, a virus scanner may detect a false positive from preemptive unknown threat detection. I think this is a good thing. No good citizen should require capturing all input globally, or sniffing all network traffic globally, so it's good to know that these things are happening on your machine.
|
# ? Apr 25, 2012 08:09 |
|
Suspicious Dish posted:Except that doesn't help target threats against new viruses. Packet sniffers shouldn't ever be running on your computer for legitimate purposes (besides debugging and reverse engineering, but if you're smart enough to do that, you're smart enough to configure your AV tool), so it's worth pointing out the very real possibility and preemptively stopping a threat before it's too late. Also, the winpcap network capturing components are installed as a driver (by necessity) so I believe from XP onwards the user will be prompted to install if a malicious application tries to deploy it. Edit; the deployable-without-driver components are used to read from capture files, which would pose no threat. The Gripper fucked around with this message at 08:42 on Apr 25, 2012 |
# ? Apr 25, 2012 08:38 |
|
Suspicious Dish posted:BeautifulSoup is dead (the author stopped development) The last release was 11 days ago, so not really. http://www.crummy.com/software/BeautifulSoup/ lxml falls back to BeautifulSoup when it gets handed a shitheap, so it's good that it's not dead
|
# ? Apr 25, 2012 15:24 |
|
Munkeymon posted:lxml falls back to BeautifulSoup when it gets handed a shitheap, so it's good that it's not dead
|
# ? Apr 25, 2012 23:24 |
|
I recently tried to use BeautifulSoup4 for the DWS2 IRC bot and had such trouble with it that I ended up having to go back to version 3.
|
# ? Apr 26, 2012 02:57 |
|
I'm a CS major and I'm about to ace my linear algebra final and conclude my business within the math department, can anyone suggest maybe some resources or specific algorithms to look at to bridge the gap from textbook stuff to practical applications in CS?
|
# ? Apr 26, 2012 15:37 |
|
gggiiimmmppp posted:I'm a CS major and I'm about to ace my linear algebra final and conclude my business within the math department, can anyone suggest maybe some resources or specific algorithms to look at to bridge the gap from textbook stuff to practical applications in CS? Have you taken algorithms yet?
|
# ? Apr 26, 2012 16:26 |
|
Scaevolus posted:BS is only better at encoding detection, and I'm pretty sure lxml only uses it it it's explicitly requested. Could be. They're not terribly specific about when they do it http://lxml.de/lxmlhtml.html#really-broken-pages
|
# ? Apr 26, 2012 18:18 |
|
Where is a comment permitted in an HTML page? Can I have one before <html>? After </html>?
|
# ? Apr 26, 2012 22:07 |
|
Wherever the hell you like, except within a tag.
|
# ? Apr 26, 2012 22:18 |
pokeyman posted:Wherever the hell you like, except within a tag. As far as I know, by SGML rules you can even put them in the middle of a tag, using -- as delimiter. Like this: code:
(By this, the usual <!-- --> notation is just a ! element containing a comment.)
|
|
# ? Apr 26, 2012 22:26 |
|
That'd be cool but I'm not seeing it in the HTML spec nor does it seem to work in WebKit (it just gets ignored and, in your example, the div would have class 'bar').
|
# ? Apr 26, 2012 22:42 |
|
nielsm posted:As far as I know, by SGML rules you can even put them in the middle of a tag, using -- as delimiter. Like this: Uh, no. That's not how SGML comment syntax works, nor does HTML follow that syntax. You see, in SGML comment syntax, <!-- starts a comment block, meaning that the text can contain >, and further appearances of -- toggle between "can have >" and "can't have >" modes. HTML5 doesn't follow this, because browsers, never followed this, and it broke sites when they tried to follow this. How? code:
|
# ? Apr 27, 2012 01:06 |
|
I posted this over in the Phyiscs questions thread and didn't see a MATLAB thread here so here, Random Number posted:I don't know if this question is really a physics question but here goes. I could just move in Y till I'm on axis with the source then move X to the source but that's less than optimal. Does MATLAB maybe have a function that does this sort of triangulation?
|
# ? Apr 27, 2012 01:23 |
|
The solution you described is 'moving to' the source - not locating it. If you're moving on a lattice, taking the route you described is no longer than zig-zagging in a 'diagonal' line toward the source. Instead, do you mean that you want to make a minimal number of moves to determine the coordinate of the source, by using the perceived signal strength at whatever position(s) you've inhabited?
|
# ? Apr 27, 2012 03:52 |
|
Newf posted:The solution you described is 'moving to' the source - not locating it. If you're moving on a lattice, taking the route you described is no longer than zig-zagging in a 'diagonal' line toward the source. I am trying to move to the source (the source is stationary by the way), But I would like to calculate it's position before moving to it. If i can determine the position of the source while remaining stationary, all the better, but I don't see a way to do that. We're using polar coordinates to move in steps of 1m or less
|
# ? Apr 27, 2012 03:59 |
|
If you only have signal strength you can't get the position. You need to triangulate it out. Record the strength at starting point x,y. That tells you the distance from that point. Move some steps in a direction, record new strength. Now you have a distance from two points. This gives you two possible locations for the source. Move toward either of the possibles, check if signal is fading or getting stronger, and decide whether to keep moving or turn around.
|
# ? Apr 27, 2012 14:29 |
|
Couldn't find a bourne/bash megathread, so hopefully someone here can help me out. Would anyone know why $STATUS returns 2 instead of 1:code:
code:
|
# ? Apr 27, 2012 15:55 |
|
Carthag posted:If you only have signal strength you can't get the position. You need to triangulate it out.
|
# ? Apr 27, 2012 16:21 |
|
2 fat 4 my lambo posted:Couldn't find a bourne/bash megathread, so hopefully someone here can help me out. Would anyone know why $STATUS returns 2 instead of 1: The use of `` runs the command in a separate process (with fork()) and records the output. While the command is running, there are actually two '/bin/sh script.sh' processes running, as you can see by dropping the | wc -l. The Gripper posted:If he can (accurately) tell distance from source by the signal strength, moving once would probably be enough to locate it i.e. "I've moved 50m east, and strength here shows I'm 2m further from the source" would be an observation that you could calculate the source from with no extra steps as far as I can tell. In practice that's not possible unless you have a signal that can't be affected by any external factors, but for an academic problem the strength may be defined and constant (though it wasn't mentioned in the question he asked). No, it's not sufficient - in your example the source could be to the north or the south. In effect, one measurement gives you a ring, and the source could lie anywhere on that ring; two measurements gives you two rings, which - unless you are very lucky and moved straight towards or away from the source - will intersect at two points, either of which could contain the source; three measurements gives you three rings, and there will only be one point at which all three intersect. Now, if you have direction and not distance, you can usually (although not always) find the location with just two measurements. ToxicFrog fucked around with this message at 16:37 on Apr 27, 2012 |
# ? Apr 27, 2012 16:34 |
|
ToxicFrog posted:The use of `` runs the command in a separate process (with fork()) and records the output. While the command is running, there are actually two '/bin/sh script.sh' processes running, as you can see by dropping the | wc -l. of course. thanks!
|
# ? Apr 27, 2012 16:42 |
|
ToxicFrog posted:No, it's not sufficient - in your example the source could be to the north or the south.
|
# ? Apr 27, 2012 17:07 |
|
2 fat 4 my lambo posted:of course. thanks! What is your actual goal here? I mean, if you're looking for info on the currently running process, it seems like it would be a lot easier to get the pid with $$ and then check /proc or something.
|
# ? Apr 27, 2012 17:24 |
|
Carthag posted:If you only have signal strength you can't get the position. You need to triangulate it out. The equation that calculates the signal strength has a randomized numerator. I get the method you're explaining conceptually, but I don't know how i would go about building the system of equations to solve it. I just had discussion with my TAs about this problem and they're just horribly frustrating, so maybe I'm just too frustrated to see the obvious solution. It's three equations that are equal to three measured values, and each equation has 3 variables, Am i on the right track here?
|
# ? Apr 27, 2012 18:04 |
|
|
# ? Jun 8, 2024 20:42 |
|
ToxicFrog posted:What is your actual goal here? I mean, if you're looking for info on the currently running process, it seems like it would be a lot easier to get the pid with $$ and then check /proc or something. you are correct, however it's not my code and I was trying to figure out why it worked in solaris but not linux + how to fix it changing as little as possible
|
# ? Apr 27, 2012 18:05 |