|
PokeJoe posted:But doesn't this just simplify my code? I can't see how it makes it functionally any different. it turns out that it's usually easier to find bugs in simpler code, and harder to write bugs in it
|
# ? Feb 9, 2015 01:36 |
|
|
# ? May 13, 2024 11:31 |
|
maybe whatever lovely image viewer you;re using doesnt actually like a bunch of extra poo poo at the end of a jpeg
|
# ? Feb 9, 2015 01:41 |
Valeyard posted:inspect the first and last byte of the working photos and then do the same for the first one that doesnt work i did this already. they all start with the proper 4 bytes to signify a jpg and they all end in zeros except for one. heres the first 4 code:
code:
bobbilljim posted:maybe whatever lovely image viewer you;re using doesnt actually like a bunch of extra poo poo at the end of a jpeg its the default one in the virtual machine they provide me for the class e: the file sizes for the broken images are all reasonable sizes too. PokeJoe fucked around with this message at 01:45 on Feb 9, 2015 |
|
# ? Feb 9, 2015 01:42 |
|
if you have the files that should be in there try diffing them something bugs me about your code and I can't put my finger on it
|
# ? Feb 9, 2015 01:59 |
|
oh, aren't you writing the first block twice
|
# ? Feb 9, 2015 02:16 |
|
like at the end of any loop where new is true you'll call fwrite twice since you're setting foundfirst and found
|
# ? Feb 9, 2015 02:17 |
|
and fwrite advances the stream you're writing into
|
# ? Feb 9, 2015 02:18 |
|
also you should be using sizeof and poo poo rather than magic numbers
|
# ? Feb 9, 2015 02:18 |
i think i know what you're talking about. could i just insert a break after that first new write?
|
|
# ? Feb 9, 2015 02:18 |
|
PokeJoe posted:i think i know what you're talking about. could i just insert a break after that first new write? not sure that'd help since it'd break you out of the current condition and back into that second fwrite.
|
# ? Feb 9, 2015 02:20 |
|
i don't really see why you need that 'write first block' fwrite at all, try commenting it out and keeping the rest and see what happens
|
# ? Feb 9, 2015 02:20 |
|
I wrote bubble sort in 6502 today to protect myself from the measles
|
# ? Feb 9, 2015 02:21 |
|
is it normal to write if (foo == true) instead of if (foo)
|
# ? Feb 9, 2015 02:24 |
|
fleshweasel posted:is it normal to write if (foo == true) instead of if (foo)
|
# ? Feb 9, 2015 02:26 |
uncurable mlady posted:i don't really see why you need that 'write first block' fwrite at all, try commenting it out and keeping the rest and see what happens pisss they all worked immediately thanks so much!
|
|
# ? Feb 9, 2015 02:26 |
|
PokeJoe posted:pisss they all worked immediately thanks so much! yw
|
# ? Feb 9, 2015 02:26 |
|
fleshweasel posted:is it normal to write if (foo == true) instead of if (foo) it can be clearer, so sure
|
# ? Feb 9, 2015 02:26 |
|
You have to parse the JIFs. JIFs are made of markers, marker segments, and free-form entropy data. Markers are two bytes, the first is 0xFF and the second is not 0x00 or 0xFF. 0xFF 0xFF is padding. Marker segments are followed by a two byte big endian size which includes the size but not the marker itself. Since marker segments have lengths, they can freely contain 0xFF bytes which don't start markers. 0xFF 0xD0 through 0xFF 0xD9 and 0xFF 0x01 are freestanding markers that do not start a segment and are not followed by a size. Entropy coded data is free form bytes just sitting there in the file, guaranteed not to contain a marker (all 0xFF bytes are replaced with 0xFF 0x00). JIF files start with the Start of Image marker 0xFF 0xD8 and end with the End of Image marker 0xFF 0xD9. JFIF and Exif aren't relevant for this discussion, they're just forms of JIF files. So you need to find the 0xFF 0xD8 SoI marker, then scan through the succeeding bytes looking for 0xFF bytes. When you find an 0xFF byte, if the next byte is 0xD0 - 0xD8, 0x01, 0x00 or 0xFF, you need to keep going looking for another 0xFF byte. If its 0xD9, you're done with the current file. Otherwise, you need to read the next two bytes, swap them if necessary (it is necessary), skip past that length and go back to looking for 0xFF bytes. pseudorandom name fucked around with this message at 02:31 on Feb 9, 2015 |
# ? Feb 9, 2015 02:28 |
fleshweasel posted:is it normal to write if (foo == true) instead of if (foo) i do it to make my code more readable to me b/c im new and don't worry about syntactic sugar
|
|
# ? Feb 9, 2015 02:38 |
|
PokeJoe posted:i do it to make my code more readable to me b/c im new and don't worry about syntactic sugar it's not syntactic sugar it's just writing less code
|
# ? Feb 9, 2015 02:39 |
also this is the terrible programmer thread
|
|
# ? Feb 9, 2015 02:40 |
|
fleshweasel posted:is it normal to write if (foo == true) instead of if (foo) no PokeJoe posted:i do it to make my code more readable to me b/c im new and don't worry about syntactic sugar stop doing it plz (e: in the nicest way )
|
# ? Feb 9, 2015 02:55 |
|
this is not just terrible, this is yahoo answers of programming
|
# ? Feb 9, 2015 02:57 |
|
people trying to cram down poo poo into as little lines as possible should be shot, unless its for a webapp in which case you should be shot anyway
|
# ? Feb 9, 2015 02:57 |
bobbilljim posted:stop doing it plz (e: in the nicest way ) ok
|
|
# ? Feb 9, 2015 02:58 |
|
Valeyard posted:people trying to cram down poo poo into as little lines as possible should be shot, unless its for a webapp in which case you should be shot anyway you should write thigns as _simply_ as you can. This is often more concise, but not always lol if you dont minify your web poo poo automatically so it doesnt matter
|
# ? Feb 9, 2015 02:59 |
|
kalstrams posted:i have terrible coding question. say, there is an hls live feed, which is locked to a fairly bad player. there is a tool that allows me to extract this live feed and pipe it into whatever video player i want. i think of setting up a website with decent (non-flash) player to be able to avoid using monstrosity of a web player that is there now. in case if i do so and succeed to do so, i have one thing i am not sure about - will it cut into my bandwidth or will it work the way i think it would, as in direct client <-> endpoint connection that just uses my server as a means to "locate the signal" ? if you're using a link to their feed, the browser connects there directly, it won't be routed via your server somehow
|
# ? Feb 9, 2015 03:26 |
|
todays workflow: make <error> google <error> fix goto 1
|
# ? Feb 9, 2015 04:30 |
|
AWWNAW posted:umm why are u doing code first against an existing db u could just import the schema to .edmx and generate the pocos That doesn't scale, apparently.
|
# ? Feb 9, 2015 05:38 |
|
bobbilljim posted:todays workflow: Reember when you used a book instead?
|
# ? Feb 9, 2015 05:49 |
|
fleshweasel posted:is it normal to write if (foo == true) instead of if (foo) code:
|
# ? Feb 9, 2015 09:20 |
|
Space Whale posted:Reember when you used a book instead? no bitch I ain't old :roflmao:
|
# ? Feb 9, 2015 11:54 |
|
i owned a book once
|
# ? Feb 9, 2015 12:02 |
|
fleshweasel posted:is it normal to write if (foo == true) instead of if (foo) the only reason I can think of to maybe make it worth doing would be perhaps if foo is a method call that doesn't sound like it would return a boolean and even then you better have a good reason to not just rename the method
|
# ? Feb 9, 2015 13:38 |
|
ok so I need to learn a bit of js but I have no interest or need for web/browser poo poo. any recommended reading? everything I've found so far is browser focused
|
# ? Feb 9, 2015 13:45 |
|
shitface posted:ok so I need to learn a bit of js but I have no interest or need for web/browser poo poo. any recommended reading? everything I've found so far is browser focused https://www.codecademy.com/en/tracks/javascript is based on the language itself rather than how it interacts with a browser afaik
|
# ? Feb 9, 2015 14:05 |
|
WTF. Builds in VS work but break like spun glass in a tornado when I try to use teamcity. Two things about this irritate me. a) VS lets you just stay broken, figures out how to run, but doesn't use that to fix the build. b) that it's possible to 'figure it out' but TC can't do it. Alternatively, this could be because of artifact shenanigans because an upstart dev started adding to gitignore without asking.
|
# ? Feb 9, 2015 19:15 |
|
KARMA! posted:
you're fired.
|
# ? Feb 9, 2015 19:40 |
|
so I already signed a contract for a grad job on the (standard) condition I get atleast a 2.1 now I am panicking about whether I will be able to do this or not how iron clad is that? im thinking about applying somewhere else with a lower req and having it as a backup, but dont really know what would go down if I ended up fufilly choice 1
|
# ? Feb 9, 2015 19:43 |
|
|
# ? May 13, 2024 11:31 |
|
Valeyard posted:so I already signed a contract for a grad job on the (standard) condition I get atleast a 2.1 Apply to jobs as you wish between now and the start of any other job you have planned. since they can change their minds as much as you! If someone offers more money or a better environment or a ballpit with less piss in it, yanno, take it.
|
# ? Feb 9, 2015 20:18 |