![]() |
The Coder's Lounge
I'll just stick around to learn what everyone posts :)
EDIT: For my friend Team_Fail: Spoiler:
|
Add me to the list. I'm Danny and I'm pretty good at Java and C#. FBI is top bae.
So, some discussion now. Anyone here use the website kattis? https://open.kattis.com/ It's pretty much just full on competition programming problems. It's great. |
How about some PHP? Of course people say it's not the safest language for a web interface, but it was the first language aside from HTML and CSS I tapped into and got a grip on.
This is a snip of code from a PHP file I wrote that parses weather conditions from Wunderground (via XML), and since they don't parse wind speeds in kilometers per hour, I wrote this bit of code to do just that. PHP Code:
|
Quote:
JavaScript is also an option if you want to use that. |
Heya all! I haven't exactly been coding for very long, but I've got a fairly good understanding of HTML and PHP, and I recently began learning C#. I haven't really shown up in the Computers & Technology section before, but I'm gonna make an attempt to make this one of my go-to places on PC. I feel like I could pick up more than a few things here.
(By the way, it's Codecademy, not CodeAcademy :P) |
Quote:
|
Hi all!
I do some programming for my uni work. Primarily it's in Python with a bit of SQL (via sqlite), cgi and HTML, and on the odd occasion Matlab as well. I've also help tutor a couple uni courses in Matlab and C. I've touched other languages briefly (mostly for uni coursework some years back... e.g. Fortran90) and did a few things back in high school/bit after in Flash with Actionscript 2.0 (which isn't too different from C I suppose). Quote:
|
Cool, this exists!
While I haven't coded in a while, I have a beginner-that-knows-what-they're-doing's knowledge of JavaScript, HTML5, and CSS/CSS3. |
For my uni course I've learnt coding for Java fairly well!
I learnt Python in my first year and C++ and Visual Basic in my second, but they didn't stick quite as well as Java! I want to learn swift and/or Objective-C so I can work with apple development - cause that sounds like fun! |
Anyone here learn Java as a first language? I did, and now every other language I see (not counting C#) just looks so.. ugly.
Just me? |
Quote:
My lecturer will use all these shortcuts right at the beginning and I don't think he told anyone what they meant haha Swift also sucks because I haven't seen anything like it before, so I'm tossing up between that and Objective-C |
I'm decent at python, and can find my way around html/css/js quite well. I mostly do gdscript (godot engine) now, and a bit of SQL. I know so little C it's not worth talking about. Oh yeah, and BBC BASIC.
|
Hey, you can add me to the list.
My best language is C#, but I also enjoy programming in Python and Lua. More recently I've been working with D and Swift, and a tiny bit of F#. Because of schooling I've become pretty good at Java and Matlab... As for web stuff, I guess knowing HTML and CSS counts, and I've used JavaScript very briefly. I haven't worked with PHP in a couple years, so I can't really say I know it anymore. Some languages that I've tried but haven't stuck with are Haskell and Julia. |
ヽ༼ຈل͜ຈ༽ノ C+= OR RIOT ヽ༼ຈل͜ຈ༽ノ
I can do some Java but that's about it. Next year will be my big expansion into coding languages, likely... Just as an introduction thing, haha... |
I actually have a question for a few coders!!
It's regarding app development in xcode - objective-C or swift? I'm going to be starting this project soon to get a better knowledge of app development, and wanna see what people think! |
Quote:
|
Quote:
|
Oh yeah, can you add me to the list?
|
So in the fall I'll be taking a class on Visual Basic as part of my degree. Would y'all say there's anything I'd need to possibly learn/look at to make sure I don't walk into the class without knowing anything?
|
Hey, add me in! I'm a bit of a beginner with programming, but I'm working my way up little by little. I work with Java, I've done a little C#, I mess around with Batch every once in a while just for fun, and I've entirely forgotten HTML :) It'll be cool to see a whole thread on programming here!
|
hmm.. guess I've never written a single line of code in my webmastering history or as a webdesigner, etc.. yup not a single line.
|
I have a basic understanding of programming, due to a couple semesters of learning Computer Science. However, I only occasionally work on the programming projects that I have. Focus mostly lies on C# and sometimes a little bit Python3. Also had a little bit of C++ and Haskell in the past, though I wouldn't really count them as I haven't done anything with them for ages.
Quote:
|
Quote:
Visual Basic was the first language I ever had experience with, as it was the language taught in my high school programming class. I picked up on it really quickly and actually enjoyed it a great deal, but learning that syntax first made for a hard transition to other languages. Though maybe "hard" isn't the best word? Perhaps the syntax habits were just hard to break. Oh, and hi! I wouldn't consider myself adept or even very knowledgeable about programming at all, but I have been picking it back up lately and playing around with it. As I've said my experience with coding stems from Visual Basic, but I've also taken a course in HTML and CSS while in college, dabbled with JavaScript, Actionscript waaaaay back, and now I'm mostly trying to focus on C# to have a more modern, versatile language to play with. :> |
Quote:
*You're pretty cool if you got that reference. While not programming languages, I know HTML and CSS. As for programming languages I only know a tiny bit of JavaScript. |
Learning Python and took a semester of C, so hoping to learn to make some gaming scripts later =3
|
Add me please even though I'm sort of an amateur lol.
Languages: C++, Java, Shell, Javascript, HTML, CSS (and some others I forgot) |
Hey!
I'm not sure if this counts, but I know a lot about GameMaker Language (GML). I've coded a lot of platformer games and simple fighters. If that's acceptable, I'd love to be added to the list! |
Well I tanked my coding test today (:
I am not very comfortable with the libgdx framework and I think it may have shown.. hehe.. oops has anyone else used libgdx before? |
Thought I'd just jump on this train to brag.
PHP, HTML, CSS. Expert in vBulletin Invision Power Board and services. Former Head Admin of Crazy-Coderz (rip) and current owner of an invision project. Feel free to shoot me any questions :) |
Quote:
But robotics sounds way cooler!! What robot are you trying to make? |
Quote:
That robotics stuff does sound hard, but I bet it pays off in the end! I wish you the best of luck :) |
Just thought I'd join this, I'm always happy to chat about coding and meet fellow coders :3
I'm a full-time software engineer and web developer. I work on identity management software which handles user authentication, authorization, and single-sign on across different web services. I know and have worked with all of the major languages to varying degrees, but the ones I work with most frequently are PHP, Perl, and Javascript. Hello all n_n |
Hey peeps! I'm a software engineer by trade and my strongest languages are C and Java. I'm doing a lot of Android work right now and also trying to find a game engine that doesn't drive me crazy for some hobby projects. I'm a big fan of parallel processing, and have a decent amount of experience with CUDA and OpenGL.
I've got some experience with libgdx, Impo, but not a lot. It worked pretty well for a small game app I did in school. |
I don't really think it's worth putting me on the list since I'm not really proficient in... anything, but I do some amateur coding from time to time. I've done stuff mostly with JavaScript and Java, and these days I'm very slowly learning Ruby (mostly by digging through the code for Pokémon Essentials) and C++ (which frustrates me forever). Looking forward to chatting with y'all!
|
Quote:
I have to make a game for a group assignment and I'm scared (: |
I've been wanting to code something in PHP for sometime (whether by modifying my current project) or just making something new and original.
Hmm, ideas ideas. :P |
Very big on C++ and native-code in general. Not a huge fan of managed environments like C#/Java/etc for "serious" coding. When it comes to performance and general programming C/C++ is my home base. Experience in x86/64, ARM, PPC, Z80, and 6502 from lots of reverse engineering.
|
I'd like to be added to the list.
I've dabbled in multiple languages but the ones I've used the most are, in this order, HTML/CSS (if it counts), C#, Python and Java, although I've mostly forgotten Java and most of Python. xD I look forward to being here and learning from you all! c: |
I have a question for the coders of PC! It's one regarding storing data (let's see if I can word it right :x )
I'm experimenting in swift trying to make an app, and it's very fun! It's essentially a pedometer and by taking steps you hatch and level Pokemon. So fun! But I have come across a problem: I have a ton of Pokemon and variables to store for them (steps taken, level, happiness, etc) which will change throughout the app, but a lot of the other variables (sprites, overworlds, icon, name, type, max exp, exp growth type, etc) will only ever be the same thing. Is there a way to store all of the latter data before instantiating it with the former variables? (I hope that made sense...) |
From what I understand, you want some values to stay the same throughout your app while some can be changed at a time after instantiating them, yeah?
You could set the values you want to remain the same as constants and the rest as ordinary variables. I looked it up and it seems like the code for setting constants in Swift is by using "let" as follows; Code:
|
hmm.. not quite, but I appreciate the help :) !
I will have to use let in the class no doubt, so you are right :) ! But I was hoping there would be a way to import the data from like a text file or something, because I don't want/know-how to write it in the Pokemon class (could you imagine like 300+ if statements to figure it out dear lord help me haha) |
Quote:
http://code.tutsplus.com/tutorials/ios-from-scratch-with-swift-data-persistence-and-sandboxing-on-ios--cms-25505 |
Quote:
|
Add me to the list.
I work on a variety of personal and open source projects. I mostly use Haskell and ES7/Javascript, but I know a bunch more. Recently I've been really into UI architectures, and I've worked on a bunch of shiny new stuff in the React/CycleJS/Elm community as a professional web developer. |
Hey everyone, I recently joined these forums and thought this thread looks pretty neat. I'm currently a student majoring in CS, but I noticed there is a lot of stuff they don't really teach so I've been wanting to learn a few things on my own this summer. I've dabbled into Java, Python, C, Scheme, PHP, and a few more. However I don't really feel that proficient in any of the languages.
Currently I've been dabbling in Meteorjs for webdeving and trying to get a few sites going with it, but I was wondering what other projects or languages I could learn that could be beneficial in the future? |
Quote:
|
Hey, guys!
I'm not a programmer by any means, but I am really comfortable with HTML/CSS and took a couple classes in Javascript and C++ in college. During my downtime at work, I like to plan out programs and have been working on a couple in C which I have been slowly teaching myself. Once I have a better hold on it, I'd like to get back to Javascript. I just wanted to pop in and say hi, especially since I may come in here from time to time with questions~ |
I'm trying to build the qt version of vgmtrans under linux as I post this, might have to do some code tweaks to get it to run.
|
Quote:
|
Quote:
|
So I'm taking Visual Basic this semester and I have a question...has anybody ever had to program Hello World? My professor is making me do that as the first assignment.
|
Quote:
|
Quote:
It was definitely fun to work with the code, although I definitely had some trouble in the beginning. In fact, I accidentally started the project as a C# project instead of Visual Basic in Visual Studio and had to start over. -_- Designing stuff in the GUI made things seem like there was nothing wrong, until I got to the coding of the buttons. |
Quote:
|
Quote:
|
Heey im starting a web dev fundamentals course next week. Should be fun, but might be exhausting while working 40+ hours/week.
|
VB was my first language; it's very accessible to programming neophytes. I think they've made the GUI a little more complicated in recent years, but honestly, you could get a decent grasp of it in an afternoon - and linking code to it is SUPER easy in Visual Studio.
Long story short, I think people still use VB because you can get a decent program up and running quickly. The syntax though... well, it's been hard unlearning it in order to grasp more powerful languages, I'm finding. :x |
Quote:
|
I feel that when it comes to NetBeans. Like it's useful for coding in Java, but I might be forced by college to use it for PHP dev'ing soon? So ughhhh. Lemme code in peace with something far more lightweight like Notepad++ which has an actually decent dark theme on it. <3
Also been having to make own version of some in-built php functions recently. It's actually kinda fun doing the legwork myself, but at the moment I'm trying to make a custom remove from array function and I'm getting annoyed 'cuz I know how to do it in C++ or Java already. Haha. |
Our company is using Delphi (7, but they plan on slowly upgrading to the newest version). I have to say, it feels pretty weird using it, especially since I'm so used to stuff like C/C++ and C# and their syntax.
|
Quote:
What I kinda don't like about Delphi is their weird indexing convention. Like, there's literally some types that you need to start by element 1 whereas others start with the 0 index which is pretty much the standard on every other language I used before. And I always find myself in the situation of asking myself if I even used the right one. {XD} |
I wish I knew and understood more. I just have very basic HTML and CSS. I always say I know enough to have my own site before WordPress...lol. I couldn't write my own stuff but I could take a template and modify it to what I needed.
|
So, I've started working on a project and in theory the only work with code I should need to do is copying code for macros that other people have posted up and then changing values to make it do what I want. That's basically the extent of my coding ability outside the worlds most limited CSS/HTML knowledge.
Which leaves me with a problem when this happens http://i.imgur.com/j64Ek7c.png Can someone translate that to English and tell me what it means so I can work out what I need to change to make it work? If it helps this is using javascript. |
If there's one thing I find annoying with Visual Basic, it's Dim statements. :P
|
Quote:
|
Hi all! I was referred to this thread by Team Fail himself on Discord :D
Now, I'm mostly an artist though but living in San Francisco for years made me seep into this coding thing. Although I 'began' coding like way back in middle school with BASIC and Visual Basic as well as a little (very little that it's very insignificant) Python v.1, Flash, and HTML at a vocational school, these didn't really teach me anything. It wasn't until as recent as 2014 that circumstances forced me to learn PHP, HTML, and CSS partly kicking and screaming. 2015 was a vacuum year in coding as well since I really focused on art a lot more. It wasn't until the beginning of 2016 where I finally met a coding buddy and my proficiency shot to the moon. tl;dr, I'm pretty much a noob and coding isn't really my 'main' thing but I am actively learning. I am proficient in PHP (although I'm avoiding it like a plague now), HTML/CSS, Javascript (JQuery, Vue.js, React, and node). I'm currently waist-deep in Go that it's pretty much my primary language. Also have worked in VB, Python, Ruby, Flash but nothing significant. |
Quote:
I'm somewhat proficient in PHP; I coded a whole web application in PHP almost from scratch as my first dive into programming. Although I don't touch PHP anymore, I'd love to become more proficient. |
Quote:
|
Hi all, I think this is the right place for me to ask this question. ^^
I am interested in learning some more programming. Everyone in my family is an engineer (even my mom programmed in college she told me hahaha), and while I have no interest in engineering or computer science in general, programming looks very interesting. Currently I know a little bit of Bash and Python that my brothers and my dad taught me, and while I can't do big things, I can do small things that help me a little bit to keep my files organized. For example, I take a lot of screenshots of the anime I watch on VLC and the file names contain the name of the anime, so I have a script that will put the screenshots in folders with the anime name that runs every 5 minutes, and things like that. But I'd like to go beyond that and write better things for myself. For example, my brothers helped me write a script that checks when a new episode of an anime I'm watching is available and sends a notification to my phone (with an app called Pushover). They did the heavy work of actually checking for episodes and I just wrote the notification script. I want to write things like that to, um, automate my life a little ^-^. So my question is, is there any book or anything I can read and practice to write that kind of tools? My interest in programming is mostly to automate things for myself. I am not too interested in writing web sites or desktop applications or fancy things like that, at least right now when I want to spend most of my time practicing music. I have googled a little bit and people always recommend me to learn Java. I have looked into it and tried to follow a few tutorials but it looks like people use it for big stuff like app development and at least right now that kind of thing goes over my head. My brothers recommended me to either learn Swift or improve on Python. I know Swift is also used for big stuff but my brothers showed me that a lot of the stuff I do with Bash can be done with Swift, but with a few more lines of code. I guess the first thing I want to do is to write my very own anime episodes checker without my brothers help. What would you do? Would you pick an new language like Swift or should I just stick with Python for this? My brother, who is very skilled with programming and has participated in many programming contests and has published some apps on both stores, told me that even he wouldn't try to do write that entire program on Bash so I guess that one is out of the question for this specific script hahaha. |
Quote:
If you don't want to go deeply into programming, then languages like Java might not be worth your while, because they usually require a lot more research and practice, especially when you're new to their concepts (object oriented programming, etc.). |
Quote:
|
Is there a "C++ for C programmers" guide anywhere? I'm a C programmer, but I'd like to write a program that uses a specific library that's C++ only. Any help?
|
Quote:
After a Google search for what you have in quotes up there, I found this. Not sure if it's what you're looking for, but it's something: http://www.embedded.com/design/programming-languages-and-tools/4424383/A-guide-to-C--for-C-programmers |
Hi all - Tsutarja kindly pointed me over here so I thought I'd pop in and introduce myself.
I'm currently still completing my degree and working for the Australian Public Service. I mostly work with Java, Javascript, SQL, HTML, CSS, and PHP. I've also dabbled ever so slightly in mobile development with Java for Android and Swift for iOS. I have a corporate account with pluralsight.com who recently aquired codeschool.com, so I've been enjoying going through some of the courses on the latter in between university and work commitments. |
Quote:
His youtube vids look pretty cool though, I'll have to watch some :) |
Hi! I may pop by here more since I've been programming a ton lately. My favorite languages are Ruby and Python - I used Ruby for my fangame and tend to use Python for random projects - though mostly lately I've been doing coding the PC Discord bot, which runs in JavaScript. I'd also like to check out PHP sometime in the future!
|
Is anyone of you adhering to certain standards when working on your projects? I'm also curious if there's people who like to use some of the more arcane features that a lot of programming languages feature.
|
Hey, can I annoy any of you guys with my excessive dialouge by joining into the conversation? =P
Don't worry. I'll leave suggestions in suggestion section, so there won't be any of it here. ;D Well, since we're just talking, has this ever happened to you? "Dum bi dum bi dum! Ooh! I just had a genius idea! OoO People keep seeking out for the admin folder and try getting into it, but what if they couldn't find it because it would use special character's they'd never expect? OuO Yeah! Genius! I'll just name admin to... “@™¡ñ” *a day later* "Alright! Let's try adding some files to my... @ folder? Hey wait a minute! What happened to the name? O_O Oh well, maybe FileZilla is glitched. =P" *tries to access it* "Huh? Won't work? Okay...? Well, maybe I'll just rename or delete it. ^^" *won't let me* "Oh oh... Uh... um... s-surely the hosting site's file management can delete that! =O" *goes into the actual hosting site's file managements, also doesn't work* "Welp! I'm screwed!" *researches a freaking day in Google to find a way to fix my issue* "Finally! It's fixed! =D" And here's what you need to do if you screw up like I did and didn't know you could mostly ONLY use ASCII (or ISO-8859-1, if you prefer me saying that) characters and not ANSI...
If you have to know what I'm good/okay at, I do HTML, CSS, JavaScript, and some PHP as well as MySQL (but also a bit of AJAX) and was into doing XHTML for quite a while. ^^ Though HTML5 and CSS3 have some pretty neat features which I've been looking into. =) I use Notepad++ and enter my code from scratch, just to make me memorize it better. ^^ But I do look at plenty of websites to research for more codes or how to make mine faster, like to get the most out of FOR loops and whatever. =) Only thing I can't stand is SVG for how long it takes to just make a shape you can easily draw (say... Pikachu's head with ears). >_> Inkscape just showered the image with excess KB of coding that are way too precise (who's ever heard of a 0.0001 pixel?) So am I allowed to talk here? 'u' I promise to behave. ^-^ ♥ *tries being cute, probably fails miserably* |
Going to be so happy when we finally ditch Delphi 7. Stupid outdated release with a stupid buggy IDE and the more addons I force upon it, the more terrible it turns. And then it doesn't even have a way to force vim keybindings into the editor, let alone use an alternative editor altogether.
*The ramblings of someone who uses Windows/Delphi at work and Linux/C++ at home* |
Been thrown headfirst in the lovely world of setting up web servers. 'Course now's the time I have to do this, by myself, when I haven't touched a Linux installation in about 3 years. Been quite a trip, trying to remember everything. Got there in the end, though. o/
|
Aye, AWS is such a lovely platform to work with, I must say. Had to set up a database on it for a group project in college back in January, and the place I'm currently working in uses it extensively too.
I just wish I understood more of its features, haha. That Route 53 stuff in particular is new territory to me, but I'm slowly getting there, I suppose. Amazon's documentation has been extremely useful and clear to read, thankfully. |
Quote:
And Johnny, maybe try using cookies or sessions? Could try storing data in a file, too, if you wish to do so without reading a DB. |
Say, I'm due to start learning about Android development in the fall, with a huge project lurking in the wings that might require some kind of android app integration. Would anyone be able to recommend me some resources/tutorials to look at? I've got that Android Studio IDE installed and I'm thinking of checking out Lynda.com, and maybe Youtube later... No clue what language to use either, but I'm open to suggestions.
|
Does anyone want free malwarez? :O
Joking, relax. XD I've been studying perl for a number of years now, I've barely started on learning C for one of my next daughters. She's going to be a Win10 Keylogger with Rootkit capabilities, for research. |
In hindsight, that was a terrible introduction to this thread. >_<
How about this instead: I've had an idea for a while now that I've never got a chance to implement. I call it the "Crypto Easter Egg". The problem with easter eggs in any game is that someone can just pick apart the game's code as soon as it is released and find out any secrets and easter eggs, which IMO defeats the purpose. I believe they should only be found after the player explores almost every corner of the game and stumbles across it by accident. So, the idea is to take the part of the game's code that has the easter egg and store it in encrypted form. When the player goes to a certain location of the game and does a certain action, a bunch of variables are taken from certain events along with the different characters' stats, and combined into a string. That string is then run through a cryptographic hash and compared to a hash digest embedded in the game's code. If it matches exactly, then that original string, the unhashed one, is converted to bytes and used to decrypt the easter egg code, which of course is then executed. How does that sound? :D If my explanation doesn't make enough sense, I can write up a quick and dirty perl script to demonstrate. |
Quote:
It seems funny if there was an easter egg in a game that nobody could ever unlock, if the key was a ridiculous size and the algorithm was something like RSA... :P |
Quote:
|
Been meaning to post in here since forever.
Hey guys! I'm Honest, but you can just call me Dipu. I majored undergrad with a degree in Media Studies concentrating in Emerging Media/Web Development, as well as a minor in Computer Science. Currently I work as a software developer trainee. I'm proficient with HTML5, CSS3, JavaScript, JQuery, AngularJS, SQL, and Java. I have also dabbled with C++, Python, and Unix. Also dabbled with C# thanks to Unity. I intend to learn NodeJS and pHp when I can. Now that the formalities are out of the way, I was wondering if anyone could help me understand something. I was doing some JPA (Java Persistence API), which is essentially manipulating databases with Java. While doing some assertion tests, I ran into this error that I simply could not wrap my mind around. My trainer could not figure it out either (I actually had to remove the test case completely cause I could not figure it out in the 2 days I had). Here are the code. This is the method from my DBReadCommand class, along with the EntityManagerFactory and EntityManager being used to connect to the database and handle my User entity: Spoiler:
Here are my write and delete User commands from my DBWriteCommand class Spoiler:
And here is my test case that kept failing, with the set-up and teardown (this is JUnit) Spoiler:
Now the test case SHOULD pass. But it does not, and it keeps giving me, if I recall correctly, an error saying I'm attempting to delete a null/non-existent entity. What I do know is that after deleting the added user, in the tear down, my findUser method reportedly finds the user in the database, even though he does not exist. So upon the attempted delete within the if-block, it throws an error. Another thing I know is that if I do not use the listUser method, the test compiles and runs just fine. If anyone happens to know what's going on, I'd greatly appreciate it! |
Quote:
|
Quote:
Sadly, I spent maybe 2 more days on it, but neither me nor my trainers could make heads or tails of the situation. In the end, I scrapped the test and simply used a different variation. Sorry for the disappointing outcome :'( |
I looked into the next AES competition, called CAESAR. The encryption algorithms submitted have to have a built-in authentication function. Upon looking at the submissions, I noticed one called 'Deoxys'. I thought, must be some kind of coincidence, probably means something else to its authors. Then I saw the previous round of submissions, and there was one called 'Joltik', by the same authors. I knew then that this was no coincidence.
I think that's pretty cool that some fans of Pokemon put in some entries for that contest, and it seemed relevant to put here. Here's hoping one of those entries wins. :D Here's the submissions for the contest: https://competitions.cr.yp.to/caesar-submissions.html |
Noob question time.
Hi! I honestly didn't know where to post this, but I thought that this one was the most appropriate place rather than making a new thread. Anyway, I was looking to start learning how to program smartphone apps, specifically Android apps, because I thought it could be interesting and also useful for my job (they asked me if I could make Android apps and unfortunately I had to say no). So my question is, any tips for a beginner like me? Some recommended developing environments or languages? Thanks in advance! |
Since @Incineroar thought that this might be a good place to continue a discussion on the Discord channel, I'll be posting it here.
I've been thinking about Android app ideas, or maybe writing Python for a change, for the first time. Just me trying to learn new things ;) Right now I've been thinking of a random name generator (perhaps useful for running a tabletop RPG or playing a video game where you can name your character), though I've been a bit on the fence about it... There's also Python... perhaps there are good resources to getting to know Python. Hopefully it's not much of a stretch coming from C, C++, C#, and Java. |
I finally learned enough of the necessary ingredients in ANSI C to start making some very basic file encryption programs. For each version, I did a test encrypt/decrypt of a small text file and an image file of about 200kb. Everything was working fine and dandy up till the 6th version, shown here:
Spoiler:
For the 7th version, all I did was take the repeated code for the S-box initializations and reversing (For decryption) and package them into separate subroutines. That code is shown here: Spoiler:
I did the same tests, with the same keys, on the same files. It worked perfectly fine for the text file. But here's where it got weird. When I used it on the image file, after decryption, it got corrupted. I restored it from an original copy and tried it several other times with different keys. I carefully examined all my input, it matched exactly between encryption and decryption. So next, I took several other image files of different sizes, the smallest being around 20kb. All of them had the same problem. Then I took another text file of around 10kb and tried it with that, it worked perfectly fine. Because of these weird inconsistencies, I can't really begin to understand what the problem is, and I'm still pretty new to C programming (I came from mostly perl). I'm in one of those "I'm not sleeping until I figure out the problem" modes. XD Note: Not sure why it removed everything between the angle brackets in the include statements when posting, must be some kind of whitelist thing going for the BBS. :O Edit1: So I stared at the code for a good while, it still won't confess its problems. :/ Next, I thought that maybe for some reason the problem was related to the size of the input file. So I made a 30kb text file, 10kb larger than the smallest image file I tried it on. It worked fine. XD Then, just to try a different file type, I encrypted/decrypted a 9mb mp4 file. Same corruption problem. :/ And just to add to that, the previous 6th version worked perfectly fine on that very same file. Normally, at this point, I would try peppering the code with debug statements, but I don't think that method will work in this case. Final Edit: Well, it's been 1 week and I still haven't solved the problem. Instead of repeatedly banging my head against the wall of code, I decided to continue work from the 6th version until I figured it out. I added a loop for variable number of cycles, and a layer of diffusion in the version now known as 'LEA' (Little Encryption Automator). But, I came across another problem that I didn't (And still don't) understand. I'll skip the details on that one, though. Then, yesterday, I had some free time after work, so I used the computer there to start working on a key schedule. It all worked fine there, so I printed out the page of code. Then today, I typed it up exactly as written, and lol, didn't work on my computer. So much for ANSI C being easily portable... But, it was simple code, so I dissected it thoroughly. I came up with the idea of changing all the int and char arrays to be the matching unsigned char type. That fixed it, though I'm not completely sure why. XD Then I decided that since it worked for that one, and since I should probably keep everything matching on LEA for when I tie the code into her, I tried the same solution for her. Much lulz ensued as it made her work just fine. I was hoping that this same solution could be applied to xorc7, and so I tried it, but it still has that same problem. I will keep trying to figure it out, but in the meantime, the next step is working more on the key schedule code and then tying it into the next version of LEA. Here is her code for now: Spoiler:
Edit X: Okay, so I said that last edit would be in fact, the last, but I had no trouble implementing the key schedule, so I decided to share it. :P Here it is: Spoiler:
If nothing else, maybe it's interesting to see the development of a (weak) cipher, step by step. :P |
<p>i started to write a discord bot in coffeescript bc i wanted to experiment with discord.js but couldn't stand actually writing js, so now i'm just compiling to it.</p>
|
I enjoyed tinkering briefly with a discord bot in c# I if I remember correctly? Coulda been C++, been ages since I last looked at it.
Finally got started on android development too. So far, so good, and now I've got to do a dissertation on a shopping list app I've chosen to develop for my final year project. |
Does anyone else actually enjoy the debugging process? As long as it's not someone else's code, I actually like doing it. It's kind of like solving a puzzle that I created on accident. :D
Not to mention that when the bugs are clear and everything works the way you wanted it to, it gives a very good feeling. ^_^ |
Debugging is complete hell if you have no idea what's wrong, but something is wrong.
|
Quote:
For example, I was recently learning how to play with argc and argv in C. Here's a snippet of the code I finished: Spoiler:
So to run this one-line mode, you enter "-c" after the name of the program, allowing you to then write out all the input on the rest of the line in one go. During a test, I printed argv[0] and argv[1], which showed that the first argument was the name of the program, and the second was "-c". However, the program would not want to jump into that if statement, going instead to the else (Not shown). So, for some reason I decided to change that part to try and use argv[0] instead, on a whim. It then successfully jumps into the if block. Now, I know damn well that argv[0] contains the name of the program, because as I stated earlier, I printed out the first 2 arguments and saw that to be true. So why does it now work as if argv[0] contains "-c"? I have no psyducking clue... XD |
Quote:
You see, strcmp does not return a bool value for comparison, so you should not use it in an if unless you explicitly compare to a result. strcmp returns zero aka "false" if the strings you are comparing are equal, whereas you are looking for a "true" value, which is any nonzero value - when the strings ae different. Your line should read Code:
|
| All times are GMT -8. The time now is 11:22 PM. |
![]()
© 2002 - 2018 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2016 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.
Acknowledgements
Use of PokéCommunity Assets
vB Optimise by DragonByte Technologies Ltd © 2023.