• Breaking News

    Thursday, June 20, 2019

    Can't come up with sample code for interview. Ask Programming

    Can't come up with sample code for interview. Ask Programming


    Can't come up with sample code for interview.

    Posted: 20 Jun 2019 08:49 PM PDT

    Hello Reddit,

    I'm in a bit of a predicament. I'm a CS student, and I just had an interview for an internship today. I was asked an array of questions having to do with OOP, SQL, and algorithmic questions. I did moderately well in answering the questions. The interview ended with the person interviewing me asking for sample code. They told me I could send it later.

    The issue is I have no code to show. My school projects are too low level, and I don't have any object-oriented personal projects. I can't think well under pressure, and I do not think I'll be able to prep anything by tomorrow. Can anyone share any ideas?

    submitted by /u/Second-Shot
    [link] [comments]

    Which language is best to use for encryption?

    Posted: 20 Jun 2019 05:57 PM PDT

    I was wondering what language would be best for handling encryption. I am going to be using this language in the backend for my web app and have narrowed down my options to either Python or Java. Does anyone know the pros/cons when using either language? Any input would be appreciated! Thanks!

    Edit: I don't know if this needs to be mentioned, but I am going to be using the Spring framework with Java, if chosen, and/or the Flask framework with Python, if chosen.

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

    How do I (a single entity without corporate backing) go about getting a virus-like app whitelisted by major security providers?

    Posted: 20 Jun 2019 07:22 AM PDT

    So in the past my strategy for running afoul of AV programs has been "don't code software that looks like a virus". Unfortunately today that strategy failed me -- the passion project I'm working on walks, talks, and quacks like a virus.

    The project catches low level keyboard/mouse hooks and depending on the behavior dispatches event handlers to draw on the screen or do custom window snapping. Think GridMove (excellent software, but starting to get dated) written in C sharp and using an unholy amount of p/invoke.

    I've found that when attempting to debug the program my AV auto deletes it. Disabling the AV while debugging is fine, but I'd like to find a more permanent solution, and don't even know where to start.

    I'm just coding this as an individual, so I don't have a legal department to talk to Mcafee for me, and I somehow doubt they listen to every tom dick and henry about their custom apps. Where does one start as an individual to get AV whitelisting?

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

    Self teaching a language online

    Posted: 20 Jun 2019 06:43 PM PDT

    I'm very new to the world of programming and would like to teach myself some python over the summer before I go back to school in the fall. Problem is I don't really know where to start or what books and resources to buy. I was wondering if anyone here could recommend any resources that would help a beginner like me

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

    Are JS state management systems (such as Redux) good practice/safe to use?

    Posted: 20 Jun 2019 08:39 PM PDT

    Technologies like Redux that hold the entire application's state seem a little code-smelly to me. It seems to violate separation of concerns if every component can theoretically see the state/data of every other component in the application, assuming their states are stored in Redux. I'm coming from an OO background (C# .NET) and just getting my feet wet with front end frameworks, so maybe the paradigm shift is confusing me.

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

    Decision tree, which language should I use

    Posted: 20 Jun 2019 07:42 PM PDT

    Hi guys! I need to implement a decision tree during the weekend for en AI assignment and I am a little hesitant about the language I should use to do this. I have the following three on my list, which one do you think I should pick?

    C - I mostly program in C, I am using it for a year and a half and still struggling with memory but I am okay with it. C++ - I did the last assignment in C++ and had a really hard time, I started using this language in the beginning of the year and never really studied it, but it is the language used in the project where I am doing my internship so I have a support team available in case of trouble. Python - I don't know anything about Python (just that you don't use " ; " ...) but all my classmates did the past assignments with this language. Their code was cleaner and shorter then mine, but their programs were really slower.

    That's it! Thanks for reading!

    Ps: English is not my language, sorry if I write some stuff wrong n.n

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

    How can I make regex for these example strings?

    Posted: 20 Jun 2019 07:24 PM PDT

    I'm brand new to regex and I am having trouble creating something to help bots from joining and spamming my Discord server.

    I'm trying to create regex to detect a string that starts with any capital letter and ends with any 3–4 numbers. Here are some examples:

    • John194
    • Sammy2923
    • Billy293

    Can anyone help me with this? I'd really appreciate it.

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

    What caused so many people to take on such a negative view of Eclipse?

    Posted: 20 Jun 2019 01:10 PM PDT

    I've been using Eclipse for everything Java related for years, but maybe 5(?) years ago every Java dev I talked to was starting to pick up IntelliJ instead if they were using Eclipse at that point, and now it seems like no one likes Eclipse. I used IntelliJ for a month around that time and ended up just sticking with Eclipse because I like how it works. I've truly never had a problem with anything Eclipse related. I recall IntelliJ might have had somewhat better autocomplete features, but at the same time Eclipse's seems to work fine, it doesn't give me problems.

    Maybe there's something inherently wrong with Eclipse that I'm just missing because I've used it for so long, but to me, it really seems like an excellent IDE.

    submitted by /u/I-Downloaded-a-Car
    [link] [comments]

    What is a faster way to traverse a 3d array?

    Posted: 20 Jun 2019 03:45 PM PDT

    I have a 3d array that i realized i cant efficiently and cleanly turn into 3 or even 2 parrallel arrays.

    There arent too many items in this 3d array. Is it good practice in this case to just use a tripple nested loop? I never used one before so it seems freaky but im not sure what else to do.

    I never used a binary tree to iterate through a multidimensional array either. Im not sure if thats what it is used for.

    So what would ve the best approach given the fact that there are probably a max of 200 items in each array?

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

    Can someone explain why I would use absolute value in programming?

    Posted: 20 Jun 2019 03:05 PM PDT

    and not just a value? If it's possible an example in pseudo code would be nice. Since I'm just beginning and don't know any actual programming languages yet. Thanks in advance.

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

    How easy is programming once you graduate and have a job? And how much will you make starting? (Prefer answers from actual career programers)

    Posted: 19 Jun 2019 10:22 PM PDT

    I currently am 21, I work at a call center and hate my job a lil more every day I come in. I started to learn how to code via SoloLearn about a year ago(on and off, haven't put 100% effort more like 15-20%) I'm planning on taking out a student loan to go to college to major in computer science (that's what you have to have in order to code right ?). I just don't want to go through all the trouble of getting a degree in it to end up having a job where I'm not happy , or is not what I expected. I'm very anti social have anxiety issues and honestly would love to just work with a computer all day and not have to deal with customers. I'm not expecting it to be easy getting to the point of being a professional but once your there is it easy? And just some additional info , I live in Phoenix and have always been interested and enjoy working with computers and technology.

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

    Where to begin with some "basic" computer automation

    Posted: 20 Jun 2019 02:31 PM PDT

    Hello,

    I am generally tech savvy laymen with some minimal scripting / coding / programming experience and feeling kind of frustrated with figuring out the necessary tools to get some windows 10 automation going.

    I'm kind of struggling to ask this question in a way that feels correct so please bear with me and sorry for the long post.

    I want my computer to "listen" for devices or programs to connect (chrome remote desktop, steam link, moonlight) basically when streaming the desktop from a variety of sources.

    Once a source connects I would like my computer to automatically start other programs depending on the device, minimize those programs (bonus for minimizing to tray), and maybe do other various things.

    I am basically trying to get a somewhat uniform streaming experience across multiple devices and their varying compatibility programs, device settings, etc. without having to manually set things up every time, and hiding all the relevant windows to the system tray.

    My computer even struggles with resetting default devices (speakers, microphone) when I disconnect from some devices in certain ways and as much as I love and use streaming both at home and at work, it feels way more cumbersome than it needs to be.

    I'm hoping this will be a fun project for me so if anyone can point me in the right direction of what I should start educating myself on to make something like this possible. I am familiar with startup / batch files / windows shell for basic windows tasks but I keep hitting roadblocks and I feel like it might not be possible with those tools alone.

    Also want to add that I have some experience in various scripting languages but this my first delve into windows 10 automation and I'm not sure where to begin.

    Thanks for reading!

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

    Designing small Uber-like architecture

    Posted: 20 Jun 2019 01:50 PM PDT

    I have to create micro service architecture of Uber-like system. The requirements are : We have customers and drivers who can chat and they must match each other. The Customer can create a route. The application must use different kind of maps.From monday - friday the app must be 99.99% available

    So my idea is to create four services - Account Service, Route Service, Chat Service and Map Service.

    1. The Account service will be used for creating accounts.
    2. The Route service will be used by the Account service to create, find, notify for near routes, and to match customer with driver
    3. The Chat service will be used for communication
    4. The Map service will be used by the Route service to help finding routes and optimizing.

    Is there a better approach, because it seems to me the services are tightly coupled ?

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

    Is it possible to create a program that sends me an email of exactly whats printed?

    Posted: 20 Jun 2019 12:58 PM PDT

    Hello, so lets say I am most of the day not at home and I want to know immediately of whats printed at my house (because reasons). Is it possible?

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

    How do we label a huge number of images for binary classification?

    Posted: 20 Jun 2019 09:07 AM PDT

    Do we do it manually or is there some software which can easily classify if the classes are distinct? Images are in the range of 100k.

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

    Syslog limit

    Posted: 20 Jun 2019 06:13 AM PDT

    Hey,

    I'm having a little trouble with getting rsyslog to ingest what I believe is being sent. I'm writing to syslog with another application and I keep seeing a limit, I've been trying all the configs I can think of, can't seem to increase it.

    Running rsyslogd -dn | grep card I see this conf setup:

    5364.476227301:main thread : action-0-builtin:omfile queue: queue.c: params: type 3, enq-only 0, disk assisted 0, spoolDir '/var/lib/rsyslog', maxFileSz 1048576, maxQSize 1000, lqsize 0, pqsize 0, child 0, full delay 970, light delay 700, deq batch size 16, min deq batch size 0, high wtrmrk 900, low wtrmrk 700, discardmrk 980, max wrkr 1, min msgs f. wrkr 1000 

    However when I run syslog manually, then have my application send data, I see this in the output

    #rsyslogd -dn

    5674.587143988:main Q:Reg/w0 : ../action.c: action[action-9-builtin:omfwd] transitioned to state: rdy 5674.587146756:main Q:Reg/w0 : ../action.c: actionCommit[action-9-builtin:omfwd]: return actionTryCommit 0 5674.587149425:main Q:Reg/w0 : ../action.c: actionCommit[action-9-builtin:omfwd]: done, iRet 0 5674.587152136:main Q:Reg/w0 : ruleset.c: processBATCH: batch of 31 elements has been processed 5674.587155496:main Q:Reg/w0 : queue.c: regular consumer finished, iret=0, szlog 0 sz phys 31 5674.587158962:main Q:Reg/w0 : queue.c: DeleteProcessedBatch: etry 0 state 3 5674.587166378:main Q:Reg/w0 : queue.c: DeleteProcessedBatch: etry 1 state 3 5674.587171635:main Q:Reg/w0 : queue.c: DeleteProcessedBatch: etry 2 state 3 5674.587177149:main Q:Reg/w0 : queue.c: DeleteProcessedBatch: etry 3 state 3 5674.587182414:main Q:Reg/w0 : queue.c: DeleteProcessedBatch: etry 4 state 3 5674.587188177:main Q:Reg/w0 : queue.c: DeleteProcessedBatch: etry 5 state 3 

    This looks like when its starting to drop messages.

    Conf file is:

    # rsyslog configuration file # For more information see /usr/share/doc/rsyslog-*/rsyslog_conf.html # If you experience problems, see http://www.rsyslog.com/doc/troubleshoot.html #### MODULES #### # The imjournal module bellow is now used as a message source instead of imuxsock. #$ModLoad imuxsock # provides support for local system logging (e.g. via logger command) $ModLoad imuxsock.so #added by david $SystemLogRateLimitInterval 1 $SystemLogRateLimitBurst 50000 $ModLoad imjournal # provides access to the systemd journal #$ModLoad imklog # reads kernel messages (the same are read from journald) #$ModLoad immark # provides --MARK-- message capability # Provides UDP syslog reception $ModLoad imudp $UDPServerRun 514 # Provides TCP syslog reception #$ModLoad imtcp #$InputTCPServerRun 514 #### GLOBAL DIRECTIVES #### # Where to place auxiliary files $WorkDirectory /var/lib/rsyslog # Use default timestamp format $ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat # File syncing capability is disabled by default. This feature is usually not required, # not useful and an extreme performance hit #$ActionFileEnableSync on # Include all config files in /etc/rsyslog.d/ $IncludeConfig /etc/rsyslog.d/*.conf # Turn off message reception via local log socket; # local messages are retrieved through imjournal now. $OmitLocalLogging on # File to store the position in the journal $IMJournalStateFile imjournal.state 

    I've tried adding various config parameters to try and get higher limits, but I'm not sure what part of the que / batching is the limiting factor.

    Any help would be great. Soo many syslog tutorials and read me-s but I'm lost

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

    What language would be the most beneficial to learn to develop an app?

    Posted: 20 Jun 2019 09:40 AM PDT

    I have an idea for an image sharing app that is somewhat similar to Instagram (for reference). I want to spend this summer learning a new language to eventually develop a MVP. I currently only know some java.

    All suggestions and justifications are appreciated. Thank you!

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

    Smallest size for a database

    Posted: 20 Jun 2019 03:40 AM PDT

    I'm working towards completing a search algorithm of a database, and need to test while working on it. However, the database needs to actually have something to search for.

    What is the smallest number of elements that you would use/suggest for a search? If this is beyond 50, just tell me that.

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

    5000 data samples, 90% simulated accuracy, AND A BIG FAT L. How do you do machine learning?

    Posted: 20 Jun 2019 07:53 AM PDT

    Hullo!

    I'm new to machine learning, and I thought a great learning tool would be to do a personal project. After reading some from a ML book I bought, I selected KNN for ML algorithm and started doing my thing. Instead of learning what affect stock prices, I just figured I would throw 30 or so data features in the program and have the algorithm recursively find one with the best accuracy. So thats what I did! I trained the algorithm from stock data ranging from 2000-yesterday and set the objective prediction to predict whether the next day's stock value peak would be higher than today's.

    Some 5000 data points per feature I got a 90% simulation accuracy. I figured I might as well try it, and invested 50$ in the stock "fcel" this morning. To my horror, as I waited, it plummeted. AND BOY DID IT PLUMMET. 10%. Theres no way it comes back from this.

    So did I just totally butcher the ML process or what?

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

    Get access to ActorService to get a list of all actors

    Posted: 20 Jun 2019 06:44 AM PDT

    Trying to learn the basics of Azure Service Fabric. I have an app working where ive made a UserActorService and i can create and retrieve actors as well as saving state in them. But i cant figure out how i could get a list of all actors.

    I have some understanding with this code:

    public async Task<List<string>> GetAllUserActors()

    {

    var fabricClient = new FabricClient();

    var cancellationTokenSource = new CancellationTokenSource();

    ContinuationToken continuationToken = null;

    var result = new List<string>();

    do

    {

    var page = await actorService.GetActorsAsync(continuationToken, cancellationTokenSource.Token);

    result.AddRange(page.Items.Select(i => i.ActorId.ToString()).ToList());

    continuationToken = page.ContinuationToken;

    } while (continuationToken != null);

    return result;

    }

    The problem is i cant figure out where i should put this. The code needs access to the actual userActor services ActorService. And in the UserActorService i can only get a hold of it inside the UserActor. I guess i could put inside UserActor and then call an individual UserActor to get this method return me a list.

    But that shouldnt have to be the case as i think i shouldnt need to know the id of one UserActor to be able to see what actors there are.

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

    Algorithm for fixing lines

    Posted: 20 Jun 2019 05:58 AM PDT

    I am creating a program that looks for vertical and horizontal lines from binary image using sobels approach. The result image is then put trough 1*10 horizontal and vertical MSE:s in order to get rid of anything that isn't part of the lines. The lines are then partially fixed by smaller MSE:s but it seems like I can't get the job fully done with elements.

    There are still a lot of imperfections in the lines and few random lines left from earlier stages. Example:

    https://imgur.com/mSgCz9A

    The screenshot is part of bigger grid structure. As you can see the gaps are fairly large at times. I could create larger MSE:s but I fear I wont end up with something that would apply to every scenario.

    What methods could I use to a. remove the last few bits of debris and b. what coudl I use to fix the imperfect lines?

    Thanks!

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

    Question regarding automating a Task.

    Posted: 20 Jun 2019 03:08 AM PDT

    So I want to Automate a Task, which I do repetitively on Daily Basis. I daily download documents which are uploaded on a daily basis on a particular Website. I just want to automate this task.

    like automatically opening Chrome at a particular time---> Automatically visiting the website----> and downloading the first 50 documents........Is this possible...

    Thanks in advance..

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

    Bad Request (Status 400) When to send it?

    Posted: 20 Jun 2019 12:21 AM PDT

    The definition of status code 400 says "The server will not process the request because the there is a problem client-side", or simply the request is "bad".

    Now imagine I have a webapp; a list of persons with details such as names, numbers, etc. If the server receives a request to update one of these persons: "Update Joe Soap's phone number to xxx" but "Joe Soap" does not exist, should I send a status code 400?

    The reason I am wondering is because the request is valid (in a technical sense), but the server could not process the request because of some other reason and it doesn't feel right to send back an OK status but with some message explaining that it was actually not OK.

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

    No comments:

    Post a Comment