• LMAO Pics v. Loss Guaranteed! No Refunds!
    5,016 replies, posted
[QUOTE=Alxnotorious;50125129]Now that it's been posted twice, I have to ask. You'd solve this through recursion, right?[/QUOTE] Through recursion, it's if b isn't zero, do "a += a; b --" But a for loop is easier
[QUOTE=mikester112;50125098]The fact that they used blades made out of light to fly away makes me very angry and uncomfortable.[/QUOTE] They're still solid enough to cut through anything though I also don't think they're made out of light, just called lightsabers because the light they emit
[img]http://i.imgur.com/gabeBaM.png[/img]
[QUOTE=VenomousBeetle;50125249]They're still solid enough to cut through anything though I also don't think they're made out of light, just called lightsabers because the light they emit[/QUOTE] lightsabers are blades of plasma encased in some kind of field and it cuts because of the [I]heat[/I]
[QUOTE=mikester112;50125098]makes me very angry and uncomfortable.[/QUOTE] "Star Wars Prequels"
[QUOTE=Ghost_Nixon;50125078][video=youtube;_h12GAmqyXE]https://www.youtube.com/watch?v=_h12GAmqyXE[/video][/QUOTE] [video=youtube;183z7bUdJnQ]http://www.youtube.com/watch?v=183z7bUdJnQ[/video]
[vid]http://i.imgur.com/oggJo5w.webm[/vid]
[IMG]http://i.imgur.com/u02et7G.jpg[/IMG]
[QUOTE=IliekBoxes;50125474][vid]http://i.imgur.com/oggJo5w.webm[/vid][/QUOTE] Cluckin' Hell, how'd he manage that?
[QUOTE=zupadupazupadude;50125457][video=youtube;183z7bUdJnQ]http://www.youtube.com/watch?v=183z7bUdJnQ[/video][/QUOTE] Can't have one without the other [media]https://www.youtube.com/watch?v=hIj5hPpd-uw[/media]
[QUOTE=Rawko;50124957][video=youtube;k9lBKQaul8k]https://www.youtube.com/watch?v=k9lBKQaul8k[/video][/QUOTE] I love Adam "Like Skyrim with guns" Kovic [media]https://youtu.be/UZvINCv4XoA?t=35s[/media] @00:35 since you can't do that "start at time" shit when embedding
[QUOTE=kmlkmljkl;50125357]lightsabers are blades of plasma encased in some kind of field and it cuts because of the [I]heat[/I][/QUOTE] Lightsabers make a WHOOSH sound though when they move around, doesn't that mean that they are interacting with some kind of wind resistance? now I haven't been to school for a while and I hit my head on a coffee table recently so maybe I'm wrong but wouldn't that mean that the sabers could theoretically generate lift if they spun fast enough?
[QUOTE=Alxnotorious;50125129]Now that it's been posted twice, I have to ask. You'd solve this through recursion, right?[/QUOTE] You could use a recursive solution, but it's an awful use of recursion. You'd waste stack space and discretely be adding unnecessary instructions (lengthening run time) due to saving and restoring from the stack. As ToXiCsoldier said, a for-loop is the best solution. For the curious this is a correct solution [CODE] // Iterative solution public int product(int a, int b){ int result = 0; for (int i = 0; i < a; i++){ result += b; } return result; } [/CODE]
[QUOTE=Cows Rule;50125582]You could use a recursive solution, but it's an awful use of recursion. You'd waste stack space and discretely be adding unnecessary instructions (lengthening run time) due to saving and restoring from the stack. As ToXiCsoldier said, a for-loop is the best solution. For the curious this is a correct solution [CODE] // Iterative solution public int product(int a, int b){ int result = 0; for (int i = 0; i < a; i++){ result += b; } return result; } [/CODE][/QUOTE] You could also use shifts and adds so you only have to do as many iterations as there are bits in the int: [code]public int product(int a, int b){ int result = 0; for(int i = 0; i < sizeof(int); i++){ if(b & 1){ result += a; } a << 1; b << 1; } return result; } [/code] [highlight](User was banned for this post ("offtopic" - Orkel))[/highlight]
[QUOTE=ManFlakes;50123900]EXCUSE ME WHAT[/QUOTE] You think I'm joking? [t]https://49.media.tumblr.com/9fdddc7f0f373c8656bb7c8b0613ff89/tumblr_o59b77OKQX1ukmfcso1_500.gif[/t] [img]https://36.media.tumblr.com/e3d785063f2773343b357d8be753659a/tumblr_inline_o58j9zjcgk1qb55ta_540.png[/img]
[QUOTE=Nikita;50125614]You could also use shifts and adds so you only have to do as many iterations as there are bits in the int: [code]public int product(int a, int b){ int result = 0; for(int i = 0; i < sizeof(int); i++){ if(b & 1){ result += a; } a << 1; b << 1; } return result; } [/code][/QUOTE] It's people like you that make stackoverflow confusing
[t]http://i.imgur.com/spohKpM.png[/t]
[QUOTE=Nikita;50125614]You could also use shifts and adds so you only have to do as many iterations as there are bits in the int: [code]public int product(int a, int b){ int result = 0; for(int i = 0; i < sizeof(int); i++){ if(b & 1){ result += a; } a << 1; b << 1; } return result; } [/code][/QUOTE] I haven't tried this method, but just eyeballing it, wouldn't you always be performing the same number of iterations every single time? All ints have the same number of bytes (per implementation) regardless the actual value (which is why types have ranges) [highlight](User was banned for this post ("offtopic" - Orkel))[/highlight]
[video]https://youtu.be/a7M_tpUr3KI[/video]
Obscure trash [video=youtube;E2YVRu09nAo]http://www.youtube.com/watch?v=E2YVRu09nAo[/video]
[QUOTE=Cows Rule;50125772]I haven't tried this method, but just eyeballing it, wouldn't you always be performing the same number of iterations every single time? All ints have the same number of bytes (per implementation) regardless the actual value (which is why types have ranges)[/QUOTE] Yeah but that's all you need. The code is basically your good old fashioned gradeschool long multiplication, but done in binary. Much, much better solution than a for loop, which will take a ridiculous amount of time if the multiplier is large. Except also it doesn't work because it uses << instead of >>= and sizeof(int) needs to be multiplied by 8 for it to work properly (sizeof returns size in bytes, not bits). Or just do this [code]public int product(int a, int b){ int result = 0; while(b){ if(b & 1){ result += a; } a >>= 1; b >>= 1; } return result; }[/code] Just don't use it with negative numbers. Or you'll have... problems. (I may have had some people in a coding chat room take a look at this.) [highlight](User was banned for this post ("offtopic" - Orkel))[/highlight]
made this when I was 14 [video=youtube;J1FFso0-Sw0]https://www.youtube.com/watch?v=J1FFso0-Sw0[/video]
[img]https://i.imgur.com/u9WY7EX.gif[/img] [highlight](User was banned for this post ("Don't post absolutely massive fucking gifs" - postal))[/highlight]
[QUOTE=allon;50125914][vid]https://i.imgur.com/u9WY7EX.webm[/vid][/QUOTE] 131 megabyte gif. Jesus christ.
snip
[QUOTE=allon;50125914]huge fucking gif[/QUOTE] Please put that thing in a webm for the sake of everyone else... [noparse]Use [vid][/vid] tags, and replace the ".gif" at the end of the url with ".webm"[/noparse]
[QUOTE=Steel & Iron;50124854]Fuck yes I found the droid I was looking for [vid]https://my.mixtape.moe/wdpunt.webm[/vid] He's still canon.[/QUOTE] [vid]http://s1.webmshare.com/1RdV0.webm[/vid] [sp]What's funny about is, those helicopter sounds are actually in the episode.[/sp] Was a great episode barring that funny shit.
[media]https://www.youtube.com/watch?v=yhAeVfpy_Mo&ab_channel=TooDamnFilthy[/media]
[QUOTE=Keychain;50125642]You think I'm joking? [t]https://49.media.tumblr.com/9fdddc7f0f373c8656bb7c8b0613ff89/tumblr_o59b77OKQX1ukmfcso1_500.gif[/t] [IMG]https://36.media.tumblr.com/e3d785063f2773343b357d8be753659a/tumblr_inline_o58j9zjcgk1qb55ta_540.png[/IMG][/QUOTE] Why would you do this??? Absolutely disgusting.
[QUOTE=mikester112;50125098]The fact that they used blades made out of light to fly away makes me very angry and uncomfortable.[/QUOTE] Lightsabers aren't light, they are [I]plasma[/I], even so do people really have to be pissed off at something like this in Star wars? it's not like it's hard sci-fi, it's science fantasy. Anyway back to the funny. [QUOTE]Boy meets world[/QUOTE] [IMG]http://i.imgur.com/PxyMnRs.gif[/IMG]
Sorry, you need to Log In to post a reply to this thread.