• Breaking News

    Wednesday, October 24, 2018

    We've got a great idea/project, should we give it to our employer? Ask Programming

    We've got a great idea/project, should we give it to our employer? Ask Programming


    We've got a great idea/project, should we give it to our employer?

    Posted: 24 Oct 2018 10:51 AM PDT

    Not sure if this should go here or on /r/LegalAdviceUK but you guys are nicer so we'll start here...

    A colleague had a great idea for a web app and asked be to build it for them. It's a pretty tight concept with some potential for monetization and we're debating whether to pitch it to our employer to see if they want to invest in it or to keep it ourselves and go it alone.

    We're also wondering whether our employer owns it by default because they pay us to do similar things at work.

    tldr; profitable idea, should we give it to work, do we even own it and the proof of concept at all?

    UPDATE: at least in my contract, intellectual property is limited to "any work you do in the course of your employment with the Company" but I'm going to check this with a lawyer. Our company doesn't employ us to build web-apps but it does own two web-apps already so would be interested in getting behind the project.

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

    Is there any way to stop code running from another account using terminal on my user account(mac)

    Posted: 24 Oct 2018 09:28 PM PDT

    Optimal data structure and algorithm for a transport problem

    Posted: 24 Oct 2018 11:11 AM PDT

    I am trying to create a module for planning routes. Given is a train/subway/roads system-like graph, and requests come in from trains/taxis for taking a path from a node to a destination node. I'd like to plan all these orders 'safely', such that, i.e. the trains are at least some units apart.

    My plan for the approach has a graph with nodes, where each node has some sort of tree, but I can't decide how I would continue and implement the algorithm and whether the data structure is optimal. Path-finding algorithm used doesn't matter. Carriages (trains/taxis) don't need to wait at stops but go directly.

    What are 'good' implementations for this problem? I am creating a sample right now in Python, but any language is fine.

    TL;DR: Shortest path-algorithm with multiple 'trains' at different times without collisions

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

    Why wont this linux program work properly?

    Posted: 24 Oct 2018 05:58 PM PDT

    The grave symbols are in the correct places they just aren't appearing in this post for some reason. Maybe it's because I'm on mobile.

    start()

    {

    hotelInfo

    custInfo

    creditCardInfo

    roomPrice

    nights

    roomType

    calculateCost

    displayBill

    }

    hotelInfo()

    {

    HotelName="Rainbow Inn"

    HotelAddress="383 Rainbow Ave."

    HotelCity="Las Vegas"

    HotelState="Nevada"

    HotelZip="13869"

    HotelPhoneNumber="318-666-1134"

    }

    custInfo()

    {

    echo "What is your first and last name?"

    read name

    echo "What is your address?"

    read address

    echo "What is your city?"

    read city

    echo "What is your state?"

    read state

    echo "What is your zip code?"

    read zipcode

    }

    creditCardInfo()

    {

    echo "What is the name on the card?"

    read cardname

    echo "What is the credit card number?"

    read cardnumber

    echo "What is the experationdate?"

    read expdate

    echo "What is the card type?"

    read cardtype

    }

    roomPrice()

    {

    king=125

    queen=90

    suite=175

    tax=20

    }

    nights()

    {

    echo "How many nights will you be staying?"

    read nightsstaying

    }

    roomType()

    {

    echo "What room type do you want king, queen, or suite?"

    read roomType

    }

    calculateCost()

    {

    case $roomType in

    King)total=expr $kingPrice \* $nights

    taxTotal=expr $tax \* $nights

    billTotal=expr $total + $taxTotal

    roomprice=$kingPrice ;;

    Queen)total=expr $queenPrice \* $nights

    taxTotal=expr $tax \* $nights

    billTotal=expr $total + $taxTotal

    roomprice=$queenPrice ;;

    Suite)total=expr $suitePrice \* $nights

    taxTotal=expr $tax \* $nights

    billTotal=expr $total + $taxTotal

    roomprice=$suitePrice ;;

    esac

    }

    displayBill()

    {

    clear

    echo "$HotelName"

    echo "$HotelAddress"

    echo "$HotelCity" "$HotelState" "$HotelZip"

    echo "$HotelPhoneNumber"

    echo "--------------------------------"

    echo "$name"

    echo "$address"

    echo "$city" "$state" "$zip"

    echo "Room Type" "$roomType"

    echo "Rate Night" "$roomPrice"

    echo "Total Cost" "$calculateCost"

    echo "Tax" "$taxTotal"

    echo "__________________________________"

    echo "Total" "$billTotal"

    }

    start

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

    What would be required to make a start-up freelancing website?

    Posted: 24 Oct 2018 07:08 AM PDT

    Hi, my apologies if this is the wrong sub.

    In a nutshell, I have an idea for a startup involving freelancing. I know there are a million websites out there, like Fiverr, Upwork, and Odesk, but my market is unique, so please humor me.

    Main Features:

    • Logins and profiles for freelancers and users

    • Secure chat and document transfer between freelancer and users

    • Payments processing & escrow

    • Multiple language support

    The costs I can calculate once I have an idea of the technical requirements i.e. how many programmers of which language, how many graphic designers. Essentially, I am asking; "what would be required to get this done in a year +/-?"

    Marketing, sales, and finding investors are not relevant to this question.

    I realize there are a lot of things that I don't know, and a bunch more that I don't know that I don't know, which is why I'm looking for a jumping-off point here.

    Thank you for your advice.

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

    why put all js event listeners in the document ready function?

    Posted: 24 Oct 2018 11:38 AM PDT

    new to js/jquery trying to understand the fundamentals. how does the document ready function work and how do the event listeners get called inside it? thanks

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

    What exact amount of information Monty Hall gave his players?

    Posted: 24 Oct 2018 02:19 PM PDT

    I'm talking about Monty Hall paradox.

    If you don't know/remember what it is: You have 3 doors, one of them hides car of your dreams. You can win a car if you guess where it is. You pick a door, and Monty opens one of another doors, which has no car, and suggest you to change you choice.

    While most people intuitive think that it does not matters, two doors have 0.5 probability of win, actually it's not, because host gave you information about initial location of items, so if you change your choice, you'll double your chances (from 1/3 to 2/3). The question is: what exact amount of information he gave you?

    I have my own answer (obviously it's <1 bit) but I'm not sure in it, so i'm wondering what you guys think.

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

    Predicting a presidential election involving monte carlo simulations

    Posted: 24 Oct 2018 01:36 PM PDT

    WE ARE USING JAVA

    Using a bookmaker we take odds and turn them into probabilities

    candidate A=1/50(98%)

    candidate B=20/1(4.8%)

    candidate C=33/1(2.9%)

    candidate D=50/1(2%)

    candidate E=150/1(0.7%)

    candidate F=200/1(0.5%)

    we are asked to calculate the probability that candidates b,c and f will finish last in any order. Then we are given this recommendation

    "First, turn the odds into probabilities. Then you could stage battles between the candidates to take a particular place. For example, candidate A is 98% likely to win. So create a random double between 0 and 1, and if it's anywhere between 0 and 0.98, candidate A is in first place. Then to decide second place, create a random number between 0 and whatever probability is left, and see if the number comes out in candidates B's favour etc. So you stage an election in this way, then rerun thousands of times. "

    I get lost when he says

    " Then to decide second place, create a random number between 0 and whatever probability is left, and see if the number comes out in candidates C's favour etc"

    Does this mean that I am supposed to take 0.02 and run the test again for candidate B if candidate A wins.

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

    Multiple Tkinter windows running on Raspberry Pi

    Posted: 24 Oct 2018 06:56 AM PDT

    I am writing a Python script to display a live graph of sensor data, and I also need to display a timer, as well as the decimal value of the sensor data in a window. So I need to have the live graph, which is a MatPlotLib, and then two independent Tkinter windows displayed on top of the graph. I am unsure of how to do this, or if it is even possible. Do i have to use threading, or is there another way around it?

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

    (Homework Help, C++) Translator using ifs

    Posted: 24 Oct 2018 08:54 AM PDT

    Hey oh. This is a homework question so if someone could explain to me where I am messing up rather than just fixing my error I'd appreciate it. Professor wanted us to make a program that would translate text into a Morse code like language. I've got everything working but no matter what I enter in as a string to be translated the program only converts the letters into the Morse code for A. Here is my function below.

    void translate (string X){ int length = X.length(); for (int I =0; I < length; I++;){ if (X[I] == 'A' || 'a'){ cout<<"+-----x"; } else if (X[I]......

    And then it continues through the whole alphabet. It spits out only +-----x no matter what the char in the place of X[I] is. Why is this?

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

    Control the execution of a function by changing a variable (python)

    Posted: 24 Oct 2018 10:30 AM PDT

    So I want to create a function which changes a variable from simulationStatus = "Pending" to simulationStatus = "Running". I want to create another function which is executed once this variable has changed. I've tried using if statements to say:

    If simulationStatus == "Running": function()

    But the problem is that this if statement only acts at the start, when simulationStatus = "Pending", so it doesn't execute the new function. The if statement doesn't recognize when I change the variable. How can I get the function in the if statement to execute when I change that variable?

    Thanks

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

    jquery help

    Posted: 24 Oct 2018 09:46 AM PDT

    Hello good people.

    I need help with some code. I know that this is easy, but i just dont know how to do this.

    In this jQuery code i have added table but i have to much repeat variable 'input'. If someon can help me how to do it without so much repeating (with some function or something) i would be very grateful

    Here is the code: https://jsfiddle.net/8nhjgyc3/

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

    How can I change the order of a nested array based on a value held inside the inner arrays of the 2D array? [ Typescript / Javascript ]

    Posted: 24 Oct 2018 02:03 AM PDT

    So I had multiple accounts, and each account had multiple transactions(an array of transaction details) and I needed an array with all the transactions in it, so I used a loop on the accounts to take the transaction arrays of each one and place them into a new array allTransactions .

    The problem is that they are now not ordered by time but in relation to the array they came from. e.g. First it's the transactions from account 1 in the loop (ordered by time), then the transactions from account 2 (ordered by time), then account 3 , etc., etc.

    How can I manipulate this 2D array to reorder the elements based on the time value which is held inside each of the inner arrays?

    The array I want to reorder looks like this

    0: amount: "44.0000000" asset_code: "myasset" asset_issuer: "myissuer" asset_type: "credit_alphanum4" created_at: "2018-10-23T15:47:49Z" effects: Æ’ (r) from: "myaccount1" id: "22" paging_token: "22" precedes: Æ’ (r) self: Æ’ (r) source_account: "myaccount1" succeeds: Æ’ (r) to: "account2" transaction: Æ’ (r) transaction_hash: "2828383jjdijdijdiej" type: "payment" type_i: 1 _links: {self: {…}, transaction: {…}, effects: {…}, succeeds: {…}, precedes: {…}} __proto__: Object 1: {_links: {…}, id: "22", paging_token: "22", source_account: "myaccount1", type: "payment", …} 2: {_links: {…}, id: "33", paging_token: "33", source_account: "myaccount1", type: "payment", …} 3: {_links: {…}, id: "22", paging_token: "22", source_account: "myaccount1", type: "payment", …} 4: {_links: {…}, id: "22", paging_token: "22", source_account: "myaccount1", type: "payment", …} 5: {_links: {…}, id: "33", paging_token: "33", source_account: "myaccount1", type: "payment", …} 6: {_links: {…}, id: "22", paging_token: "22", source_account: "myaccount1", type: "payment", …} 7: {_links: {…}, id: "44", paging_token: "44", source_account: "account3", type: "payment", …} 8: {_links: {…}, id: "55", paging_token: "55", source_account: "myissuer", type: "payment", …} 9: {_links: {…}, id: "22", paging_token: "22", source_account: "myaccount1", type: "payment", …} 10: {_links: {…}, id: "22", paging_token: "22", source_account: "myaccount1", type: "payment", …} 11: {_links: {…}, id: "33", paging_token: "33", source_account: "myaccount1", type: "payment", …} 12: {_links: {…}, id: "22", paging_token: "22", source_account: "myaccount1", type: "payment", …} 13: {_links: {…}, id: "44", paging_token: "44", source_account: "account3", type: "payment", …} 14: {_links: {…}, id: "55", paging_token: "55", source_account: "myissuer", type: "payment", …} 

    I've been struggling for hours so appreciate any help.

    Thank you.

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

    How can i allow only specific ip's to access a site?

    Posted: 24 Oct 2018 01:47 AM PDT

    I want to test an app that i did so i need to give access to others colleagues but i want to allow only their ip's to access to the URL. How can i do this?

    My hosting is linux server, Cpanel, shared hosting...

    submitted by /u/Don-g9
    [link] [comments]

    Code in Labview

    Posted: 24 Oct 2018 01:35 AM PDT

    I need help with detecting tetris shapes in a image taken with a webcam. I have had success in a controlled environment, but when the lighting in the room starts to Chang my program breaks. Can someone please help me?

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

    [Angular] Dynamic header animation based on scroll position within page.

    Posted: 23 Oct 2018 11:34 PM PDT

    TLDR; How can I dynamically change a component's tag to fade out the previous input, and fade in the next input based on scrolling on a page, which the component lives on.

    I have a component called "custom-header", which for simplicities sake of this question, has a HTML tag

    <h2> {{ Name }} </h2>

    custom-header lives on a page called Home. When a user scrolls within Home, the header will change the name value, by fading it out, and fading the new name value into the view (provided by Home). The only issue I am having, is how to conceptually pass the value change to the custom-header component.

    I was thinking about using intersectionObserver and <ng-content></ng-content>, but I am not sure how I would go about fading out one value while fading in the other at the same time.

    Some thoughts I had were to constantly keep track of a previous, current and next value for the header, and then after a certain threshold on the page, change the values.

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

    No comments:

    Post a Comment