• Breaking News

    Sunday, April 29, 2018

    Demotivated programmer, been 2 years on stand-by, wants to get back his drive and passion for coding but don't know where to start. What should I do? Ask Programming

    Demotivated programmer, been 2 years on stand-by, wants to get back his drive and passion for coding but don't know where to start. What should I do? Ask Programming


    Demotivated programmer, been 2 years on stand-by, wants to get back his drive and passion for coding but don't know where to start. What should I do?

    Posted: 29 Apr 2018 12:34 PM PDT

    How do I make the mileage distance be included in the final calculation?

    Posted: 29 Apr 2018 06:38 PM PDT

    When can estimates be accurate?

    Posted: 29 Apr 2018 05:45 PM PDT

    Over several companies I've worked with, I heard Inaccurate Estimates often. Oxymoron huh?

    Is this all tied to making 'accurate' numbers to investors?

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

    Starting out writing a Windows application - what language to use?

    Posted: 29 Apr 2018 09:30 PM PDT

    What should I use - C#, visual basic, something else? I don't have experience with either so what would be better for starting out? Think an enterprise application.

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

    C# extremely strange double behaviour

    Posted: 29 Apr 2018 08:45 AM PDT

    I'm trying to make a make a method to get a double in a range.

    I get super weired results. These are:

    -Different results in Debug and Release

    -Different results if I do the same thing in other phrase

    -Different results if I do a calculation in a try block (never used outside, doesnt return anything)

    My current code is:

    public static double NextDouble(this Random random, double minValue, double maxValue)

    {

    double d = random.NextDouble();

    d *= (maxValue - minValue);

    d += minValue;

    return d;

    }

    If I do Console.WriteLine(random.NextDouble(double.MinValue, double.MaxValue)); it returns mostly 8. If i set a breakpoint I can see that it is actually Infinity, why does it print 8?

    If I use the debug profile it sometimes prints some other values even if it should return Infinity too. Thats my logic: (maxValue - minValue) == Infinity, anything * Infinity == Infinity

    But if I use the release profile it always prints 8

    If I change the code to this:

    public static double NextDouble(this Random random, double minValue, double maxValue)

    {

    double diff = maxValue - minValue;

    double d = random.NextDouble();

    d *= diff;

    d += minValue;

    return d;

    }

    it always prints 8 (both Debug and Release). diff is Infinity as I thought.

    It becomes even more weired!

    With the following code I get random values but only in debug mode. Release gives 8

    public static double NextDouble(this Random random, double minValue, double maxValue)

    {

    return random.NextDouble() * (maxValue - minValue) + minValue;

    }

    If I add this code to the beginning of the method, it is completely random (Release and Debug)

    try

    {

    double diff = (maxValue - minValue);

    }

    catch

    {

    throw;

    }

    Sorry for my bad english.

    If you don't understand something, please don't downvote instantly, ask me please :)

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

    What platform is good for building an audio instructions app?

    Posted: 29 Apr 2018 07:49 PM PDT

    Hi, not sure this is the correct subreddit to post on but just in case...

    So for a class this semester, my project is to create an app that delivers audio instructions (probably mp3). It shouldn't be too complicated, just the audio instructions with a graphic and a "next" and "exit button." I'm not experienced in app building and I was just wondering what a good platform to build this would be? People have told me about Swift/XCode or Bootstrap but I'm not really sure...

    Just as a background I know Java, Python, C++, and a bit of HTML/CSS and Javascript.

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

    Is there a website like SS64.com, but for programming languages.

    Posted: 29 Apr 2018 06:34 PM PDT

    Like the title. is there a website that shows the syntax and gives examples for different programming languages?

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

    [C++] Question about class destructors

    Posted: 29 Apr 2018 08:12 AM PDT

    If I have a class within another class, will the class inside have it's destructor called when the main class goes out of scope? Or will I need to add a delete function inside the larger class's destructor for the inside one.

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

    Using code::blocks IDE, project files not showing up in editor part of window all of a sudden

    Posted: 29 Apr 2018 12:50 PM PDT

    Previously, I had been working on a project #1 without problems.

    I was currently working on a different project #2 and I simultaneously opened the previous project #1 so that I could look at some of its code. I then closed the project #1 files individually by clicking on the x and closing each tab. I then exited the program.

    When I went to reopen the first project#1 by itself, the files didn't show up in the editor.

    The project does appear to be open because if I run and build the program executes and terminates normally.

    I found two threads in c::b forums that seemed like similar problems, but neither solution was apparent/worked for me.

    Why are some of my files not showing up in the code::blocks editor window?

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

    2 Windows Applications must communicate to each other

    Posted: 29 Apr 2018 07:26 AM PDT

    2 applications installed on different locations which is about 20km apart. How can I make the 2 applications communicate with each other? Should I convert the 2 applications to web based? If I convert it to web based what is the best way to do it, should I use cloud services?

    Sample scenario: If there are changes on the first application should reflect on the second application installed on different place (vice-versa) like real time

    Current challenge: Slow internet connection

    I hope someone will help me about this. I am willing to answer your question.

    Thank you.

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

    Fastest Mobile Apps Framework

    Posted: 29 Apr 2018 11:58 AM PDT

    Hi experts!

    So, this is a long shot. But, here goes.

    I need to build a simple mobile app in a space of 1 week. What is the fastest framework that allows me to do that? I can publish in the app store and play store, so preferably not a web app if I can help it.

    I have experience in Ruby / ObjC and a little bit of JS. I'm willing to learn something new, if it allows me to do the job.

    Thanks!

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

    [PHP] Show data when logged in from another table

    Posted: 29 Apr 2018 03:09 PM PDT

    So I have made something like a booking system and I want when the users logs in in his account and makes a book he can be the only one who can see it. Right now you can't see bookings if you are not logged but if you look with different accounts you can see others bookings. I tried to do this:

    $uid = $_SESSION['u_id']; $sql = "SELECT * FROM users WHERE user_uid = '$uid'"; $result = mysqli_query($conn, $sql); 

    I put this in the page where you book it but did not display for anyone who is logged.

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

    Best approach for making a chatbot that can interact with players in a branching choose your own adventure type ebook ?

    Posted: 29 Apr 2018 08:59 AM PDT

    As stated in the title. Im going for somewhat of a hybrid between something like kik messenger chatbot style rpg game and a branching choice ebook. One that would also incorporate checkpoint and skill points that can be invested and affect the outcome of choices on how to handle fights or situations etc. I have a basic understanding of conventional chabot stuff machine learning concepts and such as well. For the purpose of more interaction im considering allowing the player to interact with dialogue in certain contexts with certain characters. Would it be realistic to use a nlp/nlu for this purpose.. I would like the responses to be somewhat original however it would have to be fairly accurate to be able to be used in the context of dialogue in a story..

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

    What can cause my computer to randomly stop hot updating and react tools no longer working?

    Posted: 29 Apr 2018 02:41 PM PDT

    From what I was reading, there doesnt seem to be a common issue for where to begin. React Native JS with expo android.

    • ports blocked/not listening. Nothings changed, I have the same IP.

    • Some watchmen js file stopped working

    • some yarn.lock isnt working(but I deleted them)

    • something with git isnt working

    -something in my program is messing up the async + action/reducer(redux)

    Any suggestions on where to look/begin?

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

    Filling a 2D list with newly generated buttons in C#

    Posted: 29 Apr 2018 07:45 AM PDT

    I am trying to create a spaced grid of buttons (so like the buttons are not flush together, there's a gap between them). However I need each button to not effect the others (I plan for them to be modified after being clicked on, all of them will call the same method). Thanks in advance!

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

    Large CSV File

    Posted: 29 Apr 2018 01:18 PM PDT

    so I am working on a project that reads, parses, and writes a MASSIVE csv file. The part I am focusing on right now is population of each region of earth. With each region there are three categories of population split into age. Population 1-15, Population 15-65, and Population 65+, I am writing this all in python and have come across some problems I cannot figure out. I will paste the code and explain further

    from tkinter import *

    from tkinter import filedialog

    import csv

    root = Tk()

    root.geometry("500x600")

    with open("REGION.csv", "r") as csv_file:

    csv_reader = csv.DictReader(csv_file)

    for line in csv_reader :

    print(line ["REGION_ID"])

    print(line ["POPULATION_15"])

    print(line ["POPULATION_15_65"])

    print(line ["POPULATION_65"])

    lbl1 = Label(root, text = "Enter orginal population (Estimate, Past figures only)").pack()

    orpop = Entry(root).pack()

    mainloop()

    (code may be a little sloppy, it is my first project.) Ok, now, they are about 2806 regions, and all have 3 categories of pop, now, the first thing i want to do is add all of the populations of all regions, so POPULATION_15 + POPULATION_15_65 + POPULATION_65 if someone can give me that code it would be appreciated. Next I prompt the user to give a population in the past, a TOTAL of earth. then, the program will divide that population from the original one, then split it up evenly into three categories and all the regions. After all that it would export a new file of the new data.

    Total pop divided by population less then orginal given by user, the ratio would be given of how much the populations of all three categories of each region would need to be reduced. like if you enter a population that was half of it was today, it would reduce all the populations by 50%. Whatever way works aslong as it gets the job done

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

    Cmake/make error on Mac OS but not Linux

    Posted: 29 Apr 2018 03:21 AM PDT

    I've never seen this error before....

    Using Mac OS 10.12.6 (I think this is the newest?), I'm trying to compile the following, from the repo here:

    https://github.com/D-Lo/bamdb

    So I clone the repo and try to compile with cmake:

    $ cd bamdb $ ls CMakeLists.txt Dockerfile LICENSE Singularity cmake include src $ mkdir build $ cd build $ cmake .. -- The C compiler identification is AppleClang 9.0.0.9000039 -- The CXX compiler identification is AppleClang 9.0.0.9000039 -- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc -- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ -- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found CK -- Found ZLIB: /usr/local/lib/libz.dylib (found version "1.2.11") -- Found HTSlib -- Found LMDB -- Configuring done CMake Warning (dev): Policy CMP0042 is not set: MACOSX_RPATH is enabled by default. Run "cmake --help-policy CMP0042" for policy details. Use the cmake_policy command to set the policy and suppress this warning. MACOSX_RPATH is not specified for the following targets: libbamdb This warning is for project developers. Use -Wno-dev to suppress it. -- Generating done -- Build files have been written to: /Users/username1/bamdb/build $ ls CMakeCache.txt CMakeFiles Makefile cmake_install.cmake $ make Scanning dependencies of target bamdb [ 12%] Building C object CMakeFiles/bamdb.dir/src/bam_api.c.o [ 25%] Building C object CMakeFiles/bamdb.dir/src/bam_lmdb.c.o [ 37%] Building C object CMakeFiles/bamdb.dir/src/bamdb.c.o /Users/username1/bamdb/src/bamdb.c:203:1: warning: unused function 'read_file' [-Wunused-function] read_file(samFile *input_file, offset_list_t *offset_list) ^ 1 warning generated. [ 50%] Linking C executable bamdb [ 50%] Built target bamdb Scanning dependencies of target libbamdb [ 62%] Building C object CMakeFiles/libbamdb.dir/src/bam_api.c.o [ 75%] Building C object CMakeFiles/libbamdb.dir/src/bam_lmdb.c.o [ 87%] Building C object CMakeFiles/libbamdb.dir/src/bamdb.c.o /Users/username1/bamdb/src/bamdb.c:203:1: warning: unused function 'read_file' [-Wunused-function] read_file(samFile *input_file, offset_list_t *offset_list) ^ 1 warning generated. [100%] Linking C shared library libbamdb.dylib Undefined symbols for architecture x86_64: "_bam_destroy1", referenced from: _get_bam_row in bam_api.c.o _deserialize_func in bam_lmdb.c.o "_bam_hdr_dup", referenced from: _write_row_subset in bamdb.c.o "_bam_hdr_write", referenced from: _write_row_subset in bamdb.c.o "_bam_init1", referenced from: _get_bam_row in bam_api.c.o _convert_to_lmdb in bam_lmdb.c.o _write_row_subset in bamdb.c.o "_bam_write1", referenced from: _write_row_subset in bamdb.c.o "_bgzf_close", referenced from: _write_row_subset in bamdb.c.o "_bgzf_open", referenced from: _write_row_subset in bamdb.c.o "_bgzf_seek", referenced from: _get_bam_row in bam_api.c.o _write_row_subset in bamdb.c.o "_hts_open", referenced from: _get_bam_rows in bam_lmdb.c.o _write_row_subset in bamdb.c.o _generate_index_file in bamdb.c.o "_mdb_cursor_close", referenced from: _writer_func in bam_lmdb.c.o _get_offsets in bam_lmdb.c.o "_mdb_cursor_get", referenced from: _get_offsets in bam_lmdb.c.o "_mdb_cursor_open", referenced from: _writer_func in bam_lmdb.c.o _open_ro_handle in bam_lmdb.c.o "_mdb_cursor_put", referenced from: _writer_func in bam_lmdb.c.o "_mdb_dbi_close", referenced from: _writer_func in bam_lmdb.c.o "_mdb_dbi_open", referenced from: _writer_func in bam_lmdb.c.o _open_ro_handle in bam_lmdb.c.o "_mdb_env_close", referenced from: _writer_func in bam_lmdb.c.o "_mdb_env_create", referenced from: _set_up_lmdb_env in bam_lmdb.c.o "_mdb_env_open", referenced from: _set_up_lmdb_env in bam_lmdb.c.o "_mdb_env_set_mapsize", referenced from: _set_up_lmdb_env in bam_lmdb.c.o "_mdb_env_set_maxdbs", referenced from: _set_up_lmdb_env in bam_lmdb.c.o "_mdb_env_sync", referenced from: _writer_func in bam_lmdb.c.o "_mdb_strerror", referenced from: _writer_func in bam_lmdb.c.o _get_offsets in bam_lmdb.c.o _open_ro_handle in bam_lmdb.c.o _set_up_lmdb_env in bam_lmdb.c.o _commit_transaction in bam_lmdb.c.o "_mdb_txn_abort", referenced from: _get_offsets in bam_lmdb.c.o "_mdb_txn_begin", referenced from: _writer_func in bam_lmdb.c.o _open_ro_handle in bam_lmdb.c.o "_mdb_txn_commit", referenced from: _commit_transaction in bam_lmdb.c.o "_sam_hdr_read", referenced from: _convert_to_lmdb in bam_lmdb.c.o _get_bam_rows in bam_lmdb.c.o _write_row_subset in bamdb.c.o "_sam_read1", referenced from: _get_bam_row in bam_api.c.o _convert_to_lmdb in bam_lmdb.c.o _write_row_subset in bamdb.c.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: *** [libbamdb.dylib] Error 1 make[1]: *** [CMakeFiles/libbamdb.dir/all] Error 2 make: *** [all] Error 2 

    Is this a make error? A Cmake error? I don't seem to have this issue on Linux

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

    Looking to get started learning to program

    Posted: 29 Apr 2018 06:06 AM PDT

    Hi guys. I am looking to start learning to program and take courses in this i.e. Java or software engineering. I am pretty good with computers generally, but I think there are some big basic gaps in my knowledge too. So before I look to take a course - what should I look to learn and know in order to make sure I have the basics of PC/software knowledge sorted. At the moment I think i am going to go through and make sure I know the basics and terminology for the following areas: Hardwares General PC basics - i.e. how my PC works Internet How Softwares work and interact Common IT problems/solutions

    Any suggestions/tips/advice helpful.

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

    Recommendations for git server

    Posted: 29 Apr 2018 05:39 AM PDT

    Hi all- I use GitHub a lot and my employer's instance of GitLab (the fancy kind). I need a private repo for the first time and GitHub wants $25/month! Heck no.

    I see GitLab has a free version, but I'm sure there are other worth considering. Anyone have strong recommendations? I'm plenty proficient in CLI but I would still like a decent web frontend UI. Other than that I'm open.

    PS - should've added I'm hosting with AWS, if there are any "tuned" for that.

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

    How do I solve this variant of Knapsack problem?

    Posted: 29 Apr 2018 07:05 AM PDT

    Bob wants to create a rod made of metals. The metals can be made of either Iron, Chromium, Aluminium, Silver or Gold (he need not use all five types of metals).

    Each metal has a value associated with it's strength as follows:

    • -2 for Iron
    • -1 for Chromium
    • 0 for Aluminium
    • 1 for Silver
    • 2 for Gold

    Each metal also has a cost given by I, C, A, S and G for the respective metal.

    You are given q queries. In each query, find the minimum cost for creating a rod using exactly M metals and overall strength of N.

    Overall strength N is defined as the sum of strength of each metal used in the rod.

    Input:

    First line contains 5 space separated integers I, C, A, S, G, the respective cost of metals. Next line contains q the number of queries next q lines had two integers M and N, the number of metals to be used and the overall strength.

    Output:

    For each query, output the answer in a new line. Output the minimum cost if it exists otherwise print -1.

    Constraints:

    • 1 ≤ q ≤5 * 10^5
    • 0 ≤ I, C, A, S, G ≤ 10^6
    • 0 ≤ M ≤ 100
    • −200 ≤ N ≤ 200

    Eg:

    Input:

    1 2 2 3 4

    3

    2 0

    1 -2

    3 6

    Output:

    4

    1

    12

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

    Balance process of writing into databases

    Posted: 29 Apr 2018 12:54 AM PDT

    Suppose we want in our application store each request to Redis databases but we may have more than one database and how we can balance data storing among available databases? and order of filling databases how could be?

    For example, we considered 4 databases with the followings percent of requests size:

    - DB1: 15% of requests

    - DB2: 20% of requests

    - DB3: 25% of requests

    - DB4: 15% of requests

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

    I want to use a huge file (image dataset) for a project, and it doesn't fit on my hard disk. What can I do about this? Is there some free cloud solution I can download the file to?

    Posted: 29 Apr 2018 12:48 AM PDT

    I am running a machine learning algorithm on several different datasets, and I want to add the 80 Million Tiny Images dataset. This is a last minute addition to an existing project, so I do not have time to implement something complicated. I just want to put the code somewhere where I can run a few scripts on it which I have already written and applied to other data.

    I also don't want to have to pay for anything, as this is for a school project.

    Another thing is that I do have access to my school's research cluster, but I don't know how to use it, and I'm not sure how much storage space I am allocated. I'm also not sure if there is a way to call a download link from a URL to download onto the cluster.

    Any advice would be much appreciated.

    //Thank you for reading

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

    Can anyone give me a starting point for a mobile app that searches through a list of items?

    Posted: 29 Apr 2018 12:30 AM PDT

    Hey,

    I've been tasked with creating either a mobile app, preferably for both iphone and android, or a website. On this application, I need there to be a text box where the user would enter search terms, and the application would return an item from a list, as well as an image of the item, and some other information. I already have a website that has the names of items stored in this format:

    item.xxxx = Item Name.

    The x's are replaced by the item's item code, which I can then use to get a small thumbnail of the item. These images are also stored online.

    In case this is unclear, here is an example:

    I'm a user looking for a Can of Red Pop. I open my app, or my website, and in the search box type Can of Red Pop. The application would then search through the list of items, find "Can of Red Pop" which is stored as item.2765 = Can of Red Pop, take the item code and place it into the url (which looks like example.com/items/item_2765.png). Then, displayed to the user, would be the name "Can of Red Pop," the picture, and some other information.

    There are several thousands of items, and I have a lot of time to do this project. I'm a beginner with this whole thing, though, so any help would be appreciated. If it cannot be done, let me know. Thanks for your help!

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

    Help with Regex? Trying to find an nth occurrence of something. [java]

    Posted: 28 Apr 2018 11:13 PM PDT

    Hi, i'm trying to use regex in java to achieve a certain goal.

    I'm trying to essentially split this raw data to an array using regex.

    4/12/17, 4:34:46 pm: Me: just finished ☺

    4/12/17, 4:39:17 pm: GF: Cool

    4/12/17, 4:39:33 pm: GF: The dreamology margins is so messed up

    4/12/17, 4:39:56 pm: Me: oh :/

    4/12/17, 4:39:58 pm: Me: i'll fix it up

    4/12/17, 4:40:23 pm: Me: looks fine on my pc

    4/12/17, 4:40:25 pm: Me: take a photo of it

    I want to split via the first , To get the date. the : between pm/am and the name so i can get the time. And then just the message.

    4/12/17, 4:40:25 pm: Me: take a photo of it

    so basically this should become like this.

    4/12/17 (SPLIT) 4:40:25 pm (SPLIT) Me (SPLIT) take a photo of it. [0] [1] [2] [3]. 

    Would this be possible with regex? I'm still trying to learn it but it's doing my head in. Cheers

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

    No comments:

    Post a Comment