• Breaking News

    Tuesday, October 16, 2018

    Using an API for the first time. Very confused with OAuth. Ask Programming

    Using an API for the first time. Very confused with OAuth. Ask Programming


    Using an API for the first time. Very confused with OAuth.

    Posted: 16 Oct 2018 04:09 PM PDT

    Hello. I'm trying to create a website for a rental property, and was hoping to use the HomeAway API (vrbo's api) to keep a current list of the reviews for the property. https://www.homeaway.com/platform/developer-api

    The API's I have worked with in the past were all used for educational purposes, and I don't believe they used OAuth. It was as simple as making get and post requests. I "built" a really API with nodeJS, so I have a little understanding of what they are, though I don't have a firm grasp of anything in programming.

    Before being assigned a clientId and a secret, I was asked to provide a redirect URL. My first question is: What is a redirect URL, and why is it required? I just wrote "google.com" to see if I would get my clientId and secret, and I did, but I'm wondering if I need a domain of my own for this API to function. Is a redirect URL something that is only necessary if I am accessing private data via user login rather than public data?

    I have my clientId and secret, and the API instructs us to: '

    make a POST request to

    https://ws.homeaway.com/oauth/token 

    with a standard Basic Auth header, where the username is your client id and the password is your client secret. If you are building this header manually, it should look something like this:

    Authorization: Basic NTVhODQ4NjItZmE0ZS0xMWU0LWEzMjItMTY5N2Y5MjVlYzdiOjg1MzBmNDZjLWZhNGUtMTFlNC1hMzIyLTE2OTdmOTI1ZWM3Yg== 

    where the credentials are a base-64 encoded string of your client's id and secret: '<clientId>:<clientSecret>'. You can retrieve your client id and secret by visiting the My Clients page.

    I have been using Angular, and I plan on creating a dataService to make these requests, but I hoped to test the API first by using the Rest Easy chrome extension. I'm stumped on how I am suppose to format the header, I don't even know what base-64 encoded strings are. I googled it, and I was given various methods of encryption.

    Rest Easy has a header option 'Authorization'. Is this the same as Basic Authorization?

    Thanks ahead of time.

    submitted by /u/patasalada93
    [link] [comments]

    How much of a genius was Terry Davis actually?

    Posted: 16 Oct 2018 11:00 AM PDT

    So, I've recently stumbled up some guy called Terry Davis in my YouTube recommendations. He was apparently (so say a lot of people online) a very smart and capable programmer until (at some point in his life) he started to suffer from severe mental illness. He started to believe that God was talking to him, telling him that he had been choose the built the third Temple in the form of an operating system called TempleOS. If ya'll are interested in seeing how messed up this guy actually was, I'd recommend watching a couple of minutes of this.

    Anyways, apparently this guy had a lot of fans in the programming community, claiming that this poor guy was a genius and that TempleOS a feat of his skill. I'm interested in what actually made TempleOS so special? Why did he receive so much praise?

    submitted by /u/IchMagReddit
    [link] [comments]

    [Advice] CRM Developer Jobs (Temenos: APEX, Salesforce: T24)

    Posted: 16 Oct 2018 04:27 PM PDT

    I'm a jr programmer with 5 months at a java code school and 6 months python and java full stack experience. I started looking for a new opportunities and recently some headhunters have set me up to interview for two CRM Developer positions using Salesforce and Temenos.

    Does anyone have any insight in working as developers in CRMs such as these? These both seem like prominent platforms and good career paths, but I always imagined myself being a generalist and working on full-stack applications using and learning various technologies.

    I wonder if I go down this road, will it be problematic in two or several years for me if I choose to switch out and look for a Sr Java or Full Stack position outside one of these specializations? I got the understanding that both Apex and T24 use core java, but from what I can tell from research (mostly youtube), being a developer in either is extremely different from what I've seen. Both jobs include initial training. Any insight would help. Thank you very much.

    submitted by /u/andy_lastname
    [link] [comments]

    Which SQL should I learn in order to make me more employable?

    Posted: 16 Oct 2018 10:23 PM PDT

    For instance, should I learn MS SQL or MYSQL?

    submitted by /u/78523985210
    [link] [comments]

    c# SetWinEventHook effective usage

    Posted: 16 Oct 2018 10:14 PM PDT

    I'm trying to write a program that reacts on changes of active (foreground) window. I found this solution on stackoverflow:

    https://stackoverflow.com/questions/4372055/detect-active-window-changed-using-c-sharp-without-polling

    WinEventDelegate dele = null; public Form1() { InitializeComponent(); dele = new WinEventDelegate(WinEventProc); IntPtr m_hhook = SetWinEventHook(EVENT_SYSTEM_FOREGROUND, EVENT_SYSTEM_FOREGROUND, IntPtr.Zero, dele, 0, 0, WINEVENT_OUTOFCONTEXT); } delegate void WinEventDelegate(IntPtr hWinEventHook, uint eventType, IntPtr hwnd, int idObject, int idChild, uint dwEventThread, uint dwmsEventTime); [DllImport("user32.dll")] static extern IntPtr SetWinEventHook(uint eventMin, uint eventMax, IntPtr hmodWinEventProc, WinEventDelegate lpfnWinEventProc, uint idProcess, uint idThread, uint dwFlags); private const uint WINEVENT_OUTOFCONTEXT = 0; private const uint EVENT_SYSTEM_FOREGROUND = 3; [DllImport("user32.dll")] static extern IntPtr GetForegroundWindow(); [DllImport("user32.dll")] static extern int GetWindowText(IntPtr hWnd, StringBuilder text, int count); private string GetActiveWindowTitle() { const int nChars = 256; IntPtr handle = IntPtr.Zero; StringBuilder Buff = new StringBuilder(nChars); handle = GetForegroundWindow(); if (GetWindowText(handle, Buff, nChars) > 0) { return Buff.ToString(); } return null; } public void WinEventProc(IntPtr hWinEventHook, uint eventType, IntPtr hwnd, int idObject, int idChild, uint dwEventThread, uint dwmsEventTime) { Log.Text += GetActiveWindowTitle() + "\r\n"; } 

    But it doesn't trigger on minimizing/maximizing. So I found another topic : https://stackoverflow.com/questions/9271855/windows-callback-when-the-active-window-changed where the answer is to use EVENT_SYSTEM_MINIMIZESTART and EVENT_SYSTEM_MINIMIZEEND constants additionally.

    After a few modifications I got this:

     WinEventDelegate dele = null; public Form1() { InitializeComponent(); dele = new WinEventDelegate(WinEventProc); IntPtr m_hhook = SetWinEventHook(EVENT_SYSTEM_FOREGROUND, EVENT_SYSTEM_MINIMIZEEND, IntPtr.Zero, dele, 0, 0, WINEVENT_OUTOFCONTEXT); } delegate void WinEventDelegate(IntPtr hWinEventHook, uint eventType, IntPtr hwnd, int idObject, int idChild, uint dwEventThread, uint dwmsEventTime); [DllImport("user32.dll")] static extern IntPtr SetWinEventHook(uint eventMin, uint eventMax, IntPtr hmodWinEventProc, WinEventDelegate lpfnWinEventProc, uint idProcess, uint idThread, uint dwFlags); private const uint WINEVENT_OUTOFCONTEXT = 0; private const uint EVENT_SYSTEM_FOREGROUND = 3; private const uint EVENT_SYSTEM_MINIMIZESTART = 22; private const uint EVENT_SYSTEM_MINIMIZEEND = 23; [DllImport("user32.dll")] static extern IntPtr GetForegroundWindow(); [DllImport("user32.dll")] static extern int GetWindowText(IntPtr hWnd, StringBuilder text, int count); [DllImport("user32.dll", SetLastError = true)] static extern uint GetWindowThreadProcessId(IntPtr hWnd, out int processId); int PID = new int(); Process pr1; private string GetActiveWindowTitle() { const int nChars = 256; IntPtr handle = IntPtr.Zero; StringBuilder Buff = new StringBuilder(nChars); handle = GetForegroundWindow(); if (GetWindowText(handle, Buff, nChars) > 0) { GetWindowThreadProcessId(handle,out PID); pr1=Process.GetProcessById(PID); return pr1.ProcessName.ToString(); } return null; } public void WinEventProc(IntPtr hWinEventHook, uint eventType, IntPtr hwnd, int idObject, int idChild, uint dwEventThread, uint dwmsEventTime) { if (eventType == EVENT_SYSTEM_FOREGROUND || eventType == EVENT_SYSTEM_MINIMIZESTART || eventType == EVENT_SYSTEM_MINIMIZEEND) { Log.Text += GetActiveWindowTitle() + "\r\n"; } } 

    The thing is I don't know if I used SetWinEventHook correctly and whether this usage can backfire on me.

    Basically (as I understand) I'm calling WinEventProc function on every event from #3 to #23.

    Can I do that? Or should I use SetWinEventHook twice, one time for EVENT_SYSTEM_FOREGROUND and another for EVENT_SYSTEM_MINIMIZESTART and EVENT_SYSTEM_MINIMIZEEND events?

    Edit:spelling

    submitted by /u/emgcy
    [link] [comments]

    Is it ever "too late?"

    Posted: 16 Oct 2018 04:04 PM PDT

    The title is a bit ambiguous, but I mean, is it ever too late to learn about programming? I ask because lately, as a student, I've been feeling really nervous about the interviews and jobs in my future.

    I'm nearing completion of my bachelor's degree, and yet, I feel so unprepared for a job in the field. I've read about interviews and I'm nearly certain I would not be able to answer most of the questions I have seen on the spot. Whether it be my own fault for not paying attention, or just not understanding a concept, I feel as though I don't know enough to work just yet. So is it ever too late to learn? The idea that I'm wasting money at a college is scary. I guess the real question is, can I still learn everything I need to know outside of college? What are the best resources online? Best books? What kind of things should I make on my own time to practice?

    Sorry if these are commonly asked questions or something. I'm just really feeling down about this stuff lately.

    submitted by /u/BurtMacklin5
    [link] [comments]

    (Beginner Question) In Turing I want to make it so a ring of changes colors expands across the screen (Click for more info)

    Posted: 16 Oct 2018 07:45 PM PDT

    for i: 1 .. 125

    drawoval(250,250,i,i,i)

    drawoval(250,250,i - 5,i - 5,white)

    delay(10)

    end for

    That is the current code but it stops once it reaches 125 how do I make it so it will restart with one and got threw the cycle again

    submitted by /u/TheKillerRabbit1
    [link] [comments]

    How do I make visual affects on my screen?

    Posted: 16 Oct 2018 07:43 PM PDT

    effect * Hi guys, I am relatively new to programming. I have been messing around with an arduino and realized how easy it is to send my laptop unique signals with a breadboard and buttons. I want to make a small piano game with like 3 inputs in C++. My question is how do I get started? Like the very basic idea of creating this object on the users screen that begins moving down their screen, and giving this object a design and so forth. For example say I create a class called Note and give it data members like pixel size and centered pixel location on a screen, what exactly do I need to know how to use to then transfer this info and have the actual image pop up on the users screen at this location with this size?

    submitted by /u/Futuremlb
    [link] [comments]

    What language would I write a webapp for iOS in?

    Posted: 16 Oct 2018 06:03 PM PDT

    I want to develop a webapp that's compatible with iOS browsers. It'll basically just record user input and do math with it, so I'm planning for it to be able to be used offline via a cached version. It would also be nice if I could somehow save basic data to a user's local storage. What language should I start learning to accomplish this? I'm assuming javascript, because I think I'll need to use PouchDB to save data, but I'm not sure if there's anything else.

    submitted by /u/piggypaltry
    [link] [comments]

    Is it possible to host a web server from a browser tab without any plug-ins or extensions?

    Posted: 16 Oct 2018 01:29 PM PDT

    Say I have a website that is a single html text page.

    You go to it and it loads the html text in your browser. Then once everything is loaded, as long as the tab is open, you begin serving it to others who may visit the site.

    So it would be like a mirroring RAID array of servers. But new servers would be created simply by users leaving the tab open.

    If enough people left it open always, the original server wouldn't be needed anymore.

    Is this possible?

    submitted by /u/magnora7
    [link] [comments]

    [Requesting Opinions] Code Reviews

    Posted: 16 Oct 2018 07:28 AM PDT

    Hello, I was curious of your opinion on the most efficient way of code reviewing? So far I have see these two:

    1. GitHub Pull Requests
      1. Pro - Anyone can look at it whenever
      2. Con - Sometimes the context of the change isn't always clear
    2. Peer Over-the-Shoulder Reviews
      1. Pro - Thorough
      2. Con - Time consuming. Costs time of two devs, instead of one
    submitted by /u/b_cooch
    [link] [comments]

    How are Google Forms and other Survey systems designed?

    Posted: 16 Oct 2018 10:51 AM PDT

    I have a rough understanding of programming and SQL databases but I can't grasp how the databases for something like the Google Forms or SurveyMonkey is like. This given that users get to choose how many questions and types of answers can be provided by the service and it allows them to store different types and as many as they want.

    What is the design of the database that makes it so efficient? Do they store it all in a single text/json file or do they use NoSQL like MongoDB?

    submitted by /u/FaustAlexander
    [link] [comments]

    Finding common factors of two numbers

    Posted: 16 Oct 2018 02:11 PM PDT

    I'm having trouble with thinking through the logic/pseudo-code behind finding the common factors of two positive integers. I originally thought about making two 1xnum arrays populated with zeros and changing the values to 1 for indexes which are factors of each number then comparing the two arrays to determine which factors the two numbers have in common but I'm not quite sure if it will work in practice. How would you work through this problem logically?

    I'm using matlab if that helps, but I would prefer answers that do not include actual code so I can still work through the problem myself.

    submitted by /u/SoThereWeStood
    [link] [comments]

    Faulty Robot, OpenKattis. Solution fails on 4th test case, but I can't find a bad case. Can anyone help me find one?

    Posted: 16 Oct 2018 01:35 PM PDT

    I am practicing for competition and interviews, but am struggling to find the test case, or any test case for that matter, where this solution would fail. I do not necessarily want corrections to my algorithm, as that would negate the practice, but would appreciate help finding a bad case.

    Here is my algorithm: Github Link

    Here is the problem: OpenKattis Link

    submitted by /u/AgentEnder
    [link] [comments]

    Best place to hire a developer/codementor?

    Posted: 16 Oct 2018 12:59 PM PDT

    I'm starting a personal project in my spare time and I was wondering what the best place is to hire a (reasonably priced) experienced Java software developer who can not only work on the project but also help me improve my code and help me when I get stuck.

    submitted by /u/DirtyHatKing
    [link] [comments]

    Creating a custom font with existing emojis.

    Posted: 16 Oct 2018 08:22 AM PDT

    Hello. I am looking to create a custom font to be used on a website. I need a font that has a custom emoji list, but some of the emoji have slight alterations. Is it possible to make a new font with existing emoji. If I can use svg's that would be even better. Thanks!

    submitted by /u/handykaufman
    [link] [comments]

    I'm mostly working by myself on a development project in a 3-person team. We spend around 2-3 on scrum/planning meetings a week. I sometimes wonder what's the point of all this planning.

    Posted: 16 Oct 2018 02:18 AM PDT

    Especially since 80% of my work for this half year is on a separate project, that only I work on.

    Sometimes I forget about a 4-hour task I have to do as part of the project, that I forgot about. Mostly some extra coding and testing. Then people get upset that I am not working on a ticket on the sprint.

    I feel it also kills a bit creativity, motivation and just causes extra stress. I just don't feel the obsessive detailed planning is increasing productivity and is hard to take serious sometimes.

    My manager is very intelligent, very good, but his weakness is being a bit abrasive and he behaves like he's on amphetamine, meaning he does love to spend hours on the planning.

    Feel free to be critical on me, but I've heard "it's not scrum, it's your implementation" quiet often. I've worked at enterprises, banks and tech-companies. The only environment where I do enjoy using scrum is where the environment is a bit more laid-back, so that scrum becomes no tool for micro-management and measuring performance/results as I feel it's not great for those 2 things.

    I used to love scrum at my first 2 companies though, but they didn't have such stress-inducing, creativity & motivation-killing implementations. At 3 of the last 4 companies, I'm not that excited about it. I realize it's probably mostly me, as I really like the company I currently work at, but the manager is a bit much sometimes.

    submitted by /u/ujjain
    [link] [comments]

    Anybody experienced with a web framework and firebase functions?

    Posted: 16 Oct 2018 10:56 AM PDT

    I know this may sound odd as firebase already provide a serverless architecture with functions and different other tools to help build you an app. But I wanted to know if this combination could work or if you can deploy the web framework like express there or if anybody has experienced it?

    submitted by /u/NoConversation8
    [link] [comments]

    How to compare GLM, Random Forest and Nerual Network prediction on the same data set?

    Posted: 16 Oct 2018 02:14 AM PDT

    Hi,

    I am trying to predict (regression) using the above mentioned algorithms. They provide varying results with different goodness of fit parameters. They do not have any common parameters (goodness of fit). So how do I compare the performance of all these algorithms ?

    submitted by /u/devdibyo
    [link] [comments]

    How do I create my own virtual cloud call center software?

    Posted: 16 Oct 2018 04:18 AM PDT

    I am not a programmer. I'd like to create my own virtual cloud call center software. I know there are many available, but just for curiosity, I'd like to know how one creates one themselves from scratch. I've seen similar questions and the answers are unhelpful, like, "don't make one, use an existing service" or on Qoora "we at XYZ company can make apps for you" etc. Surely all the 'pre-existing' ones were created from scratch once, even if they did use other services/components like Asterick. What aspects/components does it need, what does it entail? If I want my agents to be located anywhere, where must my servers be/how do I set this up?

    submitted by /u/Stephanie_chenxu
    [link] [comments]

    I2C Master and Slave Code in C language

    Posted: 15 Oct 2018 10:56 PM PDT

    I have recently joined a club and I am tasked with finding out how to program Master and Slave codes in C. My team knows how to use I2C in arduino, however, for our application arduino is not suitable. So we are revamping the code and switching over to C.

    I have literally zero experience using C (or any other language, teaching myself C++ right now), and not surprisingly, I am having quite a rough time trying to figure this out. If any of you guys can either provide example code for Master and Slave devices in C using I2C protocol, or link me some data sheets or something that explains this (like here or here ). Or both for that matter.

    The problem with the two pdfs I have link comes to my lack of understanding/recognition of C. They both seem to provide some sort of example code on how one would use I2C, the only issue is that I am not sure if this is C or not. If it is, then great, my problems would be partly solved. So if someone could please tell me it that is indeed C or not, that would help immensely.

    If this is C, is it safe to assume that documents similar to these are also C? Or would that be a faulty assumption?

    Thanks.

    KY

    submitted by /u/That_Important_Guy
    [link] [comments]

    No comments:

    Post a Comment