• Breaking News

    Tuesday, October 9, 2018

    What RESTful calls do you use for different needs? Ask Programming

    What RESTful calls do you use for different needs? Ask Programming


    What RESTful calls do you use for different needs?

    Posted: 09 Oct 2018 06:24 PM PDT

    Obviously get and delete and self explanatory, but how do you decide between post, patch and fetch?

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

    Which functional features of Scala does Kotlin lack?

    Posted: 09 Oct 2018 03:02 PM PDT

    Kotlin is quite a new functional language which is somewhat simplified comparing to Scala. Is that so? If I have a Scala textbook, will I be able to do all exercises from it in Kotlin? If not, what's missing in Kotlin?

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

    What makes programming hard and/or what makes programmers bad?

    Posted: 09 Oct 2018 02:36 PM PDT

    Does anyone else commit commented debug code on purpose, just in case you might need it again, even though you are 99% sure you won't - Followed by a "Remove debug comments" commit? Any other techniques?

    Posted: 09 Oct 2018 06:28 AM PDT

    I am aware of stashing, but I like a clean stash (only temporary stuff in there) and snippets.txt does not make much sense for very specific program-related code, especially when it is not really interesting code but just logging.

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

    I'm having trouble with Impostor Syndrome and learning

    Posted: 09 Oct 2018 09:19 PM PDT

    First of all, if this is the wrong sub, I apologize and would appreciate it if you let me know the correct one in the comments. Also, I posted this in r/learnprogramming as well for more visibility.

    So a little background, I originally wanted to learn Java, but I decided I would try to learn some easier languages first, like HTML, CSS and Python, and then work my way up to Java.

    The problem is, I'm just having trouble learning. Like with Web Development, it's not as bad, but I find myself not knowing how to go about achieving something without watching some video. So if I wanted to create something unique, I'd be stuck. It's like Impostor Syndrome but I actually am an impostor.

    So my question is, are there any courses for Java. or really any language, that teach the language really well? Like, they tell you how to do certain things, and why certain lines of code work the way that they do, and how to know when to use one method over the other etc.

    Or am I going about this wrong? Am I asking the wrong questions? Is this normal for beginners? And how do I overcome this?

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

    is there a way i can ensure a game won't pause when i alt tab?

    Posted: 09 Oct 2018 08:01 PM PDT

    i like to do afk stuff on runescape on my second monitor while i play other games. some games will have a setting not to pause when focus is off, for some you can make changes to the config files, but for others (in my case, i'm replaying the witcher 3) they don't have the option. in most cases you can set the game to windowed borderless and it wont pause, but i've found quite a few that still do pause

    is there any universal way to fix this? i have very basic programming knowledge (command line, a little python) but i'm willing to learn

    submitted by /u/anal-dick
    [link] [comments]

    [C#] Am I executing these asynch tasks in a foreach loop in parallel?

    Posted: 09 Oct 2018 07:27 PM PDT

    I have a string array. Foreach string, I want to call a method it and add it to a list. This works but I am not sure if it does this: call a method, move on, call a method, move on, and etc. I don't think it does. Any ideas?

     foreach (var s in string) { Task<string> t= method(s); string[] results = await Task.WhenAll(t); finalResult.Add(results[0]);// this is a list } 

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

    How to make all pairwise comparisons of values in a tab-delim column (python3)

    Posted: 09 Oct 2018 07:04 PM PDT

    I have a .txt file that contains 1000 rows and 500 columns of integers ranging from 0-2. For example the first three row might look like:

    0 0 0 0 2 2 2 2 2 1 1 1 0 2 1 2 ... 0 2 2 2 0 0 0 0 1 0 0 0 1 0 2 0 ... 0 2 2 2 2 2 2 2 0 1 1 1 1 1 1 1 ... 

    I want to compare each column value to the other in each row If there is a combination of interest (say, col1==0 and col2==2), I want to make a count and make a count for all cases where this isn't true. So far I have:

    for row in file: for col1 in row: a = [] b = [] for col2 in row: if col2==0 and col1==2: a.append(1) elif col2==0 and 0 <= col1 <= 1: b.append(1) elif col2==1 and 0 <= col1 <= 2: b.append(1) else col2==2 and 0 <= col1 <= 1: suma = sum(a) sumb = sum(b) 

    However, I don't believe the nested loops I set up will iterate through each pairwise column comparison. Anyone have tips on how to set up this loop so that each comparison is made?

    Thanks

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

    Sandboxie + teamviewer?

    Posted: 09 Oct 2018 06:29 PM PDT

    Alright so, let's say I have some software that I want to sell to someone. Say this person wants to test it before buying. Now I'm no programmer and I definitely can't spend money on SAAS hosting etc.

    It's been brought to my attention that sandboxie + teamviewer can work well for this.

    I've never used sandboxie but as I understand it's like a hosted VM. So basically, I would install TV, a browser (it's internet based software) and the software on it and the person would be able to test it out that way. Is this about right? Have it got it right?

    I would appreciate your help. Thanks.

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

    Running .exe and .java Simultaneously with a .bat file

    Posted: 09 Oct 2018 02:25 PM PDT

    I'm looking to run a .exe and .java file simultaneously but I can't get them to do so. It opens the .java then waits until it closes to run the .exe. Right now I have the code as

    java -Xmx4096M -Xms4096M -jar server.jar nogul

    start G:\Games\Minecraft\MinecraftLauncher.exe

    If someone could help me out with this that'd be great, thanks.

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

    What would be the benefit (or downside) of making values within a class pointers if I am already using pointers to that class?

    Posted: 09 Oct 2018 05:39 PM PDT

    Not sure if this title makes sense so I will make a quick example, so what if I had this

    class point { int x; int y; } 

    and then I make a pointer to this class

    point *myPoint = new point; myPoint->setX(1); myPoint->setY(2); 

    is that any different than if I had made X and Y within the class pointers? either way I can just delete myPointer and all the memory is freed anyhow right? Or am I missing a bit point (no pun intended) of pointers here?

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

    CSS Positioning/ Z-Index Help

    Posted: 09 Oct 2018 04:59 PM PDT

    I am having some issues with the layering/positioning/z-index of the notification ".dropdown-menu" pop up on the top right of the dashboard. The dropdown is layered behind ".an-content-body" and is falling behind some of the body text. Can any CSS ninjas be of assistance. The issues exists in all browsers except for Chrome and on all mobile devices. Willing to pay for the assistance. PM me. Thanks.

    https://dev.benefitsquest.com/dashboard/

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

    [C#] Trying for ternary operator, can't figure out what's wrong.

    Posted: 09 Oct 2018 12:53 PM PDT

    I have a simple block of code that I'm trying to simplify even further. I'd like your thoughts. I want to turn this:

     var query1 = "MYSELECTSTATEMENT"; DataTable requests = Data.DB.QueryDB(query1); Dictionary<string, int> requestMap = new Dictionary<string, int>(); for (var i = 0; i < requests.Rows.Count; i++) { var key = requests.Rows[i][0].ToString(); // Problem starts here. if (requestMap.ContainsKey(key)) { requestMap[key] += 1; } else { requestMap.Add(key, 1); } } 

    Into this:

    requestMap.ContainsKey(key) ? requestMap[key]++ : requestMap.Add(key, 1); 

    I know there may be other formatting or syntactical nono's in this, but it's functional code. I just want to slim it down a little bit. For whatever reason my ternary operator isn't acceptable because my IDE tells me "only assignment call increment decrement and new object expressions can be used as a statement."

    Can you help me catch what I'm missing? Do I have to just settle for my ugly if (or some variation)? Note: "requestMap[key]++" also doesn't work if I keep it as "+= 1" I just thought that change would help.

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

    How to prepare for internships/jobs while taking college courses

    Posted: 09 Oct 2018 04:38 PM PDT

    I'm a sophomore at college right know working at a computer science major. I want to program after college but I'm not sure specifically what I want to program.

    I've taken into java classes multiple times and I have the basics down pretty solid. Next summer it is suggested that I get an internship but I don't feel ready for real life programming. My programming knowledge doesn't feel very practical. I only know how to solve problems on a test on paper or in eclipse. I don't even think I could put myself out there on GitHub and expect to be able to solve problems from scratch myself (which is another great form of experience I hear).

    How can I become a more experienced and prepared programmer outside of class? What should I learn specifically? Should I try learning new languages outside of java and C++?

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

    3-way Quicksort Linked List

    Posted: 09 Oct 2018 04:14 PM PDT

    I need to create a 3-way quicksort with a custom built LinkedLists class in JAVA. I already have the class and the Node subclass. How would I proceed to transverse through this problem because honestly I am not a fan of working with nodes vs actual arrays. (Already have a Knuth shuffle)

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

    Building a "decision tree" like app

    Posted: 09 Oct 2018 03:40 PM PDT

    Hi folks, I'm wondering if anyone here has ever built an app that would help you pick an item (out of multiple options) based on the criteria you input. Either by decision tree function or based on the weighting of criteria selected. If so, is there a template I can buy? For example, I answer 10 questions and based on the inputs i get suggested option A or option B.

    Thanks

    JM

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

    How to use itertools.isslice() in a tab delim file that does not contain column/row headers (Python3)

    Posted: 09 Oct 2018 09:24 AM PDT

    I have a .txt file that contains 1000 rows and 500 columns of integers ranging from 0-2. For example the first three row might look like:

    0 0 0 0 2 2 2 2 2 1 1 1 0 2 1 2 ... 0 2 2 2 0 0 0 0 1 0 0 0 1 0 2 0 ... 0 2 2 2 2 2 2 2 0 1 1 1 1 1 1 1 ... 

    I'm going to compare each column value to the other in a given row and do something with them.

    However, I need to distinguish the first 500 rows from the last 500 during my iteration.

    if I code in something like:

    for row in file: for col1 in row: for col2 in row: 

    The for loop will include all rows. My aim is to have two for loops like this, one for the first 500 rows and another for the last 500 rows. The rows are separated by new lines and it is a .txt file I am reading in using csv.reader.

    Searching around some I see that itertools.isslice() may work for this problem, but in all the examples I've seen in documentation there is either a single row or there are qualities of the first column in each row that can be used to distinguish the rows themselves.

    Am I on the correct track thinking I can use itertools.isslice() to parse rows or will that not work here?

    Thanks in advance for the help.

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

    good platform to ask for programming question ?

    Posted: 09 Oct 2018 03:07 PM PDT

    What good platforum to ask programming question with fast response time, if possible without registering an account and good privacy ?

    for php/python and c ?

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

    The n decimal of pi.

    Posted: 09 Oct 2018 11:15 AM PDT

    I got a homework thats asking me to get a number, n, and show the nth decimal of pi, in C++. How?

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

    What is the best way to improve myself as a C++ programmer?

    Posted: 09 Oct 2018 08:41 AM PDT

    I currently have 4 years of experience as a programmer, with only two of them being a simple C++ job. I think I am lacking in depth knowledge of C++. I dont know about copy constructors, references vs pointers, new C++11, 14 features etc.

    For me improving means two things(in priority).

    1. I become so good that it is very easy for me to find a new job when I want to switch from my current position. (I have struggled with job interviews in the past). Most people recommend the programming interviews book but that does not work so well. My number one fear is ending up without a job. Money is not a problem but ending up without a visa of that country is my fear.

    2. I get a very good understanding of C++ so that I become very fast and efficient in doing my daily tasks.

    You can suggest books, websites, articles or anything to improve myself.

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

    Is it possible to replicate a cable television "like" experience with multiple running channels of digital video?

    Posted: 09 Oct 2018 08:34 AM PDT

    I've had this idea for a while and was wondering if it was possible for a while but just couldn't figure out a way to programmatically formulate it from a high level perspective. The best way I could explain or compare this concept would be as so:

    Having a collection of video files saved to a drive Having a large number of "channels" that are dedicated to playing said videos (like playlists) Having the videos play asynchronously and continually. So if I switch from one channel to the next they should still be playing with no pause.

    The biggest obstacle I could think of for this would be RAM but maybe not. What am I overlooking and overall, what would it take to do this?

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

    Can someone please remind me how to loop while and if functions? (python)

    Posted: 09 Oct 2018 01:17 PM PDT

    specifically, how to loop in a "while True" or "if True" statement while not replacing the "True" for something based on the variable itself? thanks guys

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

    List of technology certifications? CSV, SQL, JSON, etc.

    Posted: 09 Oct 2018 12:17 PM PDT

    Hi all --

    Does anyone know where I could download a list of technology certifications? I know there are TONS of them these days (MCSE, CISSP, AWS, CompTIA+, etc.) and I'm working on a project where we'd like to allow our employees to indicate which certifications they've obtained. While we could just put a text field out there and let them enter the name themselves, I'd prefer to have it auto-complete or have them select from a list of available certifications in a database. Can anyone point me to something like this? Thanks!!

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

    When writting/designed a program, how do you find the libraries that can perform the function you would like?

    Posted: 09 Oct 2018 05:07 AM PDT

    EDIT: Did not spellcheck my title, instant regret lol.

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

    How to minimize workload when calculating the Manhattan Distance in an MxN Space?

    Posted: 09 Oct 2018 06:42 AM PDT

    Hello,

    Before all, I do not aim to have this solved by you guys, but I'm rather new and I know that iterations should be (in general) avoided as much as possible. So when I was tasked to do this, I spent some time thinking about it, and wondering what the best approach is to reduce the iterations it takes to solve, I have however not found something that makes me happy, and I feel there are probably a lot better solutions.

    So, I been asked as part of an exercise to do the following:

    There is a grid of squares of size M x N (M and N can be over a thousand). In this grid there are Key Squares.

    Those Key squares get a Value of 0. Then each square in the grid gets a value equal to the Manhattan distance to the closest Key Square.

    Example

    So what I have to do is a code that given a list of locations for the key squares, and an MxN size, return the value of each square.

    In the previous example would be something like:

    (Row, Column, Value):(1,1,0);(1,2,1);(1,3,1);(2,1,1)... and so on.

    What I want to find is the proper approach/logic to tackle this while not making the workload impossible to handle.

    I have thought of doing it in the following way, but I do think it's probably wrong:

    1) Get the vector of the positions of each key square and assign it Value 0 in each of those. Store these positions in a "Location Vector".

    2) For each position in "Location Vector". go +1 and -1 in both row and column directions (unless they are 1 or M/N) and Give it Value V (it starts at 1) unless they have a Value already. Store the location of each modified square in a new Location Vector.

    3) Increase V by 1 and repeat Step 2, until the location vector is empty (which means that for each single one all the surrounding squares are filled, and that can only happen if all are filled).

    Btw, I'm a newbie to coding, so patience and understanding is appreciated.

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

    No comments:

    Post a Comment