• Breaking News

    Tuesday, August 21, 2018

    How can i sort a json array in php? Ask Programming

    How can i sort a json array in php? Ask Programming


    How can i sort a json array in php?

    Posted: 21 Aug 2018 06:41 PM PDT

    I want to sort the list by the smaller difference between F and A fields :

    $jsonTeams = '[ { "Team": "Arsenal", "P": "38", "W": "26", "L": "9", "D": "3", "F": "79", "A": "36", "Pts": "87" }, { "Team": "Liverpool", "P": "38", "W": "24", "L": "8", "D": "6", "F": "67", "A": "30", "Pts": "80" }, { "Team": "Manchester_U", "P": "38", "W": "24", "L": "5", "D": "9", "F": "87", "A": "45", "Pts": "77" }, { "Team": "Newcastle", "P": "38", "W": "21", "L": "8", "D": "9", "F": "74", "A": "52", "Pts": "71" }, { "Team": "Leeds", "P": "38", "W": "18", "L": "12", "D": "8", "F": "53", "A": "37", "Pts": "66" } ]'; 

    submitted by /u/Don-g9
    [link] [comments]

    What is the weirdest yet most satisfying API you know of?

    Posted: 21 Aug 2018 04:07 AM PDT

    I recently stumbled across a Python API for ordering Domino's Pizza and I started to wonder if there were any more weird, pointless but mildly useful APIs out there.

    If you know of any just a link to the NPM page or Github page or wherever it's hosted and a short description of what it's for would be perfect.

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

    Java: can this be simplified by using nested for loops?

    Posted: 21 Aug 2018 04:40 PM PDT

    Basically, I want the console to print 5 lines, with each line containing a sequence of numbers that represent an equation. Right now I have:

     for(int a = 1; a <= 5; a++) { System.out.print(2*a + " "); } System.out.println(); for(int b = 1; b <= 5; b++) { System.out.print(15*b - 11 + " "); } 

    So the for loop outputs 5 numbers from the equation (2x) in one line, and the second for loop does the same thing, but for the equation (15x - 11). The way I'm doing it now, I would have 5 separate for loops (one for each equation), but is it possible to simplify this code using nested for loops?

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

    Is there a program that can be written that will translate foreign language text into english?

    Posted: 21 Aug 2018 06:06 PM PDT

    I am an American living in China starting a agriculture business. Currently I am researching Greenhouse Control Systems software to control different systems in my greenhouses. I have found some pretty interesting systems but they only come in Chinese language but doesn't come in English version or allow to be translated into english. This is great for my General manager and the assistant growers who are Chinese but not for me. Sure, I can learn the characters but that takes a lot more time that I have. I am pretty decent speaking it but Characters are a different beast.

    So I guess what I am asking is there a program that can be written into the software where it acts like google translate when it asks you if you want the page to be translated in the prompt? This would help out so much and I have no idea where to research this. Thank you for your assistance.

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

    Bachelor Degrees (CompSci vs. Software Engineering vs. Application Development)

    Posted: 21 Aug 2018 03:54 PM PDT

    Hi there!

    I currently work in Tech Support (supporting end-users for server software) but I've been getting bored and realized I don't have a lot of growth opportunities. I've been having fun learning Python which has piqued my interest in going back to school and to focus on programming. I ultimately want a coding job.

    I have a 2-yr degree already (Associates of Applied Science - IT Networking) but very few credits would transfer to a Computer Science (BS) degree. However, I found out that I am roughly 70 credits shy of a Bachelors of Applied Science - Software Development (BAS) degree. Similarly, I also found a B.A.S. program for Application Development.

    In regards to the BAS vs BS — I'm wondering...would a BAS degree not hold the same weight as a BS in CompSci? Would there be an effect on job opportunities and/or Salary?

    For the two different BAS degrees — Are the job opportunities for an Application Developer really that different than a Software Engineer? (...and is that different than a Software Developer?)

    I just want to make stuff and have more career opportunities, but I also don't want to sink more $$$ into the BAS if a BS is really worth it in the end

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

    Is there a sub to exchange experiences and ask opinions or help for MINIGUI programming ?

    Posted: 21 Aug 2018 09:42 AM PDT

    Mutable and Immutable?

    Posted: 21 Aug 2018 06:20 AM PDT

    So I jut learned the difference between Mutable and Immutable, and am trying to understand why there are 2 separate mechanics for memory allocation?

    While looking for an answer to my question online I noticed that these terms are mostly explained in the Object Oriented circles. Are these terms only found in those circles or are they also found in other types of programming?

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

    Notification working, designing

    Posted: 21 Aug 2018 12:56 PM PDT

    Hi guys, am working on a simple app in which I want to add notification like in Facebook. I don't know what they are called web or push notifications. My thinking is that i have a notifications table in my db. Am thinking to create socket application where in it keep on reading that table for new rows and if it finds new row it emits request to its subscribers. Am sure this is not good strategy to go with. Can anyone guide me what I should learn before working with it and how to implement it in both web app and native app. Btw am working with node, angular, postgres and nativescript. Sorry for my bad English :)

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

    Can someone discover the solution of this small exercise?

    Posted: 21 Aug 2018 12:56 PM PDT

    I was asked to solve this problem in a company test but i couldn't make it work the way it should, even now i try but still... And now i'm curious about the solution

    Exercise:

    Fix the bugs in the registerHandlers function. An alert should display anchor's zero-based index within a document instead of following the link.

    For example, in the document below, the alert should display "2" when Google anchor is clicked since it is the third anchor element in the document and its zero-based index is 2.

    <body> In my life, I used the following web search engines:<br/> <a href="//www.yahoo.com">Yahoo!</a><br/> <a href="//www.altavista.com">AltaVista</a><br/> <a href="//www.google.com">Google</a><br/> </body> 

    Base your solution on:

    function registerHandlers() { var as = document.getElementsByTagName('a'); for (var i = 0; i < as.length; i++) { as[i].onclick = function() { alert(i); return false; } } } /* HTML code for testing purposes (do not submit uncommented): <body> In my life, I used the following web search engines:<br/> <a href="//www.yahoo.com">Yahoo!</a><br/> <a href="//www.altavista.com">AltaVista</a><br/> <a href="//www.google.com">Google</a><br/> </body> */ 
    submitted by /u/Don-g9
    [link] [comments]

    HTML/CSS preloader

    Posted: 21 Aug 2018 10:53 AM PDT

    I was able to make and animate a simple preloader, but I'm unsure about how to make it show just the preloader when I open my page and then have it disappear or just fade away once I feel enough time has passed. Anyone have any advice? Thank you!

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

    Do you use tagged templates in JavaScript? What for?

    Posted: 21 Aug 2018 10:22 AM PDT

    I can't really think of a good use case in my programs for the tagged template syntax in JavaScript, e.g.:

    const test = myFunction`some text goes here`;

    What is a real-life case where you used tagged templates in JavaScript?

    Note: I'm not talking about syntax like below - that one is awesome.

    const x = `${var1} ${var2}`;

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

    Please review my first technical blog post

    Posted: 21 Aug 2018 01:21 AM PDT

    I did have a fellow colleague review the technical side of the blog, and also another to review the structure and the wording/phrasing. I'm looking for some feedback in general, how do you feel about the post?

    https://blog.codecentric.de/en/2018/08/x-509-client-certificates-with-spring-security/

    Edit: I updated the image, thanks @omers!

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

    Finding The Geometric Shape and Size of Clusters

    Posted: 21 Aug 2018 08:43 AM PDT

    I have k clusters of points and Im trying to find the general geometric shape and size of each cluster. e.g. cluster 1 is about a circle with a radius of 100, or cluster 2 is an ellipse with xr 50, yr 200 and tilted at a 45 degree angle, or cluster 3 is about a square, etc.
    These shapes arent going to be perfect obviously, but im just looking for a technique that would estimate these shapes and sizes. Im currently using opencv2 w/python, but any general theory or documentation would be super useful.
    Thanks

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

    I wanna automate my Mullvad VPN client to change autonoumusly its account number every three hours

    Posted: 21 Aug 2018 06:02 AM PDT

    Hi guys, I have this boring thing with the free trial of mullvad VPN: every three hours I have to change the account number manually by going to their website, filling out a captcha, copying the number, clicking on the change number button in the mullvadvpn-app paste the number and click change.

    Now, I've started to thinking about this automation thing:

    1. I should use a (maybe Python?) scraper to get the number, the captcha is like this one.
    2. then I should automate the client to get the code from a text file.

    That's the point. In your opinion, how should I do?

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

    No comments:

    Post a Comment