• Breaking News

    Tuesday, December 5, 2017

    Anyone willing to help a college student with an interview? Ask Programming

    Anyone willing to help a college student with an interview? Ask Programming


    Anyone willing to help a college student with an interview?

    Posted: 05 Dec 2017 06:27 PM PST

    Hi! I'm a freshman in college, I have an assignment to interview anyone that is a programmer, pm me if you'd like to help thank you!

    submitted by /u/4degreeswarmer
    [link] [comments]

    [C++] OUTPUT REDIRECTION - open(), dup(), and dup2() always return -1 and I'm not sure why

    Posted: 05 Dec 2017 09:07 PM PST

    So for my class I need to use pipe() and dup() system calls. I have to learn this on our own because the instructors will not teach us how to use it, mostly because they don't know how to and they don't know how to do the assignment because they're just lecturers and not the ones who made the class. I've asked all that I can and the main professor said to read the manuals because he doesn't know, but my TA learned these function calls on his own to help me and we worked on this together but for some reason it stopped working.

    We got the program to work once, but when I added a close(1); at the end of the function, it stopped working. The big issue is that open() and dup() always return -1 and both my TA and I could not figure out why.

    int newout = 0; newout = open(path.c_str(), O_APPEND | O_WRONLY); // opens file to be outputted to std::cout<<newout<<std::endl; // returns status of open() which is -1 dup2(newout, 1); // returns status of dup2() which is -1 std::cout<<newout<<std::endl; // file should now be what output goes to std::cout << "this will print to file" << std::endl; // should be outputted into the file but does not 

    1) path.c_str() is the file that I want to output to and I've double checked that the file was valid and works.

    2) I want everything sent to standard output to go into the file, which is why I called open() and used dup2() to set the file as output

    tl;dr - open(), dup(), and dup2() return -1 and I don't know why. It worked as intended once and then stopped when I tried adding close(1) at the end of the function. I know the code isn't 100% complete but my main goal is to currently get open() and dup() to work so that I can output to file.

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

    How do you make a web presentation like this?

    Posted: 05 Dec 2017 06:19 PM PST

    Can anyone help me figure out what this log file means?

    Posted: 05 Dec 2017 09:50 PM PST

    I had a friend send me a visual novel a while back and just happened to look at the logs around the time I fired it up. What does all of this mean? Specifically the stuff referencing recording logs and twitch.tv? There is more after this but these were the first things in the log.

    [05:34:34.00174- 11244] Conor,.exe dbglog.cpp(214) DbgLog_F Log for module 'game' (122689) started with process 'Conor,.exe' (x86, PID: 8280, CmdLine: "D:\Conor,\Conor,\Conor,.exe" ) - Sun May 28 05:34:34 2017

    [05:34:34.00174- 11244] Conor,.exe ltc_game.cpp(5970) DllMain Current process is an auto-hook candidate

    [05:34:34.00174- 11244] Conor,.exe ltc_game.cpp(2434) StartAutoHookMonitoring Auto-hook monitoring started

    [05:34:34.00175- 1404] Conor,.exe autohook.cpp(265) AutoHookManager::_WatchForQuitOrTimeoutThread Watching

    [05:34:34.00175- 1192] Conor,.exe ltc_game.cpp(5665) MainThread MainThread executing...

    [05:34:34.00175- 1192] Conor,.exe console.h(154) CConsole::Output CONSOLE: Console logging has been enabled.

    [05:34:34.00175- 1192] Conor,.exe console.h(154) CConsole::Output CONSOLE: Added alias [sta:"StartRecorder"]

    [05:34:34.00175- 1192] Conor,.exe console.h(154) CConsole::Output CONSOLE: Added alias [stp:"StopRecorder"]

    [05:34:34.00175- 1192] Conor,.exe console.h(154) CConsole::Output CONSOLE: Added alias [slsk:"SetLiveStreamKey live_37135925_lD9UDVtrXfCT8yf0kHeWdVhaITG9oy"]

    [05:34:34.00175- 1192] Conor,.exe console.h(154) CConsole::Output CONSOLE: Added alias [srl:"RecorderLog C:\Users\Randal\Desktop\ffmpeg.log"]

    [05:34:34.00175- 1192] Conor,.exe console.h(154) CConsole::Output CONSOLE: Added alias [twitchtest2:"BroadcasterDebug 1;GetTwitchAuthToken ql7dn49ya6oalq5xux4s33a16n3e7sv RaptrRandal raptrtest"]

    [05:34:34.00175- 1192] Conor,.exe console.h(154) CConsole::Output CONSOLE: Added alias [twitchtest:"BroadcasterDebug 1;SetTwitchAuthToken 1eduwz3hdp3yprib6vhpr5c64go2nv3;StartBroadcast"]

    [05:34:34.00175- 1192] Conor,.exe console.h(154) CConsole::Output CONSOLE: Added alias [gfastfb:"GetFramebufferAsSizeFastBench 1"]

    [05:34:34.00175- 1192] Conor,.exe console.h(154) CConsole::Output CONSOLE: Added alias [dt1:"D3D11FastDumpTest 1"]

    [05:34:34.00175- 1192] Conor,.exe console.h(154) CConsole::Output CONSOLE: Console initialised.

    [05:34:34.00179- 1192] Conor,.exe overlayui.cpp(1182) OverlayUI_InitializeConsole This game has no on-load flags.

    [05:34:34.00180- 10144] Conor,.exe ltc_game.cpp(2936) ModuleScanThread ModuleScanThread executing...

    [05:34:34.00180- 10144] Conor,.exe ltc_game.cpp(2943) ModuleScanThread Process File Name:Conor,.exe [05:34:34.00180- 10144] Conor,.exe ltc_game.cpp(2913) LogRunningProcesses Processes at startup:

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

    Hoping to get your Input on Online Programming Community Leadership survey for my Final Thesis

    Posted: 05 Dec 2017 09:34 PM PST

    Dear Ms./Mr. (Admin & Respectful Members) ,

    I'm Abdul Razak, studying at Universiti Utara Malaysia. I really need your help by humbly requesting to fill in my estimated 6 minutes survey if you have ever participate in any online programming communities to learn, asking for help, sharing knowledge, developing software/programs and joining any other activities ( such as Java programming forum, codeguru.com, Python forum, PHP Community, Android/IOS community, Matlab, Codeacademy.com and others).

    I have collected 110 respondents for 1 month and 1 weeks now. I need 300 participants to accomplish data collection and analysis for my final thesis. Below is the survey link :

    https://www.surveymonkey.com/r/abdulrazak123

    [Lucky Draw of USD 10 Amazon gift card x 6 respondents ] will be delivered to random six respondents as an appreciation for participating.

    "Your willingness to answer this survey is highly appreciated"

    Thank You Very Much

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

    Anyone who is a computer programmer mind answering these questions? For a project?

    Posted: 05 Dec 2017 03:16 PM PST

    I am currently doing a field of study paper for college and I have to interview someone who is a computer programmer. I would prefer someone who has worked in a company or freelanced for at least 2 years or more. Anyone can answer. These are the 10 questions below: Thanks in Advance!

    1. What is the ideal work environment for a computer programmer?

    2. What are the duties/functions/responsibilities of your job (if you work at a company)?

    3. What are the educational, requirements for a programmer? What other types of credentials or licenses are required?

    4. What part of this job do you personally find most satisfying? most challenging?

    5. Tell me about the most challenging project you have worked on in your career. (in terms that a non-programmer/business-person would understand)

    6. What programming languages can you work with? Describe your experience with them.

    7. In what way did computer programming interest you and how did you get started?

    8. Why is there a need to learn multiple computer programming languages?

    9. What can you tell me about the employment outlook in your occupational field?

    10. How much demand is there for people in this occupation?

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

    Why/how does code become outdated?

    Posted: 05 Dec 2017 01:35 PM PST

    I've seen in many instances people complaining that code is 'outdated' where they work or that it hasn't been touched in x years. Why does this matter?

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

    Finished my code but getting a different output?

    Posted: 05 Dec 2017 08:21 PM PST

    I have been working on my code all night and finally finished, when I ran it, I'm now getting a different output than I expected. Everything is coming back as "True" when there should be some false as well. I tried editing my return statement and modifying the root node but nothing seems to change it. Here is my code so far:

    public class FamilyTree {

    private Node root; private class Node { private String name; private Node father; private Node mother; private Node(String name, Node father, Node mother) { this.name = name; this.father = father; this.mother = mother; } } public FamilyTree(String ego) { this.root = new Node(ego, null, null); } private Node find(String name) { return find(name, root); } private Node find(String name, Node root) { if (name == null || root == null) { return null; } if (root.name.equals(name)) { } return root; } public void addParents(String ego, String father, String mother) { if (find(ego) == null) { throw new IllegalArgumentException(); } else { find(ego).father = new Node(father, null, null); find(ego).mother = new Node(mother, null, null); } } public boolean isDescendant(String ego, String ancestor) { if (find(ego) == null || find(ancestor) == null) { return false; } else { return isDescendant(find(ego), find(ancestor)); } } public boolean isDescendant(Node root, Node ancestor) { if (ancestor != null) { if (root.equals(ancestor)) { return true; } } return false; } 

    } class Pottery {

    // MAIN. Harry Potter and the Hairier Pottery.

    public static void main(String [] args) { FamilyTree family = new FamilyTree("Al");

    family.addParents("Al", "Harry", "Ginny"); family.addParents("Harry", "James", "Lily" ); family.addParents("Ginny", "Arthur", "Molly"); try { family.addParents("Joanne", "Peter", "Anne"); } catch (IllegalArgumentException ignore) { System.out.println("No Joanne."); // 2 No Joanne. } System.out.println(family.isDescendant("Joanne", "Joanne")); // 2 false System.out.println(family.isDescendant("Al", "Al")); // 2 true System.out.println(family.isDescendant("Al", "Harry")); // 2 true System.out.println(family.isDescendant("Al", "Ginny")); // 2 true System.out.println(family.isDescendant("Al", "James")); // 2 true System.out.println(family.isDescendant("Al", "Lily")); // 2 true System.out.println(family.isDescendant("Al", "Arthur")); // 2 true System.out.println(family.isDescendant("Al", "Molly")); // 2 true System.out.println(family.isDescendant("Al", "Joanne")); // 2 false System.out.println(family.isDescendant("Harry", "Harry")); // 2 true System.out.println(family.isDescendant("Harry", "Al")); // 2 false System.out.println(family.isDescendant("Harry", "James")); // 2 true System.out.println(family.isDescendant("Harry", "Lily")); // 2 true System.out.println(family.isDescendant("Harry", "Ginny")); // 2 false System.out.println(family.isDescendant("Harry", "Arthur")); // 2 false System.out.println(family.isDescendant("Harry", "Molly")); // 2 false System.out.println(family.isDescendant("Harry", "Joanne")); // 2 false System.out.println(family.isDescendant("Ginny", "Arthur")); // 2 true System.out.println(family.isDescendant("Arthur", "Ginny")); // 2 false 

    }
    }

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

    How do I create a simple menu using sfml in C++? Any examples would help

    Posted: 05 Dec 2017 08:20 PM PST

    I was developing a game for class in C++ we have to use sfml and use graphics. I was just wondering how I could create a menu that says play how to play and exit using graphics

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

    How would you get the number of likes a facebook page has?

    Posted: 05 Dec 2017 07:26 PM PST

    The graph API may support this, I'm still reading more and more about it. So far it seems it's much more extensive than what I'm really looking for.

    LinkedIn has a separate federator api that I can use to look at very high level information about companies (number of employees, location, etc.) that is not behind an authentication barrier. I'm hoping facebook has the same but when googling all I find is "how to increase your facebook likes" kind of content.

    Anyone have any ideas/opinions?

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

    Shopify custom code help!

    Posted: 05 Dec 2017 07:24 PM PST

    Hey,

    I'm having trouble with this code, It's overriding my other options on a 3rd Party app (Infinite options). We want the other option to show up in the cart page and the Shopify Admin order.

    The support guy I've been talking to say we need to allow other line item properties to be added to the cart.

    <script> function checkLoaded() { $("body").on('keyup','.custom-input-product-size',function (e) {

    var assignedFlag = 0; $inputSize = $(this); $inputVal = ( $inputSize.val() != "" ) ? ( $inputSize.val() * 1 ) : "0" ; if( $inputVal >= 4800 ) { $inputSize.val(4800); keyVariantRefer = 4800; $('.product-priceprice span').text(variantPriceObj[4800].price); assignedFlag = 1; } else { for( variant in variantPriceObj ) { if( variant >= $inputVal ) { keyVariantRefer = variant; $('.product-priceprice span').text(variantPriceObj[variant].price); assignedFlag = 1; break; } } }

    e.preventDefault(); });

    $('#AddToCart-product-template').click(function(){ if( typeof keyVariantRefer != "undefined" ) { if( $('.custom-input-product-size').val() == "" ) { alert("Please enter the size"); } else {

    jQuery.post('/cart/add.js', { quantity: 1, id: variantPriceObj[keyVariantRefer].variant_id, properties: { 'Custom Size': $('.custom-input-product-size').val() } }).always(function(){ window.location.href = "/cart"; }); } }

    }); }

    </script>

    I'm trying to get in touch with the original programmer but have been unable to as of yet.

    Site: https://www.customiseddrains.com.au/products/heel-grate

    The enter size is the one causing the problems and not allowing me to see what else people have typed in.

    Any help would be much appreciated.

    Thanks.

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

    Why does the main method for a class in Java have an array of strings?

    Posted: 05 Dec 2017 06:24 PM PST

    My only experience with programming so far has been c++.

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

    Any decent Kinect-like hardware for motion and gesture tracking?

    Posted: 05 Dec 2017 10:48 AM PST

    Considering that the Kinect is pretty much dead, is there any alternative Kinect-like hardware for motion and gesture tracking?

    I'm particularly interested in tracking movements ranging from full arm movements to finger movements.

    Any help would be greatly appreciated :) If you need more details I'll be happy to provide!

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

    Want to hack my headset to make active noise cancelling

    Posted: 05 Dec 2017 05:45 PM PST

    So I've read a bit into noise cancelling and wanted to see if I could come up with a software-based active noise cancelling. Will probably be needing to find how to get sound input from my mic and output sound to the speakers realtime, simultaneously.

    I need some guidance on several points before starting to code. I'm more familiar with Java but I could try Python for this as well, any recommendations on which one? Is there already a similar project, or does anyone else want to give it a try too? Any classes or packages I should be looking into? Any info regarding sound/waves that I should read up on?

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

    Example of "feature interaction"?

    Posted: 05 Dec 2017 04:35 PM PST

    I'm studying Computer Science and my teacher defined feature interaction as, "two or more features in a language interacting with each other in an undesirable way".

    Can anyone provide a few examples of what that means?

    submitted by /u/TDN-ThickDickNick
    [link] [comments]

    Getting the first int value of a tuple but the first value is a string. Python Error

    Posted: 05 Dec 2017 11:53 AM PST

    I am trying to get the first int value from all of the tuples in my dictionary keys. The problem is I keep getting the error: "ValueError: invalid literal for int() with base 10: 'Population'" The code I am using is

    print([int(item[0]) for item in self.countryCat.values()])

    Is there any way I can skip over the first value in my tuple which is "Population" so I will not get this error anymore? I have been stuck on this forever.

    Thanks!

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

    ATOM processor and float?

    Posted: 05 Dec 2017 03:00 PM PST

    I have a program that has a float in it (its a low level bare metal program), runs fine on an X86 machine, but when I run it on an Atom, it halts at that step:

    float x = (float)z / (float)b;

    Any ideas? b and z both contain valid values and are uin8_t.

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

    HELP USING GOOGLE API VISION: How to employ text_detection

    Posted: 05 Dec 2017 02:51 PM PST

    Hello all, I am trying to use Google Cloud Platform's Vision API to pull text from a image and then search that text, ultimately using this info in another part of my project. My question is how do I go from grabbing the text in the image with TEXT_DETECTION to getting data from the web that will ultimately help me? There is extensive documentation and tutorials on how to go from the raw image to text, but not how to make the next step, analysis of that text.

    For example, say I had a picture of a question and options that went something like this: What does the 'A' in NASA stand for? A. Aeronautics, B. Astronaut, C. Air . Once I have the text, what API would I use to google the output of the previous process?

    Any help appreciated, Thanks.

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

    Anyone here working on software to detect fake video? Making a documentary about it and looking for experts!

    Posted: 05 Dec 2017 11:01 AM PST

    I'm making a short documentary about fake video and am interested in talking to some people who are working on software solutions to detect it. Additionally, if you're aware of any software that exists already, I'd love to check it out.

    Looking forward to learning from you all! Thanks!

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

    Single line of code isn't using variable inside a nested for-loop

    Posted: 05 Dec 2017 01:38 PM PST

    I posted my question over at stackoverflow, I was wondering if you guys could help me.

    https://stackoverflow.com/questions/47662578/for-loop-yielding-partially-correct-result

    Thanks :)

    EDIT: Solved at the link.

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

    How to divide an array in C such that the new array keeps increasing (say new_array is from 0-3 then 3-5 then 5-10)

    Posted: 05 Dec 2017 01:30 PM PST

    I would like to divide an array in C. I currently have two arrays, one of them holds strings (arguments), and the other holds the "break points" of my array.

    Example: my_arguments = ["a","b","c","d"] where_to_split = [1,3]

    So the new_array should be ["a"] first, then ["b","c"] and then ["d"]. This is done in a while loop so I would first initiatet the new_array[0:1] then inside the loop my_array[1:3] and my_array[3:length(arg_array)]

    Hope this makes sense and that you guys can help.

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

    How can I increase the refresh rate of this shuttle tracker?

    Posted: 05 Dec 2017 12:54 PM PST

    There is a shuttle tracker here: http://shuttlebusapp.azurewebsites.net/

     

    It takes anywhere from 5 to 20 seconds to update, and just looks super clunky.

     

    I'd like to get it down to a 0.5s refresh or so, more like these examples:

    http://www.uconnshuttle.com/ or

    http://pdxlivebus.com/

    (but without the fancy extra functionality). Someone mentioned I could execute

    setInterval(function() { map.handleBing(); }, 500) 

    to make it update more frequently to result in smoother motion, but either I'm not doing that right or it doesn't work.

     

    Right now I'm just poking around in the console for the page, changing things in main.js. I can increase the size or shape/opacity of the shuttle markers but not much else. Not super sure what I'm doing - where does the location data come from? What controls the display update frequency, is it limited by the free Google Map API key or by something else?

     

    Any pointers appreciated, thanks

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

    [JS] How to get amount of consecutive numbers from an array?

    Posted: 05 Dec 2017 08:07 AM PST

    I have an array of six numbers (1-6) that i need to find the amount of consecutive numbers starting with a 1. For example if my array was [1,2,3,1,2,3] would be two sets of three, for 6 consecutive numbers. [1,5,3,2,1,2] would be 5 consecutive numbers. I can't seem to get this right sorry for the horrible code still learning

    function calculate(current, streak, first) { var returnValues = [current, streak, first]; // The first run check for a 1 if(returnValues[2]) { for(i = 0; i < set.length; i++) { // If there is a 1 change the value to 0 and increase current if(set[i] == 1) { set[i] = 0; returnValues[0] = 2; returnValues[2] = false; } } // If current is still one return streak if(returnValues[0] != 2) { return returnValues; } } // Check for consecutive numbers for(i = 0; i < set.length; i++) { if(set[i] == returnValues[0]) { set[i] = 0; if(returnValues[0] == 2) { returnValues[1]++; } returnValues = calculate(++returnValues[0], ++returnValues[1], false); } } for(i = 0; i < set.length; i++) { if(set[i] == 1) { returnValues = calculate(1, returnValues[1], true); } } return returnValues; } 
    submitted by /u/kingkronik
    [link] [comments]

    What is the name for this web component?

    Posted: 05 Dec 2017 07:45 AM PST

    I see these a lot on website and want to do some more research but can't even find the name of this thing

    Its a cross between a dropdown box and a textfield. As you type things in it filters the dropdown list and shows you only the matching list items

    https://imgur.com/a/5Waie

    example is taken from http://www.nationalexpress.com/home.aspx

    Sorry if this is the wrong sub, couldn't find r/askwebdevelopers

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

    Full stack developers, how is it you're good at programming and design at the same time?

    Posted: 05 Dec 2017 12:28 AM PST

    Or are you offloading some design to others?

    I'm more interested in consultants that actually do everything themselves and have really good frontend experience that can make a div do anything.

    To me frontend (good design) is like draw couple of circles - then draw rest of owl.

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

    No comments:

    Post a Comment