• Breaking News

    Thursday, August 8, 2019

    Why does python have a reputation for begin good with data? Ask Programming

    Why does python have a reputation for begin good with data? Ask Programming


    Why does python have a reputation for begin good with data?

    Posted: 08 Aug 2019 02:59 PM PDT

    I wrote a switch statement in Lua, does it work like I think I does

    Posted: 08 Aug 2019 09:23 PM PDT

    So after reading about it on a couple different web pages, I made a pseudo-switch statement in Lua, which doesn't have switch statements.

    local function switch(statement, input) if statement[input] ~= nil then statement[input]() return true else statement.default() end end local switch_numbers = { [1] = function (x) print("One") end, [2] = function (x) print("Two") end, [3] = function (x) print("Three") end, [4] = function (x) print("Four") end, [5] = function (x) print("Five") end, [6] = function (x) print("Six") end, [7] = function (x) print("Seven") end, [8] = function (x) print ("Eight") end, [9] = function (x) print("Nine") end, [10] = function (x) print("Ten") end, default = function (x) print("Error!") end, } print("Enter a number...") local x = io.read() switch(switch_numbers, tonumber(x)) 

    So the idea here is that this should save time over a stream of if/elseif statements. Let's say the user inputs something that's not in the table. If this was if/elseif, then the program would have to go through all ten results before knowing that its not on the table and returning the error message.

    But (at least I think) with my "switch", all the program has to do is check to see whether the input is on the table by seeing if its a nil value on the table. If it isn't, then it'll instantly access the function at the value without having to cycle through each if/elseif. And if it does come up nil, then it instantly goes to the default.

    Is that how it works? Or am I missing something?

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

    What is a static ban?

    Posted: 08 Aug 2019 08:51 PM PDT

    Java IDE for beginner

    Posted: 08 Aug 2019 06:34 PM PDT

    Recently I've been trying to learn Java to further my knowledge of programming language and I want a simple ide for java for beginners. I know basic coding from C/C ++. Please don't say Ecplise I hate it with a passion writing a simple Hello program is a nightmare. I know I'm choosy but in want to get my bearings before i start. So if anyone knows dime simple ide for java I'll be very grateful.

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

    Is there a library for executing html in python

    Posted: 08 Aug 2019 08:52 AM PDT

    i have already asked this question here in StackOverflow.

    TL:DR i need a way ro render html in python for my own web browser.

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

    Should the Model in an MVC carry most of the functionality or the Controller.

    Posted: 08 Aug 2019 09:48 AM PDT

    Should the controller serve data to the view instead of the model, or just take charge in case of user interaction with the data? I know there isn't one answer but as a new programmer I would like to know what's the industry standard way of doing?

    tl;dr Should the controller be the mediator between the model and the view?

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

    Looking for a report writer with an end-user design component that works in Xamarin

    Posted: 08 Aug 2019 01:30 PM PDT

    We currently use ActiveReports 11 in a .NET ClickOnce application, but the next version of our product is being developed in Xamarin. We run a SaaS application for around 600 different client sites each with their private databases. We'll be developing in Xamrin.Forms, iOS, and Android to deploy platform-specific versions of the clients. The desktop client will need to include a report designer that power users/admins can use to edit canned reports that we provide.

    I've contacted a sales rep at GrapeCity and they told me the ActiveReports end-user designer component does not work in Xamarin. So I'm looking for an alternative and comparable report engine that does. We do need commonly used export formats: Excel, CSV, PDF, etc, and some way to save modified reports definitions to a database preferably.

    Does anyone have any recommendations? Any help is appreciated.

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

    Maven project refuses to find JDBC driver

    Posted: 08 Aug 2019 01:09 PM PDT

    Here's my maven project structure. Basically my assignment is to get an EAR that holds an EJB, JAR and WAR deployed successfully that can pull from an SQL database. However, the application refuses to find the JDBC driver

    My onboarding-parent has this SQL dependency

     <!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java --> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>8.0.13</version> <scope>provided</scope> </dependency> 

    My onboarding-war contains a listener which gets called after deployment. This leads to a DBConnector class in onboarding =-common (JAR) which gets to this method:

    public void onloading() { try { // Load the JConnector Driver Class.forName("com.mysql.jdbc.Driver"); try { // Connect to DB using DB URL, Username and password con = DriverManager.getConnection(dbURL, user, password); }catch (SQLException e) { System.out.println("Error: Failed to connect to database\n" + e.getMessage()); } } catch (ClassNotFoundException e) { System.out.println("Error: failed to find driver: " + e.getMessage()); } 

    But it always fails at that Class.forName("com.mysql.jdbc.Driver");

    And the message in the console is really unhelpful.

    20:05:28,973 INFO [stdout] (ServerService Thread Pool -- 80) Error: failed to find driver: com.mysql.jdbc.Driver from [Module "deployment.onboarding-ear-0.0.1-SNAPSHOT.ear.onboarding-war-0.0.1-SNAPSHOT.war" from Service Module Loader] 

    Should I be doing anything other than adding that dependency mentioned above? I've been wrecking my head over this for hours and I don't know what I'm missing

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

    Willing to pay for help regarding using iMacro or other program to automate a process for me

    Posted: 08 Aug 2019 07:38 AM PDT

    I am looking to use a program to scrape a change from a website (a number change to >0) and then automatically clicking a box underneath that number when it changes. I am willing to pay for your time to help me get that set up. Please contact me if interested and you are familiar with this program. Using latest chrome, mac osx (10.11.16, can be updated).

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

    Should linting occur in a CI pipeline?

    Posted: 08 Aug 2019 10:28 AM PDT

    As part of a CI pipeline we have some build policies state that the code must be linted to a standard and that the documentation should be in-sync with the code.

    This sometimes requires contributors to run lint and/or auto-documentation commands and commit the changes to a pull requested branch, which in turn triggers the build policies to run again and pass. Happy days. This has the benefit of not leaving contributors to be in more control of their PRs. On the other hand, and probably naively, I've never had a linter or a build-docs command alter my code's behaviour, so perhaps having this control actually serves no purpose and the timesaving would be much more valuable.

    My question is; for processes that do not affect the behaviour of the program such as linting and docs building, is it better to reject a request until a contributor has linted and/or updated docs, or is it acceptable for the CI pipeline to run these processes and perhaps add a linting and/or doc update commit to the history?

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

    copy and rename batched files in linux

    Posted: 08 Aug 2019 08:32 AM PDT

    Hey,

    I've found partial answer on stack but I can't quite get both parts to work.

    I'm trying to both rename and move files on a loop. I'm going to have a directory with files appearing. I basically want to clone them with incramenting numbers and move them to a new directory

    This link is basically what I'm looking for but I have no idea how to edit this response to suit my needs

    link

    Lets Say I have a file

    foo_david51_bar.gz where foo and bar are arbitrarily long different strings.

    What I'm trying to do is copy this file to a new location keep everything the same but increment 51 to 52, then 53 etc

    So something like

    input file is in directory one

    ls /dir_1: Output foo_david51_bar.gz

    Magic command

    ls /dir_2:

    foo_david51_bar.gz

    foo_david52_bar.gz

    foo_david53_bar.gz

    foo_david54_bar.gz

    foo_david55_bar.gz

    foo_david56_bar.gz

    Sed looks like what I want to do, but I'm not sure how to do it

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

    I've built the first part of a bash script but not sure how to introduce a database to petform another function.

    Posted: 08 Aug 2019 03:56 AM PDT

    1. Run a script that gathers info from webservers (predefined list of addresses)
    2. Collates the info into a database
    3. Can perform an action based on the info collected from webservers (e.g is equal to X then perform action X).

    I've made the shell script that does part 1.

    But I'm stuck at 2 and 3.

    I'm open to using other languages... How would you do this if it were u?

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

    Are there good programming habits? (expanded)

    Posted: 08 Aug 2019 03:33 AM PDT

    I'm new in the programming world and, while watching YouTube tutorials, I noticed that the guy would instantly add parenthesis() and curly brackets{} whenever he used functions like *while*. He typed the function added those and started talking about variables and created a few variables, went back to the while function and continued. Is that a good habit - so you can just fill it with whatever and after many lines of code you don't need to remember either you had "closed" the function or is it just personal? Are there good habits to have so they become automatic when you are learning or are they most likely trivial as a beginner? (I mostly found post on what to avoid but not many about what actually to practice and learn when it comes to habits)

    return answer;

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

    Self Hosted apps and Containers

    Posted: 08 Aug 2019 02:52 AM PDT

    Hello all,

    Recently I started using pgblitz which is a set of tools to help you create your own plex server. All the apps you use for this selfhosted plex server are into containers and you can access them through portainer. This is how I learned the existent of containers.

    In my personal life or at work, every time we wanted to test a self hosted app we were setting up xampp or a virtual machine and continue from there. Since I saw how easy was to manage all the installed tools from portainer I was wondering if I can achieve something similar with the all the self hosted apps that I want to try (e.g. zabbix, glpi, znipe-it, invoiceninja, internal sites in work currently using xampp).

    First of all I want to know if it's possible to achieve something like that using containers (docker, kubernetes) and then whats the first steps? Sorry for my ignorance. This is my first time with containers and it's all a bit confusing.

    Thank you all for your time.

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

    No comments:

    Post a Comment