• Hey, guest user. Hope you're enjoying NeoGAF! Have you considered registering for an account? Come join us and add your take to the daily discourse.

Programming |OT| C is better than C++! No, C++ is better than C

The think is, I don't see where they add the offset, and if you want a number in the [-2^31 .. 2^31-1) range, you should create one in the [0 .. 2^32-1) range, no?

But don't bother, I'll take my time with the assembly tomorrow, after a good sleep :) I shouldn't try to understad half a dozen pages of assembly just with two dozen lines.

The assembly was from GCC, and the source code I was using was from clang. So it could be different. In the clang version they add the offset at the end. But in all honesty, adding the offset is the only way to skirt around the signed overflow problem I think, so I'd be surprised if GCC doesn't do it. That said, I haven't looked more closely at the assembly yet either. It's probably easier to just look at the GCC Source code.
 
Hey, question about Windows 10's SmartScreen and distributing programs built in Visual Studio. Can that SmartScreen block be bypassed for users? I don't think anything I've downloaded from anywhere else gives me that pop up, but if I send a program I created to someone, then they'll see that screen and it could be annoying. Is there something I have to do to make it pass SmartScreen?
 
Hey, question about Windows 10's SmartScreen and distributing programs built in Visual Studio. Can that SmartScreen block be bypassed for users? I don't think anything I've downloaded from anywhere else gives me that pop up, but if I send a program I created to someone, then they'll see that screen and it could be annoying. Is there something I have to do to make it pass SmartScreen?

https://msdn.microsoft.com/en-us/library/ms537361(v=vs.85).aspx

Alternatively distribute it in a zip. Then the program didn't come from the Internet but was created by whatever application was used to extract it.
 

Two Words

Member
Our group recently got assigned our senior design project. We are working with company to make an AR iPhone application for mapping data created in their product desktop application into real space using ARKit. We're likely going to be working in Swift. Xamarin is still an option for us to consider. Any recommendations on learning iPhone app development and AR development? We're kinda hoping that ARKit handles a lot of the AR work for us.
 
Good to know... But doesn't it defeat the "purpose"? And why downloaded apps aren't "created" by the browser?

The Internet browser has to mark the file, which the common browsers all do. https://textslashplain.com/2016/04/04/downloads-and-the-mark-of-the-web/

7-zip or similar could do the same if they wanted to implement it. According to that website it looks like Windows explorer's built in archiving tool as well as many others do, so maybe the zip advice is years out of date.
 

peakish

Member
@cpp and koren: Thanks a lot for your comments and discussion! I'm sorry for not responding earlier. I kind of read "disassemble the code", said to myself "well shit" and wanted to come back to the issue once I had some time to look into it. Never dove into that aspect of coding before, although I knew it should happen sooner or later... anyway, I haven't really had time to do it so I didn't return to comment.

Honestly a lot of your discussion is over my head but (think) I get the gist of it. Still though, just changing to generating with uint32_t (and others) don't give me any speedups at all - but I think this is due to some templating gone wrong in my stupid code. I'll hopefully get around to writing a proper benchmark (ie. not time) for my calls later this week.
 

Koren

Member
Well, it was interesting... I hope you'll be able to optimize your code, but feel free to discuss it more...


integrated compiler vs integrated interpreter?
I'd say it's fuzzier, and depend on whether the language is considered programming language or scripting language...

I don't think I've seen ISE for Python, and while it's somehow compiled to some extend, I'd put it in the interpreter side...
 

peakish

Member
Well, it was interesting... I hope you'll be able to optimize your code, but feel free to discuss it more...
I'll post my results when I get them. I'm probably spending a lot more than than I should on a simple lab program but I like doing things to the best of my ability ... plus, it's good learning.
 
I'll post my results when I get them. I'm probably spending a lot more than than I should on a simple lab program but I like doing things to the best of my ability ... plus, it's good learning.

Try constructing the generator with INT_MIN and INT_MAX for the min and max values.
 

GaimeGuy

Volunteer Deputy Campaign Director, Obama for America '16
Fucking eclipse.

So, I have a code branch for a GIT repository SCP'd over to my cygwin directory at

C:\ProgramData\Cygwin\home\MyUserName\BranchName

It's imported into my eclipse workspace as a C++ project called BranchName

Consider the following code:

BranchName/woof/alpha/source/Foo.h

Code:
#ifndef FOO_H
#define FOO_H

// Non-MyTeam API headers
#include "beta.h"

namespace myteam
{
namespace alpha
{

class Foo
{
public:

    static Foo& getInstance();  
    void  someFunction(beta::Operation_t op);

private:

    Foo();
    ~Foo();
    Foo(const Foo& copyArg);
    Foo& operator=(const Foo& rhs);

    static Foo*  m_pFooInst;
};  // class

} // end namespace alpha
} // end namespace myteam

#endif /* FOO_H_ */

Now, in C:\Documents\DevIncludes\ProjectAPIs\branchname\ are a bunch of external APIs for the project.

In file C:\Documents\DevIncludes\ProjectAPIs\branchname\woof\beta\source\beta.h:

Code:
#ifndef BETA_H_INCLUDED
#define BETA_H_INCLUDED

namespace beta
{

enum Operation_t {
 NONE = 0,
 ADD = 1,
 UPDATE = 2,
 DELETE = 3};

const Operation_t NOOP = NONE;


} // end namespace beta

#endif /* BETA_H_INCLUDED*/

Now, I have C:\Documents\DevIncludes\ProjectAPIs\branchname\woof\beta\source as an includes directory for the project (right click on BranchName in C/C++ Projects in Eclipse, go to Properties, then C/C++ General -> Paths and Symbols, Includes Tab, directory listed under Include Paths).

So, then, why the hell is it that next to this line in Foo.h:

Code:
    void  someFunction(beta::Operation_t op);

Eclipse is placing a marker with the folowing text:
Type 'beta::Operation_t' could not be resolved



WTF ECLIPSE INDEXER?!

I tried deleting the pbom for the index, I tried freshening all files, nothing works.

I can Mouse over the "beta.h" in the following line:
Code:
#include "beta.h"
and press F3, and the Eclipse IDE will open the beta.h file from the includes directory.

Yet, it can not see the symbol. At all.

It's like the CDT indexer and parser aren't finding it, but the outline view is.
 

Sesuadra

Unconfirmed Member
hey you all...so something crazy happened. I had an intelligence test from my country and now my country will pay for a two year education in application development. I won't get a salary, but they'll pay for all the classes and my train tickets. Luckily my wife has a job and I'm able to partake. I got the news yesterday and I'm still processing it.

So, I've no former programming knowledge..and all I know is that parts of the curriculum is Java with a OCPJP certificate at the end as well as MySQL, PHP and OOP Web-development.

now, it starts in 4 weeks and I'd like to prepare. How could I prepare best for this? I'd like to look into Java and MySQL. For SQL I found learnSQLthehardway. would it be worth it for me? anyone every bought the book?

Any other sources, ideas what I should prepare or any help at all would be great. I'm freakishly frightened o.o".
 
hey you all...so something crazy happened. I had an intelligence test from my country and now my country will pay for a two year education in application development. I won't get a salary, but they'll pay for all the classes and my train tickets. Luckily my wife has a job and I'm able to partake. I got the news yesterday and I'm still processing it.

So, I've no former programming knowledge..and all I know is that parts of the curriculum is Java with a OCPJP certificate at the end as well as MySQL, PHP and OOP Web-development.

now, it starts in 4 weeks and I'd like to prepare. How could I prepare best for this? I'd like to look into Java and MySQL. For SQL I found learnSQLthehardway. would it be worth it for me? anyone every bought the book?

Any other sources, ideas what I should prepare or any help at all would be great. I'm freakishly frightened o.o".

Congratulations. Sounds exciting. Syntax books are kind of a waste, IMO. Everything syntax related is one search away. I would use books to pick up design patterns, methods of refactoring, and things like that.

For Java stuff, codingbat and hacker rank are great resources for problem solving. I used Udemy and YouTube to learn syntax. Tbh, general SQL is easy and can be reviewed in a couple of days, if not shorter. I am not sure how much you'll need to learn, tho.

Just ask questions. Literally no stupid ones. Sometimes it's just hard to explain things so there's a language barrier - not necessarily traditional.

I am learning with you - I am aspiring to be a good Java developer and a useful developer overall so we can leverage each other.

Have fun.
 
Starting a new desktop application in Java. Going to finally make a good to-do list. Slamming post-its on my monitor is not efficient anymore, lol.
 

Kansoku

Member
Starting a new desktop application in Java. Going to finally make a good to-do list. Slamming post-its on my monitor is not efficient anymore, lol.

Have you heard of Kotlin? I wouldn't start a new Java project after discovering it. Better everything + full interop with Java, so best of both worlds.
 

upandaway

Member
Starting a new desktop application in Java. Going to finally make a good to-do list. Slamming post-its on my monitor is not efficient anymore, lol.
The most talented and experienced software engineer I know uses the monitor post-its. He has 3 monitors and I can't even see the bezel. I guess it's possible to make it work
 
Have you heard of Kotlin? I wouldn't start a new Java project after discovering it. Better everything + full interop with Java, so best of both worlds.

I've heard of Kotlin, haven't sat down to learn it, however. I should probably get to it, I have heard great things about it.
 
I made a new friend recently who's majoring in Elec. Engineering but thinking about switching to CS. I figured it would help if he did some research on the field first before diving in.

I'm fairly new to CS myself, so I was wondering if you guys knew any good resources detailing what you should know to get into Programming. English is his second language(he's from China), so I'm going to need material that isn't too difficult for a transfer student to understand.
 

Munti

Member
I can attend a paid course and will probably take a Java course where I'll be prepared to do an OCA-exam. I know the basics of Python, SQL and web development. So I hope this will not be redundant.

Is Java still a language that is being widely used?
 

fixuis

Member
What are your guys opinions on python? Is it worth learning if you want to be a software engineer? Good place to start with? what if someone wants to do QA automation with the likes of selenium..worth it then? also SQL, is it worth learning? Thanks guys!
 
What are your guys opinions on python? Is it worth learning if you want to be a software engineer? Good place to start with? what if someone wants to do QA automation with the likes of selenium..worth it then? also SQL, is it worth learning? Thanks guys!

SQL is definitely always good to know. It's relatively easy to learn - at least the things most devs use, too.
 
What are your guys opinions on python? Is it worth learning if you want to be a software engineer? Good place to start with? what if someone wants to do QA automation with the likes of selenium..worth it then? also SQL, is it worth learning? Thanks guys!

SQL is dirt simple but the real thing you want to learn is database design, normalization, etc. If you're ever going to work as a developer of business applications, in particular, you're going to interact with data up to and including the design of how that data is stored. You don't want to treat it like a spreadsheet.
 

Slo

Member
If we're going to consider SQL as a programming language, then we should also consider the verbiage used to order food at the McDonalds drive through as a new natural language too.
 

Somnid

Member
What are your guys opinions on python? Is it worth learning if you want to be a software engineer? Good place to start with? what if someone wants to do QA automation with the likes of selenium..worth it then? also SQL, is it worth learning? Thanks guys!

Python is a decent first language. Overall, javascript seems to fill that general typeless get stuff done quick niche a bit better but all the best machine learning libraries are built for Python and that's something that anyone getting into software engineering now should be looking at. Modern browser automation is all javascript, there's little reason to start with the older selenium-based testing until you encounter it on the job.

SQL is highly useful as you will encounter it everywhere you need structured data. It's super simple though, you'll only need a couple of basics for setting up tables, retrieving data, updating and deleting with joins. If you need more than that it's either some nasty legacy thing or you are doing something very wrong. Keep it minimal.
 

Zoe

Member
SQL is highly useful as you will encounter it everywhere you need structured data. It's super simple though, you'll only need a couple of basics for setting up tables, retrieving data, updating and deleting with joins. If you need more than that it's either some nasty legacy thing or you are doing something very wrong. Keep it minimal.

I wouldn't consider complex queries a "nasty legacy thing" or doing it wrong.
 

Koren

Member
What are your guys opinions on python?
Is it worth learning if you want to be a software engineer?
Great language for prototyping, testing, scripting, scientific work (not number crunching but plotting and the like, even if it does decent number crunching via numpy/scipy and the like) and programming competitions. Wonderful standard library and a lot of 3rd party modules.

Decent first language because of the advantages, but using references for everything can feel strange at first when you use mutable types. I would still use ADA as a first programming language if I had time, but ADA practical use is far, far lower than Python.

Overall, I think knowing Python is really useful, and decent enough as a first language. Still, do you a service: go directly Python3k (even if it may be slightly easier to find Python (2.x) documentation online).

Good place to start with?
The official Python tutorial is good.

also SQL, is it worth learning?
Always, at least at a basic level. And it's only an afternoon work to learn the basics. After that, it's a matter of practice.

BTW, to practice SQL, you can access an interesting online database about geographic/political data at
http://www.semwebtech.org/sqlfrontend

You can enter requests and see the result. It's handy when you learn.
 

Munti

Member
It's around the third most used language in the world after Javascript and SQL pretty much. So yeah.

You have my sympathy...

Yes, it's still really useful, unfortunately...

Thanks! Looks like it isn't very well-liked though ��.

Although I could also attend a course about web-development/-publishing. But because I already know the basics about HTML+CSS, PHP, Javascript and responsive webdesign, I think it is more worth to learn a proper programming language deeply for once. Am I correct with this mindset? Have the feeling that self-study is good enough to learn more in web-development.
 

Koren

Member
Thanks! Looks like it isn't very well-liked though ��.
If you're not familiar with coders yet, there's an everlasting war between languages (down to this thread tittle ;) ). When you learn plently of them, you're bound to love or hate some of them. It can sometimes change over the years, too.

There's probably as many people that hate Java as people that love it. And people joke about it all day long ;) Don't pay too much attention to that.

I think it is more worth to learn a proper programming language deeply for once.
I'd say it's always a good idea.

Have the feeling that self-study is good enough to learn more in web-development.
With online ressources now, I think it's even more doable now than ever. In any case, programming is learned by practice, not by courses, so code, code and code ;)
 
What are your guys opinions on python? Is it worth learning if you want to be a software engineer? Good place to start with? what if someone wants to do QA automation with the likes of selenium..worth it then? also SQL, is it worth learning? Thanks guys!

There are Selenium bindings for pretty much all the common languages. If you want to get into QA automation, I would become proficient in your language of choice, then learn how to use Selenium on top of it.

Also look into Cucumber.
 
Did you guys see this?

https://www.w3.org/blog/wpwg/2017/0...rowsers-advances-on-the-recommendation-track/

Pretty cool. I wonder if this would be under PCI?


PCI has very little to do the communications between the card holder and the merchant. It almost entirely determines protocols for how the merchant handles your data once it gets it.

The only exception is (I believe) that it requires all card information to be encrypted during transmission. But this is so basic that there's no way it isn't covered by tge api.

So this should definitely be covered by PCI
 

Koren

Member
You know you're too old when you see "PCI" and you think "the thing that killed the ISA bus, unfortunately"...

(really, ISA was the last time you could easily create your own PC hardware in direct connection with the motherboard... Now, you can still do it via USB, but it's harder, and nowhere near as fun)
 

Mike M

Nick N
I have a challenge I need to complete for a job interview where I need to look up weather within a 750 mile radius and allow the user to book a flight to the nearest city with sunny weather.

I've been poking around the Openweathermap API, and it can return weather for cities in a radius around a given coordinate point, but it tops out at 50 locations, so that's no good for a 750 mile radius.

I'm having a bitch of a time finding *anything* what would just return weather from a given radius around a given coordinate. Anyone have any ideas? My only other idea is to fake it and just hit the API for multiple points, but that is horribly inefficient.
 
Top Bottom