• Breaking News

    Tuesday, February 27, 2018

    Recommended minimal MEAN Angular 5, typescript, express starter project? Ask Programming

    Recommended minimal MEAN Angular 5, typescript, express starter project? Ask Programming


    Recommended minimal MEAN Angular 5, typescript, express starter project?

    Posted: 27 Feb 2018 03:31 PM PST

    Anyone know of a good minimal starter project like this?

    How're these?

    https://github.com/jussikinnula/angular-mean-starter

    https://github.com/gdi2290/angular-starter

    Or Nestjs for the backend? with a different angular 5 starter project?

    It would be nice if it had a tutorial as well.

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

    [Java] Word Search for loops problem with indexing

    Posted: 27 Feb 2018 05:03 PM PST

    https://pastebin.com/K3FQ0DGR

    For some reasons I'm having troubles with for loops and trying to index them. I've been playing with numbers for a while and can't figure it out. Any form of hint or something would be great! Thanks

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

    How can I automatically install drivers for my device? (Xbox360 wireless adapter)

    Posted: 27 Feb 2018 04:30 PM PST

    So every time I plug in my X360 wireless adapter I have to go into device manager and manually install the drivers. Would there be a simple to do this by running some sort of program or batch?

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

    Python: What should I be looking at first in this lambda expression?

    Posted: 27 Feb 2018 08:56 PM PST

    def boo(x): return lambda y: x(x(y)) print (boo(boo) (lambda x:x+1) (5)) 

    Answer is 9, btw. Thanks in advance.

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

    JQUERY + how to make a table with variable number of rows / columns

    Posted: 27 Feb 2018 08:36 PM PST

    hey guys,

    im building a game that allows the users to pick the number of rows / columns (Always equal) to build the board. They are allowed to pick an 8x8, a 16x16 and a 24x24.

    At this point I have successfully passed the variable into my function, but i'm not quite sure how to dynamically build a table with the number of rows / columns equal to my variable. How would i do this with jquery? I assume i'd have to do append the table and <th> / <td> elements to my already existing div, but that's where my brain hits a wall.

    Any help is appreciated!

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

    Can other functions execute while a "while" loop is executing?

    Posted: 27 Feb 2018 04:44 PM PST

    I'm working on an Arduino LED project with extensive code and wanted to clean up the main loop so I put each LED "effect" into its own function and only call the relevant effect function in the main loop. However, the way I'm changing which effect is called is through MQTT messages, so I'm wondering if the MQTT client will still receive messages and parse them if I'm running a "while" loop for the effect.

    So for example:

    int new_mqtt_message_arrived = 0; char effect; void loop{ client.loop(); //function from PubSubClient library for Arduino, receives MQTT messages if(new_mqtt_message_arrived == 1){ new_mqtt_message_arrived = 0; while(new_mqtt_message_arrived == 0 && effect == "LED effect 1"){ LEDeffect1(); } while(new_mqtt_message_arrived == 0 && effect == "LED effect 2"){ LEDeffect2(); } } void LEDeffect1(){ //effect code } void LEDeffect2(){ //effect code } void callback(){ new_mqtt_message_arrived = 1; //some other mqtt code } 

    I don't have an ESP handy to test this, but I'm wondering if this would get stuck in either of the while loops unable to receive messages since client.loop() won't be called until the while loop exits. Would a new MQTT message still trigger the callback function and allow it to set new_mqtt_message_arrived to 1 (thereby killing the while loop)?

    Is there a better way to approach this? The whole idea is to have the main loop as clean as possible and put all the effect-specific code in their own little functions to make it easier to add/remove/change the effects.

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

    I want to make a program that scrubs a twitter account for videos

    Posted: 27 Feb 2018 04:27 PM PST

    I'd expect Twitter to have reasons to not allow this sort of thing but I only expect to have it for personal use. I'm not sure where to start though. I have some CS background including C++, Java.

    On a twitter page, each post is appears a link to the post itself and in that page source is a direct link of the video if there is one. How I image the scrubber to work is:

    1: Account name entered.

    2: Site is visited (preferably invisibly) in some kind of black box, I'm guessing there's a way to do this im unaware of.

    3: It loads as many pages as it can as the intial feed shows x amount of most recent posts.

    4:It collects all links that are prefixed with what is synonymous with a post. ie. twitter.com/post/

    5: It views page source for all twitter post links to look for keywords/prefixes for a video source

    6: Copies video source link and puts into document.

    This project seems to be difficult for someone like me, but doesn't sound that hard for someone with expertise so I'm wondering why nobody has done it before or is it that it's something that you'd get into legal trouble for if you distributed it?

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

    What are some optimizations that I can make to a sorting algorithm if I only have to sort by 4 key values?

    Posted: 27 Feb 2018 04:25 PM PST

    For more context, I implemented a Bitonic sorting network (type of parallel mergesort) for a GPU shader. The values that I am sorting are structured like so: 32 bit integers, the high 16 bits are 0, 1, 2, or 3 (that is to say, bits 18 to 31 are all zeroes), and the low 16 bits are values from 0 to 1023 inclusive. Everything starts out pre-sorted based on the lower bits. My primary goal is to sort everything based on the higher bits (putting everything into 4 bins, essentially). A secondary goal would be to have the lower bits in each bin in sorted order too, but that's not a huge priority. I'd happily sacrifice the sorted order of the lower bits if it means that my sort will complete more quickly.

    Which leads into my issue; my bitonic sorting network shader completes more slowly than I'd like (takes about half a second). I suspect that it's all the memory barriers I'm putting up for the threadgroupshared memory. Would anyone have any suggestions for how to optimize the sorting algorithm for my particular situation?

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

    C# fractal calculator problems

    Posted: 27 Feb 2018 06:57 PM PST

    Got an assignment to do program that asks user for two fractions (eg. 1/3 and 2/4) and then uses those input values to do four basic calculations (add/divide/multiply/subst). Been trying to google how the heck does fractals work but haven't got it working, probably because too tired. Would appreciate if someone had time to give some beginnerfriendly advice

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

    Help finding boolean version of strpos function in PHP

    Posted: 27 Feb 2018 12:13 PM PST

    Have an assignment where I need to see if an @ symbol is present in a string, I was trying to do this: (inside a switch statement)

    $email = $_POST['email']; if (!strpos($email, "@") || (!strpos($email, ".")) || $email == "") { $message = "enter a valid email"; break;

    but it doesn't seem to be working

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

    Squarespace Custom CSS Help

    Posted: 27 Feb 2018 12:46 PM PST

    Hi!

    I have a Squarespace coding issue that is driving me crazy! There are two codes that I would like to use but I think that they are cancelling each other out.
    Would anyone be able to help?🙏 (it's probably a simple fix but I have no idea how to go about it)


    My logo is scrolling with the page on the desktop version and when I plug in Code 2 (below) it causes my logo to overlap the content

    Code 1: 1. @media screen and (max-width: 640px) { 2. .site-header { 3. padding-top: 3%; 4. padding-bottom: 10%; 5. } 6.
    7. .sqs-block-horizontalrule hr { 8. border: none; 9. color: #bbb; 10. background-color: #bbb; 11. /* height: 1px; */ 12. } 13.
    14. }

    Code 2: .header-announcement-wrapper { position: absolute; }

    Thanks!!!!!

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

    Step based unit testing

    Posted: 27 Feb 2018 12:40 PM PST

    I've just joined a startup and would like to add some automated testing for some basic processes. I'd like something that's step based, i.e. run a step, test the output in some arbitrary way, and then proceed to the next step and do the same. For example:

    • use an app (that has a headless mode) to generate a 3D model
    • spin up a system to render an image of said model
    • compare the image generated to a pre-existing image to determine overall success.

    Each of these steps requires a different tool, whatever system I use should be able to run these tools via a command line. Is there such a system?

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

    Altering what I'm pasting based on the number of times I've pasted it?

    Posted: 27 Feb 2018 09:12 AM PST

    I have no background on programming, so I'm wondering if this could be accomplished and how hard it would be for me to make. I'm wondering if I could copy and paste "testx = whatever" and x increases by 1 every time I paste it. Is this a thing I could create or does something like this exist?

    Some elaboration: I'm creating a mod and I will have to paste pretty much just that a couple thousand times and the id has to be unique so I'm upping it by one every time I paste it. I've done 1007 so far and it wasn't fun having to paste it and change it individually. They are being inserted between other lines of code

    Edit: Ended up using autohotkey with the script:

    SetKeyDelay, -1

    counter = 1

    NumpadDiv::

    send, text%counter% = {{}{}}

    counter++

    Return

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

    How to calculate values from CSV File

    Posted: 27 Feb 2018 02:36 PM PST

    I have the class below. I am reading from a CSV file but I am wanting to output each town with the number of car parks. E.g Belfast has 5 different car parks so I want to print Belfast + has 5 car parks. Although I can only get it to add up the total amount of car parks and to repeat all the town names.

    public class calculate {

    public static void main (String []args) { try { int carParkno = 0; String myCV = "/Users/jack/Desktop/examRevision/Open_Data_car_parks.csv"; File myFile = new File(myCV); Scanner mySc = new Scanner(myFile); while(mySc.hasNextLine()) { String record = mySc.nextLine(); String[] parts = record.split(","); String carPark = parts[0].trim(); String town = parts[1].trim(); if(town.equals(town) && carPark.equals(carPark)) { System.out.println(town); System.out.println("Number of car parks is" + carParkno); } } //System.out.println("Number of car parks is" + carParkno); } catch(FileNotFoundException e) { System.out.println("File Cant be located"); } 
    submitted by /u/Life59
    [link] [comments]

    Question regarding summer internships after first year of university

    Posted: 27 Feb 2018 09:58 AM PST

    Is this an option in the programming field? Furthermore is it worth it or is it better to wait until I've learned more and can be a more useful asset? There's nothing more that I hate than feeling more like a burden than an actual help to somebody

    I'd be interested in knowing what people have done at different stages in their college careers

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

    Run php code locally

    Posted: 27 Feb 2018 01:01 PM PST

    Im creating a website that has html, css,javascript, and php, how can I test the php locally within my mac, instead of launching it to a dynamic server?

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

    How can I turn this code into a menubar app?

    Posted: 27 Feb 2018 06:52 AM PST

    Accuweather.com provides a code that becomes a weather widget when added to a website. I want to use that code to make a menubar app, so that when I click the icon the widget will show (updated to reflect the latest weather). I have no idea where to start -- is there a program that can handle this for me? I know nothing about coding/programming.

    EDIT: Forgot to mention I'm working with Mac OS here.

    Here's the code:

    <a href="https://www.accuweather.com/en/us/boston-ma/02108/weather-forecast/348735" class="aw-widget-legal"> <!-- By accessing and/or using this code snippet, you agree to AccuWeather's terms and conditions (in English) which can be found at https://www.accuweather.com/en/free-weather-widgets/terms and AccuWeather's Privacy Statement (in English) which can be found at https://www.accuweather.com/en/privacy. --> </a><div id="awtd1519738000833" class="aw-widget-36hour" data-locationkey="" data-unit="f" data-language="en-us" data-useip="true" data-uid="awtd1519738000833" data-editlocation="true"></div><script type="text/javascript" src="https://oap.accuweather.com/launch.js"></script>

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

    Can a Linux FUSE implementation write files to it's own mounted directory (that remain when the FUSE app is not running)?

    Posted: 27 Feb 2018 04:54 AM PST

    So for example, say I write a FUSE app that gets files from some remote server or something, but when the user modifies those files, it stores them files locally. Where can I store that data? I understand that the mount point is supposed to be an empty directory, but it would be really convenient if I could write the files right there (maybe make them hidden). However, I'd think that if tried to open and write a file there, it would just invoke my own FUSE write functions and go into a recursive loop. Is there a way I can say "no really.. invoke the default write function for ext4 (or whatever FS the mount point is under). Then if I umount it and remount it later, the files will still be there for next time?

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

    Listing years of experience (Application/Resume Question, not sure if allowed)

    Posted: 27 Feb 2018 08:37 AM PST

    I'm currently looking for a job and have a small conflict on how list my experience. I completed my Bachelors last year and was in programming classes for 3 of the 4 years (2014-2017). I was also working as a programmer for 2 of those years (2015-present). Going by calendar year I know that I have been programming for 4 years when I started my Bachelors. Having worked at the same time if I didn't over lap School + Work I could say I have 7 years experience. Is there a good way to equate that on a resume?

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

    Can someone help me write this MIPS assembly program?

    Posted: 27 Feb 2018 10:01 AM PST

    How can I use write a program that does outputs the sum 12 + 23 + ... + 10*11 while using mflo?

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

    To programmers who have coded 3D modeling/printing software, how is geometry made solid?

    Posted: 27 Feb 2018 12:19 AM PST

    For the 3d printing question:

    If all you have are list of vertices, then you can't print out a solid object since you would just be putting dabs of plastic in midair, where your list of vertices say.

    How does the 3d printer know where to continuously print and where to stop, if it doesn't have any other points than the list of vertices?

    Here's a picture I made: https://imgur.com/a/tF6mi

    In the first picture, observe the red triangle. The corners of that triangle are what is stored in the STL file. If the 3d printer were to just follow this, it would create 3 dots of plastic, with no line connecting them. Obviously, that's not what happens in a real printer. To make it a solid, you need to add lines in between the points.

    If you look at the second image, one way to make it a solid is to calculate the lines that make up the walls of the triangle, then connect the walls with lines made by the 3d printer (not sure if this is actually the case), OR draw lines ONLY between vertices listed in the STL, but that would create a hole in the triangle, wouldn't it?

    For 3d modeling:

    If you just have a list of vertices, how do you display solids? For example, if you have a triangle's vertices, how do you "fill in" what makes up the inside of that triangle? Is the computer calculating the 3d equations for the lines connecting each of the vertices for all the triangles?

    Also, assuming that we are looking at one of the triangles making up the model. Is it usually coded so that each triangle if of only one solid color? Is it possible to make just one triangle multiple colors?

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

    No comments:

    Post a Comment