• Breaking News

    Sunday, March 10, 2019

    Need help in using a huge template Ask Programming

    Need help in using a huge template Ask Programming


    Need help in using a huge template

    Posted: 10 Mar 2019 08:53 PM PDT

    I discovered this admin template called, Stisla (https://getstisla.com/)

    I haven't tried something so huge like this before, after I downloaded the depencies, it grew in size up to 200+mb, just for a template :3

    I am also planning to use this with symfony ang angularjs, though I am having trouble as how I would set the directories, where to create or put new pages, and mainly, HOW TO CUSTOMIZE the pages together with symfony and angularjs.

    It contains a lot of javascripts and css, looking at it makes me frustrated.

    It would truly help if someone could provide me a workflow? or what steps should I take.

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

    Is it possible to program from your iPhone?

    Posted: 10 Mar 2019 07:26 PM PDT

    I met someone this past summer who had some sort of command line interface on his Android. I'm not really sure what capabilities he had, but it looked like he could enter in bash commands and explore file directories and whatnot. Is this (or will this ever be) possible on iPhones? If not, is there any way I could work on larger projects (for college assignments mainly) from my iPhone? Thanks!

    ~ Shoot for the Stars ~

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

    GO vs RUST?

    Posted: 10 Mar 2019 02:32 PM PDT

    I am thinking to learn a new low level programming language but i am between learning Rust and Go, any help/suggestion would be great. Thanks in advance. And btw just for general purpose, and nothing special in mind.

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

    Do you ever suffer from code writer's block?

    Posted: 10 Mar 2019 05:37 AM PDT

    I've noticed a pattern in my own work where i suffer from a kind of code writer's block. When i googled this, it was hard to come up with a conclusive definition, so what I'm talking about here is:

    • Working with problems i know how to solve.
    • Not being exhausted, demotivated or otherwise unproductive at work. For instance, i can still plan and participate efficiently in meetings and help others who get stuck on a problem. I can go through mentally challenging tasks like reading legal documents or designing system architectures.
    • Yet, when i sit down to work on a problem, i have a hard time implementing what i intend to do. I lose focus halfway through my train of thought and have to start over. I get stuck just staring at the screen, and i get dumbfounded at problems way below the difficulty i can handle.

    I'm curious about whether others have experienced the same thing, and what you've tried to do to alleviate it.

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

    Do you know any good video live streaming API?

    Posted: 10 Mar 2019 11:22 AM PDT

    I need to make a website supporting multiple live streams simultaneously. Basically, I need users to be able to start a live from my website, and to watch those lives from the same website.I'm looking for an API that would allow me to do so.

    I've looked the following:- livestream.com: Seems fine, but when looking through the documentation, there is nothing about starting a livestream

    - mux.com: The pricing is by viewer, which is going to cost a lot at the end of the month

    - api.video: They are acting like they are free while they're not (saying "free" everywhere, hiding their Pricing tab at the end of a long page) - this isn't a good sign. And they cost way too much.

    I'm a junior developer, and I'm not sure what's needed for such a website sadly. If anyone can help with information or ideas about other APIs I could use, I would appreciate that a lot.

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

    LINQ, lambdas, and Java

    Posted: 10 Mar 2019 02:38 PM PDT

    Background: I'm I'm one of the weird ones who has an education in a discipline not in CS but have been working in software engineer for a little while.

    I'm curious if LINQ is just C# fancy functionality on top of your basic Lambda. In Python is was map lambda, I'm not sure what it is Java but if I had a need to know it I'm sure it's a variation of map reduce.

    I'm just curious why people use LINQ with anonymous functions for everything. Got a need to act on a collection, use LINQ. You can use anonymous functions without LINQ in C# but I don't know if people are abusing what was intended to good way to do database stuff almost everything.

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

    Programming languages with TeX-like macros?

    Posted: 10 Mar 2019 06:06 PM PDT

    Are there any programming languages with TeX-like macros?

    What I mean by this is a language where one could define macros to redefine keywords, redefined what for loops look like, and basically redefine the syntax of the entire language (of course, like TeX, the original syntax would remain valid; I do not mean this `redefine').

    There are, of course, languages with macro capability; what I'm asking about is a language where you can literally redefine the entire look of it.

    Note: I'm not saying such a design decision would be good, I'm just wondering whether something like this exists out there.

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

    When applications have keywords that aren't allowed, like cuss words, does this mean that somewhere in the source code there's an enum or array that contains "fuck"?

    Posted: 10 Mar 2019 08:32 AM PDT

    How can I fix the conflicts in this YACC grammar?

    Posted: 10 Mar 2019 05:00 PM PDT

    Why does my method say it must return a type string and gives me an error even though my method does return a type string

    Posted: 10 Mar 2019 09:10 AM PDT

    public static String grade(){

     Scanner s = new Scanner([System.in](https://System.in)); System.out.println("Please enter your letter grade"); String grade = [s.next](https://s.next)(); String a = "Your grade is between 93.0 and 100"; String b = "Your grade is between 83.0 and 93.0"; String c = "Your grade is between 73.0 and 83.0"; String d = "Your grade is between 63.0 and 73.0"; String f = "Your grade is less than 63.0"; if(grade.equals('A')){ return a; }else if (grade.equals('B')){ return b; }else if (grade.equals('C')){ return c; }else if (grade.equals('D')){ 

    return d;

     }else if (grade.equals('F')){ return f; } } 

    i dont understand what is wrong with this at all it it just keeps saying this method must return a result of type string even though it does

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

    What are the different ways to flaunt your coding skills?

    Posted: 10 Mar 2019 08:26 PM PDT

    Web design vs Programming?

    Posted: 10 Mar 2019 01:54 PM PDT

    Hello. I am considering a major career change (my primary profession is very far removed from anything computer) mainly for health reasons.

    I have experience with web design and major CMSes but I fear it isn't profitable, especially as a freelance designer. Would investing in learning programming and then delving into it as a beginner be a wise choice? Are either a viable source of income these days (as freelance)?

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

    [C++] How do you convert a compile-time if statement into two separate compiled functions?

    Posted: 10 Mar 2019 01:43 PM PDT

    I have two functions, which are identical except for one constant array value. A ternary statement does the job but conceptually nothing is 'conditional' on anything; they're two different functions! This doesn't extend well to when there are more than two variants of a function because if scopes variables so you can't set them to const.

    inline int function(const bool the_diagonal_version) { // do something const int orthogonal[4][2] = {{1,0},{-1,0},{0,1},{0,-1}}; const int diagonal[4][2] = {{1,1},{1,-1},{-1,1},{-1,-1}}; const auto directions = the_diagonal_version?diagonal:orthogonal; // use these directions, maybe even in a function that overloads/enable_ifs for const/non-const. return 0; } 

    Is there some clever trick with the newfangled constexpr if ? Alternatively is there some hellscape SFINAE solution that at least helps me avoid duplicating code?

    Edit: is C++20's constinit what I'm looking for?

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

    How can i do this better ?

    Posted: 10 Mar 2019 10:22 AM PDT

    Hello guys!

    So I'm working on a Angular project for myself to test out stuff. And i have this database with products taht i display through array using a service that i subscribe to. The service function basically sends a get request to an API(.Net Core based) to fetch the products. So its all dandy and good with displaying. The problem is I'm having hard time filtering the information using checkboxes.

    So i went around the internet looking for solutions trying to figure out what i can do and testing and i came up with this very(stupid) i would say on my end idea that somewhat works, but i'm not sure how to make it better or to make it dynamic, so i don't have to run all this functions and checkers. I was told only 1 filter would be enough, but i guess i didn't understand how to use it properly, so here is my code :

    Product-list.html

    <div class="category-container"> <div class="wrapper"> <h2>Material</h2> <div class="form-check"> <input type="checkbox" [(ngModel)]="cotton" (change)="loadProducts()"> <label for="defaultCheck1" class="form-check-label"> Cotton </label> <input type="checkbox" [(ngModel)]="silk" (change)="loadProductsSecond()"> <label for="defaultCheck1" class="form-check-label"> Silk </label> </div> </div> </div> <div class="container"> <div class="row align-items-start"> <div *ngFor="let product of products " class="col-6"> <app-product-card [product]="product" ></app-product-card> </div> </div> </div> 

    Product-list.component.ts

    import { Component, OnInit, Input } from '@angular/core'; import { ProductService } from 'src/app/_services/product.service'; import { Product } from 'src/app/_models/product'; @Component({ selector: 'app-product-list', templateUrl: './product-list.component.html', styleUrls: ['./product-list.component.css'] }) export class ProductListComponent implements OnInit { @Input() product: Product; products: Product[]; cotton: any; silk: any; filter1 = 'Cotton'; filter2 = 'Silk'; constructor(private productService: ProductService) { } ngOnInit() { this.loadProducts(); } loadProducts() { this.productService.getProducts().subscribe((products: Product[]) => { this.products = products; if (this.cotton === true) { const a = this.products.filter(e => e.material === this.filter1); this.products = a; } }, error => { console.log(error); }); } loadProductsSecond() { this.productService.getProducts().subscribe((products: Product[]) => { this.products = products; if (this.silk === true) { const a = this.products.filter(e => e.material === this.filter2); this.products = a; } }, error => { console.log(error); }); } } 

    I honestly think this is a very very bad way to do this. But i spent fair share of hours today, trying to figure a more smart way with checkboxes. On top of that, i am unable to use both checkboxes, it either shows the value of one or the other. I really found a lot of text input ways that i know how they work etc, but i don't know why checkboxes are being so tough on me ;/

    Thanks in advance !

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

    How make open all outbound links in new "continue destination" page

    Posted: 10 Mar 2019 09:55 AM PDT

    Hi i have a website and have only basic programming skills. I want to have all outbound links on my site to first go through a page showing people that they are leaving my site and where they have the option to continue or go back.

    However, like i said, i want it to only do that on outbound links, not on my own domain links like menu navigation. Is this possible?

    Thank you in advance.

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

    How to come up with ideas?

    Posted: 10 Mar 2019 01:29 PM PDT

    Why is my method returning false even though the conditions are true

    Posted: 10 Mar 2019 09:42 AM PDT

    public class Lab3Exercises {

    public static void main(String\[\] args){ Scanner s = new Scanner([System.in](https://System.in)); System.out.println("Please enter a word to check if it is a palindrome"); String myP = [s.next](https://s.next)(); System.out.println(palindrome(myP)); } public static boolean palindrome(String p){ String myWord = p; String reverseWord = ""; int i = 1; while (i < myWord.length()){ reverseWord = myWord.charAt(i) + myWord.substring(0, i) + myWord.substring((i + 1), myWord.length()); i++; } if (reverseWord.equals(myWord)) { return true; } else{ return false; } } 

    I checked and the reverseWord is the exact same as myWord yet it returns false everytime. I've tried hannah, racecar, etc. they all return false

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

    Function from type Class

    Posted: 10 Mar 2019 07:17 AM PDT

    I have a class A, C and a function B. The function is written in class C, it looks like this: private A B() { } What does it mean when your function's type is a Class?

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

    How do I Turn On/Off a TP Link Plug with Children [Javascript]?

    Posted: 10 Mar 2019 07:01 AM PDT

    I'm just starting to learn Javascript and I'm having trouble sending ON / OFF commands to individual plugs on my TP Link HS300 smart power strip. The tplink-smarthome-api documentation says this model will have a children property and if the plug is instantiated with a childId it will control the outlet associated with that childId. How do I send an on off command to it with the childid?

    API Documentation - https://www.npmjs.com/package/tplink-smarthome-api

    This is my code to toggle the device on without specifying children.

    https://pastebin.com/Ppwh3XLg

    Thanks in advance.

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

    Why do I get this unexpected output, regarding Threads and intrinsic locks [Java]?

    Posted: 10 Mar 2019 12:56 AM PST

    Hey guys, I am currently going through Cave of Programming multithreading course.

    In that course, in one lesson there were two methods, both had synchronized blocks inside of them (and separate objects for locks). Tutor said that if two threads call those two methods at a roughly same time (both Threads call both methods), one would be able to run first method, the other one wouldn't be able to call that method (because it didn't obtain the lock), but it would be able to call the second method (so you get the effect of simultaneous execution of methods).

    However, when I ran the program, and added some print statements I don't get the expected output.

    Code:https://pastebin.com/fLrjfS7S

    I would expect to get: Current Stage:s1, Current Thread:Thread 0 followed by Current Stage:s2, Current Thread:Thread 1, since those two methods are ran by different threads in a parallel fashion.

    What I get is: Current Stage:s1, Current Thread:Thread 0 followed by Current Stage:s1, Current Thread:Thread 1 , as if Thread 1 is waiting for Thread 0? There are two locks, so basically Thread 1 should see that lock1 reserved for stageOne() is already taken (by Thread 0), but lock2 isn't for stageTwo(), so shouldn't it just go execute stageTwo()? I do get reduced time by 2, compared to just regular synchronize keyword added to the method (instead of sync block), because in that scenario Thread 1 has to wait for Thread 0 to free lock (since there is just one), so in that case methods aren't ran in parallel fashion. So I do get the desired result (of parallel execution, which is confirmed by the time it takes everything to finish), but the printing results don't reflect it.

    What is happening?

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

    How difficult is it to learn Qt for a modestly experienced programmer?

    Posted: 09 Mar 2019 11:37 PM PST

    I am looking to make a desktop application with a team of 3 other people for a competition. We have moderate experience with C++ programming but are completely new to Qt. Is it difficult to learn?

    How does it compare in difficulty to JavaFX assuming we have equal skill level in C++ and Java?

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

    No comments:

    Post a Comment