• Breaking News

    Thursday, February 28, 2019

    Practice python coding learn programming

    Practice python coding learn programming


    Practice python coding

    Posted: 27 Feb 2019 05:47 AM PST

    I am pretty new to programming (python) and want to know some sites where I can practice coding, solve given problems and stuff? it would be a good way to learn some new stuff as well.

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

    Learn programming offer !

    Posted: 27 Feb 2019 11:57 AM PST

    Hi everyone ! I work as a .net dev and have a little experience. If there is some beginner who want to learn coding C# .net and javascript - just ask me. I enjoy web development. I want to improve my english skills and just need to talk with somebody in english as much as possible.

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

    Question about building a simple scheduling website for my restaurant

    Posted: 27 Feb 2019 10:51 AM PST

    I'm a computer science student and am interested in side projects with meaning. The restaurant I work for is a "mom and pop" shop that does its scheduling handwritten on paper. I'd like to build a simple website to allow for more streamlined scheduling.

    How large of a project would this be and could it feasibly be done by one student?

    Thanks in advance for any input!

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

    Can you learn how methods in programming libraries work?

    Posted: 27 Feb 2019 07:17 PM PST

    I notice a lot of programming tutorials ask you to download a specific library and use the include methods to make programming easier and quicker. That is totally fine. But what if I want to know how the library methods I'm using work?

    Take openCV for example. One of the first things the tutorial shows is the following

    Import cv2

    vidCapture = cv2.VideoCapture(0)

    Now I understand that these two lines 1) import the cv2 library 2) take your default camera and assign it to vidCapture.

    But how is it doing this? Is source code available for each and every method? I

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

    What does reentrancy really mean?

    Posted: 27 Feb 2019 10:44 PM PST

    It seems like the definition of reentrance is inconcistent among many people:

    https://imgur.com/a/F2HTvi0

    from the last paragraph first sentence, "must be reentrant - it must be capable of running in more than one context at the same time" source: Linux device drivers O'reilly which, to me, means that the kernel code you write must be able to be run by eg multiple threads at the same time. While when looking at this answer on SO and explanation on Wikipedia:

    https://stackoverflow.com/questions/34758863/what-is-reentrant-function-in-c/34759003#34759003

    "Function is called reentrant if it can be interrupted in the middle of its execution and then safely called again ("re-entered") before its previous invocations complete execution" those are 2 totally different things! In the former you should only make sure that you have a locking mechanism on eg the driver's fd, while in the latter you only have to disable interrupts and task preemption. And the C99 standard obviously doesn't define "reentrancy"

    What does reentrancy really mean? Where can I find a proper reliable definition?

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

    How pictures and videos are being captured on the screen?

    Posted: 27 Feb 2019 10:44 PM PST

    How pictures and videos are being captured by the computer in programming terms..

    I mean what's the process in pseudo-code of program's source code to order capturing a picture/video of the screen? Thanks!

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

    Trying to learn C++ as my first language

    Posted: 27 Feb 2019 11:29 AM PST

    So i am trying to learn c++ through Programming Principles and practice using C++, but its kinda to complicated since english isnt my mother language, is there any better start to learn coding ?

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

    Request Help Converting C/ASM

    Posted: 27 Feb 2019 07:14 PM PST

    I am porting a library from Arduino to Raspbian. There is a section of embedded assembly that I cannot quite figure out and I am hoping someone can help or point me to a different subreddit. Helpfully, the code is well commented, so fingers crossed. Many thanks in advance.

    The Arduino code is:

    // The macro below uses 3 instructions per pin to generate the byte to transfer with SPI // Retreive duty cycle setting from memory (ldd, 2 clockcycles) // Compare with the counter (cp, 1 clockcycle) --> result is stored in carry // Use the rotate over carry right to shift the compare result into the byte. (1 clockcycle). #define add_one_pin_to_byte(sendbyte, counter, ledPtr) \ { \ unsigned char pwmval=*ledPtr; \ asm volatile ("cp %0, %1" : /* No outputs */ : "r" (counter), "r" (pwmval): ); \ asm volatile ("ror %0" : "+r" (sendbyte) : "r" (sendbyte) : ); \ } 

    I believe that on ARM/Raspberry Pi "compare" is "CMP" rather than "CP", but the problem is with the "ROR" statement. I get an error message at build that says:

    /tmp/ccZN1jmK.s: Assembler messages: /tmp/ccZN1jmK.s:138: Error: bad arguments to instruction -- `ror r3' 

    I understand that "ROR" is Rotate Over Right, and I expect the compiler put the "r3" in, and that "r3" is probably the third register. But I'm guessing and I do not understand "+r" vs "r" and what "(sendbyte)" means in this context.

    While this code is designed to be very tight, allowing a low power processor to do a lot of work, I would be OK converting it to C and eliminating the assembly if necessary.

    Again, thanks very much for any help at all.

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

    How can I learn to code offline on my laptop or smartphone?

    Posted: 27 Feb 2019 04:16 PM PST

    I don't have internet at my house but I want to learn to code from scratch as I want to delve into the industry in a couple years of hardcore study/practice but I don't have internet. I'd appreciate some directions towards the right place to master coding or at least the basics for now

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

    Can't figure out parts of while loop in my Dice game

    Posted: 27 Feb 2019 06:39 PM PST

    So I made a class called Die that represents a die as an object where you can set and get the facevalue of the dice, and a method that randomly rolls the dice. In the main method program I have to create a game where you have to score 100 points after repeatedly rolling 2 dice. The program asks for a number between 2 and 12, the user then rolls 2 dice 3 times. If the number chosen by the user comes up, the user wins 5 points, but If the number does not come up within 3 rolls, the computer wins 3 points. This is what I have so far.....

    public class Derro_Die { private int faceValue; private String color; public Derro_Die() { faceValue=(int)(Math.random()*6)+1; } public void roll() { faceValue=(int)(Math.random()*6)+1; } public int getFaceValue() { return faceValue; } public void setFaceValue(int value) { faceValue=value; } public String toString() { String result = Integer.toString(faceValue); return result; } public String getColor() { return color; } public void setColor(String color1) { color = color1; } } import java.util.Scanner; public class Derro_DiceGame { public static void main(String[] args) { int playerscore = 0, computerscore = 0; Scanner scan = new Scanner(System.in); Derro_Die die1 = new Derro_Die(); Derro_Die die2 = new Derro_Die(); int i = 0; while (playerscore < 100 && computerscore < 100) { System.out.println("Give a number between 2 and 12"); int die_total = scan.nextInt(); while (i < 3) { die1.roll(); die2.roll(); int roll1 = die1.getFaceValue(); int roll2 = die2.getFaceValue(); i= i+1; if (roll1 + roll2 == die_total) { playerscore = playerscore + 5;} } if (playerscore >= 100) System.out.println("User won game"); if (computerscore >= 100) System.out.println("Computer has won game"); } } } 

    I'm not sure how you can make the computer score 3 points after 3 tries of rolling 2 dice

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

    Are there any ways to make calculations less mathematically precise, instead of more?

    Posted: 27 Feb 2019 06:32 PM PST

    Just out of curiosity. Would it make the program run faster?

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

    (PYTHON) Trying to do modular exponentiation for RSA cypher but the number after pow(x, e, n), does not return the same number as wht I began with after pow(x, d, n)

    Posted: 28 Feb 2019 12:21 AM PST

    For example:

    x = 123456789109876543211234567891098765432112345678910987654321123456789109876543211234567891098765432112345678910987654321123456789109876543211234567891098765432112345678910987654321 e = 223 d = 103 n = 2183 num = pow(x, e, n) print(num) print(pow(one, d, n))

    Output: 1406 1110

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

    Automated shift scheduling

    Posted: 28 Feb 2019 12:12 AM PST

    I want to build a web app that given shift requests from employees generates a weekly shift schedule. Where do i start?

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

    New to scripting, looking for assistance on writing a specific script.

    Posted: 27 Feb 2019 04:23 PM PST

    I've been looking at how to create a script to perform a specific task: When Scroll Wheel Up is "scrolled", I would like the C key to be held while the Spacebar key is pressed.

    I am having trouble understanding the right commands to have my Logitech mouse run.

    Any help would be appreciated; thank you!

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

    Help with a proxy redirect involving subdomains.

    Posted: 27 Feb 2019 07:47 PM PST

    Say I have http://s.example.com. I want http://s.ioixd.example.com to redirect to the folder "/sites/ioixd/index.html" silently, via proxy. So I have this rule in /sites/ in .htaccess (since s.*.example.com redirects to that folder)

    RewriteEngine on RewriteCond %{HTTP_HOST} s\.(.*)\.example\.com$ [NC] RewriteRule ^(.*)$ http://s.example.com/sites/%1/$1 [L,P] 

    It works normally, with just [L]. The problem comes when I change that to [L,P], because I want it to be a silent /proxy redirect, and I get this semi-familiar error:

    Not Found

    The requested URL /index.html was not found on this server.


    Apache/2.4.25 (Debian) Server at s.ioixd.ioi-xd.net Port 80

    But index.html DOES exist, and when I go to http://s.example.com/sites/ioixd manually, it shows the contents of the index.html file, which is just the word "hey" (for testing). Is this not possible? What am I doing wrong?

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

    I need help

    Posted: 27 Feb 2019 11:31 PM PST

    Hello guys I need help with my school project. I need someone to not only help fixing the code, but to also explain what I did wrong. It

    Sorry iam new to programing and my English is not the best. It's called the back pack. The program needs to

    When you press 1. Save what ever you write when you press 2. Print out what you wrote when you press 3 empty the content when you press 4 quit the program

    This I as far as I have gotten. I think I need to declare a string outside the loop, but i can't get it to work.

    Here it the code Patebin

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

    NoSql vs Sql: How To Choose & Schema Design

    Posted: 27 Feb 2019 11:06 PM PST

    I know the general differences between the two, but I'm having a hard time choosing which one to use in what scenario. Does anyone know of any good resources that go over the differences in detail, cover cases in which to use one over the other, and also something that goes over how to design tables or schemas for each? This is a huge weak spot of mine and I'm trying to resolve this asap. Thank you!

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

    [R] For-loop basics help, getting a simple simulation of picking marbles from a bag

    Posted: 27 Feb 2019 11:00 PM PST

    I'm currently trying to draw three marbles from a bag, repeated 10000 times (there are four colors with their own probabilities, but the problem is in the actual simulation itself). I initially had a lot of issues with storing the values of two vectors in one for-loop (couldn't understand how to apply it to more than one), but I believe I was able to correctly run the experiment like this:

    x<-0

    rep<-10000

    for(j in 1:rep){

    pop = c("r","b","b","g","g","g","y","y","y","y")

    samp = sample(pop,3)

    x[j]<-samp

    }

    table(x)

    However, assuming the code above works fine for this context, I won't be able to use it for the following section of my lab. The goal is the same, but now there is a small addition to the code that I'm not sure how to get running.

    sim=10000

    blues<-numeric(sim); yellows<-numeric(sim) #line of code added that I hadn't originally done for my simulation

    for(i in 1:sim){

    pop = c("r","b","b","g","g","g","y","y","y","y")

    samp = sample(pop,3) # draw 3 marbles

    blues[i]<-samp

    }

    Clearly I'm doing something wrong with the for-loop, as that's where the error always ends up in. I'm not understanding what's wrong within it and how the added line of code properly works here. They should be "storage vectors," but I don't understand how to get them to work (I was under the impression that for-loops needed some kind of initialized vector at (some_name)<-0 before starting the loop, but it doesn't seem to be the case for how this chunk should work). I'm definitely also not entirely sure what to do for that blues[i] portion, which was my attempt at storing the output for each simulation... Can anyone point me to the right direction?

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

    Help me please with learning tips

    Posted: 27 Feb 2019 10:50 PM PST

    Hello, tell me please, I want to study web programming, but I have problems with abstract understanding of the tasks, that is, if there is a clear task, then I can do it, and if it is a bit abstract, then I have problems, how can this be solved? And also, if I have such a problem, is it better for me to start learning the backend? Because in my opinion frontened

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

    Need help in finding a backend starting point for fast development.

    Posted: 27 Feb 2019 10:42 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]

    [JAVA] Need help with music files and Jar Files

    Posted: 27 Feb 2019 10:26 PM PST

    Hello everyone, i have just finished developing a program for my DnD players to use for combat, however i have ran into an issue. When running the .JAR on my computer, everything works fine, but when i distribute the .JAR to my Surface Pro to attempt to test it, the music files do not play. Now, i know why this happens, its because the program makes calls file locations on my computer, and those files don't exist on the surface, my question is, how do i fix this? I'm not quite sure how to make music files that will be included in the JAR. All of the music files are saved in the SRC of the file. Here is my GetFile code for reference:

    public static void GetFileDTT() { try { File fileDTT = new File("C:\\Users\\Conno\\Desktop\\RPG's\\Kingdom Hearts RPG\\PlayerApplication\\src\\playerapplication\\Dont_Think_Twice_Orchestra.wav"); clipDTT = AudioSystem.getClip(); clipDTT.open(AudioSystem.getAudioInputStream(fileDTT)); } catch (Exception e) { System.err.println(e.getMessage()); } } 

    Thanks for the help!

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

    What is the underlying logic in self-driving cars?

    Posted: 27 Feb 2019 10:17 PM PST

    I'm trying to grasp-figure what the computer in the car has to calculate to preform the self driving task... in short, i'm interested to know the different mechanism that the computer have to calculate in order to preform this task.. so for example: 1. the distance between the car and all the objects in front 2. the lanes, etc etc... if anyone had worked in that field and can share some insights about the underlying work of all that it would be very appreciated...

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

    Quick.sort() in Java

    Posted: 27 Feb 2019 04:19 PM PST

    I have this code:

    private static int partition(Comparable[] a, int lo, int hi) {

    int i = lo, j = hi+1;

    Comparable v = a[lo];

    while(true) {

    while (less(a[++i], v)) if (i == hi) break;

    while (less(v, a[--i])) if (j == lo) break;

    if (i >= j) break;

    exch(a, i, j);

    }

    exch(a, lo, j);

    return j;

    }

    and this code:

    private static void exch(Comparable[] a, int i, int j) {

    Comparable swap = a[i];

    a[i] = a[j];

    a[j] = swap;

    }

    taken directly out of my textbook, but I keep getting "Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 7"

    Obviously because a[j] doesn't exist (j = hi+1 and hi is the array's length-1)

    This is taken directly out of the textbook so I don't know how I should/if I may change the code but it doesn't work. Any suggestions?

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

    Udacity Front-End Development Nanodegree Review?

    Posted: 27 Feb 2019 04:15 PM PST

    Hi

    I want to get a review of Udacity's front-end development program.

    I'm concerned that Udacity does not have good mentors. I'm the type that needs to get my questions answered as I am a verbal learner and the program may be a suitable alternative to a boot camp.

    Am I wrong? Are the mentors and forum support good quality?

    Thanks

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

    No comments:

    Post a Comment