• Breaking News

    Saturday, December 2, 2017

    Will multi-threaded Javascript make it like PHP/Java/etc.? Ask Programming

    Will multi-threaded Javascript make it like PHP/Java/etc.? Ask Programming


    Will multi-threaded Javascript make it like PHP/Java/etc.?

    Posted: 02 Dec 2017 07:33 PM PST

    The new Microsoft Napa.js project is a "multithreaded Javascript runtime".

    Does this mean I'll be able to write Javascript code, on the server, using the blocking IO/-sync Node methods, so I will therefore not have to use callbacks/promises/generators/etc., and I'll still be able to achieve good performance?

    i.e. will server-side Javascript coding be roughly analogous to using any other multi-threaded server-side language, like PHP, Java, etc.?

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

    What is the best way to learn Audio Programming?

    Posted: 02 Dec 2017 11:37 AM PST

    I'm looking for the best way to learn audio programming. I find the materials on the internet that I have seen so far fairly lacking.

    Interested in what people have to say and if there is anyone out there who is experienced is this field I would be interested in starting a dialogue with you.

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

    What languages would I need to know to write a password manager?

    Posted: 02 Dec 2017 07:05 PM PST

    I've been learning Ruby as my first language for about the last two weeks. When I first decided I wanted to learn programming I set a goal for myself that I would make a password manager that I could use. What languages/skills would I need in order to make a simple program that could: save passwords, pop-up and prompt me when I am on a website or entering a password in an application that is already saved, save passwords after I type them in, and have all of the passwords protected by one universal password.

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

    What should I know as I attempt to build a remote administration tool in Java?

    Posted: 02 Dec 2017 06:12 PM PST

    Been grinding leetcode, CTCI in Java recently, inspired to learn a bit of networking, which I know nothing about.

    I want to build a super simple remote admin tool in Java, client-server model. Two things came into my head that I don't understand how to build..

    • Can I dynamically build the client jar programmatically using something like JarOutputStream?

    • When streaming the desktop, do you literally streams image files continuously in sequence? I'd like to program as much of this using standard JDK, minimal 3rd party libraries.

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

    How would I extract a day from a date stored in a variable in PL/SQL?

    Posted: 02 Dec 2017 06:07 PM PST

    I tried DBMS_OUTPUT.PUT_LINE(DAY(variable)); I haven't found many ways of doing this in my various textbooks. I just want to extract the day (i.e. day of the week) from a date stored in a variable.

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

    Which coding for profiles website and filter on user information

    Posted: 02 Dec 2017 09:48 PM PST

    Hi guys,

    i want to get into coding but i already have a site in mind. In brief it will be based on users being able to create a profile and find each other with certain filters. Somewhat like tinder you could say but the purpose would be completely different. So i understand what html does, CSS and somewhat what javascript does but i can't really seem to figure out which one to learn to manage the profile data and implement filters on this user data. I understand that facebook does a lot with PHP but i don't seem to find confirmation that this is my next step. Many thanks for helping out and ask me if anything would not be clear!!

    Thanks thanks thanks

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

    Git or Mercurial?

    Posted: 02 Dec 2017 08:43 PM PST

    We've been using SVN for quite some time, but are thinking about switching to either Git or Mercurial. Before we used SVN I had used a number of commercial source control systems including Perforce and Sourcegear Vault, but I've never used GIT or Mercurial.

    From what I've heard, Mercurial is easier to use than GIT, and (at least for Windows) offers a nicer user interface with TortoiseHg. However it doesn't seem to be as widely used as Git.

    What we absolutely need is branching as well as the ability to only give certain users access to certain repositories. We use almost exclusively Windows thus far.

    I was hoping to hear from users who have used both systems as to which one they prefer, and why.

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

    Why cant all crypto be broken right now?

    Posted: 02 Dec 2017 07:29 PM PST

    I should have formed a better question, but it seems any of the alphabet groups could ask for a budget that would break all the concepts of crypto, since many of them were the ones who invented it in the first place. The usual short reply I get back which doesnt make sense to me is that "if you got all the super computers and tried to break the crypto it would take 1000's of years"...im kinda paraphrasing.

    • Why can XYZ invent a super computer and keep it hidden?
    • Why cant private groups fund the breaking of crypto and easily be successful just like how they made crypto in the first place?
    • In the traveling salesman movie, they show RAND commissioning (3) to break all crypto and the main guy does and ends up getting shot at home because he wanted to tell the world.
    • How can the random function in programming languages be 100% random?
    submitted by /u/InsertCoinPushStart
    [link] [comments]

    How do I make a bot?

    Posted: 02 Dec 2017 01:22 PM PST

    Hello, i am interested in learning how to make a bot. and to be specific, i want to learn how to make a search bot for specific things. What program would i have to use to make it? what are the steps?

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

    How do I look in a column in python CSV and print the row of data it is in?

    Posted: 02 Dec 2017 12:40 PM PST

    'name' is a column in a csv file and I want to have an if statement to check if a certain name is in the column. If the name is there I want it to use that list to make a scatter plot.

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

    Regular Expression

    Posted: 02 Dec 2017 04:09 PM PST

    Let the alphabet ∑={ 0,1}. I am trying to write a regular expression for each of the following. I'm only using only union, concatenation, and Kleene star.

    a) Bit strings that have an even number of 0's

    c) All bit strings that do not have substring '01'

    So far I have;

    a) 1 * (01 * 01 *) * )

    c) However, confused on how to do C

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

    C#/WPF/XAML : How can I raise an attached event?

    Posted: 02 Dec 2017 03:45 PM PST

    I'm trying to create an attached event to Panel objects that will fire when the controls children collection changes. The purpose is to be able to know when children have been added or removed to any object which implements the Panel class WITHOUT having to extend those classes themselves.

    This is what I have so far -

    public class PanelObserver { public static readonly RoutedEvent VisualChildrenChangedEvent; static PanelObserver( ) { VisualChildrenChangedEvent = EventManager.RegisterRoutedEvent( "VisualChildrenChanged", RoutingStrategy.Bubble, typeof( RoutedEventHandler ), typeof( Panel ) ); } public static void AddVisualChildrenChangedHandler( DependencyObject d, RoutedEventHandler handler ) { Panel p = d as Panel; if ( p != null ) { p.AddHandler( VisualChildrenChangedEvent, handler ); } } public static void RemoveVisualChildrenChangedHandler( DependencyObject d, RoutedEventHandler handler ) { Panel p = d as Panel; if ( p != null ) { p.RemoveHandler( VisualChildrenChangedEvent, handler ); } } } 

    Unfortunately, I don't know how I can change the incoming Panel object such that when children are added or removed, the panel will raise the VisualChildrenChanged event.

    Am I on the right track for this? What is it that I need to do to make this work?

    Thanks...

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

    Hi, im getting this error in my script: Unity error Assets/Scripts/PlayerBehaviour.cs(26,16): error CS0120: An object reference is required to access non-static member `UnityEngine.Rigidbody2D.AddForce(UnityEngine.Vector2)' Anybody's willing to give me a hand?

    Posted: 02 Dec 2017 03:04 PM PST

    1.using System.Collections; 2.using System.Collections.Generic; 3.using UnityEngine; 4. 5. public class PlayerBehaviour : MonoBehaviour { 6. 7. public Transform mesh; 8. public float forceFly; 9. private Animator animatorPlayer; 10. 11. private float currentTimeToAnim; 12. private bool inAnim; 13. 14. // Use this for initialization 15. void Start () { 16. animatorPlayer = mesh.GetComponent<Animator>(); 17. } 18. 19. // Update is called once per frame 20. void Update () { 21. 22. if (Input.GetMouseButtonDown (0)) { 23.
    24. inAnim = true; 25. 26. Rigidbody2D.AddForce (new Vector2 (0, 1)*forceFly); 27. 28. } 29. 30. if(inAnim) { 31. currentTimeToAnim += Time.deltaTime; 32. 33. if(currentTimeToAnim > 0.6f) { 34. currentTimeToAnim = 0; 35. inAnim = false; 36. 37. } 38. } 39. 40. animatorPlayer.SetBool ("callFly", inAnim); 41. 42. } 43.}

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

    Environment for C++?

    Posted: 02 Dec 2017 01:57 PM PST

    Hi guys, I'm pretty new to programming and just learned the basics of C++ like vectors, iterations, functions, and putting stuff together for projects. I have a windows PC but I have enough room and processing power to get Linux.

    How should I set up my environment? I've been using visual studios but I can't work with files in my computer. Also I plan on learning Arduino on a side note but I'll be taking more courses in just C++ itself.

    Also if I need Linux, which one? What should I know?

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

    Java: Can Someone Explain "this/this()" To Me?

    Posted: 02 Dec 2017 01:42 PM PST

    I'm trying to understand the purpose of this or this() is the following example:

    public static final class TicketExpiration implements Parcelable { public static final Creator<TicketExpiration> CREATOR = new C11041(); public final long activationTime; public final long expirationTime; public final FareRuleType fareRuleType; public final boolean hasExpired; public final boolean isValid; private TicketExpiration(int i, long j, long j2, boolean z, boolean z2) { this.fareRuleType = FareRuleType.valueOf(i); this.hasExpired = z; this.isValid = z2; this.expirationTime = j2; this.activationTime = j; } } 

    Can someone tell me what is happening to the TicketExpiration variables?

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

    What coding jobs can an advanced 16 year old coder get?

    Posted: 02 Dec 2017 12:55 PM PST

    Hi, I can code pretty well in both JS and Python and I was wondering is there any way to get an online job (pay doesn't have to be great) that involves me coding? Thanks

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

    what does it take to make a forum?

    Posted: 02 Dec 2017 12:35 PM PST

    -I mean i have the idea of making a forum similair to Hackforums/leaksforum etc... but its not 100% replica i have some good ideas to add! but what i need as like personel skills/money and others :)

    thanks in advance

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

    What is the best way to convert multiple URLs to PDFs?

    Posted: 02 Dec 2017 12:10 PM PST

    I'm looking for a program that I can feed a list of URLs to and it will convert them all to PDFs, or preferably one long PDF. If this doesn't exist I'd like to create it - I have a lot of other feature ideas in mind, and I'm wondering what language would be best suited for this kind of task.

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

    How to create an assembler?

    Posted: 02 Dec 2017 08:16 AM PST

    I have developed a simple compiler for my custom grammar. It hase linear execution, no functions nor classes, integer types, console read and write, a comparison and a loop, and I was able to made it generate actually working Windows Assembly Code.

    Now I would like to make the assembler, to understand how the process of generating an executable file works, but I have no idea of how it is made.

    Edit: I may have made a confusing question so let me try to simplify my doubt:

    How do I transform my Assembly Code into an Windows Executable File?

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

    OOP question

    Posted: 02 Dec 2017 10:43 AM PST

    I am currently in the second year of my educatoon wich teaches us to create websites, apps, and game wich I really enjoy. But the teachers started sayibg that OOP was a extremely hard topic to wrap your mind around. Eventhough I have had some trouble it is, for now, not really hard to learn and understand and quite interesting. Why is it that me and a friend of mine understand this easier that most classmates? Just luck and interest?

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

    In need of multimedia development advice..

    Posted: 02 Dec 2017 10:35 AM PST

    Hi! I want to do a multimedia application as a side project, using the touchscreen for input and interaction, and a pc to run the software. For example: iPad's on stores and showrooms, where the customers can use the device for interactive functionality. In this particular case, the platform, is a common windows pc with a touchscreen. At first, I took interest in the Universal Windows Platform apps, but I'm a bit confused in terms of licensing and distributing, and if it cames with additional costs, and needing to release to windows store to make it deliverable, and not as a stand-alone product. Second, as an electron app, using javascript, not my language of choice, but, it looks interesting. Not so interesting is all the nasty opinions about this platform.

    tl;dr I just want to put video, images, music, text, in a interactive way, and as stand-alone (easy to distribute and mantain) pc software. Which are the best tools for this kind of project?

    Thanks in advance, Cheers!

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

    C/Arduino Run two sketches using two namespaces. Function not declared?

    Posted: 02 Dec 2017 10:00 AM PST

    I'm trying to run multiple sketches within the same board. I looked online and found that this can only be done using namespaces.

    Example code

    setup() { if(conditionIsTrue) { aGroup::setup(); } else { bGroup::setup(); } } loop() { if(conditionIsTrue) { aGroup::loop(); } else { bGroup::loop(); } } namespace aGroup { setup() { // Code } loop() { // Code } } namespace bGroup { setup() { // Code } loop() { // Code } } 

    My Code

    #include <Adafruit_Fingerprint.h> #include <SoftwareSerial.h> SoftwareSerial mySerial(2, 3); Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial); #include <Adafruit_Fingerprint.h> 

    //First Namespace

    namespace logIn { void setup() { Serial.begin(9600); while (!Serial); delay(100); Serial.println("\n\nAdafruit finger detect test"); // set the data rate for the sensor serial port finger.begin(57600); if (finger.verifyPassword()) { Serial.println("Found fingerprint sensor!"); } else { Serial.println("Did not find fingerprint sensor :("); while (1) { delay(1); } } Serial.println("Waiting for valid finger..."); } void loop() // run over and over again { getFingerprintIDez(); delay(50); //don't ned to run this at full speed. } uint8_t getFingerprintID() { uint8_t p = finger.getImage(); switch (p) { case FINGERPRINT_OK: Serial.println("Image taken"); break; case FINGERPRINT_NOFINGER: Serial.println("No finger detected"); return p; case FINGERPRINT_PACKETRECIEVEERR: Serial.println("Communication error"); return p; case FINGERPRINT_IMAGEFAIL: Serial.println("Imaging error"); return p; default: Serial.println("Unknown error"); return p; } // OK success! p = finger.image2Tz(); switch (p) { case FINGERPRINT_OK: Serial.println("Image converted"); break; case FINGERPRINT_IMAGEMESS: Serial.println("Image too messy"); return p; case FINGERPRINT_PACKETRECIEVEERR: Serial.println("Communication error"); return p; case FINGERPRINT_FEATUREFAIL: Serial.println("Could not find fingerprint features"); return p; case FINGERPRINT_INVALIDIMAGE: Serial.println("Could not find fingerprint features"); return p; default: Serial.println("Unknown error"); return p; } // OK converted! p = finger.fingerFastSearch(); if (p == FINGERPRINT_OK) { Serial.println("Found a print match!"); } else if (p == FINGERPRINT_PACKETRECIEVEERR) { Serial.println("Communication error"); return p; } else if (p == FINGERPRINT_NOTFOUND) { Serial.println("Did not find a match"); return p; } else { Serial.println("Unknown error"); return p; } // found a match! Serial.print("Found ID #"); Serial.print(finger.fingerID); Serial.print(" with confidence of "); Serial.println(finger.confidence); return finger.fingerID; } // returns -1 if failed, otherwise returns ID # int getFingerprintIDez() { uint8_t p = finger.getImage(); if (p != FINGERPRINT_OK) return -1; p = finger.image2Tz(); if (p != FINGERPRINT_OK) return -1; p = finger.fingerFastSearch(); if (p != FINGERPRINT_OK) return -1; // found a match! Serial.print("Found ID #"); Serial.print(finger.fingerID); Serial.print(" with confidence of "); Serial.println(finger.confidence); return finger.fingerID; } } 

    //Second Namespace

    namespace enroll { uint8_t id; void setup() { Serial.begin(9600); while (!Serial); // For Yun/Leo/Micro/Zero/... delay(100); Serial.println("\n\nAdafruit Fingerprint sensor enrollment"); // set the data rate for the sensor serial port finger.begin(57600); if (finger.verifyPassword()) { Serial.println("Found fingerprint sensor!"); } else { Serial.println("Did not find fingerprint sensor :("); while (1) { delay(1); } } } uint8_t readnumber(void) { uint8_t num = 0; while (num == 0) { while (! Serial.available()); num = Serial.parseInt(); } return num; } void loop() // run over and over again { Serial.println("Ready to enroll a fingerprint!"); Serial.println("Please type in the ID # (from 1 to 127) you want to save this finger as..."); id = readnumber(); if (id == 0) {// ID #0 not allowed, try again! return; } Serial.print("Enrolling ID #"); Serial.println(id); while (! getFingerprintEnroll() ); } uint8_t getFingerprintEnroll() { int p = -1; Serial.print("Waiting for valid finger to enroll as #"); Serial.println(id); while (p != FINGERPRINT_OK) { p = finger.getImage(); switch (p) { case FINGERPRINT_OK: Serial.println("Image taken"); break; case FINGERPRINT_NOFINGER: Serial.println("."); break; case FINGERPRINT_PACKETRECIEVEERR: Serial.println("Communication error"); break; case FINGERPRINT_IMAGEFAIL: Serial.println("Imaging error"); break; default: Serial.println("Unknown error"); break; } } // OK success! p = finger.image2Tz(1); switch (p) { case FINGERPRINT_OK: Serial.println("Image converted"); break; case FINGERPRINT_IMAGEMESS: Serial.println("Image too messy"); return p; case FINGERPRINT_PACKETRECIEVEERR: Serial.println("Communication error"); return p; case FINGERPRINT_FEATUREFAIL: Serial.println("Could not find fingerprint features"); return p; case FINGERPRINT_INVALIDIMAGE: Serial.println("Could not find fingerprint features"); return p; default: Serial.println("Unknown error"); return p; } Serial.println("Remove finger"); delay(2000); p = 0; while (p != FINGERPRINT_NOFINGER) { p = finger.getImage(); } Serial.print("ID "); Serial.println(id); p = -1; Serial.println("Place same finger again"); while (p != FINGERPRINT_OK) { p = finger.getImage(); switch (p) { case FINGERPRINT_OK: Serial.println("Image taken"); break; case FINGERPRINT_NOFINGER: Serial.print("."); break; case FINGERPRINT_PACKETRECIEVEERR: Serial.println("Communication error"); break; case FINGERPRINT_IMAGEFAIL: Serial.println("Imaging error"); break; default: Serial.println("Unknown error"); break; } } // OK success! p = finger.image2Tz(2); switch (p) { case FINGERPRINT_OK: Serial.println("Image converted"); break; case FINGERPRINT_IMAGEMESS: Serial.println("Image too messy"); return p; case FINGERPRINT_PACKETRECIEVEERR: Serial.println("Communication error"); return p; case FINGERPRINT_FEATUREFAIL: Serial.println("Could not find fingerprint features"); return p; case FINGERPRINT_INVALIDIMAGE: Serial.println("Could not find fingerprint features"); return p; default: Serial.println("Unknown error"); return p; } // OK converted! Serial.print("Creating model for #"); Serial.println(id); p = finger.createModel(); if (p == FINGERPRINT_OK) { Serial.println("Prints matched!"); } else if (p == FINGERPRINT_PACKETRECIEVEERR) { Serial.println("Communication error"); return p; } else if (p == FINGERPRINT_ENROLLMISMATCH) { Serial.println("Fingerprints did not match"); return p; } else { Serial.println("Unknown error"); return p; } Serial.print("ID "); Serial.println(id); p = finger.storeModel(id); if (p == FINGERPRINT_OK) { Serial.println("Stored!"); } else if (p == FINGERPRINT_PACKETRECIEVEERR) { Serial.println("Communication error"); return p; } else if (p == FINGERPRINT_BADLOCATION) { Serial.println("Could not store in that location"); return p; } else if (p == FINGERPRINT_FLASHERR) { Serial.println("Error writing to flash"); return p; } else { Serial.println("Unknown error"); return p; } } } 

    //Main Code that calls Namespace 1 or 2 based on user input

    void setup() { int userInput = Serial.read(); if (userInput == 1) { logIn::setup(); while (true) logIn::loop(); } else if (userInput == 2) { enroll::setup(); while (true) enroll::loop(); } else { Serial.println("Wrong Input. Please Retry!"); } } void loop() { } 

    But when I run my code I get this error for the function: 'getFingerprintIDez' was not declared in this scope from the First Namespace loop

    The compiler doesn't see any of the functions as declared for some reason.

    I've been stuck at this for a while

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

    C++, How top stop every 25 outputs.

    Posted: 02 Dec 2017 09:20 AM PST

    Trying to output some information 100 times. I need the output to stop after 25 so the user can review the output and then go for another 25, etc. I was thinking cin.get for the pause, but I can't seem to wrap my head around getting it to do it every 25 times. Any help would be greatly appreciated. If I need to provide code or examples I will.

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

    how to store pieces in a Gomoku game

    Posted: 02 Dec 2017 09:04 AM PST

    can someone please me with this question I posted on stack overflow? https://stackoverflow.com/questions/47610276/how-to-store-pieces-in-gomoku

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

    Is it possible to create an in-page screenshot tool for a website?

    Posted: 02 Dec 2017 05:41 AM PST

    Lets say its a video site like youtube. I want an in-page button near (but outside) the video canvas that can screenshot the page or just the video itself. And then provide option to share the image to social media. Is this possible?

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

    No comments:

    Post a Comment