• Breaking News

    Thursday, April 18, 2019

    I got stumped on this JS question in an interview today. Ask Programming

    I got stumped on this JS question in an interview today. Ask Programming


    I got stumped on this JS question in an interview today.

    Posted: 18 Apr 2019 04:03 PM PDT

    Can anyone explain why this prints what it does?

    var length = 10;

    function fn() {
    console.log(this.length);
    }
    var obj = {
    length: 5,
    method: function(fn) {
    fn();
    arguments[0]();
    }
    };

    obj.method(fn, 1);

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

    I've got an odd question for you Programmers. Any Programmers here code for so long that you started coding your way through your dreams?

    Posted: 18 Apr 2019 09:45 PM PDT

    I know, a bit out there. I'm an aspie and I asked this on the Asperberger sub and got hits galore. I am wondering if this is just an aspie thing or is it industry wide and an unknown problem?

    I literally switched from programming to network engineering at one point in my life because I thought I was losing it. I would code my way through dreams and I did not feel rested when I woke up. My mind was still tired from coding all night while problem solving. I hope this isn't too weird, it's my first time posting here.

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

    Has programming affected your eyesight over the years? What can you do to minimize the damage?

    Posted: 18 Apr 2019 04:44 AM PDT

    I spent a large portion of my day near a computer screen even when I was not programming, now especially and while it hasn't caused any issues to my eyes yet, I have a feeling it's gonna bite me in the ass in future, what precautions can I take?

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

    What are, in your mind, the top 5 most essential programming books? Preferably not language specific, but if you feel they deserve to be there include them

    Posted: 18 Apr 2019 08:04 PM PDT

    android app programming

    Posted: 18 Apr 2019 04:13 PM PDT

    Hi guys , so I got an idea about an android app and I think it will be very useful in my country but I never coded an app before. I know a bit about programming through small programming ctf tasks but I use python or C . I never used Java. and the app must contain ( database for registration , invitation for an activity , notification ..... ) so how can I learn to code this app , and how long it takes ?

    ps: I can't use udemy or any payed courses

    thnx.

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

    Not sure what to focus on for Developer Career

    Posted: 18 Apr 2019 07:12 PM PDT

    I recently graduated with an Associates degree in CIS. The coursework focused on C#.net and SQL. I have recently starting working with and learning SSIS . I want to be able to keep my mind sharp and continue learning because I feel myself forgetting a lot of things I learned in school. Is there any resources that would help me move towards a career as a Database Administrator or Software Developer? I'm honestly not sure exactly what I want to do but I do know I have been the most satisfied while in school working on coding projects.

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

    Looking for a Web Entry Database Platform

    Posted: 18 Apr 2019 05:03 PM PDT

    I'm looking for a database front end that I can easily set up on AWS or similar. I'm looking to setup a feedback and error logging system for my small company. The point is easy of access, so I'd like to have a simple webform that individuals can just complete in 20 seconds and submit.

    I'm not technically illiterate, but I'm no developer. I can muddle my way through something like AWS because the guides are clear, but I won't be able to program much from Python or Javascript. So, I'm looking for something that is mostly setup. Either free or low cost, not $1,000 per year.

    Any ideas?

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

    When writing js, why is it so common to bundle libraries like React into your own js?

    Posted: 18 Apr 2019 02:21 PM PDT

    I have been trying to wrap my head around webpack and some of the common practices for javascript and I am struggling to understand why so many tutorials would simply have you roll the library you are using into the javascript file that you host for your site.

    I understand there is logic in webpack to trim out unused code (Tree shaking I think it was called?), but doesn't sending the parts of the library you are using with your code only ensure that it runs? It seems like you lose out on the benefits browser caching could serve for the library if you had just used something like unpkg. So far, I have used webpack's externals configuration option to allow me to grab those libraries from unpkg, but even webpack's own documentation suggests that the feature may not be for general use.

    What am I missing?

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

    C++: conversion of vector of strings to char* array

    Posted: 18 Apr 2019 12:13 PM PDT

    Hey all,

    I have a vector of strings, called input {"this", "is", "a", "vector"}.

    I need to convert the input vector to char* argv[]. So argv[0] = "this", argv[1] = "is", etc.

    How do I do this on a linux machine?

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

    Serious noob question, but I want to learn...

    Posted: 18 Apr 2019 11:43 AM PDT

    I would have just googled this but I'm not really even sure how to ask. What language would allow me to, like, send an email from Gmail, or otherwise interact with web pages? Like what if I wanted to make a program that would log into eBay and reply to any messages I had received. Is this possible? How can I learn more about this without bothering you guys? Apologies and thank you for your time.

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

    Found something paperclipped to a document that was turned in to me.

    Posted: 18 Apr 2019 10:27 AM PDT

    I am not a programmer (much) so I think it looks like code??? What is it and what does it do?

    https://imgur.com/RK2KowZ

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

    How to create CLR Windows Application that includes .lib library that use mutex

    Posted: 18 Apr 2019 08:43 AM PDT

    So, I have to create a Windows Application with a UI, that includes a library or, in alternative, some headers, that uses mutex, and when I try to build it, I get this error:

    "mutex" is not supported when compiling with /clr or /clr:pure.

    What can I do? I read I should use a wrapper, but I don't know where to put my hands in the dependencies that uses mutex not to break everything.

    Is there another way to build appliactions with UI in C++ and Visual Studio, that can make use fo mutex?

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

    Good (light, hopeful) structured logging/json logging viewer (not Saas)

    Posted: 18 Apr 2019 08:18 AM PDT

    I need a way to analyze logs for a increased numbers of customers, and need a tool for that. I already have tried for SAAS products, that is not what I want here.

    My desires are to quickly located data in the log, colorized + formatting output. https://goaccess.io is a example, but is highly biased for web logs (like almost most tools I have find). My logs are *app* logs:

    {"Timestamp":"2019-04-18T09:50:53.3028990-05:00","Level":"Debug","MessageTemplate":"CMD: {Sql} {Params}","Properties":{"Sql":"SELECT libs.set_schema(@name)","Params":["(name, proveedoraelbagre)"]}} 

    I work on OSX. I'm ok with terminal UIs.

    I can change the output if required.

    I *wish* to not have a complex setup, that is why I don't like Elastic search and friends.

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

    ABOUT PYTHON ON VSCODE ISSUE

    Posted: 18 Apr 2019 11:47 AM PDT

    [Qt/C++17] How do you use loops in constexpr functions in Qt?

    Posted: 18 Apr 2019 07:33 AM PDT

    I have written most of a chess engine in Xcode and I am trying to bring it into Qt console for a cross-platform user interface. I have a number of constant expression functions that populate various databases at compile time. As a simple example, I have something like (spread across headers and cpp files):

    constexpr auto least_significant_bit() const { constexpr auto db = []() constexpr { std::array<int, 64> result = {0}; uint64_t bit=1; int i=0; do { result [(bit*0x07edd5e59a4e28c2)>>58]=i; i++; bit<<=1; } while(bit); return result; }(); return db[((bb&-bb)* 0x07edd5e59a4e28c2)>>58]; } 

    In Xcode, this compiles and calculates the least significant bit of a 64 bit integer. In Qt, I get an error

    saying I am not allowed to use a do while loop in a constexpr function. I have tried both

    • CONFIG += c++17
    • QMAKE_CXXFLAGS += -std=c++17

    but neither seem to work. In this particular case, I could just hard-code 64 numbers but there is another database used for calculating rook moves efficiently with around 20000 entries where hard-coding is not feasible. Other than generating read-only data at runtime, what are my options?

    I am using QT Creator 4.9.0 which uses Qt 5.12.2 and Clang 10.0.

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

    Encoded binary exe into readable c++?

    Posted: 18 Apr 2019 03:22 AM PDT

    I have this old game that is shut down that I want to revive. How do I get it's files when it's encoded ? When I open it it's gibberish .. even the .dat files are encoded too..

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

    SFML graphics help

    Posted: 18 Apr 2019 02:48 AM PDT

    I know maybe this isn't the right place to ask but I've tried asking everywhere else and searching but I dont get the right answer.

    I am trying to Make a Tic-Tac-Toe using SFML and c++. I have been successful in creating the grid, the sprites etc. But the problem that I am facing is kinda weird.

    I have a switch in the main game loop which checks the "Event.type".

    inside the switch I have a case called Event::MouseButtonPressed.

    inside which I have another if that checks that if left mouse button is pressed then getGlobalBounds for the 1st cell of the grid and check if that cell contains the Mouse using GetPosition.

    and if that returns true, I want to draw the X / O . To draw that, I have declared a sprite and to draw the texture, I am calling window.draw(sprite) an window.display() inside that if. I know its kinda messy but if you see the code you will understand it.

    case Event::MouseButtonPressed: if (event.mouseButton.button == Mouse::Left) { if (Cell_1.getGlobalBounds().contains(window.mapPixelToCoords(sf::Mouse::getPosition(window)))) { cout << "Cell 1" << endl; cout << "player no : " << playerno << endl; sprite.setPosition(Vector2f(125.f, cell_height)); for (int s1 = 0; i < 6100000000000000000; i++) { window.draw(sprite); window.display(); } 

    The problem that occurs is that the Sprite is drawn only for one frame whereas I want it to stay there once it is displayed.

    If I am understanding it correctly, It shows it for only one frame becoz when the it is finished drawing, it exits the if and it is despwanned.

    Is there any way to fix this?

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

    Looking for suggestions on how to build a specific web app

    Posted: 18 Apr 2019 01:50 AM PDT

    The 'web app' I have in mind is effectively a front end that can query a database in a user friendly way. I've spent a lot of time looking for good examples that aren't e-commerce based and sofifa.com is probably the best example.

    I see mostly JavaScript, but what other methods could work well? Achievable with Python + Django?

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

    How to implement an licensing system for an on-premise application similar to Atlassian products?

    Posted: 17 Apr 2019 10:20 PM PDT

    Atlassian products can be installed on-premise (for example, JIRA). How to they manage their licensing?

    I am asking because we need to implement a similar licensing scheme.

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

    No comments:

    Post a Comment