• Breaking News

    Wednesday, November 29, 2017

    How do I fix this webpack error in my CLI? Ask Programming

    How do I fix this webpack error in my CLI? Ask Programming


    How do I fix this webpack error in my CLI?

    Posted: 29 Nov 2017 06:12 PM PST

    There are multiple modules with names that only differ in casing. This can lead to unexpected behavior when compiling on a filesystem with other case-semantic. Use equal casing. Compare these module identifiers:

    Webpack hot emitter js Webpack hot dev-server js Webpack hot log js Webpack hot nonrecursive

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

    Can I create a git repo on a network drive?

    Posted: 29 Nov 2017 07:35 PM PST

    I googles around and most things I found were describing how to setup a git repo using -bare then cloning that repo to your local machine. I don't want to clone the repo, I want to create a git repo on a network drive then commit changes straight to that network drive, no cloning to my local drive. I will be the only one using this git repo and I just want to track changes and keep everything on a NAS box, not my local machine. Is this as easy as creating a network drive then switching to it and creating a git repo? Does it matter what my local machine os is? Can I commit to this repo from any machine and OS as long as I have the NAS mapped to a network drive on said local machine?

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

    Java question. String to object conversion

    Posted: 29 Nov 2017 06:26 PM PST

    hypothetically, if a user inputs "Car" to create a Car object, is there anyway to test for a valid Car class to declare without mediating through a conditional or switch statement?

    I know that a string to integer conversion uses a parse function, but is there any similar function for a generic or the default object class?

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

    Javascript OnClick Event Not Working - function() is not defined (PHP, SQL, JS)

    Posted: 29 Nov 2017 11:42 AM PST

    I'm sure this is a relatively simple error but I can't figure out what the issue is.

    NOTE: I cannot use JQuery, I need to use a mixture between javascript, php, sql, html, and css.

    What I want to happen is be able to click on the Customer Number and have a div appear showing the individual customer's phone number, sales representative name, and credit limit.

    The way I'm implementing this is having a PHP while loop fetching data from an SQL database and outputting the records into a table. And with the onclick event, I have the extra table implemented as a function ($orderText).

    The function I'm having an issue with is customerDetails() for the second table. The first one works perfectly. I have the div that is filled styled in the css stylesheet so that the position is fixed.

    So specifically the area I need to fix is

    <div> <div class="jsbox" id="customerOrderDetails" ></div> <table> <thead> <tr> <th>Order Number</th> <th>Order Date</th> <th>Status</th> <th>Customer Number</th> </tr> </thead> <tbody> <?php while ($s = $q2->fetch()): ?> <tr> <?php $orderText = "<table><tr><th>Phone Number</th><th>Rep Name</th><th>Credit Limit</th>"; $orderText .= "<tr><td>" . htmlspecialchars($s['phone']) . "</td>"; $orderText .= "<td>" . htmlspecialchars($s['repName']) . "</td>"; $orderText .= "<td>" . htmlspecialchars($s['creditLimit']) . "</td></tr></table>"; ?> </tr> <tr> <td><?php echo htmlspecialchars($s['orderNumber']) ?></td> <td><?php echo htmlspecialchars($s['orderDate']) ?></td> <td><?php echo htmlspecialchars($s['status']) ?></td> <td><?php echo "<button onclick=\"customerDetails('$orderText')\">" . htmlspecialchars($s['customerNumber']) . "</button>" ?></td> </tr> <?php endwhile; ?> </tbody> </table> </div> <script type="text/javascript"> function customerOrder(msg) { document.getElementById("customerDetails").innerHTML = msg; } </script> 

    And below is the all of the code:

     <?php require_once "dbconfig.php"; try { $conn = new PDO("mysql:host=$servername;dbname=$dbname;charset=UTF8", $username, $password); $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); echo "Connected successfully"; $sql = 'SELECT DISTINCT O.orderDate, O.customerNumber, O.comments, O.status, O.orderNumber, OD.productCode, P.productLine, P.productName FROM orders O JOIN orderdetails OD on O.orderNumber = OD.orderNumber JOIN products P ON OD.productCode = P.productCode WHERE O.status = "In Process" ORDER BY O.orderNumber'; $q = $conn->query($sql); $q->setFetchMode(PDO::FETCH_ASSOC); $sql2 = 'SELECT O.orderNumber, O.orderDate, O.customerNumber, O.comments, O.status, C.phone, C.salesRepEmployeeNumber as repNumber, C.creditLimit, concat(E.firstName, " ", E.lastName) as repName, E.employeeNumber FROM orders O JOIN customers C on O.customerNumber = C.customerNumber JOIN employees E on C.salesRepEmployeeNumber = E.employeeNumber ORDER BY O.orderDate desc LIMIT 20'; $q2 = $conn->query($sql2); $q2->setFetchMode(PDO::FETCH_ASSOC); } catch(PDOException $e) { echo "Connection failed: " . $e->getMessage(); } ?> <!doctype html> <html> <head> <title>Page Title</title> <meta charset="UTF-8"> <meta name="viewport" content="initial-scale=1.0"> <link rel="stylesheet" href='orders.css'> </head> <body> <div> <div class="jsbox" id="orderDetails" ></div> <table> <thead> <tr> <th>Order Number</th> <th>Order Date</th> <th>Status</th> <th>Customer Number</th> </tr> </thead> <tbody> <?php while ($r = $q->fetch()): ?> <?php $text = "<table><tr><th>Product Code</th><th>Product Line</th><th>Product Name</th><th>Comments</th>"; $text .= "<tr><td>" . htmlspecialchars($r['productCode']) . "</td>"; $text .= "<td>" . htmlspecialchars($r['productLine']) . "</td>"; $text .= "<td>" . htmlspecialchars($r['productName']) . "</td>"; $text .= "<td>" . htmlspecialchars($r['comments']) . "</td></table>" ?> <tr> <td ><?php echo "<button onclick=\"myFunction('$text')\">" . htmlspecialchars($r['orderNumber']) . "</button>" ?></td> <td><?php echo htmlspecialchars($r['orderDate']) ?></td> <td><?php echo htmlspecialchars($r['status']) ?></td> <td><?php echo htmlspecialchars($r['customerNumber']) ?></td> </tr> <?php endwhile; ?> </tbody> </table> </div> <script type="text/javascript"> function myFunction(msg) { document.getElementById("orderDetails").innerHTML = msg; } </script> <div> <div class="jsbox" id="customerOrderDetails" ></div> <table> <thead> <tr> <th>Order Number</th> <th>Order Date</th> <th>Status</th> <th>Customer Number</th> </tr> </thead> <tbody> <?php while ($s = $q2->fetch()): ?> <tr> <?php $orderText = "<table><tr><th>Phone Number</th><th>Rep Name</th><th>Credit Limit</th>"; $orderText .= "<tr><td>" . htmlspecialchars($s['phone']) . "</td>"; $orderText .= "<td>" . htmlspecialchars($s['repName']) . "</td>"; $orderText .= "<td>" . htmlspecialchars($s['creditLimit']) . "</td></tr></table>"; ?> </tr> <tr> <td><?php echo htmlspecialchars($s['orderNumber']) ?></td> <td><?php echo htmlspecialchars($s['orderDate']) ?></td> <td><?php echo htmlspecialchars($s['status']) ?></td> <td><?php echo "<button onclick=\"customerDetails('$orderText')\">" . htmlspecialchars($s['customerNumber']) . "</button>" ?></td> </tr> <?php endwhile; ?> </tbody> </table> </div> <script type="text/javascript"> function customerOrder(msg) { document.getElementById("customerDetails").innerHTML = msg; } </script> </body> </html> 
    submitted by /u/imsorryboutit
    [link] [comments]

    Help learning the DOM

    Posted: 29 Nov 2017 08:18 PM PST

    I am currently in a web development class. We learned html, css, js, and for the last week or two have been talking about the DOM. I really just can't wrap my head around how this will work/does work, does anyone have any recommendations for learning how to use this to manipulate webpages?

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

    Help with creating a simple system

    Posted: 29 Nov 2017 06:19 PM PST

    I need help to create simple system that takes as input the score for each match for a given tournament and updates each player's position, calculates each player's ranking points and produces a list of the players ranking in descending order.

    The system needs to calculate the prize money due to each player at any given point in time and accumulates these having stored them safely.

    I am thinking of using bubblesort but have also looked at lists and I am not sure which to use.

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

    SQL entry not reading the same time as OS.

    Posted: 29 Nov 2017 06:06 PM PST

    I'm going out of my mind here. I have a VM up with SQL on it deriving data from PLCs. The entries aren't showing the right time. I've gone through every time setting available from the OS to the ESXi host. They're all right, however SQL is reading a day or so ahead. If I change the time of the OS into the past, it just doesn't read/populate (supposed to every second), if I set it into the future it reads fine (with the future date).

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

    Impossible to test complex programs?

    Posted: 29 Nov 2017 04:33 PM PST

    Take a million lines of code. If 10% of those lines are conditionals that's 2100000 possible states. Complete coverage, ignoring timing differences, would take a very long time.

    What's the problem with this argument?

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

    materials required to write an app?

    Posted: 29 Nov 2017 10:22 AM PST

    My teacher asked us this question What are the materials required to write an app ? Note please materials not TOOLS

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

    I have an idea, but forget how to do it.

    Posted: 29 Nov 2017 04:18 PM PST

    Ok, so I want to write a script that detects in Google Chrome when on the screen it says "It's raining! Click here to claim some free coins!". When it detects this, I want it to create a notification or a sound. I took a programming class a year ago, and I've forgotten how. Any help?

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

    finding the mean of every 7th value from a CSV file c#

    Posted: 29 Nov 2017 01:17 PM PST

    So i managed to write the code to parse the CSV file. However I am having trouble writing code to find the mean of every 7th value from the CSV file. If anyone can lend a hand that would be great.

    The coding looks abit strange in the post? Can I add a code tag or anything for it to look more organized?

    My code so far: -

    using System;

    using System.Collections.Generic;

    using System.Linq;

    using System.Text;

    using System.IO;

    namespace Question01

    {

    class Program { static void Main(string[] args) { try { String st = System.IO.File.ReadAllText("data03"); Console.WriteLine(st); } catch (Exception e) { Console.WriteLine("The file could not be read"); Console.WriteLine(e.Message); } Console.Read(); } } 

    }

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

    Are there any other types of variables apart from global and local?

    Posted: 29 Nov 2017 12:26 PM PST

    E.G. A variable inside a function

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

    Make our CRM "connect" to external sales system - Possible?

    Posted: 29 Nov 2017 12:11 PM PST

    To a avoid wasting a lot of time on a mission impossible I was hoping to get some feedback from someone with more knowledge.

    So, my company is a franchise for a large corporation, we have to use their system(standard website) to get prices, proposals, sales etc.. Their system sucks so bad I fear long term damage to my soul... + hours wasted every day..!

    I was thinking it might be possible to implement their site to our custom CRM (server/root access). We don't have any root/server/source code access to the external system besides what the browser or a scraper/crawler can reveal.

    Their system use php,xml and a shitload of javascript.

    What I'm hoping to accomplish is this: 1. Implement their forms to our CRM, so we can register sales/proposals without using their site at all 2. Use a webscraper etc.. to collect and save the results to our database (mysql)

    I understand it's hard to say without seeing the code, all I want to know if this is even possible without the serverside soruce code.

    Btw, if using the (browsers) code isn't possible, could this still be accomplished in some way with macros/hotscript/etc??

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

    Possible to get a list of high and low temperatures for a list of zip codes for a certain day? More detail in comments.

    Posted: 29 Nov 2017 10:28 AM PST

    Part of my job is to check shipments for low and high temperatures during the winter (we ship a perishable product). In the past this has been done by looking at a map of highs and lows and marking each shipping label. With the increase in holidays orders this can take quite a bit of time. I've looked into NOAA's Weather Toolkit but can't make sense of it.

    tl/dr: Is there a way to obtain the highs and lows for each zip code in an excel spreadsheet?

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

    Designing a car park simulator prototype - can anyone assist with some creative functionality?

    Posted: 29 Nov 2017 09:46 AM PST

    Hey, I'm working on a throwaway prototype at the moment for a car park simulator. I know this may not massively fit here due to it not being about any specific coding help, it's much more about implementing ideas than syntax or conventions. So if that's the case and anyone could direct me to a more fitting sub, I'd appreciate it.

    The basic idea is that there are entry and exit barriers, and payment works on a chip-coin based system, where-in the user has to take a coin and then pay for it before they are able to exit.

    Effectively, there are 3 major functions at the moment:

    Number 1 is an emergency system: Depending on the state of emergency, the car park may range from a closed barrier to complete lock down.

    Number 2 is a security system: This system is to make sure that there are as few opportunities for thieves as possible, and works based on a password being assigned to the chip-coin.

    Finally is number 3, a sensor based system: Works based on sensors in each space being triggered whenever a vehicle enters, so that users can see if the floor is full and continue moving up etcetera.

    I'm really struggling with adding some more unique features here though, I've played around with the idea of things such as a loyalty based system, as well as advanced payments etc. But ultimately I decided they're a little bit too basic. So if anyone could help me come up with some additional functionality that might be a little bit unique, that'd be a big help!

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

    Using APIs In Wordpress? PHP Post Request?

    Posted: 29 Nov 2017 09:45 AM PST

    Basically, I'm making a football site. On that site, I want to be able to list live scores and play-by-play, and have no idea where to start, as I barely have any experience. Found a site called profootballapi.com that seems to have what I want, so I got an API key. Great.

    But then it's telling me that I need to use PHP Post request or something? The code given, as an example, is as follows:

    <?php

    $url = 'https://profootballapi.com/teams';

    $apikey = 'My API Key_';

    $query_string = 'api_key='.$api_key.'&team=NE&month=10';

    $ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POSTFIELDS, $query_string); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

    $result = curl_exec($ch);

    curl_close($ch);

    echo $result;

    ?>

    Well...how do I actually use this? How do I send that request, and how can I parse that info, and put it into a nice user interface? I'm just trying to have people be able to watch play-by-plays of NFL games on my Wordpress site, that's all. I want to start with NFL, but eventually do NCAA as well.

    Just very confused, and obviously in over my head, but I still want to get it done. Any way to do this?

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

    New Programmer - Need advice with coding confidence

    Posted: 29 Nov 2017 09:34 AM PST

    Hey, I got into programming in the last two years (kinda fell into the job). I have to say I LOVE it. I wish I wasn't of the generation that skipped teaching this in schools otherwise I would gone higher in education doing it.

    I feel I have been capable of solving a lot of issues in the company I work in however I still cant help feeling that I'm not good enough - I don't really have anyone to compare my skills of as I am one of the more senior devs therefore have 0 confidence in my own ability other then the fact I do a lot of coding work (level of my work I am not sure).

    I have mostly coded in javascript (our programme had a JS run time library that I learnt from) and I am now dabbling in more cloud side applications using angular.

    I have done small applications in C# and looked into python but don't have confidence to say I know much about any of those two.

    All I want to know as anyone experienced this anxiety and how did you manage to overcome it if at all? or is it just a natural process?

    Thanks and please be nice! :)

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

    What selectors do autofill browser extensions use to know which inputs to fill?

    Posted: 29 Nov 2017 05:17 AM PST

    And how do they avoid accidentally filling in unrelated forms?

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

    Student wondering what to do over the break as far as keeping mind sharp?

    Posted: 29 Nov 2017 12:36 AM PST

    Hey reddit, you guys know of any websites or books to keep my mind sharp over my break? I work full time but I have most evenings to study or write code. I have heard of r/dailyprogrammer although I'm not sure where to begin on it. Are there any other websites that offer challenges that are fun and not insanely difficult? Thanks.

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

    No comments:

    Post a Comment