• Breaking News

    Wednesday, February 27, 2019

    Door knock detector program [like a door voicemail?] Ask Programming

    Door knock detector program [like a door voicemail?] Ask Programming


    Door knock detector program [like a door voicemail?]

    Posted: 27 Feb 2019 04:48 PM PST

    Hey everyone!

    Brief story

    I'm a uni student who live in the campus dorm, but I often stay at a friend's. there was once where i ordered food and it took so long (an hour and half late), so i went to my friend's room out of boredom, When I remembered about the food I went back to find the poor delivery man waiting for me (He waited around 7 minutes), but he kinda deserved it tbh... NOT the point! So later on I had an idea to create something that would notify my when someone is at my door. I usually leave my laptop at my room so i might turn it to the detection device.

    My Goal

    To create a computer program that identifies door knocks using a microphone and notify the user (me) through his phone.

    I hope it's not hard and maybe add a feature when the doors opens (louder noise) it sent another kind of notification.

    submitted by /u/Faisal-alali
    [link] [comments]

    Making my own IDE? (C++)

    Posted: 27 Feb 2019 07:31 PM PST

    I'm getting more and more frustrated with existing IDE's. I feel like I waste so much time because my IDE isn't just how I want it. For example I'll want to change one little behavior and sometimes it takes an hour to track down the correct settings or files (if there even is one)! Plus, I feel the one size fits all approach results in huge amounts of bloat and a million features/settings I will never use. Not to mention Atom and VSCode are based on electron (disgusting).

    Assuming I have the following (gui) functionality taken care of, are there any critical components that would really make this difficult to put together?

    • Font rendering / text editing (based on Vim)

    • Syntax highlighting

    • Intellisense (I realize this is hard)

    • Compile with GCC

    • Debug with GDB

    • Project/folder viewer (like VS solution explorer)

    • Makefile generation

    • Version control

    It seems simpler than it should be. I feel like I could easily put this together in under a month with minimal dependencies (GCC, GDB, Vulkan, freetype, GLFW, a couple others). The one thing I'm not sure how to do is intellisense errors (like the red squiggly line underneath e.g. an undefined expression).

    So, is this a terrible idea? Has anyone here attempted something similar?

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

    Help me find a backend starting point for fast development.

    Posted: 27 Feb 2019 10:21 PM PST

    Hey guys, I am about to start working on a side project. Basically its a web based (for now) marketplace like platform where there are two types of users -
    Consumers - can subscribe to online packages
    Sellers - can create online packages.

    What do you think will be a good starting point of the project ? I want to get through the development process as soon as possible. I am good with js (node, express, react), php, python. Main thing I am looking for is a backend framework through which I can build my project as quickly as possible.

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

    What is the linker doing?

    Posted: 27 Feb 2019 05:36 PM PST

    In this very short assembly program:

    movl $1, %eax movl $0, %ebx int $0x80 

    After assembling with as, I still need to link it with ld, for some reason, before it can be run.

    What is ld doing here? What role is it serving?

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

    Do people/teams at big companies whose programming resulted in major exploits get fired?

    Posted: 27 Feb 2019 12:20 AM PST

    For example, people at Google or Apple where you can run an exploit to get private information or root, that level of severity....do they get fired?

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

    Looking for a language or environment that can handle three-dimensional objects in space

    Posted: 27 Feb 2019 05:57 PM PST

    Note: I am not interested in rendering graphics or modeling anything in 3D. I'm looking for a language that can deal with three-dimensional objects in a three-dimensional space using only code. I know there's Unity but I do not need the overhead.

    Example: I have 4 cuboid "objects" that are created from data imported from a CSV using given dimensions (Length, Width, Height) and want to specify each one's center point in space using X,Y,Z coordinates. I want to be able to perform calculations such as distance from eachother, total volume, be able to perform rotations and translations, possibly detect if any of them intersect each other.

    Not sure if I'm being very clear, sorry, but any assistance would be appreciated.

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

    binary tree to list (ordered)

    Posted: 27 Feb 2019 12:48 PM PST

    I am trying to implement an algorithm that takes a tree as input and returns a list with all of the values in the correct order (top to bottom, each row left to right) but I am having trouble with it. The easy way to do it unordered is to reduce the entire list where each node gets appended to the accumulated list.

    This is the code I wrote to reduce a tree (written in elixir) where each node has a left and right branch which can be another node or nil:

    def reduce(nil, op, init), do: init def reduce({:node, n, left, right}, op, init) do reduce(right, op, reduce(left, op, op.(n, init))) end 

    called like this to get the tree (but in the wrong order):

    result = reduce(tree, fn (node, acc) -> [acc|node] end, []) 

    Any tips?

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

    Submit button that converts .doc to .pdf that also sends and email via Outlook

    Posted: 27 Feb 2019 10:04 AM PST

    Hello,

    I'm not to versed in programming but I thought I would ask a question. I'm looking to make a .doc/word template that has a submit button that automatically BCC's my email address. I can do this in VBA and I can do it in PDF with Prepare form and an encoder.

    BUT! I'm looking to see if I can combine the two:

    Submit button on the word document that converts to pdf then opens Outlook to BCC my inbox as well. All in one button.

    I don't want the process to be lengthy because over 400 users would sue this template.

    Thank you!

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

    MIPS Assembly book recommendations

    Posted: 27 Feb 2019 11:14 AM PST

    Can anyone recommend a decent book for learning MIPS?

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

    Printing type-casted types in C

    Posted: 27 Feb 2019 02:48 PM PST

    #include <stdio.h> int main(void) { int nr = 5; char castChar = (char)nr; char realChar = '5'; printf("The value is: %d\n", castChar); } 

    If the above code is compiled, the output will be:

    The value is: 5 

    But if the code below is compiled, the console will output the value 53 instead. Why doesn't it print the same as the when the "castChar" is printed?

    #include <stdio.h> int main(void) { int nr = 5; char castChar = (char)nr; char realChar = '5'; printf("The value is: %d\n", realChar); } 
    submitted by /u/hungry_cheff
    [link] [comments]

    What does "a sync" mean when talking about user flow?

    Posted: 27 Feb 2019 01:50 PM PST

    A job I applied to asked some questions. One of them is:

    What's one improvement you would make to the user flow when creating a sync?

    I have no idea what 'a sync' is in this context

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

    Needing help with a simple calculation in IBM HAScript

    Posted: 27 Feb 2019 01:33 PM PST

    I need to output the hours, in number form, between now and the next day at 16:30. Can this be done in a macro? Will be ran in AS400.

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

    On a computer, what are the main abstraction layers from the hardware to end-user application?

    Posted: 27 Feb 2019 05:53 AM PST

    I'm a College level CS teacher and I was reading an article about boxing and unboxing performance in C# and this question came to my mind.

    What are all the main abstraction layers from hardware level up to the average end-user application?

    Update : Let's say to keep it simple a Notepad in C# on Windows 10.

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

    [Poll] Which browser, browser engine, browser wrapper do you prefer/use and why?

    Posted: 27 Feb 2019 12:54 PM PST

    I'm curious how much Chrome/Chromium has conquered/invaded/entered the dev space.

    Here's the Poll and here athe Results

    Also, can you explain why your preferences? I have a running theory that Gecko isn't being used due to XPCOM and outdated documentation.

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

    Is it hard being a newly graduate programmer at 30?

    Posted: 27 Feb 2019 11:41 AM PST

    Hi everyone. I'm 26 rn and I recently went back to school because I didn't do well in in school in my early 20s. I'll get my associate in comp science in 1 years and possibly get a bachelor before 30. My question is, would it be hard to find a entry level software dev (50k/year) when you're around 30 ? What should I do in school beside school stuff to improve as a coder ? Anyone in the same situation before, could you share your insights ?

    edit: I live in dallas tx.

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

    Does whitespace matter in seeds.rb in Ruby on Rails?

    Posted: 27 Feb 2019 11:36 AM PST

    May seem like a dumb question, but, seriously, does it matter? To give more context, I was looking at an example seed file (just started learning Rails), and there's this one huge seed file that's very difficult to read, and I would've preferred that the programmer behind the seed file create a tab between each database column (i.e. Customer.create(id: 1, username: "username" - enough tabbing between "id" and "username" such that it's easy to read them as separate columns, rather than a mish-mash of usernames that have different lengths when seeding 50 users, thus making it harder to tell what's going on at first glance). I ask the above question because I'm curious...

    • would it be bad practice to tab out the database columns such that it's easier to read?

    • would the extra whitespace created by tabbing cause some sort of error when trying to seed with, and correct me if I'm wrong on this syntax, rails db:seed?

    At the end of the day, I just want to create readable code, and I was thinking if this were a viable option for me out in the real world. Thanks!

    submitted by /u/k-hiroshi
    [link] [comments]

    [C#] Parsing HTML code that gets retrieved through an AJAX call to a private API.

    Posted: 27 Feb 2019 11:35 AM PST

    I have a question for you guys. I built a small utility that displays the remaining data in my data plan, parsing the HTML code from the webpage of my ISP. The app is built with a headless browser because the data is displayed only after the page is loaded through JS and a private API and without having a full browser in the background doing its own things I have yet to find a better way.

    My question is: is there a better approach to my problem? Right now I'm using Web Browser component which should be an IE instance; should I substitute it with something better/more lightweight? Is this the best way to do what I need?

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

    Resources for writing technical docs?

    Posted: 27 Feb 2019 11:10 AM PST

    I'm look for resources similar to this article on best practices for writing docs. Things like API documentation, tools documentation, etc etc. Does anyone have good videos, articles, online courses, etc that cover this topic?

    Is this even the right subreddit for this question? If not, where should I ask?

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

    Hosting a .net Core API on Ubuntu server

    Posted: 27 Feb 2019 10:15 AM PST

    Hi guys,

    Recently I've been trying to develop a simple API that will take HTTP objects, and store them in a database. One of the constraints of the project I'm working on, is that this all has to be run on an Ubuntu server.

    I'm using .net Core 2.2, and have a couple of Models and Controllers ready and working locally (tested with Postman), and for testing purposes I've been using the "in memory database" option. My issue is, having followed the instructions here: https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/linux-nginx?view=aspnetcore-2.2 I am still unable to access the database with http requests. Is it possible to run an API to store the contents of an http request on Ubuntu in this way? I've got netcore installed fine on the server, and Nginx seems to be configured well - the API seems to run, but not to allow any input/access even to hardcoded database entries (the default "Values", for example) via "server_ip/api/values" etc.

    I understand that ForwardedHeaders must be used - though I'm not sure if this is the correct implementation. I have them included in the "Configure" method in Startup.cs.

    Any corrections/advice would be appreciated!

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

    [HTML/JS] Numeric Text box value to shapes?

    Posted: 27 Feb 2019 09:09 AM PST

    Good evening everyone, i'm stuck on a fairly simple problem, consider the following code (no errors, just unsure of how to add below message to it)

    </style> <title>TEST</title> <link rel="stylesheet" type="text/css" href="stylesheet.css" /> Shape amount: <input type="text" id="shapeQuantity" value=""> <button onclick="background_Color();getBox();">Show Me!</button> <div id="box"></div> <br> <p id="demo"></p> <script> //function to change the color of the box. function background_Color() { var r = Math.floor(Math.random() * 256); var g = Math.floor(Math.random() * 256); var b = Math.floor(Math.random() * 256); var bgColor = "rgb(" + r + "," + g + "," + b + ")"; console.log(bgColor); var boxObj = document.getElementById('box'); boxObj.style.background = bgColor; return boxObj; } //changes the width and height of the box received. function getBox() { var boxObj = document.getElementById('box').style.width = "50px"; var boxObj = document.getElementById('box').style.height = "50px"; return boxObj; } </script>` 

    What i'd like to do (haven't implemented yet, hence why i'm here) is, is when a user enters a number value within text box then via its 'Show Me' Button show the amount entered as shapes on the screen (EG: If number 10 is entered then show 10 shapes) with these said shapes being on the same row and having the margin distance between them doubled for each shape in the said sequence (i'm aware of of how to do it normally for one object, but not multiple shapes or items at once)

    If anyone could give a logical explanation to this it would be great.

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

    How to multiplex terminal on Windows

    Posted: 27 Feb 2019 08:41 AM PST

    Hey, /r/AskProgramming,

    First of all, sorry if this is offtopic here, I couldn't think of a better subreddit to post this in.

    So, my question is: is it possible to achieve similiar functionality on Windows like with tmux/screen on Linux using the standard command prompt, Powershell or Git Bash? Basically what I want to do is run multiple processes and display their output in a single window, preferably split vertically side by side.

    Thanks for any help in advance!

    (If you know a better place for this question feel free to tell me so I can subscribe/crosspost there. Thank you!)

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

    looking for some tips before I start my project

    Posted: 27 Feb 2019 01:34 AM PST

    For my computer science class we have to make a simple application that uses an algorithm. I decided on making a program that is meant for students that want to move to the netherlands. The program will ask 4 questions to the user about how much they value safety, education, a young population, and city size; they will have to answer between 1-10 , 10 being strongly value. For each of my 4 criteria, I ranked 10 cities from best to worst.

    My goal is that my program will look at each of the answers the person gave and then go through my data and tell the user the best city for them that most closely matches their requirements.

    What are some tips you would give me when coding this project?

    I feel like the hardest part will be for the program to compare each answer and to find the best city, any advice on this part specifically?

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

    How to restore files deleted by git pull rebase

    Posted: 27 Feb 2019 05:12 AM PST

    Hi guys, something quite tragic happened to all my files in my project after I did a git pull rebase. I tried to follow the tips in this thread:

    https://stackoverflow.com/questions/10268940/git-pull-deleted-uncommitted-changes

    especially the second solution and I have been trying this:

    grep -rin <string\_in\_missing\_file> .git/

    I see results in the terminal like this:

    .git//rebase-apply/0002:9609:+const ExplainSection = styled.div`

    .git//rebase-apply/0002:9614:+const SectionNumber = styled.div`

    .git//rebase-apply/0002:9621:+const SectionImage = styled.div`

    .git//rebase-apply/0002:9626:+const SectionText = styled.div`

    It seems that info about my files are still floating around somewhere, but I have no idea how to restore them, or if it is even still possible.

    Please help me out here :(

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

    How to autoexec.bat this or any other way?

    Posted: 27 Feb 2019 02:25 AM PST

    Hi there,I don't know if it is right to ask in here but i need a little help.

    https://declanrussell.com/portfolio/nvidia-ai-denoiser/

    at this link there is nvidia ai denoiser in executable form. it works in command line.Tried it working fine.But i need an automatic operation cos it is not efficient to write it in the command line everytime.

    I need a bat file for nvidia ai denoise utility. What I want to do is put an image to the directory of my choise and the image name is whatever it is downloaded from internet. I want to have the ability to input image file in that directory run denoise command to that image, rename the image*_denoised.jpg after the operation. But also I wanna have the ability to move the processed input images to another directory so they will be ignored next time when I run the command again, or optional ignore the images that are proccesed looking for the file names if they contain "denoised" in the name of the file,or log the files processed and ignore them. Don't know if it is achievable with autoexec.bat file but I make it work in a simple command like this 1:

    L:\Nvidia_AI_Denoiser_v2.2\Denoiser.exe -i L:\Nvidia_AI_Denoiser_v2.2\a.jpg -o L:\Nvidia_AI_Denoiser_v2.2\b.jpg

    -i stands for input image, -o stands for output image

    it makes the operation but I always need to rename the input image a.jpg and it only works for single image.

    How can I have the batch work for multiple images also ignoring the path of image files.The command should work in any directory where it is executed where there are image files.

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

    No comments:

    Post a Comment