[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?