|
PainBreak posted:With no coding experience to speak of, what is the best programming language to learn the basics nowadays? My little brother is a CS major, and is taking C++ right off the bat. Is that going to be biting off way more than he can chew? The things about C++ that make it tough/annoying aren't taught in school. Like, in a C++ class, you might actually use <iostream> and be able to follow relatively simple string examples. Then you get to the real world and have to do something useful with strings and it becomes a research project just to figure out what the names of the functions you should use are.
|
# ¿ Sep 11, 2011 22:28 |
|
|
# ¿ May 21, 2024 04:21 |
|
Zombywuf posted:Pointers are a traditional source of confusion, made worse by the fact that some people try to pretend they don't exist as if that made it easier. They're pretty simple once you get the hang of them though. When I was interviewing for a job as a C++ programmer, I noticed a lot of interview questions that would consist of a bunch of pointer arithmetic and questions asking "what does this do?" These questions always used to strike me as bullshit - then I got a job doing maintenance on an ancient C++ codebase, the highlight being a method consisting of 500 lines of pointer arithmetic... Plus a few of 'Goto' statements thrown in for good measure. gently caress that.
|
# ¿ Sep 27, 2011 07:52 |
|
Dolemite posted:I'm not sure whether to ask this here or in the Cavern of COBOL reading thread. I have a two-fold problem being a newer developer without a computer science background. The only development methodology that I've found really useful for improving the quality of the design is test driven development - essentially, write unit tests first, get the tests to pass, then refactor once you get stuff working. I think it's counter-productive to sit down and try to come up with an elaborate, over-arching design - if you write the unit tests first, and force yourself to go entirely TDD, there will at least be enough discipline so that whatever you come up with will be testable, and the likelihood of coming up with an design that isn't viable is greatly reduced - and should the design suck, it's MUCH easier to refactor if you have working unit tests.
|
# ¿ Jan 11, 2012 09:29 |
|
Dolemite posted:Thanks all for the advice on programming design. Things I've noticed about unit testing in addition to previous comments: 1. It forces developers to use object oriented programming. If your 'design' isn't object-oriented, you're going to have a bitch of a time writing unit tests. 2. It forces developers to properly mock objects and write scaffolding code - say you're writing a program that displays CR images on a screen, and you use a DLL from another company to do the image processing (sharpening/edge enhancement). And say you need to swap out the old DLL for a new one. If you haven't written unit tests that mock out the component and scaffolding code, then you're in for a hell of a time doing guess and check when people start blaming the new module for issues QA is finding. 3. The unit tests themselves serve as MUCH better documentation than documentation. They're all example code demonstrating how the system works, and should cover every capability - rather than having to page through a reference, you have sample code exercising all the intended code of a module sitting right in front of you - that is huge. 4. Good unit tests make continuous integration worthwhile - if you make your CI tool run the unit tests, and you have good unit tests, you can instantly figure out who broke the build.
|
# ¿ Jan 11, 2012 23:43 |
|
ante posted:Back in the nineties, I've got fond memories of loading up my hex editors and other script kiddie tools and hacking in shortcuts to my Mac OS 9 application menus. Use auto-it or autohotkey, it's loving amazing at adding shortcuts to things that don't have shortcuts. Anotehr habit I've picked up is using greasemonkey to modify shortcuts on websites - I wrote a greasemonkey plugin that makes it so if I press left/right arrow, it goes back and forward in a thread (except if I'm typing a reply) by figuring out that there's a link called "next" or "prev" on the page and binding it to left and right unless there's an edit text box on the page. It's actually pretty ludicrously complex now, but here's an excerpt (I have keys for going up forums, smooth scrolling through posts, etc) code:
|
# ¿ Jan 28, 2012 04:09 |
|
Fruit Smoothies posted:I have no idea what I want to be honest. Just a nice, happy, flexible language. I wish everything was like PHP / Javascript. But I'm probably alone in my thoughts, and also wrong. C# gives me the fewest "what the gently caress were these idiots thinking" moments of any language I've ever used.
|
# ¿ Apr 1, 2012 17:22 |
|
KARMA! posted:And yet you never have to touch any of it! Amazing. Except when something breaks and the debugger pops up with crazy poo poo that's not in "your" code. Your boss isn't going to be "jolly well then, it's not your fault, can't be helped."
|
# ¿ Apr 6, 2012 14:32 |
|
Sab669 posted:This is really a dumb question, but I've never really thought about it before.
|
# ¿ Jul 26, 2012 01:16 |
|
shrughes posted:It seems you get corruption on the Ruby side when the IV has characters 128 or higher. And it corresponds exactly to the position of the character. Whenever I see a problem involving 128, I start looking around everywhere I see ascii encoding if it involves encryption.
|
# ¿ Aug 5, 2012 03:14 |
|
gandlethorpe posted:I writing a macro in AutoIt that automatically fills forms by sending javascript commands to an IE browser. AutoIt is mainly for handling loops and page loads. I'm 99% done, but I'm having a problem with page transitions. I need to find a way to detect when a page or frame changes before the next one begins to load. Form submissions can take anywhere from a few milliseconds to several seconds, so I can't just tell it to sleep for a while then start waiting for the next page to load. Anyone familiar with AutoIt scripting? You're using the COM interface right? Take a look at this page and see if waiting on the ready state would work http://www.autoitscript.com/autoit3/docs/functions/ObjEvent.htm
|
# ¿ Jan 17, 2013 07:19 |
|
gandlethorpe posted:I have been avoiding that, as it's confusing as hell to me right now. It looks like there is an event under WebBrowser that will help me, though (Navigated). How do I go about detecting this event? If you do an objconnect to the running browser you should be able to just be like while($foo.readystate == whatever)
|
# ¿ Jan 17, 2013 23:05 |
|
Zhentar posted:That's because there's not much value to it, not because it's too hard. You can't functionally depend on that much memory without cutting off 2/3rds of the market, so you're limited to doing things like extra caching (much of which the OS will do with unused RAM anyway) for small performance gains on top end systems, at the cost of added testing & support costs. The holdup is probably the engine or DLLs that the game depends on - I do windows dev and we had a large legacy app that needed to be converted to 64-bit, and once we got DLLs for everything that worked in both 32-bit and 64-bit, the actual porting effort was maybe three man months for about 500k LOC, and there were only a handful of bugs. The problem is for games, there's no business justification for doing a 64-bit port - worse, if you support both 64-bit and 32-bit, you have to QA both, which is expensive. The 64-bit benefits for performance/memory utilization are negligible on the windows platform - the only real-world advantage to 64-bit windows app right now is that 64-bit apps don't crash when you hit 2 gb of virtual address space, which is not a very compelling reason cut 64-bit support (gently caress your app if you hit 2 gb of VAS). I was hoping Windows 8 would cut 32-bit support altogether but I guess that's another thing microsoft hosed up.
|
# ¿ Feb 22, 2013 06:25 |
|
Hadlock posted:My friend actually writes software for medical devices. From the stories he told me, there's no way my code would make it through the auditing process at the FDA. You can write poo poo code and have it end up in medical devices. The FDA is looking primarily for documentation - you have to have a quality system, and the steps of the design process have to be documented. You have to have processes, and you have to follow those processes in the course of designing the product. This generally leads to a lot of forms and paperwork. The FDA is looking for the 'existence' of a process, and that we 'follow' the process, not whether or not the code is any good. At the high level, you'll have your design, then your software, then your design verification - but it's not as if the auditors are actually really testing your product, they're just making sure that a) you have a process, b) the forms corresponding with the process have been filled out, and c) your company appears compliant with the process. The design verification stage can be passed with "does this component do what it says it is supposed to do" type testing - there's no imperative (suggestions, but no imperative) that you do say, a code review, or unit testing, negative testing, or security testing, or anything really but functional testing under simulated/actual device conditions. You may recognize this as 'the bare minimum necessary to get a product out the door if you expect it to work.'
|
# ¿ Apr 15, 2013 12:59 |
|
Thermopyle posted:What type of software has a million or 20 million lines? Not doubting you, I'm just curious. I work on fifteen year old medical software - we're at 6 million LOC, probably about 3 million of it in C++. I know where pretty much everything is.
|
# ¿ Apr 24, 2013 01:26 |
|
UnfurledSails posted:I'm an undergrad majoring in CS. Right now I've finished taking the core courses that teach the methodology of programming, as well as data structures and some stuff that's a little more in depth like reading assembly language. I found that the quickest way of getting up to speed on security is to just go to a bunch of conventions - check out say, Summercon (http://www.summercon.org) or Defcon (http://www.defcon.org). Conventions will generally have student discounts. You might not really understand the subject material presented but I learned a poo poo-ton just by googling stuff I heard people talking about at Summercon. The problem with learning from books is that computer security is a rapidly changing field and the textbook stuff will be super out-of-date.
|
# ¿ May 12, 2013 18:16 |
|
Jared592 posted:Yeah I know, I just don't feel like crapping out a program for such a simple change. you do realize you can do what you're suggesting in like 4 loc in most languages right if you use a parser?
|
# ¿ Oct 17, 2013 20:45 |
|
baby puzzle posted:I have an idea for a project but I don't know where to start. I want to create virtual keyboard and mouse devices that look like a regular USB devices to programs. And then be able to control this device via scripts. What you want to do is a total bitch. There is no universal solution - you need to know what API the game is using for input, and there are many possibilities. If the game responds to window messages from the mouse and keyboard like an ordinary windows application should, just use autohotkey/autoit and call it a day.
|
# ¿ Nov 9, 2013 16:18 |
|
baby puzzle posted:It seems like this might have been the case. I guess I will try each option until I run into walls. I have already run into many issues with autohotkey.. I assume that ahk is flakey because of the difficulty of the problem. So I will probably try autoit next. Autohotkey is actually really good if you learn how to use it - if you're experiencing flakiness, there is stuff you can do to compensate by using SendRaw etc, and worst comes to worse if you think you've found a bug in their functions, you can make direct calls to the API. I actually wrote an 'analog automation tool' (aka keylogger) in it that would record any keyboard/mouse moves that you would make, replay it, and generate a graph of what the user did with screenshots.
|
# ¿ Nov 9, 2013 17:19 |
|
bobua posted:Generic question, and I probably have terminology wrong, but hopefully I can get this across. In javascript, all asynchronous events go into an event queue - take a look at this link and it might be helpful for wrapping your head around the asynchronous stuff in generalhttp://javascript.info/tutorial/events-and-timing-depth
|
# ¿ Nov 16, 2013 18:26 |
|
Seashell Salesman posted:2 and 3 sound like you are talking about some boundary between code being managed by a runtime (eg. the CLR or the JVM) and native code in the program? This does introduce some overhead but I'm not really sure if it's a significant source of slowdown in a 3D game. I'd expect people writing games in C++ to be using libraries built on other libraries built on OS provided APIs, not so much calling into the kernel explicitly or anything like that.
|
# ¿ Nov 19, 2013 06:28 |
|
Pollyanna posted:So after reading up on the different kinds of paradigms it has come to my attention that I have never done functional programming. I was under the impression that it meant defining functions in a program and then using them later. In that case, what's the difference between functional programming and object oriented programming? Functional programming, in its simplest form "programming without using assignment operators." Your program consists of functions - these functions are supposed to have referential transparency, meaning that same function, same arguments gives same result (no out parameters) hence why you don't need assignment operators. You can write like this in any language given enough effort, but it's generally done in languages like Haskell/Scala/Erlang/F#/etc (note that this is an ideal, not an absolute rule.) This is the complete opposite of object oriented programming because in OOP, your functions live in objects, and those objects have state.
|
# ¿ Dec 4, 2013 07:14 |
|
Shinku ABOOKEN posted:Hello all, It depends on what you want to secure. If you're just serving up web pages or using a web service, you can just configure your web server to require TLS in apache/IIS/whatever configuration. Then when client connects to the web server using a browser, the browser handles all the details. You can do TLS on any application specific protocol like FTP, etc - doesn't have to be HTTP. If you have your own application specific protocol, you can add TLS support to it on client/server using 3rd party libraries, but I would honestly take the route of serving the data that needs to be secured using apache/IIS with special configuration settings, and having your app use a web browser type control and piggy-back off the client authentication code from that, because doing it that way is way easier to not gently caress up.
|
# ¿ Dec 31, 2013 12:43 |
|
Hughmoris posted:I stepped in it. If you really had to, you could make a VM where autoit would run when you booted the VM (just put it in the startup items folder), and you could use powershell or puppet or whatever to spin up the VMs. However, step back from the technical. You're focused on one of the questions. There are three: a) What are you measuring, and why? b) How are you going to collect it? c) Who wants the data, and why? You're focused on b). I'd worry more about a) and c).
|
# ¿ Aug 7, 2014 01:02 |
|
Hughmoris posted:To answer your question: There are multiple problems: a) You can't rely on stopwatch measurements. Taking a bunch of numbers with a stop watch is really boring, and you won't get consistent results even with same person, different day, exact same scenario. If you get a bunch of different people, half won't understand the direction. b) It's going to be very difficult to repeat the results with some autoit script that bangs on the keyboard anyway, to say nothing about using VMs and lack of controlled environments. You'll get different numbers every day of the week. c) There is no scenario where the physicians are going to give a gently caress about your numbers. You probably don't have enough information to know if you're even reproducing the problem or not, so it's unlikely that your script is going to reproduce the problem in the old version, and demonstrate that the problem goes away in the new version. What you need to do is get the impact analysis of the fix - e.g. what did the vendor say was the problem? What was the fix? How did they test it? I work for a pretty major medical software company, I used to do this kind of testing for them for a living - if you don't have a dedicated group doing software testing in your hospital, your IT department is going to end up with serious problems when they install all this bullshit medical software that doesn't work.
|
# ¿ Aug 7, 2014 07:52 |
|
Kuule hain nussivan posted:How does $("#h1").length work in JavaScript? Does it count the number of h1 elements present, or the length of the content in the first h1 element present? JQuery selectors that return by id only return one element. "#h1" is a jquery selector that returns the element with "id" h1. It will always select one element (id should be unique in a document). If you want to return all h1 elements, use selector "h1" (e.g. $("h1").length. Read this: https://api.jquery.com/category/selectors/
|
# ¿ Aug 6, 2015 11:14 |
|
AuxPriest posted:As far as I know, anything that begins with a $ is jquery. Angular uses the $ in front of a lot of crap, but $. is jquery namespace. I give people a free pass because it's kinda hard to google "what does $(whatever) do"?
|
# ¿ Aug 7, 2015 23:52 |
|
Faith For Two posted:background: I have a semester-or-so of computer science knowledge, and am not pursuing a degree or career in computer science. Most of the programming i've done is simple c++/java or matlab scripts (proof of concept programs for using certain functions or features of the language). Microsoft Excel/Office are very easy to automate using OLE automation. A good resource to start would be: http://blogs.technet.com/b/heyscriptingguy/archive/2006/09/08/how-can-i-use-windows-powershell-to-automate-microsoft-excel.aspx. It doesn't have to be powershell, you can use OLE automation from pretty much any programming language.
|
# ¿ Sep 1, 2015 01:46 |
|
Reik posted:I am not a programmer, I am an actuary, but I have a project I'm working on that involves automation of testing on a government website. The process we have in place from last year involved just running the site through Internet Explorer using VBA to fill out forms, push button, and pull text dumps from the pages in question. Unfortunately this year they updated the website and it appears our version of Internet Explorer, IE8, no longer works with this website. We do have access to Chrome thank god, but the VBA code we use only works in IE. I've looked up solutions to this problem and it looks like there are multiple simple solutions out there, but I'm trying to find one that meets the following restrictions: Did you try playing with the compatibility view settings in IE to see if you could get the site to work, or changing the user agent string? It's extremely rare that something would have changed between IE versions that would break a site between IE6 and 8, yet work in Chrome at the same time - the site may just be checking browser versions and saying it doesn't work.
|
# ¿ Oct 2, 2015 04:49 |
|
mystes posted:I have a windows/C++ related question (I'm not sure if there's a more specific thread this would fall under?): For a really dumb reason, I want to modify a method in a C++ COM library DLL but that isn't included in the COM interface by which the DLL will actually be used. In the unlikely event that I'm understanding how this stuff works correctly, can I theoretically just create a replacement DLL that in its DllGetClassObject substitutes another method and returns the result of the all get class object function from the original DLL? You can use Microsoft detours to do this. See "http://www.codeproject.com/Articles/30140/API-Hooking-with-MS-Detours" - it's possible to detour arbitrary functions if you know the address of the function.
|
# ¿ Dec 2, 2015 11:04 |
|
mystes posted:Thanks. This is exactly what I need. I mean you could just declare a global file handle and pass it, but you're cruising for a bad time trying to do file IO in a trampoline function. Like if you don't know what you're doing, just use ::outputdebugstring function whenever you need to log and run dbgview.exe to collect the logs if you need it.
|
# ¿ Dec 3, 2015 05:05 |
|
Sedro posted:People are moving away from JQuery. Also, the JQuery event handling library is bullshit. a) Whenever a jquery event fires, it normalizes it (as back in the old days, properties for events were not common between browsers, so jquery tries to make the properties consistent.) The code that does this is slow as gently caress. b) JQuery has to track the event handlers in its own internal event handler cache - so an event fires, it's raised in JQuery object itself rather than execution context where the event was defined. This is infuriating to read in the memory profiler, and also has other consequences - like, in vanilla js, if you define an event handler on a div, and remove the div, it goes away, but in JQuery, the event handler lives on in the event handler cache. c) The only thing that you can't easily do in vanilla JS that you can do in JQuery is event delegation (e.g. bind an event to fire on a selector.) However, just adding the event to whatever element you would want is actually a problem because vanilla JS event handling isn't garbage slow.
|
# ¿ Apr 15, 2016 11:32 |
|
Fancy Corndog posted:Not really a technical question, but here goes: I feel like any place that hires for .NET has a higher-than-average chance of being a weird hellhole. I like visual studio and TFS and C# and .NET and think they're great tools, but it's really easy to find companies that were dumb enough to be Microsoft shops back when people were writing desktop apps in C++ using MFC and just kept buying whatever microsoft releases, and then you end up working with a bunch of old people who don't know what the internet is. That said, what's the worst that can happen, another 20k raise in a year and a half?
|
# ¿ Jul 28, 2016 04:27 |
|
baby puzzle posted:This is kinda a programming question. I'm wondering how to handle this build process. Make a batch file that does this and have visual studio call it as a post-build event https://msdn.microsoft.com/en-us/library/h7dhf0ty.aspx.
|
# ¿ Aug 25, 2016 14:29 |
|
Doghouse posted:Anyone have any opinions on mongodb? I've been learning it for a personal side project and it seems awesome in some ways, but there seems to be a sentiment around the internet that it's awful. I used mongo in a toy project once. There is/was a bug where if you use a 32-bit mongo, the database is limited to 2gb in size (for "code simplicity"). You know what happens when the database reaches 2gb? It just motherfucking stopped like... storing more data. You'd execute the commands to store your data... but it wouldn't come back later, no exception, no logged error. Apparently it keeps the whole database in RAM and since there's a 2gb address space limit on windows.... Like why loving make a 32-bit version at all if it can't have a database bigger than 2gb?
|
# ¿ Jan 10, 2017 14:12 |
|
Honest Thief posted:I worked at a place one time where the dev lead wanted me to implement a reverse proxy for a specific use that to this day confounds me, he basically wanted people to access Z through Y, so simple enough that's a reverse proxy, people go to Y and are actually going to Z! Seems simple.. Yeah, we ran into the same problem (except with oauth) and had to implement it in the reverse proxy itself.
|
# ¿ Mar 1, 2017 13:55 |
|
Generally I like to go with testing the public api instead of private functions, but one thing you can do is break up the complicated private functions into static methods - static methods are the easiest thing in the world to test.
|
# ¿ Nov 28, 2017 02:26 |
|
Caganer posted:Is there an easy way to convert an image from png to gif? download imagemagick, just do code:
|
# ¿ Feb 16, 2018 17:07 |
|
strange posted:If I want to render SPA DOM code on the server am I stuck with a something running on Node? Can I get any of the big front-end frameworks to hook into my server-rendered DOM + state object? i'm almost inclined to say that if you want to render SPA on the server, you could like, consider not making an SPA. SPA is a specific technical term meaning "bloated website that uses a twenty megabyte of js framework to solve the challenging technical problem of making it so if the data in your model changes, your view should also update."
|
# ¿ May 30, 2018 13:38 |
|
CzarChasm posted:Cross Posting from Stupid Questions thread What you're looking for in general called a regular expression (regex). In javascript, doing something like: code:
Unfortunately, I don't recognize the language in the file, either. The string concatenation operator is &, which is strange. Do you have more context clues about the language (like, a filename extension)? Also, is the text of the script exactly as in the original file? My best guess from looking at http://rigaux.org/language-study/syntax-across-languages.html#StrngStrnCnct is that it might be awk, based on the names of the methods and sigils present in the variable names. In that case, this might work: https://www.gnu.org/software/gawk/manual/html_node/String-Functions.html
|
# ¿ Jun 22, 2018 15:03 |
|
|
# ¿ May 21, 2024 04:21 |
|
Carecat posted:As someone who has an intermediate understanding of C# , which textbook would be good for web development? I'm going through the W3 schools material at the moment. Php, mysql and w3 schools are all trash and javascript is a necessary evil. You want to pick up something about asp.net mvc .net core, something about typescript, and something about react.
|
# ¿ Jul 5, 2018 13:22 |