• Breaking News

    Wednesday, January 17, 2018

    Do you ever get the feeling that you're not good or smart enough? Ask Programming

    Do you ever get the feeling that you're not good or smart enough? Ask Programming


    Do you ever get the feeling that you're not good or smart enough?

    Posted: 17 Jan 2018 06:10 PM PST

    I've been working as a developer professionally for about a year and a half now, and just started a new job.

    Granted, it's a new and unfamiliar stack with new and unfamiliar projects, but damn, man. Sometimes I just feel in over my head and like I'm not good enough to figure this shit out.

    Does anyone ever get this? If so, what helps you overcome it? Thanks in advance for the advice. Feeling stressed right now.

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

    Textbook on C (Beginner)

    Posted: 17 Jan 2018 07:58 PM PST

    I've only taken Java 1 so far. Anyone know a good textbook on C?

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

    Having Different Languages 'Work Together'

    Posted: 17 Jan 2018 06:13 PM PST

    Hey, I am interested in writing a programme with a back-end implemented in one language (Python in my case) and a GUI front-end implemented in another (C# in my case). How would I go about doing this?

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

    I am curious what yall think of the answer I came up with to this question in the interview questions of CodeFights

    Posted: 17 Jan 2018 09:04 PM PST

    The question:

    You have a list of dishes. Each dish is associated with a list of ingredients used to prepare it. You want to group the dishes by ingredients, so that for each ingredient you'll be able to find all the dishes that contain it (if there are at least 2 such dishes).

    Return an array where each element is a list with the first element equal to the name of the ingredient and all of the other elements equal to the names of dishes that contain this ingredient. The dishes inside each list should be sorted lexicographically. The result array should be sorted lexicographically by the names of the ingredients in its elements.

    According to the estimated time CodeFights states this problem should take about 20 minutes. It took me a couple of days of playing with (probably about 2 hours total). The reason I am posting is so that more seasoned programmers can tell me what they think of my approach and what I could have done better.

    My code:

    https://pastebin.com/DW8p9BDB

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

    Best way to teach myself C?

    Posted: 17 Jan 2018 11:32 AM PST

    What's the best way to teach myself C? I'd like to obtain a good, working knowledge; enough to write a serious and efficient program. Not one of the lame "lean to write a choose-your-own-adventure" courses. Thoughts on the best way to self-teach?
    EDIT: if it's relevant, I've already done html/css/javascript (including node.js), ruby on rails, bash script, and am familiar with linux.

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

    [Java] Help getting a "combination lock" to "open"

    Posted: 17 Jan 2018 07:42 PM PST

    Hello! I am going through Java Early Objects 6th Edition and attempting the practice programming questions. For this question, I need to build a ComboLock that will unlock if a dial is turned left, then right, then left, and an open() method is called. I have this so far:

    import java.util.Random; public class ComboLock { Random random = new Random(); private static int dial; int slot1; int slot2; int slot3; private static boolean left, right; public ComboLock(){//Constructor slot1 = random.nextInt(39) + 1; slot2 = random.nextInt(39) + 1; slot3 = random.nextInt(39) + 1; } public void reset(){ dial = 0; } public void turnLeft(int ticks){ left = true; dial = ticks; } public void turnRight(int ticks){ right = true; dial = ticks; } public boolean open(){ } 

    }

    The problem is that I don't know to check is someone used turnLeft or turnRight to land on the correct numbers. My line of thinking with this was to set a direction, left and right, and somehow check them at certain steps in open(). But I have no idea how top do that. Please help!

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

    What is the best way to gather JSON data from a URL and store it into a database?

    Posted: 17 Jan 2018 10:45 AM PST

    I'm developing a mobile app that uses json data from a url. The data is updated every few seconds, so I want to have a script/program that reads this data and stores it into a database. This way, the client won't have to make multiple calls to the url, they can just request the data from my database.

    I understand how to develop the code and set up the database, but I'm not sure how to deploy a single script that will run by itself every 2-3 seconds. I've ran scripts to do this in the past, but I used the task scheduler on my laptop which required my laptop to be powered on. What is the best way for me to deploy this script to run all by itself?

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

    Stuck on some calculus in school. Is my programming career over before it starts?

    Posted: 17 Jan 2018 11:30 AM PST

    I'm going into programming. Focused on game design (I found a college and a major for it). I'm in pre-calculus in high school right now. I noticed for my college courses it goes up to calculus 3. I'm stuck. I did find with radians and logs and whatnot. But we're doing more work with sin, cos, arcsin, periods, amplitudes (trigonometry). It's just kicking my ass. I totally feel like I figured it out then did horrible on the test so apparently I suck. Any advice? Also I'm a little confused how some of this is gonna be used in game programming. I'm just lost and a little worried that I won't be able to become a game dev due to failure in calculus. Don't get me wrong I'm trying I just am not succeeding very well. Any advice?

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

    I have a programming interview for an software development internship with SAP next week. They told me it is two hours long with two people the first hour, and two different people the next hour. Anyone have any idea what to expect? I’ve just been doing review questions for SAP from geeks for geeks

    Posted: 17 Jan 2018 12:41 PM PST

    CMD.exe help, command not working?

    Posted: 17 Jan 2018 03:46 PM PST

    Hello guys, i really need your help here, i open cmd and try to put in the command $ pip install -U -r requirements.txt , trying to download spotify playlist, source ( https://github.com/ritiek/spotify-downloader ) but it keeps saying '$' is not recognized as an internal or external command, operable program or batch file. i have system32 in path but still cant seem to get it to work, any ideas??

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

    [Java]Passing command line arguments to a method other than my main method.

    Posted: 17 Jan 2018 08:42 AM PST

    In my main method, I set up a switch statement to deal with multiple arguments from the command line:

    //We need to first declare all variables and objects we need int test;//This will be the number of consecutive pairs Scanner in; PrintWriter out; File f; //We need to set up a default scenario if we don't take in enough arguments from the command line switch(args.length){ case 1: test = Integer.parseInt(args[0]); in = new Scanner(System.in); out = new PrintWriter(System.out); break; case 2: test = Integer.parseInt(args[0]); in = new Scanner(args[1]); out = new PrintWriter(System.out); break; case 3: test = Integer.parseInt(args[0]); in = new Scanner(args[1]); out = new PrintWriter(args[2]); f = new File(args[2]); break; default: test = 3; in = new Scanner(System.in); out = new PrintWriter(System.out); break; } 

    After my main method, I want to make a public static void method that will take in these declared variables and objects:

    public static void checker() 

    The problem is, I don't know how to do this. I could set up the method header to accept (String[] args), but then I would have to re declare my variable and objects inside of the checker method. I was specifically told not to do this, and to keep them inside of the main method. Please explain! Thanks in advance.

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

    Beautiful Soup and Reddit

    Posted: 17 Jan 2018 06:07 AM PST

    Can anyone link me to a resource or does anyone have experience parsing Reddit with Beautiful Soup? I have like 10 pages where I want all the second level comments. I saw some stuff online for getting links from a subreddit, but nothing for parsing comments. Thanks!

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

    How to make an idle site

    Posted: 17 Jan 2018 11:54 AM PST

    So i recently found a guy, he had his own steam idle program. and im wondering how do people make something like that. So my question is, is there somebody in this Reddit that knows how to make an Idle program that runs on a public server.

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

    Open source business intelligence/reporting packages?

    Posted: 17 Jan 2018 11:47 AM PST

    What are some good options for open source reporting packages, along the lines of Business Objects, Microstrategy, or Crystal Reports? Anything that will connect to a web services API as a data source?

    submitted by /u/cville-z
    [link] [comments]

    How can I integrate this Ajax code into this Google Maps Javascript method?

    Posted: 17 Jan 2018 09:54 AM PST

    I'm working on a project and I've encountered a brick wall. I'm trying to add an AJAX snippet of code into this method that is called by a button to search a location on a map. The purpose of adding this AJAX code is so I can pass the ".search_latitutde" and ".search_longitude" variables into longitude and latitude variables in an MVC Spring project. I'm unfamiliar with both Javascript and AJAX so any pointers would be much appreciated!

    Google Map JS code

     var PostCodeid = '#search_location'; $(function () { $(PostCodeid).autocomplete({ source: function (request, response) { geocoder.geocode({ 'address': request.term }, function (results, status) { response($.map(results, function (item) { return { label: item.formatted_address, value: item.formatted_address, lat: item.geometry.location.lat(), lon: item.geometry.location.lng() }; })); }); }, select: function (event, ui) { $('.search_addr').val(ui.item.value); $('.search_latitude').val(ui.item.lat); $('.search_longitude').val(ui.item.lon); var latlng = new google.maps.LatLng(ui.item.lat, ui.item.lon); marker.setPosition(latlng); initialize(); } }); }); 

    Ajax Code

    #firstname and #lastname will be replaced by '.search_longitude' and '.search_latitude'

     $(document).ready(function() { $('#sampleForm').submit( function(event) { var firstname = $('#firstname').val(); var lastname = $('#lastname').val(); var data = 'firstname=' + encodeURIComponent(firstname) + '&lastname=' + encodeURIComponent(lastname); $.ajax({ url : $("#sampleForm").attr("action"), data : data, type : "GET", success : function(response) { alert( response ); }, error : function(xhr, status, error) { alert(xhr.responseText); } }); return false; }); }); 

    If I'm making no sense please feel free to call me out for it!

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

    Senior in college - career switch from neuro to CS - information overload - most efficient route to go from zero to hero?

    Posted: 17 Jan 2018 09:42 AM PST

    I will try to summarize my situation as succinctly as possible. I am a senior at a top university in the U.S. getting a B.Sc. in neuroscience, on semester leave until Fall 2018 (graduating december). I was pre-med and realized it wasn't the track for me (I frame it as divergent creative vs. convergent creative -- I more enjoy projects that are open-ended in "solution" rather than using "creative methods" to converge on the "true solution", as in neuro research). In addition, I am looking at job prospects and recognize that I have a very difficult chance landing a satisfying job as a neuro major since I don't want to continue as a lab rat.

    I recognize that developing CS skill + knowledge will be a huge asset to my future goals (short-term: getting an interesting job; long-term: starting a project or company of my own making).

    Now the further I dig into CS online the more and more confused I am. Dipping deep in the pool of ignorance and experiencing severe information overload. I'm getting lots of little leaves and nuggets of information but with no larger branches to attach them to in my 'semantic tree' of understanding, so I find a lot of the information very jumbled and hazy in my head.

    My question for you all, as I have yet to find this resource online, isn't so much 'where to start' (I'm running through CS50 rn, figuring out GitHub, some other stuff), but what will be most useful in my case to try and land some sort of gig during recruitment season this coming fall (so, 8 months away).

    I realize this will be a huge uphill battle to teach myself, but I'm sure that by cutting out some of the less crucial aspects of CS on the front end may optimize my chances of success in the job search by presenting some real value. Ideally someone who has had a similar situation in changing track somewhat late in the game might PM me or something. I suppose what I'm looking for is a light mentorship/touch-point person as I try and figure out what kind of developer I want to be, as to what kind of tools I pick up in these next few months?

    tl;dr: switching track as a senior majoring in neuro to learning CS, want to land a job this coming recruiting season (fall)(am I delusional), experiencing info overload, what do?

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

    question about execution of stack.pop() in python

    Posted: 17 Jan 2018 09:12 AM PST

    I am working on a program for parenthesis validation.

    def isValid(s): stack = [] dict = {"]":"[", "}":"{", ")":"("} for char in s: if char in dict.values(): stack.append(char) elif char in dict.keys(): print("dic char is", char) for p in stack: print("stack item", p) if stack == [] or stack.pop() != dict[char]: return False else: return False return stack == [] print(isValid("[()]")) 

    Here, for the line if stack == [] or stack.pop() != dict[char]:

    when stack.pop() is executed, is it only valid for the test condition or does it modify the original stack? My logic tells me it shouldn't affect the original stack as it is only an if test and not an instruction for a pop()

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

    IF/END IF Code problem

    Posted: 17 Jan 2018 08:44 AM PST

    Helped a friend put his company website on the internet, He asked me to have a look at the Prices and Defaults section (where i assume he changes prices of stuff etc)

    I know nothing about the inner workings of his website, but i do know enough to know this is not a very complicated problem.. Simple syntax error. I just don't know how to fix it.

    Ideas?

    Line 12 (The error is basically you can't have an if without an End If)

    https://pastebin.com/H6TRXfN1

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

    Can i learn a new language from a tutorial using a older version of the program?

    Posted: 17 Jan 2018 08:41 AM PST

    I'm new to programming and just getting started to learn python 3.7. The thing is that I'm watching a tutorial from version 3.5. Can i still use the tutorial?

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

    Connecting a private blockchain to a wallet application?

    Posted: 17 Jan 2018 08:21 AM PST

    I'm trying to develop a wallet application for this cryptocurrency I created but I'm not able to find any information on how to do it. I came across this article about connecting a private blockchain to an existing application (ethereum apps mostly), is that a solution? If not could you point me towards a tutorial, article or book? Thanks!

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

    Advice for image sharing platform

    Posted: 17 Jan 2018 07:26 AM PST

    We're starting a new project at work and I was asked to look for an application/platform to use. To keep it simple: what we're looking for is something where we can share pictures with our users.

    They should be able to log in and browse the images and search for specific ones. To find a specific picture, they should have 3 options:

    • Navigate a file structure

    • Click on tags

    • Search by name

    After researching this a bit, I think I found a solution in Pimcore DAM. But I read that it's not that easy to begin using it so I'm still not sure.

    Does anyone know of any software, applications or platforms that I should look at? Or does someone have experience with Pimcore?

    Thanks!

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

    How to implement WS-Policy with Java and Axis2?

    Posted: 17 Jan 2018 07:12 AM PST

    I'm doing an exercise using Java and Axis2 to implement some WS-* framework. The only part I had a "tutorial" of sort is implementing the WS-Security framework with Timestamp, Encryption and Signature.

    I have a service folder for the server-side that contains my security keys, the java class with the method to call (a simple sum) and the PWCallback class that it's used for user/password auth. Inside there's the META-INF folder that contains the services.xml file.

    The client folder has the java client, the PWCallback class and an axis2.xml file.

    The axis2.xml and services.xml were already there, I just commented out the part to enable the timestamp etc.

    Now my problem is that I don't know how to integrate ws-policy and ws-secureconnection too.

    Reading online I see a different way of writing the xml file and I don't know where to start.

    I'll post some code now:

    Axis2.xml

    <axisconfig name="AxisJava2.0"> <!-- Engage the security module --> <module ref="rampart"/> <parameter name="OutflowSecurity"> <action> <items>Timestamp Signature Encrypt</items> <user>John</user> <passwordCallbackClass>client.PWCallback</passwordCallbackClass> <signaturePropFile>axis-repo\\conf\\security.properties</signaturePropFile> <signatureKeyIdentifier>SKIKeyIdentifier</signatureKeyIdentifier> <encryptionKeyIdentifier>SKIKeyIdentifier</encryptionKeyIdentifier> <encryptionUser>John</encryptionUser> <signatureParts>Body</signatureParts> <optimizeParts>//xenc:EncryptedData/xenc:CipherData/xenc:CipherValue</optimizeParts> </action> </parameter> <parameter name="InflowSecurity"> <action> <items>Timestamp Signature Encrypt</items> <user>John</user> <passwordCallbackClass>client.PWCallback</passwordCallbackClass> <signaturePropFile>axis-repo\\conf\\security.properties</signaturePropFile> <signatureKeyIdentifier>SKIKeyIdentifier</signatureKeyIdentifier> <encryptionKeyIdentifier>SKIKeyIdentifier</encryptionKeyIdentifier> <encryptionUser>John</encryptionUser> <signatureParts>Body</signatureParts> <optimizeParts>//xenc:EncryptedData/xenc:CipherData/xenc:CipherValue</optimizeParts> </action> </parameter> <!-- ================================================= --> <!-- Parameters --> <!-- ================================================= --> <parameter name="hotdeployment" locked="false">true</parameter> <parameter name="hotupdate" locked="false">false</parameter> <parameter name="enableMTOM" locked="false">true</parameter> <!-- Uncomment this to enable REST support --> <!-- <parameter name="enableREST" locked="false">true</parameter>--> <parameter name="userName" locked="false">admin</parameter> <parameter name="password" locked="false">axis2</parameter> <!-- ================================================= --> <!-- Message Receivers --> <!-- ================================================= --> <!--This is the Deafult Message Receiver for the system , if you want to have MessageReceivers for --> <!--all the other MEP implement it and add the correct entry to here, so that you can refer from--> <!--any operation --> <!--Note : You can ovride this for particular service by adding the same element with your requirement--> <messageReceivers> <messageReceiver mep="http://www.w3.org/ns/wsdl/in-only" class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver"/> <messageReceiver mep="http://www.w3.org/ns/wsdl/in-out" class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/> </messageReceivers> <!-- ================================================= --> <!-- Transport Ins --> <!-- ================================================= --> <transportReceiver name="http" class="org.apache.axis2.transport.http.SimpleHTTPServer"> <parameter name="port" locked="false">6060</parameter> <!--If you want to give your own host address for EPR generation--> <!--uncommet following paramter , and set as you required.--> <!--<parameter name="hostname" locked="false">http://myApp.com/ws</parameter>--> </transportReceiver> <transportReceiver name="tcp" class="org.apache.axis2.transport.tcp.TCPServer"> <parameter name="port" locked="false">6061</parameter> <!--If you want to give your own host address for EPR generation--> <!--uncommet following paramter , and set as you required.--> <!--<parameter name="hostname" locked="false">tcp://myApp.com/ws</parameter>--> </transportReceiver> <!-- ================================================= --> <!-- Transport Outs --> <!-- ================================================= --> <transportSender name="tcp" class="org.apache.axis2.transport.tcp.TCPTransportSender"/> <transportSender name="local" class="org.apache.axis2.transport.local.LocalTransportSender"/> <!--<transportSender name="jms" class="org.apache.axis2.transport.jms.JMSSender"/>--> <transportSender name="http" class="org.apache.axis2.transport.http.CommonsHTTPTransportSender"> <parameter name="PROTOCOL" locked="false">HTTP/1.1</parameter> <parameter name="Transfer-Encoding" locked="false">chunked</parameter> </transportSender> <transportSender name="https" class="org.apache.axis2.transport.http.CommonsHTTPTransportSender"> <parameter name="PROTOCOL" locked="false">HTTP/1.1</parameter> <parameter name="Transfer-Encoding" locked="false">chunked</parameter> </transportSender> <!-- ================================================= --> <!-- Phases --> <!-- ================================================= --> <phaseOrder type="InFlow"> <!-- Global phases --> <phase name="Transport"> <handler name="RequestURIBasedDispatcher" class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher"> <order phase="Transport"/> </handler> <handler name="SOAPActionBasedDispatcher" class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher"> <order phase="Transport"/> </handler> </phase> <phase name="Security"/> <phase name="PreDispatch"/> <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase"> <handler name="AddressingBasedDispatcher" class="org.apache.axis2.dispatchers.AddressingBasedDispatcher"> <order phase="Dispatch"/> </handler> <handler name="SOAPMessageBodyBasedDispatcher" class="org.apache.axis2.dispatchers.SOAPMessageBodyBasedDispatcher"> <order phase="Dispatch"/> </handler> <handler name="InstanceDispatcher" class="org.apache.axis2.engine.InstanceDispatcher"> <order phase="Dispatch"/> </handler> </phase> <!-- Global phases --> <!-- After the Dispatch phase module author or service author can add any phase he wants --> <phase name="OperationInPhase"/> </phaseOrder> <phaseOrder type="OutFlow"> <!-- user can add his own phases to this area --> <phase name="OperationOutPhase"/> <!-- Global phases --> <!-- these phases will run irrespective of the service --> <phase name="MessageOut"/> <phase name="PolicyDetermination"/> <phase name="Security"/> </phaseOrder> <phaseOrder type="InFaultFlow"> <phase name="PreDispatch"/> <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase"> <handler name="RequestURIBasedDispatcher" class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher"> <order phase="Dispatch"/> </handler> <handler name="SOAPActionBasedDispatcher" class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher"> <order phase="Dispatch"/> </handler> <handler name="AddressingBasedDispatcher" class="org.apache.axis2.dispatchers.AddressingBasedDispatcher"> <order phase="Dispatch"/> </handler> <handler name="SOAPMessageBodyBasedDispatcher" class="org.apache.axis2.dispatchers.SOAPMessageBodyBasedDispatcher"> <order phase="Dispatch"/> </handler> <handler name="InstanceDispatcher" class="org.apache.axis2.engine.InstanceDispatcher"> <order phase="Dispatch"/> </handler> <handler name="SecurityInHandler" class="org.apache.rampart.handler.WSDoAllReceiver"> <order phase="Security"/> </handler> </phase> <phase name="Security"> <handler name="SecurityInHandler" class="org.apache.rampart.handler.WSDoAllReceiver"> <order phase="Security"/> </handler> </phase> <!-- user can add his own phases to this area --> <phase name="OperationInFaultPhase"/> </phaseOrder> <phaseOrder type="OutFaultFlow"> <!-- user can add his own phases to this area --> <phase name="OperationOutFaultPhase"/> <phase name="Security"/> <phase name="PolicyDetermination"/> <phase name="MessageOut"/> </phaseOrder> </axisconfig> 

    Services.xml

    <service name="SecureService"> <description> Secure Service </description> <parameter name="ServiceClass" locked="false">SecureService</parameter> <parameter name="InflowSecurity"> <action> <items>Timestamp Signature Encrypt</items> <user>John</user> <passwordCallbackClass>PWCallback</passwordCallbackClass> <signaturePropFile>security.properties</signaturePropFile> </action> </parameter> <parameter name="OutflowSecurity"> <action> <items>Timestamp Signature Encrypt</items> <user>John</user> <passwordCallbackClass>PWCallback</passwordCallbackClass> <signaturePropFile>security.properties</signaturePropFile> </action> </parameter> <operation name="binary"> <messageReceiver class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/> </operation> </service> 

    Thanks

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

    Does anyone know how to the "No valid kits found" for Qt Creator?

    Posted: 17 Jan 2018 06:27 AM PST

    I'm trying to run a project file but it keeps telling me that there is no valid kits found. Anyone had any experience with this?

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

    What object would best represent a stack trace?

    Posted: 17 Jan 2018 05:19 AM PST

    I'm trying to find out what people think a stack trace would look like in real life. My immediate idea is that there would be a polystyrene slab with the stack trace text written on it.

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

    Can You Name These Programming Languages Quiz!

    Posted: 17 Jan 2018 08:08 AM PST

    No comments:

    Post a Comment