• Breaking News

    Friday, January 3, 2020

    Did anyone here move from a normal job to freelancing? Ask Programming

    Did anyone here move from a normal job to freelancing? Ask Programming


    Did anyone here move from a normal job to freelancing?

    Posted: 03 Jan 2020 02:12 PM PST

    1. Was it worth the move? Are you satisfied or do you miss your regular job?

    2. How did you find that job? In the past I had tried a lot to get a project but I was always outbid by someone else. I never had a freelancing project.

    3. Do you still have a good work-life balance/

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

    Power Query/Pivot - can i create a pivot table from powerpivot then reload it into PowerPivot via Powerquery

    Posted: 03 Jan 2020 05:43 PM PST

    Hey community,

    I have created a normal pivot table in excel from number of powerpivot tables that were loaded via power queries in the same workbook. Am I am to then load this pivot table back into power pivot for further manipulation?

    When i try it says i can't overlap anothe pivot table??

    I've used this basic premise with power query and tables. WHy wont it work for pivot tables? Even if it converts it into a normal table when i reload it back into power pivot.

    -DeliriousWanderer

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

    Anagrams in C

    Posted: 03 Jan 2020 05:29 PM PST

    Hello guys, I'm struggling with the following problem:

    An anagram is a word or phrase formed by rearranging the letters of a different word or phrase. It's important to note that if a letter is repeated a certain number of times, it needs to repeat same number of times in other word too.For example, TRAVA, anagrams are AVATR, ARTVA, ATARV, but RATV isn't anagram.

    I need to write function remove_anagrams that takes two strings, and removes from first string all words that are anagrams of some words from second string. We neglect the difference between uppercase and lowercase letters. Word is defined as uninterrupted array of uppercase and lowercase letters.Function should also ignore whitespace characters and it should return pointer on start of first received string.

    So far, I made a function anagram which compares two strings and checks if they're anagrams, here's the code:

    #include <stdio.h> int anagram (char* s1, char* s2) { int first[26]={0}, second[26]={0}, i; // frequency of characters of the first string while(*s1!='\0') { if(*s1>='A' && *s1<='Z') first[*s1-'A']++; if(*s1>='a' && *s1<='z') first[*s1-'a']++; s1++; } // frequency of characters of the second string while(*s2!='\0') { if(*s2>='A' && *s2<='Z') second[*s2-'A']++; if(*s2>='a' && *s2<='z') second[*s2-'a']++; s2++; } // comparing the frequency of characters for(i=0;i<26;i++) if(first[i]!=second[i]) return 0; return 1; } int main() { char s1[]="CAT"; char s2[]="ACT"; if(anagram(s1,s2)) printf("Strings are anagrams."); else printf("Strings aren't anagrams."); return 0; } 

    Now I don't know how to make this function which removes the words that are anagrams of some words from the second string.

    I was thinking that maybe I need a while loop which goes through the first string and ends at \0 (while (*s1!='\0')), then looks for words ("Word is defined as uninterrupted array of uppercase and lowercase letters") so I look if there is space between them and that's a word, and compares this word with words from the second string. If the word is anagram then I put one pointer on the first letter of the word and another pointer at the end of the word and remove everything between these two pointers. Is my thought process good for this other task, and if yes, can you help me do this?

    Thank you in advance.

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

    Share Your Knowledge: Can experienced programmers here share tips/give their 2 cents on a great testable code?

    Posted: 03 Jan 2020 10:47 PM PST

    If possible, can you add learning resource that helped you evolve into the programmer you're today?

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

    Is there any resource to "Automate the boring stuff" equivalent for Bash?

    Posted: 03 Jan 2020 03:24 AM PST

    I am trying to create scripts that are ready to go on windows operating systems. And most of the time I can't install python, but Bash is like prebuilt in all PC. So, how do I get started with using Bash as my automation language?

    I want to do create pdf files from inputs, send virtual inputs, manage clipboard, do calculations from command line using bash scripts. Eventually do something as ambitious as controlling the web browser with some form of implementation of selenium. Even if it requires me to install stuff, I want to atleast get started with something that has automation in mind.

    Is there an all encompassing resource or book for Bash for automation like we have for python with "Automate the boring stuff with python"?

    Edit : I feel really stupid now. The difference between Bash, CMD, Powershell in 2 minutes. I have been constantly switching between CMD, Powershell, Git Bash and WSl, I never bothered looking it up. I thought they are syntactically similar and are interchangeable.

    And I skimmed through the difference between Terminal vs Bash vs Command Line vs Prompt in 11 minutes

    I think what I need to know is how CMD works not bash. Well, I need to learn Bash anyway, but for random uses I would also need to know CMD. Many PCs don't have powershell pre-activated, I think.

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

    Predictions for this decade?

    Posted: 03 Jan 2020 09:46 PM PST

    Are these inferences about javascript correct?

    Posted: 03 Jan 2020 03:21 PM PST

    Since javascript is written in C:

    • C is more powerful than javascript.
    • Anything javascript can do, C can do.
    • Theoretically, I can write a language in javascript in an analogous manner of how javascript is written in C.
    submitted by /u/mementomoriok
    [link] [comments]

    practical case for MDA(model driven architecture)?

    Posted: 03 Jan 2020 05:29 PM PST

    i don't know if this is the place to ask this i'm kinda new to reddit but, i need to present a practical case algon with an investigation about MDA for a very important university assingment, but i don't know what would be an mda practical case, do i have to make the model for a proyect but don't make the proyect itselft? that would just be uml, what would differentiate it from mda?.

    i just have a week to do it but all i find are magnanimous tasks that take lots of time to make

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

    Is it possible to send a <svg> between two js files?

    Posted: 03 Jan 2020 04:26 PM PST

    Hey,

    Ive got a js file from a github project that encolors parts of the svg based on a bunch of path-tags. I wondered if its possible to load that manipulated svg file into another js file? Do I need to save it from the svg-js and than get it from the other-js or is there another way?

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

    Numbers within Strings

    Posted: 03 Jan 2020 03:36 PM PST

    http://puu.sh/EW7EX/4f6b007086.png

    I just barely started trying to learn programming and I was watching a video where it stated that strings that had numbers didn't need to have quotations marks. I tried to switch the age to just a plain 50 but it just gave me an error.

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

    Which blockchain-like platform has the lowest lag for massively multiplayer game (mmg) painting? I imagine an unlimited size space where resolution varies to keep it updating the screen as fast as games, and whichever fiew have the most compute power together paint something that many others watch

    Posted: 03 Jan 2020 02:59 PM PST

    like those few dreaming together a live streaming video that many others would watch, sometimes affecting fewer pixels for smaller times... I'd prefer that everyone have equal influence on the video, but if you have to count cryptocurrency instead of just proofOfWork then its already far laggier than realtime video or realtime games. Whats available?

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

    While building a Tic-Tac-Toe using Reac, a column of 3x3 gets misaligned sometimes when one button is clicked.

    Posted: 03 Jan 2020 02:54 PM PST

    Screenshot of the issue: https://imgur.com/a/mlSr9DI and https://imgur.com/a/06WJxem (Please note that initially when the app first starts, the blank 3 by 3 is displayed correctly)

    Hello, I am getting into React and started building the application. There are few more things i need to add and fix before i call it a "completion", and this misallignment is one of issues i have difficulty resolving.

    function Square(props){ 

    .......

    return( <div> <Pulse> <button className="squareBtn" style={{backgroundColor: 'greenyellow'}} onClick={props.onClick}> <h1>{temp}</h1> // this will display O or X </button> </Pulse> </div> )

    }

    class Board extends React.Component{ render(){ return( <div className="boardRow" > <Square test0={this.state.squares_status} test1={0} onClick={() => this.handleClick(0)} /> <Square test0={this.state.squares_status} test1={1} onClick={() => this.handleClick(1)} /> <Square test0={this.state.squares_status} test1={2} onClick={() => this.handleClick(2)} /> </div> .....and two more above for 3 by 3. ) }} // Lastly below is css for boardRow className .boardRow { display: inline-block; } 

    I tried different values for css file (especially 'display', 'padding', and others).

    Could someone pelase advise on how i can fix the issue or give me a direction where i should look into? Please let me know if you require any more information from me and i will be provide what i can.

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

    Programming - what do I learn for my goals?

    Posted: 03 Jan 2020 02:30 PM PST

    By all means, I'm not looking for a shortcut. Quite the opposite - I'm looking for something that will take a lot of time to learn properly, something that's necessary and can give value to people. At the same time, I need some kind of a belief in me that what I'm learning is not useless, so here I am.

    I've very little experience with programming so far, but It's pretty fun. I'm young and impressionable. Please, be gentle :)

    Couple of things I'm looking for specifically :

    • Something that can eventually be streamlined.
    • Generating interest
    • Generating passive income
    • Requiring very little upkeep (my time wise, like 2 hours a day or something) once finished , like a well designed store or something. Automation might be the word I'm looking for.

    Currently, In order to achieve all that (not only programming that is) in general, It seems like I'd need to...

    • Invent things or services.
    • Become a business owner, likely multiple etc.
    • Get sponsors...?

    I'd appreciate the guidance! Thank you.

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

    React - how to change background with state?

    Posted: 03 Jan 2020 02:22 PM PST

    import React, { Component } from "react"; import { tsParenthesizedType } from "@babel/types"; class Counter extends Component { constructor(props) { super(props); this.myFunction = this.myFunction.bind(this); } state = { bgcolor: "" }; styleQuestion = { backgroundColor: this.state.bgcolor, }; render() { return ( <div style={this.styleQuestion}> <button onClick={this.myFunction} > </button> </div> ); } myFunction() { this.setState({ bgcolor: "blue" }); this.forceUpdate(); } 

    When I click the button, the state of bgcolor changes (I debugged it) but the background doesn't change. What am I missing here?

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

    About the efficiency of garbage collector in C#

    Posted: 03 Jan 2020 02:12 PM PST

    What i understood from what iread is this: running time memory is stored either on the stack or in the heap.

    Variables go into the stack and reference types like classes go in the heap. Memory on the stack gets disposed the instant the variable ceases to exist, but heap memory needs to wait for the garbage collector, like every 30 seconds. This may cause frame drops. If any of this is incorrect please tell me.

    The question is, do class objects instantiated inside methods go into the stack or the heap? Also, how can i make less garbage?

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

    What is the best website to improve my rusty c++?

    Posted: 03 Jan 2020 03:46 AM PST

    I have been working for a few years but c++ is not that great as it should be. An example is that I didn't remember that c++ has garbage values by default.

    I am looking for a site where I can get practice problems and implement them. I also want to be able to get reviews from people online. That is very important.

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

    CPU usage and multithreading oddity

    Posted: 03 Jan 2020 01:21 PM PST

    I've got a couple of functions which read bytes (floats), do a couple of calculations on them, and then write floats (bytes). I'm using SSE so that part should all be nice and quick.

    To make it even quicker, I'm trying to multithread it. My CPU usage jumps from 12.5% (1/8th) to to 100%, but the functions are only very slightly quicker. Other functions, which do a lot more calculations, see a much bigger benefit from multithreading (while also increasing CPU usage from 12.5% to 100%).

    Is this likely to be because moving memory around is acting as a bottleneck? Are there any fancy principles I should be applying, rather than simply breaking up the function into multiple calls on different threads?

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

    What is the underlying mechanism for when you move a file from folder 1 to folder 2?

    Posted: 03 Jan 2020 06:48 AM PST

    I'm curious if it's something reference based, or if it's writing the file to the buffer, deleting the file, writing the file to folder 2.

    I am using NodeJS right now to move files around my folder, and I am doing it in the latter manner, which seems very inefficient.

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

    Counting Positive Numbers In Vector Correctly, Why Is It Returning A Garbage Value For Negative Numbers?

    Posted: 03 Jan 2020 11:43 AM PST

    #include <iostream> #include <vector> using namespace std; void PlusMinus(vector <int> arr){ int pos_counter; int neg_counter; int zero_counter; for (int i=0;i<arr.size();i++){ if (arr.at(i) > 0){ pos_counter++; } else if (arr.at(i) < 0){ neg_counter++; } else{ zero_counter++; } } cout<<pos_counter<<endl<<neg_counter<<endl<<zero_counter<<endl; int pos_ratio=pos_counter/arr.size(); int neg_ratio=neg_counter/arr.size(); int zero_ratio=zero_counter/arr.size(); cout<<pos_ratio<<endl; cout<<neg_ratio<<endl; cout<<zero_ratio<<endl; } int main() { std::cout << "Hello, World!" << std::endl; vector <int> test={1,5,7,9,15,16,-3,0,0}; PlusMinus(test); } 

    Hey guys, pos counter is returning 8, zero counter is at 2 which is correct, however negative is at 6421953. Why is it doing this but works for the other two?

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

    Time Complexity Puzzle

    Posted: 03 Jan 2020 10:07 AM PST

    I have stumbled upon a puzzle in a book I'm reading for uni which I can not understand. There is this piece of code:

    for(int i=1; I<N; i=2*i) {
    for(int j=0; j<i; j++) {
    someMethod(); // O(1)
    }
    }

    And in the book they say its time complexity is O(N) but I just can not see how this is possible as it is a nested loop where one of the loops clearly is lg(N). Is there something I'm missing or is the misprint in the book?

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

    Is there a way to programmatically use Apple Pages Word-Processor?

    Posted: 03 Jan 2020 09:12 AM PST

    For example,

    In the source file I'd like to have a string like: "Hello <b>World</b>" Some sort of compilation would happen,

    and then the end result would be a .pages document with 'hello World.

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

    How to insert CSS @Media queries in React JSX?

    Posted: 03 Jan 2020 08:58 AM PST

    I've been watching this tutorial above and it doesn't mention about CSS. I've googled many sites but still no idea where to implement it. What I'm trying to implement is:

    @media only screen and (min-device-width : 768px) and (max-device-width : 1024px) { /* Styles */ } 

    and I'm getting this error:

    http://prntscr.com/qiyvk7

    I can't find any documents on React JSX with CSS...

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

    Anyone know of a software COM port sniffer for Windows 10

    Posted: 03 Jan 2020 08:10 AM PST

    Anyone know of a software COM port sniffer for Windows 10? I'd like something from a trusted source. Microsoft's PortMon for Windows is not supported for Win 10. Eltima, AGG, an others are from "masked" sources. That is the company addresses of these companies are the same addresses of many other companies. Therefore, it obscures the real source of the software. I need something trusted to both use and recommend. Price is not too important. I can't use the hardware approach because I need to capture data from the application that uses virtual USB/COM port.

    Thanks

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

    Looking to add a compiled language to my toolkit

    Posted: 03 Jan 2020 07:49 AM PST

    I have been programming primarily with PHP and NodeJS. I would like to add a compiled language to my toolkit.
    I was given a task at work using Go and found it easy to learn, however Java is where the jobs are.
    So b/w Go and Java which one should I choose ?

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

    No comments:

    Post a Comment