• Breaking News

    Thursday, August 15, 2019

    So How Do you Build a Desktop Application? Ask Programming

    So How Do you Build a Desktop Application? Ask Programming


    So How Do you Build a Desktop Application?

    Posted: 15 Aug 2019 02:08 PM PDT

    I see so many tutorials and guides for making websites that it's easy to see the process, but I'm at a loss for how to make desktop applications. What languages can be used? Are there frameworks for desktop apps? Are there guides online? Do you just use the same stuff for web app design now? I have no idea ....

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

    Really Beginner Issue

    Posted: 15 Aug 2019 08:28 PM PDT

    Well after 5 days of trying to figure this out on my own I have to accept that I need some guidance on a problem I'm having. So my issue is I want to send json data from a API call on the back end to an axios call to the front end. I am having a lot of trouble trying to get the right response back. I know it's user error. I've been looking at the documentation for express router's and axios calls I just can't seem to put my finger on the problem I just keep dancing around it. bottom line is I want the json to be called into a javascript file in which I can save it as an object and use it at will on the index.html file. Thanks!

    <====== Recipe Router =======>

    const express = require("express");
    const axios = require("axios");
    const router = express.Router();
    const recipeController = require("../../../controllers/recipeController");
    const Recipe = require("../models/Recipe");
    const auth = require("../middleware/auth");
    router.get("/search-recipe", async (req, res, next) => {
    try {
    let query = "";
    query = req.query.search;
    const url = `https://www.themealdb.com/api/json/v1/1/search.php?s=${query}\`;
    return await axios
    .get(url)
    .then(async response => {
    const data = response.data;
    data.meals.forEach(element => {
    recipe = recipeController.createObject(element);
    return recipe;
    });

    res.redirect('/display-recipe')
    })
    .catch(error => {
    console.log(error);
    });
    } catch (error) {
    console.log(error);
    }
    res.end()
    });
    router.get("/display-recipe", (req, res, next) => {
    res.json(recipe)
    });
    });

    //Authentication Endpoints
    router.post("/save-recipe/:id", auth, (req, res) => {});
    module.exports = router;
    <=======HTML==========>

    <!DOCTYPE html>
    <html *lang*="en">
    <head>
    <meta *charset*="UTF-8" />
    <meta *name*="viewport" *content*="width=device-width, initial-scale=1.0" />
    <meta *http-equiv*="X-UA-Compatible" *content*="ie=edge" />
    <script *src*="https://unpkg.com/axios/dist/axios.min.js"></script>
    <link *rel*="stylesheet" *type*="text/css" *href*="/assets/css/style-home.css" />
    <title>I Dunno</title>
    </head>
    <body>

    <form *action*="/search-recipe" *method*="GET" *id*="search-recipe" *class*="recipe">
    <input *id*="find-recipe" *class*="input" *type*="text" *name*="search" *placeholder*="Find a recipe" />
    <button *class*="btn" *type*="submit" *onclick*='getdata()'>
    Search
    </button>
    <script>
    function getdata() {
    axios.get('/display-recipe').then(response=>{
    const data = response.data
    data.forEach(el=>{
    console.log(el)
    })
    }
    </script>

    </body>
    </html>

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

    int m = l + (r - l) / 2 vs . int m = (r + l) / 2

    Posted: 15 Aug 2019 04:53 PM PDT

    Whenever I look online, a lot of people seem to do:

    l + (r - l)

    instead of:

    r + l

    Why is this? Does it make a difference?

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

    Running .py script via Terminal throws error when referencing .txt file in same folder

    Posted: 15 Aug 2019 09:26 PM PDT

    Hi all,

    I've been running a Python script via terminal, and when launched from the /Users/name directory like so:

    ./directory/filename.py

    it runs the script, but throws an error when the script tries to access a .txt file like so:

    file=open('notes_file.txt', 'rt')

    The terminal states that no such file is found. It works just fine when I run it through IDLE, and even when the folder is not in the home directory. To be clear, both the Python script and the .txt live in the same folder. I (chmod +x filename) the Python script. Do I need to do something to the .txt file for it to be recognized by the Python script now that they live within a folder that lives within the home directory?

    Maybe I need to get better with searching Stack Overflow, but I prefer reddit. But if you all think I should be directing this elsewhere, definitely let me know. Thanks!

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

    I don't now how to begin with programming...

    Posted: 15 Aug 2019 06:26 AM PDT

    Hi reddit,

    I've been willing to start programming for a while now and today i decided that I should start. The problem is that i have no idea how to start. I'm planning to use c++ because i want to code games eventually. But i have trouble finding any good tutorials.

    So how would you all reccomend starting programming?(Is there any good tutorial? should i pay for one? What should I start with? etc.)

    submitted by /u/o-k-norton
    [link] [comments]

    I want to create a bot net for Facebook likes

    Posted: 15 Aug 2019 02:52 PM PDT

    This is for nothing malicious. Mostly just to see if I can build a bot net and have them like and share posts on a page I will make for this purpose. Does anyone know how this kinda stuff works or would you be able to point me to better resources? I've got a strong programming background already so I don't need tutorials on any basics or anything, but I've never undertaken a project of this type. It doesn't need to be huge either. If I could get 10 bots running and have the scalability to get to 100 I'd consider it a success since I don't actually need to do that.

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

    Has anyone built their own recommender system? If so, how hard was it and what were the methods to create it?

    Posted: 15 Aug 2019 05:19 PM PDT

    Learning Java, what is the best way to find a method for your need?

    Posted: 15 Aug 2019 05:00 PM PDT

    I have a question, let's say I'm a new developer, I just learned java, but I'm not familiar with the standard library/documentation, how do you go about finding the right function to do what you want from the SL, if you're not familiar with it.

    Ex. I want to know the current date/month, how do you know what method that is, or how do you find it if you don't already know it?

    Does this make sense to you guys? I know I need a function, but I don't know what it is, and I'm sure it already exists...what is the fastest most efficient way of finding it?

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

    What algoritms execute in O(log₂ n)?

    Posted: 15 Aug 2019 03:39 PM PDT

    I need some examples for a college project

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

    Example of a project that was written in C++ then ported to C?

    Posted: 15 Aug 2019 01:27 AM PDT

    To get an idea of the task ahead of me, does anyone know of any example projects that started out as C++ and were ported to C. I would like to see how classes etc. look like once they have been converted.

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

    Where to start machine learning on C#?

    Posted: 15 Aug 2019 09:44 AM PDT

    I would like to learn some machine learning and I am a heavy C# user so I found ML.Net pretty quickly. They have a bunch of samples but I'm failing to understand any of them. I think of myself as a fairly competent programmer and yet I cannot even understand the most basic examples, because the samples are not really telling you how stuff works, instead you get instructions how to load some pre-defined dataset, deserialize it into some example class, transforming the dataset a bit and finally calling some generalized method, something like Train() and Predict().

    Here is a good example. I don't know if the attributes on the classes are related to to this task at all. I don't know how I can simply provide the data from memory instead of reading some random format and transforming the data (to what?). I don't know how to start training without a data set. So in the end I get a neat little program that predicts a flower in command line and zero ideas how to use this library for my problem (I'm not sure yet what my problem is yet though). This taught me more about machine learning than any of the examples.

    I'm planning to do very simple server-side AI which learns from user input. Something basic like XOR gate for start and then move on to predicting string based on input, and so on. So, how the hell I transform float[] input to float[] output. How do I train the model in real-time? What should I do with strings?

    I have fairly advanced programming skills but I'm not that good at (advanced) math. I have tried many times to learn this stuff but it's either too overwhelming and complicated or too much simplified (like this one). So each time I have given up because I don't have to learn this. I would like to and I don't know where to find usable examples that I can actually use.

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

    need guidelines for programming language

    Posted: 15 Aug 2019 08:34 AM PDT

    hey guys ,i learn C and python also working on algorithms and other stuff.Is learning LISP is good Idea for Artificial intelligence and ML .Any guideline will be highly appreciated. Also thought regarding HASKELL is welcome.

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

    Creating a Web Application in MS Visual Studio and would like to start connecting to an Oracle Database to Test My Code, How Do I Get an Oracle Database on My Machine?

    Posted: 15 Aug 2019 08:06 AM PDT

    I am on a Windows desktop and have been working on a web app using ASP.NET in VS and have been using MS Access as my test database for some time now. I would like to start using Oracle for my test data to become more familiar working with Oracle since people I would eventually like to sell to use Oracle Servers. The issue is every time I have downloaded anything from Oracle like 19c and 12c databases they don't work and I have SQLDeveloper but I can't get that to connect to anything. Anyone here able to help me out?

    Thanks!!!

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

    Where to start if I'm interested in AI?

    Posted: 15 Aug 2019 07:31 AM PDT

    I'm interested in working with AI and machine learning. What programming languages would be most useful to learn? Any advice on where to start?

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

    My REST resource file refuses to be found

    Posted: 15 Aug 2019 06:48 AM PDT

    Resource class

    package com.onboarding.rest; import javax.ws.rs.GET; import javax.ws.rs.PUT; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import com.onboarding.singleton.DataHandler; @Path("/data") public class DataResource extends javax.ws.rs.core.Application{ DataHandler dataHandler = DataHandler.getInstance(); @GET @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML }) public Response findAll() { System.out.println("findAll called"); String data = dataHandler.returnAllData(); System.out.println("Ouput " + data); return Response.status(Response.Status.OK).entity(data).build(); } } 

    My web.xml

    <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0"> <display-name>onboarding-war</display-name> <context-param> <param-name>resteasy.scan</param-name> <param-value>true</param-value> </context-param> <context-param> <param-name>resteasy.servlet.mapping.prefix</param-name> <param-value>/rest</param-value> </context-param> <listener> <listener-class> org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap</listener-class> </listener> <servlet> <servlet-name>Resteasy</servlet-name> <servlet-class>org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher</servlet-class> <init-param> <param-name>javax.ws.rs.Application</param-name> <param-value>com.onboarding.rest.DataResource</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>Resteasy</servlet-name> <url-pattern>/rest/*</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file>index.html</welcome-file> <welcome-file>index.htm</welcome-file> <welcome-file>index.jsp</welcome-file> <welcome-file>default.html</welcome-file> <welcome-file>default.htm</welcome-file> <welcome-file>default.jsp</welcome-file> </welcome-file-list> </web-app> 

    pom.xml

    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.onboarding.assignment</groupId> <artifactId>onboarding-war</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>war</packaging> <repositories> <repository> <id>JBoss repository</id> <url>https://repository.jboss.org/nexus/content/groups/public-jboss/</url> </repository> </repositories> <dependencies> <dependency> <groupId>com.onboarding.assignment</groupId> <artifactId>onboarding-common</artifactId> <version>0.0.1-SNAPSHOT</version> </dependency> <dependency> <groupId>org.jboss.resteasy</groupId> <artifactId>resteasy-jaxrs</artifactId> <version>3.1.4.Final</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.jboss.resteasy</groupId> <artifactId>resteasy-jaxb-provider</artifactId> <version>3.1.4.Final</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.jboss.resteasy</groupId> <artifactId>resteasy-servlet-initializer</artifactId> <version>3.1.4.Final</version> <scope>provided</scope> </dependency> </dependencies> <build> <sourceDirectory>src</sourceDirectory> <plugins> <plugin> <artifactId>maven-war-plugin</artifactId> <version>3.2.1</version> <configuration> <warSourceDirectory>WebContent</warSourceDirectory> <failOnMissingWebXml>false</failOnMissingWebXml> </configuration> </plugin> </plugins> </build> </project> 

    Everytime I deploy, I keep getting a 404 both on the http://localhost:8080/onboarding-war/rest/data and http://localhost:8080/onboarding-war/. There are no errors on the console that stop it outright but something is still missing. I added the jboss dependencies after an earlier error so I think I have all them but I'm not sure..

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

    Looking for some hard to track down documentation

    Posted: 15 Aug 2019 06:00 AM PDT

    Hey all -

    I am a developer working with various print languages. I have been trying to hunt down the documentation (or Spec) for the Xerox Metacode language, but for whatever reason, they don't seem to have it anywhere that I can find. I am posting since I figure I will throw out the hail mary to see if anyone here knows where I can find it.

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

    Why might Xcode only be pushing part of my project to Github?

    Posted: 15 Aug 2019 01:48 AM PDT

    I've recently finished a chess game which I want to push to Github. The user interface is in Objective-C, and the logic is in C++17. I set up a remote inside Xcode and this has pushed the Objective-C code to Github but not the C++/Objective-C++ code. What might be happening here? How do I push the rest of the project across? I'm fairly new to Github.

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

    Printing using Nodejs

    Posted: 14 Aug 2019 11:48 PM PDT

    I am having a really hard time figuring out how I am going to handle printing in my Nodejs application. I have a website where there is a bunch of purchase numbers. I want the users to print this numbers in a click of a button. These numbers are dynamically generated after querying the database.

    I started using this npm library to print the purchase number. When I am developing in my local computer this library is working fine. I made it so that each time the user presses a button in the front end, I make a post request to my Nodejs Server which prints to the printer that I configured locally.

    The problem is that I want to eventually deploy my website to Heroku. Website will be used by a group of people sharing the same network and printer. I do not know of a way to set heroku to communicate with the printer using this package.

    I also thought that printing directly from the front end might be a better idea, but I have to open google on kiosk mode and then do the same for all the users that are going to use this website. Also, most of the users will be using a tablet device so configuring printer in those devices will be difficult as well.

    I did not find anything online that I can use as a reference. Any advice or suggestion will be greatly appreciated.

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

    No comments:

    Post a Comment