• Breaking News

    Sunday, March 24, 2019

    What are the best practices for repository names in a github organization? Ask Programming

    What are the best practices for repository names in a github organization? Ask Programming


    What are the best practices for repository names in a github organization?

    Posted: 24 Mar 2019 04:01 PM PDT

    New to NLP, training model to summarize text. Point me in a direction please! :)

    Posted: 24 Mar 2019 01:44 PM PDT

    I very much appreciate any advice in figuring out what direction i should take with a project. I have been given 7600 page pdf of labor contracts/policies, and a 4 page excerpt regarding employee compensation (salary, raise increments, overtime etc..), and asked for this:

    1. Use natural language processing tools to establish training and test datasets based on the information in the provided contracts, or other relevant corpus, with regard to employee compensation. You may want to exclude the text contained in the excerpt in this step.
    2. Use the datasets to train a machine learning model.
    3. Use the model to extract and summarize the employee compensation information from the excerpt.
    4. Organize the information in a format that can be utilized by applications.
    5. Create a simple application that allows users to search and display the organized information.

    Im reading into the extractive model of summarization not sure is abstractive is a good solution here,...what do you think is meant by step 4 and 5? How can i make it searchable? Is indexing needed?

    Thank you!!

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

    [Java] Help with Iterating a linked list

    Posted: 24 Mar 2019 06:22 PM PDT

    Hello! I'm working on a prime factorization project and I need help with a small thing. I'm using a linked list, and I have a class for Nodes, and an iterator for amending the list. I can't seem to figure out how to set what will be the previous and next nodes in the list when I initialize the node. I'll post my code for example.

    private LinkedList<Node> x = new LinkedList<Node>(); private Node head; private Node tail; public PrimeFactorization(long n){ // initializes linked list 'x' and factors a number n into primes and their respective multiplicities } private class Node{ PrimeFactor pFactor; public Node next; // this is where I need help; How do I set the next and previous nodes from within node? public Node previous; public Node(int p, m){ // initiializes node to be inserted into linked list pFactor = new PrimeFactor(p,m); } public class PrimeFactor{ private int prime; private int multiplicity; public PrimeFactor(int prime, int multiplicity){ this.prime = prime; this.multiplicity = multiplicity; } } private class PrimeIterator implements ListIterator<PrimeFactor>{ private Node cursor = head.next; private pending = null; private int index = 0; public PrimeIterator(){ // positions cursor before smallest prime factor } public hasNext() public hasPrevious() public next() public previous() public add() public remove() } 
    submitted by /u/CanHeWrite
    [link] [comments]

    Using google maps api for js, but my project is in c#

    Posted: 24 Mar 2019 05:25 PM PDT

    Im trying to use the google maps api for js in my current project, i have a problem getting markers, since the old marker api was deprecated, before i could send data to this url http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld= and get a marker with label,color and style, but now im forced to use the new api and it requires javascript, this is a server side project, so i was thinking to create a simple rest service, send the entity color, label and style to the service, and then with js, consume that service and use the api, but what i want to know is where will that json be allocated or where/how should i store it, i want that data to be temporal.

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

    Can anyone help me reason about using RAII in a minimax search?

    Posted: 24 Mar 2019 03:38 PM PDT

    I have a class that describes a system's state.

    class Game_state { stack<Move> history; perform(Move); wind_back_last_move(); Game_state(Game_state); // prohibitively slow } 

    I then have a minimax search

    int minimax(Game_state& state, int depth, bool maximizingPlayer) { if(depth==0) { return heuristic(state); } if(maximizingPlayer) { value = -LARGE_SCORE; for(const auto& move : movelist(state)) state.perform(move); value = max(value, minimax(state, depth − 1, false)); state.wind_back_last_move(); } return value; } else { value = LARGE_SCORE; state.perform(move); for(const auto& move : movelist(state)) state.perform(move); value = min(value, minimax(state, depth − 1, true)); state.wind_back_last_move(); } return value } 

    I would love to be able to use RAII to do the move wind back, the same way lock_guard frees a mutex. Can anyone point me to a good resource on this kind of pattern and also advise on whether this is a sensible idea in this instance?

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

    Functional Programming -- Which to learn in 2019?

    Posted: 24 Mar 2019 02:16 AM PDT

    Hi there,

    I'm looking to learn functional programming. I know PHP, JavaScript, some Java and C#. and looking to expand my horizons.

    Of which functional programming languages would you recommend to learn?

    • Clojure
    • Elm
    • Erlang
    • F#
    • Haskell
    • Lisp
    • OCamel
    • PureScript
    • Scala

    Not really looking to learn anything web-based as I'd like to expand my skillset in other grounds not web-based.

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

    JavaFX help

    Posted: 24 Mar 2019 02:23 PM PDT

    I got a small problem in JavaFX. I have declared an int outside of a loop and I am trying to change the value of the int from inside the loop. How would I do that?

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

    [JAVA] Help with multi threading in java

    Posted: 24 Mar 2019 01:34 PM PDT

    Hello all,

    I have created a small multi threaded solution to the Dining Philosophers problem, where I have used Thread.sleep() to achieve some level of protection from deadlock. I read on multiple blogs that this is a very lazy coding practice. I want to do it using semaphores instead. I have a theoretical understanding of semaphores but I cannot practically implement them (I tried)So any kind of help would be greatly appreciated.

    Following is the code I've developed:

    import java.util.Random; import java.util.Vector; /** A class implementing the Dining Philosphers */ public class Philosopher extends Thread { protected static Random random = new Random(); // randomize protected int me; // number for trace protected Integer left, right; // my chopsticks public Philosopher (int me, Integer left, Integer right) { this.me = me; this.left = left; this.right = right; } /** philosopher's body: think and eat 5 times */ public void run () { for (int n = 1; n <= 5; ++ n) { System.out.println(me+" thinks"); try { Thread.sleep((long)(random.nextFloat()*1000)); } catch(Exception e) { e.printStackTrace(); } System.out.println(me+" is trying to eat"); synchronized ( left ) { synchronized ( right ) { System.out.println("\t" + me+" eats"); try { Thread.sleep((long)(random.nextFloat()*1000)); } catch(Exception e) { e.printStackTrace(); } } } System.out.println("\t" + me+" leaves"); } } /** sets up for 5 philosophers */ public static void main (String args []) { Integer f[] = new Integer[5]; for (int n = 0; n < 5; ++ n) f[n] = new Integer(n); Philosopher p[] = new Philosopher[5]; p[0] = new Philosopher(0, f[4], f[0]); // backwards for (int n = 1; n < 5; ++ n) p[n] = new Philosopher(n, f[n-1], f[n]); for (int n = 0; n < 5; ++ n) p[n].start(); } } 

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

    How do I download and read the UESP wiki?

    Posted: 24 Mar 2019 09:46 AM PDT

    The link for downloading it is here: https://en.uesp.net/wiki/UESPWiki:Database_Download

    However, I don't know what to do with the data dumps. Any help would be appreciated

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

    Can I make a widget on windows lock screen?

    Posted: 24 Mar 2019 12:44 PM PDT

    I am planning to make a widget for windows on the lock screen like spotify. I tried to look it up, but I didn't find any solution. Is there anything that can help me?

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

    [Java] Need guidance on Java REST services

    Posted: 24 Mar 2019 11:08 AM PDT

    Greetings Programmers!

    I hope that someone can give me some guidance regarding this project I got. I already have some programming experience, I just never made something similar to this so it is new to me. Sorry for the long post it's just that the task is very long and descriptive.

    Ultimate goal will be to create two services, service A and service B, and use a messaging system to connect them to single business process.

    ##### Mandatory criteria:

    - Service A will send messages to service B

    - Service B will track a balance containing money in some storage. It will receive messages from service A and add to the balance accordingly.

    - Services have no concept of "users", and this kind of development is not necessary for task at hand.

    - No authentication is necessary on any of the services

    - "EUR" should be the only supported currency in this initial version.

    - Both services must be documented with README.md files explaining following, project purpose, how to setup it, how to run it.

    ##### Bonus points:

    - Services as docker containers

    - Unit test

    - Handling concurrent messages on Service B

    ## Service A Service A has two task:

    1) Accept HTTP request that carry money information

    2) Generate AMQP messages towards "Service B"

    ##### HTTP API - HTTP API must be able to accept following HTTP payload:

    ```json {

    "amount": 1123.4,

    "currency": "EUR", }

    ```

    - Amount is sent as decimal representation.

    - Amount property must not be lower than -100000000 EUR, and larger than +100000000 EUR.

    - Valid requests must generate HTTP/200 requests

    - Invalid requests must generate HTTP/400 responses - HTTP API must be documented via projects README.md

    ##### Messaging API - Messaging API must generate valid messages for Service B to consume after HTTP api described above is invoked.

    - All Messaging infrastructure (except definitions necessary for service B to consume messages) must be defined as part of service A

    - Example message sent over message broker:

    ```json { "amount": 112304, "currency": "EUR", } ```

    - Amount is sent as minimal currency denomination representation (e.g. cents, this means that 1 EUR is sent as amount 100, and 100.19 EUR is sent as amount 10019)

    ## Service B

    - Service accepts AMQP messages generated by Service A

    - Service must have **account** entity stored in database, described by two properties, **balance** and **updatedAt**

    ##### Handling messages - Initial **balance** must be set at **0** - Initial **updatedAt** must be set at **NULL**

    As a result of each message processing, following must happen:

    - Balance must increased or decreased based on **amount** property

    - **updatedAt** property must be updated so that it reflect last balance change

    ##### HTTP API - HTTP API must have single route that exposes state of balance

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

    Tools for creating portfolio/blog website for InfoSec student

    Posted: 24 Mar 2019 06:56 AM PDT

    Hello, Reddit!

    I found a necessity of a portfolio/blog website, where I can link my information, resume, links, etc. But I also want to include my articles on various topics.

    I want my website to be really simple. Like main page, where is some basic info about me, scroll down and see my resume and skillset, then down - projects, and down - contact information. And from main page maybe go right and see my articles, which will be in some kind of list or whatever.

    I need a way to write my articles in LaTeX (I need text, formulas, code listings and rare images). I could probably write some LaTeX to HTML converter, given enough time and dedication, but I feel like there must be better tools for doing what I want. Also I need a way to maintain all the articles I put on the website later.

    So maybe there are some engines, or some frameworks, or some techniques that would allow me to do what I want?

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

    [C++] The question is about how to find words in a .txt file. I'm unsure of how to ask this question without first showing a snippet of the code and an example of the .txt file, so I added them to the description.

    Posted: 24 Mar 2019 06:38 AM PDT

    Sorry, I don't think I asked my question properly. The text file is formatted like this.

    BOOK 1 CHAPTER 1 1 words 2 words 3 words 4 words 5 words 6 words BOOK 2 CHAPTER 1 1 words 2 words 3 what I need to find 4 words 5 words 

    Basically, when the user asks for line 4 in chapter 1 of book 2, I need to output it to them. The issue is that I cannot figure out how to output line 4. The snippet of my code.

    //FIXME string line, bookNum, chapter, usersLine; bool foundLine; while(!foundLine) { getline(fromBook, line);//fromBook is the .txt file if (line == "BOOK " + bookNum){ //this doesn't find the book } if (line == "CHAPTER " + chapter){ //this doesn't find the chapter } if (line.substr(0, usersLine.length()) == usersLine){ //this works foundLine = true; } if(fromBook.eof()){ cout << "No match found." << endl; break; } } cout << line << endl; 

    When I cout line, it just outputs the correct line number from the correct book, but not for the chapter.

    EDIT: With the help of u/ICantMakeNames , I was able to get the code to work. The working code can be found in the comments. It is the one not marked //FIXME

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

    why am I unable to insert an element in a linked list with this program (C)

    Posted: 24 Mar 2019 10:00 AM PDT

    I'm getting runtime error.

    void insEnd(ll,x)

    struct linkedlist *ll;

    int x;

    {

    NODEPTR p; p=getnode(); p->info=x; p->next=NULL; if(empty(ll)) { ll->head=p; } else{ NODEPTR q=ll->head; while(q->next!=NULL) { q=q->next; } q->next=p; } 

    }

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

    Do you think this is a fair question for a Microsoft C# Certification?

    Posted: 24 Mar 2019 05:17 AM PDT

    Im studding for the Microsoft's Certification Exam 70-483 - "Programming in C#" and trying to make every single free online testing that I can. I've been working with C# almost 2 years and I read the entire book Microsoft provide for this certification. Today I just faced this question that made me think if this exam is fair:

    Image

    The PerformanceCounterType Enum has 28 different options, each one with a considerable description size, it's not even in the book but in MS docs It's not even something that is used in large scale in C#, I guess. What you guys think about this? am I being a pussy or is this question just unfair?

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

    How to make indices sort with frequency in counting sort algorithm?

    Posted: 24 Mar 2019 02:13 AM PDT

    I'm trying to sort with a counting sort algorithm the frequency of how often are given numbers inputed.

    I manage to sort the frequency but i don't know exactly how to also sort the indices based on their frequency.

    #include <stdio.h>

    #include <algorithm>

    #include <stdlib.h>

    #define MAXN 1000000

    #define K 50

    using namespace std;

    int a[MAXN],N,b[K+1];

    bool mycmp(int i, int j) {

    return(i>j);

    }

    int main() {

    int i,j,l=0;

    scanf("%d", &N);

    for(i=0;i<=K;i++) b[i]=0;

    for(i=1;i<=N;i++) {

    scanf("%d", &j);

    b[j]++;

    }

    for(i=0;i<=K;i++) {

    if(b[i]>0) {

    for(j=1; j<=b[i];j++) {

    a[l++]=i;

    }

    }

    }

    sort(b,b+K,mycmp);

    for(i=0;i<=K;i++) {

    if(b[i]>0 ) {

    printf("%d %d\n", a[i], b[i]);

    }

    }

    }

    The input im inserting is :

    9

    42 42 34 26 42 35 34 47 47

    The result i get is :

    26 3

    34 2

    34 2

    35 1

    42 1

    And the result I'm trying to get is :

    42 3

    34 2

    47 2

    26 1

    35 1

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

    Writing pure functional algorithms without arrays

    Posted: 24 Mar 2019 03:41 AM PDT

    I am new to functional programming so sorry if my question is stupid. For a course I am assigned to solve a problem in a functional language. I have figured out an algorithm but it uses an array for counting the appearance frequency of each element in the list. I can implement it using a mutable array but that is not "pure" functional programming as I have understood.

    So my question is: Is there any point in trying to figure out an algorithm that solves the problem without arrays or is it just ok to use arrays. Is it possible that some problems cannot be solved with the same complexity without arrays (or some other non pure functional technique)? For the assignment it is ok to "cheat" and use arrays but I am trying to understand how and most importantly why should I not use arrays.

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

    No comments:

    Post a Comment