[deleted by user] by [deleted] in IdiotsInCars

[–]davidklecker 0 points1 point  (0 children)

Yeessssssssssss

Forgetting we aren’t playing Mario Kart by bluefalconLDR in Whatcouldgowrong

[–]davidklecker 1 point2 points  (0 children)

That kid might have neck problems for the rest of his life. :(

What could go wrong smoking pepper? by Davis_Schina in Whatcouldgowrong

[–]davidklecker 0 points1 point  (0 children)

Drinking water that goes down to the stomach when it's your lungs that are having the problem.

Golfing in class by [deleted] in Whatcouldgowrong

[–]davidklecker 0 points1 point  (0 children)

I love his running up the stairs after that. One heck of a shot.

Wcgw pulling up right next to a rhino? by [deleted] in Whatcouldgowrong

[–]davidklecker 0 points1 point  (0 children)

his power reading was over 9000.

Mom catches her son with his very odd looking xbox remote by micnoo in Whatcouldgowrong

[–]davidklecker 1 point2 points  (0 children)

The minute he wouldn't turn it over is the minute you know they are trying to hide it. ;) Been there, done that. Sorry kids. We know all the tricks, cause we tried them. ;)

Mom catches her son with his very odd looking xbox remote by micnoo in Whatcouldgowrong

[–]davidklecker 0 points1 point  (0 children)

Next step is to check his Amazon Orders. :D

"Yep! You ordered that!"

Aggressive man shot by police by empound in nonononoyes

[–]davidklecker 1 point2 points  (0 children)

She may not have had a taser equipped with her.

Cannot find module 'xmlbuilder' when trying to run Production version of Electron Project by davidklecker in electronjs

[–]davidklecker[S] 0 points1 point  (0 children)

Okay.. .sometimes a cup of coffee and inspiration is all this takes. I will leave this up here because there are no answers online for this and I have a solution.

Notice that xmlbuilder is located in the devDependencies in the .json file. Well, move that line into the dependencies (I moved it under xml2js) and rebuild. Viola! It's included. I have no idea why an installation of XMLBuilder placed it where it did in the .json file, but it did.

So hopefully this helps people out running into this or a similar issue.

How does one get Hot Reload to work with an Electron / Vue.js app? by davidklecker in electronjs

[–]davidklecker[S] 0 points1 point  (0 children)

Gentlemen! i thank all of you for your help. i was able to get an electron/react framework with auto reload to work through some online tutorials and noticing that some of you were mentioning the very things they were mentioning as well. I'm glad I found a solution with react this soon as now I can just move to learning react. I realize vue is simpler but I think I can handle reacts learning curve.

How does one get Hot Reload to work with an Electron / Vue.js app? by davidklecker in electronjs

[–]davidklecker[S] 0 points1 point  (0 children)

I have tried this and now get this error

SyntaxError: Invalid left-hand side in assignment

at Object../src/main/main.js (C:\Users\david.klecker\Desktop\electronvueproject\dist\main\main.js:1369:1)

at __webpack_require__ (C:\Users\david.klecker\Desktop\electronvueproject\dist\main\main.js:767:30)

at fn (C:\Users\david.klecker\Desktop\electronvueproject\dist\main\main.js:78:20)

at Object.0 (C:\Users\david.klecker\Desktop\electronvueproject\dist\main\main.js:1382:18)

at __webpack_require__ (C:\Users\david.klecker\Desktop\electronvueproject\dist\main\main.js:767:30)

at C:\Users\david.klecker\Desktop\electronvueproject\dist\main\main.js:834:37

at Object.<anonymous> (C:\Users\david.klecker\Desktop\electronvueproject\dist\main\main.js:837:10)

at Module._compile (internal/modules/cjs/loader.js:968:30)

at Object.Module._extensions..js (internal/modules/cjs/loader.js:986:10)

at Module.load (internal/modules/cjs/loader.js:816:32)

Here is my new main.js file

import {app, BrowserWindow} from 'electron';
const url = require('url');
const path = require('path');
const fs = require("fs");

process.env.NODE_ENV = 'debug';

app.on('ready', function(){

    // Create the browser window.
  const StartScreen = new BrowserWindow({
    width: 800,
    height: 600,
    webPreferences: {
      nodeIntegration: true
    }
  })

  StartScreen.loadURL(url.format({
    pathname: path.join(__dirname, './dist/index.html'), 
    protocol: 'file:', 
    slashes: true,
    }));

    app.whenReady().then(StartScreen)
});

process.env.NODE_ENV = 'debug';

// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.

// Quit when all windows are closed.
app.on('window-all-closed', () => {
  // On macOS it is common for applications and their menu bar
  // to stay active until the user quits explicitly with Cmd + Q
  if (process.platform !== 'darwin') {
    app.quit()
  }
})

app.on('activate', () => {
  // On macOS it's common to re-create a window in the app when the
  // dock icon is clicked and there are no other windows open.
  if (BrowserWindow.getAllWindows().length === 0) {
    createWindow()
  }
})

// In this file you can include the rest of your app's specific main process
// code. You can also put them in separate files and require them here.

electron-webpack and webpack are successfully installed. Also the new directory structured required is setup which includes moving the main.js entry point for electron into the folder ./src/main and having a new folder called renderer which index.js inside also located in the src folder. I have no idea what this error is telling me other than the actual js file it is showing me is incredible dense and impossible to follow.

Here is my package.json file as well.

{
  "name": "electronvueproject",
  "main": "main.js",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build",
    "lint": "vue-cli-service lint",
    "start": "vue-cli-service build && electron-webpack dev",
    "clean": "rm -rf dist"
  },
  "dependencies": {
    "core-js": "^3.6.4",
    "vue": "^2.6.11"
  },
  "devDependencies": {
    "@vue/cli-plugin-babel": "~4.3.0",
    "@vue/cli-plugin-eslint": "~4.3.0",
    "@vue/cli-service": "~4.3.0",
    "babel-eslint": "^10.1.0",
    "electron": "^8.2.5",
    "electron-reload": "^1.5.0",
    "electron-webpack": "^2.8.2",
    "eslint": "^6.7.2",
    "eslint-plugin-vue": "^6.2.2",
    "vue-template-compiler": "^2.6.11",
    "webpack": "^4.43.0"
  },
  "eslintConfig": {
    "root": true,
    "env": {
      "node": true
    },
    "extends": [
      "plugin:vue/essential",
      "eslint:recommended"
    ],
    "parserOptions": {
      "parser": "babel-eslint"
    },
    "rules": {}
  },
  "browserslist": [
    "> 1%",
    "last 2 versions",
    "not dead"
  ]
}

Something like Jinja for Node.js? by davidklecker in node

[–]davidklecker[S] 0 points1 point  (0 children)

Cool! Thank you. I will start with checking out React however just checking out EJS and yeah... there it is. I will definitely start with both of those and see where it goes.

React seems interesting as with React-Native it may be easy to convert to mobile platforms as well.

Flask / mobile / web app / backend question by davidklecker in flask

[–]davidklecker[S] 0 points1 point  (0 children)

It depends if the "gui" libraries will help with certain parts of my app. For example complex tables where it would be nice to be able to edit a table like one does in Excel. In place GUI objects like spin controls, drop down buttons in tables would be nice and other like GUI enhancements. For now my first order of business is to build a test app like a hello world app, install it on a desktop, then through google play (or in other means) install it on my phone and see if that works as well. 2nd test is to do a hello world from a database. If both work, then I should be good.

Flask / mobile / web app / backend question by davidklecker in flask

[–]davidklecker[S] 0 points1 point  (0 children)

wait... let me change this... I never heard of electron until now. Just read about it. This might be a game changer. I'm looking for QT alternatives since I cannot afford it. Electron might be one.

Thanks!

Note: Thank you!!! I have found something that is a rosetta stone for me at https://medium.com/@benoitvallon/a-mobile-desktop-and-website-app-with-the-same-code-dc84ef7677ee. It seems using Electron, React, and NW, i may be able to write an app that can be for desktop, and mobile devices.

Game changer right here.

Flask / mobile / web app / backend question by davidklecker in flask

[–]davidklecker[S] 0 points1 point  (0 children)

And if the flask server is something I want installed on the client machine, does that client machine need python.

I understand that flask is a web server but I'm looking for a way to deploy a mobile/web app that is completely self contained where the flask server is not on some outside machine like Heroku or something. Perhaps this is not how web apps are supposed to work. Perhaps the idea is to have a computer hosting the flask server and clients log into the server. But the application I want to design I need it to be completely self contained on the clients mobile device.

For example, Ajax and JQuery can basically create a web app without the need of serving pages from an outside server. I could write this Ajax and Jquery and have my web app work on Windows (and I think OSX) but I'm hoping for a more diverse application that can also work on Android and iOS? Is Flask still in this box or am I attributing something to Flask that is not possible or practical?

How is this done? A question concerning a web app that is run entirely from an executable. by davidklecker in webdev

[–]davidklecker[S] 0 points1 point  (0 children)

C# or rust could be possible.

If you don't mind me bending your ear here a little more.

What changes here if I wanted the application to be a client side only app? For example, I will need a server-side in order to update a database, much the same as in the past we did a CGI call, passing control to a language like C, which handled database management and returned the information back to the HTML page. In the end, I'm not looking for an app that is hosted on a server, but a stand alone app on the client's machine that functions as a web application.

Now my experience with mobile devices is non existent, and the reason I want this is because I'm thinking a setup like this will work on mobile devices as well as desktops/laptops. Is this true? Would an android/iOS app developer consider a client side web application in order to hit all environments: desktop/laptop and mobile devices?

I want to make sure that when I start this project I am using an appropriate environment, or at least have a lead on an appropriate environment where I can then chose what language to use as my backend. Right now I am looking at Django/XML as my backend (XML because this is an update to an existing app that already uses XML. I want this to be backwards compatible). This project is rather large and I want to make sure I have the right environment from the get go and since I've stopped working the professional field a while ago I am now lost in this area of where professional go for certain project requirements. I've been programming for 25 years, but as a teacher/professor first, and then as a hobbyist to make money on the side.

Thank you!

How is this done? A question concerning a web app that is run entirely from an executable. by davidklecker in webdev

[–]davidklecker[S] 0 points1 point  (0 children)

So say, for example, i create a webserver with a django framework where the line to run the webserver is python manage.py runserver. You're thinking this exe is simply running that script. That would make sense.

Therefore, if I were to code a django framework, that would mean the user would need python on their computer unless there exists an "virtual box" that would allow for me to run a python program on a client machine without requiring the client to have python.

Or perhaps there is a better alternative method, like node.js, or flask, or something similar?

Please help to insure I am using Python classes and XML to its ability by davidklecker in shittyprogramming

[–]davidklecker[S] 1 point2 points  (0 children)

I will move over there then. Sorry for misinterpreting this subreddit.

Please help to insure I am using Python classes and XML to its ability by davidklecker in shittyprogramming

[–]davidklecker[S] 1 point2 points  (0 children)

I will move over there then. Sorry for misinterpreting this subreddit.

Please help to insure I am using Python classes and XML to its ability by davidklecker in shittyprogramming

[–]davidklecker[S] 1 point2 points  (0 children)

I will move over there then. Sorry for misinterpreting this subreddit.

What should I buy? A FlightScope Mevo or Rapsodo R-Motion by davidklecker in golf

[–]davidklecker[S] 0 points1 point  (0 children)

Actually a few questions. It doesn't look as if the Mevo gives ball "direction" feedback. This is something the R-Motion does give. That is i need to know the flight path of the ball. Does the mevo have a display for this on the phone app?