• Breaking News

    Thursday, April 16, 2020

    Have you ever read a compsci book and found those "real world analogies" helpful understanding anything? Ask Programming

    Have you ever read a compsci book and found those "real world analogies" helpful understanding anything? Ask Programming


    Have you ever read a compsci book and found those "real world analogies" helpful understanding anything?

    Posted: 16 Apr 2020 03:32 PM PDT

    I just started reading "The Art of Exploitation", where there is an intro to programming with some pages of verbose analogy to driving instructions (it's always car related, isn't it), immediately followed by dissecting the hello-world-assembly in terminal GDB... which I found pretty ridiculous and that got me thinking. I turned down Kurose's networking book, because the analogy game was just getting out of hand before ever touching anything real. I do have problems with attention and focus, which might explain my aversion, but I am wondering does anyone actually like these narrative elements? Has anyone ever profited from these simplified and lacking comparisons? Or do authors just don't know any better/suck at analogies?

    Any good books on basic topics, eg. networking, programming, operating systems, security, ... which feature good explanations, but get to the point?

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

    Dealing with stress, anxiety, and frustration when coding?

    Posted: 16 Apr 2020 02:02 PM PDT

    So, I'm in an extremely uncomfortable position here. I'm not a coder. I've never coded a day in my life until graduate school, when I joined a field tangential to the one I studied in undergrad.

    I'm in a coding class (in R) to fulfill a program requirement, and it's completely upended my professional career. I know that sounds silly, but it's true. I barely understand anything, from the documentation (which for some packages is just the code to the class projects.

    I've never been in a situation where I couldn't understand something, no matter how many hours of work I put into it. Some weeks, I spend more than 20 hours coding a project that takes my peers 6-7. It's ruined my perception of myself as a scientist and I dread opening RStudio every day.

    How do you guys deal with this? Is this normal?

    It's almost reached a point where I don't think I can handle the class much longer. It's too stressful. I'd almost rather take a full load of the toughest classes in my field than this one intro to R class.

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

    So what's the deal with every programming book beginning with 'Hello, World"? Is there a history behind this?

    Posted: 16 Apr 2020 05:14 PM PDT

    Is there a way to pair to a BT device from data on an already paired computer? (Pair a device indirectly)

    Posted: 16 Apr 2020 10:12 PM PDT

    If this isn't the right sub for this question, let me know.

    Say I have a computer, with a BT device paired to it. Could I use the information from, say the system_profiler SPBluetoothDataType command, to pair this BT device with a separate computer without directly pairing it?

    Thanks in advanced, u/Th4t_gi

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

    Hands-free coding with voice, technically feasible?

    Posted: 16 Apr 2020 01:04 AM PDT

    I saw a YouTube video that tells programmers to "put down the keyboard". That gave me an idea... How about hands-free coding using voice recognition? It probably is not possible right now, because voice recognition software probably cannot understand special words like "int" or "func" or something like those, but if someone creates a voice recognition software just for specific programming language and IDE? Can this be feasible?

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

    Command Prompt -> bash

    Posted: 16 Apr 2020 09:18 PM PDT

    Hello there, I am transitioning from vs code to working on vim from the command prompt and am wondering if anyone has any advice for the best terminal to use. I have just been using command prompt, as this seems like the obvious choice. I've heard that PutTy is good if you're gonna need to use ssh a lot.

    My main problem right now is when I do 'bash' in command prompt then, say, compile a c++ program with a lot of errors, I cannot scroll all the way up to see all of the errors. Does anyone know how to fix this? I have tried increasing the buffer size and number of buffers but it does not work.

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

    Is there a (Linux compatible) tool for rapid diagramming with a textual source?

    Posted: 16 Apr 2020 08:59 PM PDT

    I am wanting to make simple but still attractive and appealing diagrams quickly and reproducibly. Visually, my needs are pretty straightforward: Colors; boxes with a few basic shapes; typefaces; basic text formatting, sizes, and alignments; and lines between boxes, with basic line endings.

    There's plenty of graphical software out there, everything from InkScape to yEd. But I haven't found anything that gives me the right blend of rapidity and control.

    So I've decided I want a textual tool instead. There's Graphviz and its DOT language, but the layouts are fully automatic and never what I want. [Mermaid] is a little better, but it handles specific kinds of diagrams, and its layouts are still automatic, and it doesn't export to PNG (so I have to do that myself).

    Ideally, I would be able to specify shapes and lines, being able to add labels to both, and then be able to lay out the diagram by specifying positional relationships (e.g. this box immediately above that box, this box 300 units to the right of that box). Styles could be applied separately. But all done with declarative instructions handed to an processor or engine of some type.

    Is there something that fits this description? I'm even interested in software components, if putting together an interface for them wouldn't take much time.

    Thanks!

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

    i am making a website called "sourceyourclaim"

    Posted: 16 Apr 2020 08:13 PM PDT

    it allows users to search and add common quotes and statements, and allows them to find sources for the claim. the user can also "upvote" or "downvote" these sources, similar to reddit. what do you guys think?

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

    How would you secure an Android, Vue.js & Spring service?

    Posted: 16 Apr 2020 01:26 PM PDT

    I am looking at developing a service that will use Spring Boot for the backend API (communication with the database hosted on AWS), Vue.js for the frontend website that is accessible with a login page to secure areas of the website, and then an Android app to perform other features that the camera and other sensors are required for. I have developed a system with these three platforms before and for the login I used 'Firebase Auth'.

    The system worked using firebase auth but I was not able to secure the REST API I created because there was I know of no way to validate the users who are calling on the API. What would be the best approach to secure this application? Firebase auth did like 10% of what I needed in another project but it was very lacking I feel.

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

    Programming mixed with hands on/field work.

    Posted: 16 Apr 2020 04:58 PM PDT

    Currently I do automation control work where I programming ddc controllers and wire them up. I love it other than it's become rather simple and I've grown bored of it. Outside of that I've done coding in college and as a hobby. Other then PLCs, are there fields where you can code and have a little hands on work such as wiring? Thanks for the reply's in advance.

    submitted by /u/Volt-Ghost
    [link] [comments]

    Hardware ID from website visitors?

    Posted: 16 Apr 2020 04:15 PM PDT

    Hey guys,

    I run a service/website that is subject to a lot of fraud, sadly. We use a ton of ways to try and detect it and use some services from anti-fraud companies even, but some still get through. A lot of the time it seems they have managed to get access to some private residential VPNs that are very hard to know are abusers before it's too late. I've been reading about Hardware ID lately and think it might be the way to go moving forward if we want to make sure they will have a hard time/not worth the hassle to continue abusing the site. I'm just wondering what would be the best and non-intrusive way to do this? Is it possible to get Hardware ID from someone just visiting my website? Would a browser extension be able to get the Hardware ID? Or do I need the users to download a program that gets root access for me to be able to see Hardware ID? Any other ideas perhaps about anti-fraud measures?

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

    Best Pluralsight Courses to take during the free month?

    Posted: 16 Apr 2020 03:48 PM PDT

    Actually, since Pluralsight is providing free access to its platform, I was looking for some of the best courses on the platform to take so as to grow as a developer. I work as a Software Engineer mostly on Java/Spring.

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

    [Java] Slackbot - give me advice!

    Posted: 16 Apr 2020 11:28 AM PDT

    Hello,

    I try to make bot to Slack. I depends on this doc: Slack.dev
    I create bot app and added it to my namespace in slack. I write my simple projekt like in doc and try to run it - in console get

    cd /home/belluu/programming/StasBot ; /usr/lib/jvm/java-14-oracle/bin/java -Dfile.encoding=UTF-8 @/tmp/cp_366zb15x5bzae2tta7g8laupf.argfile pl.belluu.App

    but bot do not wrote on chat.
    This is my simple repo: Repository

    Someone can give me advice?
    Best Regards!

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

    Traffic flow simulations: Major undergraduate Project

    Posted: 16 Apr 2020 03:05 PM PDT

    Excuse me everyone - For a major project for my undergraduate year I am required to find a peer-reviewed research article that successfully used a computer simulation as a means of study. Then to create my own simplified simulation to model the system.

    I picked matlab because I am fairly proficient in it, and choose the topic of traffic flows that was approved by the prof.

    I am please hoping for a kick in the right direction in terms of this primary research article, I honestly have looked and would really appreciate some guidance.

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

    What are low and high level operations?

    Posted: 16 Apr 2020 08:52 AM PDT

    Sort by Episodes playlist.

    Posted: 16 Apr 2020 08:46 AM PDT

    So, I have a big question/petition... no one ever answered before, and it would be kinda like a dream come true if I ever made it possible.

    The thing is that I been always getting series and anime installed in my harddrive, and it's awesome to watch the whole show long until the end, but what I always wanted is to watch many anime or series sorted by episodes, just like they used to do in TV before. I wish it was possible to program PotPlayer or any other player to play episode 1 of each of my folders, then episode 2, etc... Example:

    Death Note - Episode 1
    Slam Dunk - Episode 1
    Sakura Taisen - Episode 1
    Death Note - Episode 2
    Slam Dunk - Episode 2
    Sakura Taisen - Episode 2
    etc...

    I hope I explained my idea well enough, and thank you for reading my post.

    submitted by /u/-Sophika-
    [link] [comments]

    help with git - used to be able to push updates not anymore - permission denied (publickey)

    Posted: 16 Apr 2020 10:35 AM PDT

    Hi,

    Looking to see if anyone can help me out there. I have googled this quite a bit and it is a common question, but unfortunately I can't seem to figure out what I'm doing wrong. If someone can walk me through my mistakes in simple language I would greatly appreciate it. I guess obviously I wouldn't have this problem if I could digest what people are saying online.

    So I have a repository on git (bitbucket if that matters) where I push my code from my Mac. I have an ssh key stored on bitbucket and I use SourceTree to push my code. Its worked in the past...I do commit>>push and my new code shows up on bitbucket. Awesome!

    But then every time I restart my computer or close Sourcetree or its a new day (not sure which). I get the following error message:

    Please make sure you have the correct access rights and the repository exists. Pushing to git@bitbucket.org: ######## git@bitbucket.org: Permission denied (publickey). fatal: Could not read from remote repository. 

    It seems from google something is wrong with my ssh keys. Obviously I seem to be pretty idiotic here and can't figure out something that seems so basic. Can someone let me know what I'm doing wrong? I haven't changed anything and I got my code to the bitbucket account in the past, but EVERYTIME I have to make new ssh keys and get them uploaded and everything which is real annoying.

    TY so much

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

    What does the programmer actually need from designer?

    Posted: 16 Apr 2020 02:19 PM PDT

    I want to hire a developer to create a MVP for a mobile app.

    I am currently designing UI with figma.

    Once I am ready, what do I actually need to give to the developer in order for him to get the idea of what exactly I want to build?

    · Is it just the files and the prototype within the figma.

    · a word document with a list of all the features and explanations of what they do.

    · Power point presentation.

    · video of me explaining everything about the app and how it should be used.

    · a skype interview with the developer and talk about the project.

    If any of you had gone through something like this or you are developer yourself, please share your experiences and the process, it would be very helpful and interesting.

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

    Managing working for office and personal time,self development

    Posted: 16 Apr 2020 10:06 AM PDT

    Hi Guys,

    Soft Dev - Front End

    1. How do you guys manage work if a task is given which does not get completed within the office hours irrespective of deadline ?Do you sit after and work in your personal hours just to get it done or care enough to continue following day (w deadline/wo deadline) ?
    2. This leads to manager misusing you knowing that you are ready to sit late to get the task done, when you sat for few times,it happens and i don't know is it due to my incapability to solve the problem or the problem itself is going to take long time to solve
    3. If you do work for ofc in personal hours how do you manage time to learn & build something for yourself as working or learning related to office takes up time?
    4. I feel anxiety knowing that i could have completed it within ofc hours if i sat a little late but sometimes become long so i don't do it and work for personal stuff?How to manage
    5. Does giving your best means sitting late anyhow and do whatever it takes to complete the task done?Watching others sitting late feels i am not giving my best and not being honest to ofc work
    6. We do say health is important even for me, but somehow mindlessly i end up giving more time to office work in personal hours doing it, i have seen people sitting late and not caring about health for the sake of money,how to manage stress,burnout and imposter feelings?
    7. How to really disconnect your mind from the bubble of office work after office hours?What works?

    P.S:- I have seen posts related to stress,burnout but need some help on my questions :(. Thanks

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

    Building native forEach and map functions in Javascript

    Posted: 16 Apr 2020 01:48 PM PDT

    I am currently trying to build my own native forEach and map functions in JS, and I am getting undefined for my current solution when I use my own forEach in map.

    function forEach(array, callback){ for(let i =0; i< array.length; i++){ callback(array[i], i, array); } } function map(array, callback){ let results = []; results.push(forEach(array, callback)) return results; } console.log(map([3,4,5], n => n - 2)); // should log: [1, 2, 3] but I'm getting [undefined] 

    I found this following solution online, with its forEach identical to mine, and map written as such:

    function map(array, callback) { let newArray = []; forEach(array,(ele) => { newArray.push(callback(ele)) }) return newArray; } 

    Now, I am confused as to how and why forEach can take a new (ele) parameter when it was not defined in the first place, or what it means to have a new parameter inside an existing parameter.

    Any help on my own solution or any explanation on the correct solution would be greatly appreciated! :-)

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

    Does a program’s Ring 0 level access carry out across multiple operating systems on a multi-booted system?

    Posted: 16 Apr 2020 01:44 PM PDT

    Hi guys, so to clear up the question a bit I'll provide an example.

    Let's say I have a dual booted system with Linux and Windows 10 on it and I were to install an application on Windows that has Ring 0 level access and starts up on boot.

    If I were to instead boot into Linux, would said application still be able to start up or would it only start if I boot into Windows?

    Thanks!

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

    I was trying to make a stock market simulation by using the Monte Carlo principle I went somewhere wrong and made an error "IndentationError: expected an indented block". Please help me solve this

    Posted: 16 Apr 2020 01:41 PM PDT

    import numpy as np

    import pandas as pd

    from pandas_datareder import data as wb

    import matplotlib as mpl

    import mathplotlib.pyplot as plt

    from scipy.stats import norm

    def get_simulation(ticker,name):

    data=pd.DataFrame()

    data[ticker]=wb.DataReader(ticker,data_source='yahoo',start='2020-1-1')['Adj Close']

    log_return =np.log(1+data.pct_change())

    u=log_return.mean()

    var=log_return.var()

    drift=u-(0.5*var)

    stdev=log_returns.std()

    t_intervals=365

    iteration =10

    daily_returns =np.exp(drift.value+ stdev.values*norm.ppf(np.random.rand(t_intervals,iterations))

    S0=data.iloc[-1]

    price_list=np.zeros_like(daily_returns)

    price_list[0]=S0

    for t in range(1,t_intervals):

    price_list[t]=price_list[t-1]+daily_returns[t]

    plt.figure(figsize=(10,6))

    plt.title("1 year Monte Carlo Simulation"+name)

    plt.ylabe("Price(P)")

    plt.xlab("Time (Day)")

    plt.plot(price_list)

    plt.show()

    get_simulation("UU.L","United Utility")

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

    Does anyone have experience with Studio Web's Web Developer course? Is it worth it?

    Posted: 16 Apr 2020 08:55 AM PDT

    I'm currently looking into purchasing the Complete Web Developer course on Studio Web's site. It currently costs about the same price as a month of Pluralsight, and it looks like it's pretty cohesive, since it's all one class instead of me trying to piece smaller classes together. I was wondering if anybody here had experience with it, and even if you don't, do you think it's worth it for me to look into? I'm currently learning C++, but I don't think that C++ will allow me to do some of the jobs I want to do.

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

    Hi! How can I use C to do some low level operations in my computer?

    Posted: 16 Apr 2020 08:45 AM PDT

    I'm trying to learn more about OS kernels and low level programming, but I don't know where to start Can you guys recommend me books or sources?

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

    [C++] How to make this code more concise

    Posted: 16 Apr 2020 12:17 PM PDT

    Hello everyone, I am new to oop programming, and today I watched a video about the strategy pattern. Which was perfect for the program I am making, which is a program the switches between filters applied to video feed on user command. This solved the problem of having a big ugly switch case which is nice, but now I have big repetitive ugly classes, is there a way to make this more concise, thanks a lot!

    Header file:

     class OperationTypeStrategy{ public: virtual void applyOperation([[maybe_unused]] Mat &frame, [[maybe_unused]] OpSize opSize=OpSize::invalid)=0; }; class MedianFilter: public OperationTypeStrategy{ public: void applyOperation(Mat &frame, OpSize opSize) override; }; class MeanFilter: public OperationTypeStrategy{ public: void applyOperation(Mat &frame, OpSize opSize) override; }; 

    Cpp file:

     void MedianFilter::applyOperation(Mat &frame, OpSize opSize=OpSize::invalid){ if(opSize==OpSize::invalid) throw std::runtime_error("Invalid size"); // store neighbors in order to sort and find median std::vector<float> pixels; const unsigned short intopSize=static_cast<short>(opSize); // The first half of the neighboring pixels have indices // less than the current pixel. Therefore, we need to // subtract from the current pixel's index in order to // access them. const short hopSize=intopSize/2; // Accessing pixels using pointer notation is faster // than using frame.at according to: // https://docs.opencv.org/master/db/da5/tutorial_how_to_scan_images.html float *pixelPtr=frame.ptr<float>(); const uint64_t frameSize=frame.cols*frame.rows; int64_t index; //used to pick the element in the middle as the median, by //calculating the middle index of opsize const int middle=(intopSize*intopSize)/2; for(auto x{0}; x<frame.rows; x++){ for(auto y{0}; y<frame.cols;y++){ for(auto medx{-hopSize}; medx<hopSize+1; medx++){ for(auto medy{-hopSize}; medy<hopSize+1; medy++){ index=(x+medx)*frame.cols+(y+medy); // safe pixel access ;) pixels.push_back(checkedPixel(pixelPtr, index, frameSize)); } } std::sort(pixels.begin(), pixels.end(), std::greater<float>()); // set the new pixel value pixelPtr[x*frame.cols+y]=pixels[middle]; pixels.clear(); } } } void MeanFilter::applyOperation(Mat &frame, OpSize opSize=OpSize::invalid){ if(opSize==OpSize::invalid) throw std::runtime_error("Invalid size"); const unsigned short intopSize=static_cast<short>(opSize); // The first half of the neighboring pixels have indices // less than the current pixel. Therefore, we need to // subtract from the current pixel's index in order to // access them. const short hopSize=intopSize/2; // Accessing pixels using pointer notation is faster // than using frame.at according to: // https://docs.opencv.org/master/db/da5/tutorial_how_to_scan_images.html float *pixelPtr=frame.ptr<float>(); const uint64_t frameSize=frame.cols*frame.rows; int64_t index; // Total sum of pixels, used to get the mean(divide by // number of pixels). int64_t vals{}; // The total block size whose mean is going to be taken auto blockSize=intopSize*intopSize; for(auto x{0}; x<frame.rows; x++){ for(auto y{0}; y<frame.cols;y++){ for(auto medx{-hopSize}; medx<hopSize+1; medx++){ for(auto medy{-hopSize}; medy<hopSize+1; medy++){ index=(x+medx)*frame.cols+(y+medy); // accumulate neighboring pixel values using // safe pixel access vals+=checkedPixel(pixelPtr, index, frameSize); } } // set the new pixel value to the mean value pixelPtr[x*frame.cols+y]=vals/blockSize; vals=0; } } } 
    submitted by /u/llFLAWLESSll
    [link] [comments]

    No comments:

    Post a Comment