on-internet

Categorical classification in Keras Python

I am doing multi-class classification of 5 classes. I am using Tensorflow with Keras. My code is like this: # load dataset dataframe = pandas.read_csv("Data5Class.csv", header=None) dataset = dataframe.values # split into input (X) and output (Y) variables X = dataset[:,0:47].astype(float) Y = dataset[:,47] print("Load Data.....") encoder= to_categorical(Y) def create_larger(): model = Sequential() print("Create Dense Ip & HL 1 Model ......") model.add(Dense(47, input_dim=47, kernel_initializer='normal', activation='relu')) print("Add Dense HL 2 Model ......") model.add(Dense(40, kernel_initia

Join the discussion →

VBScript Create and Show UserForm

I have programmed some Excel VBA and now I'm testing VBScript. I'm trying to create a form/window and after a while I managed to create this code: Dim ExApp ExApp = CreateObject("Excel.Application") 'ExApp.Application.Visible = True Dim Workbook Set Workbook = ExApp.Workbooks.Add Dim myForm Set myForm = Workbook.VBProject.VBComponents.Add(3) Workbook.VBProject.VBComponents.Add(1).CodeModule.AddFromString "Function getForm()" & vbNewLine & "Set getForm = " & myForm.Name & vbNewLine & "End Function" Dim userForm Set userForm = ExApp.Run("getForm") 'VBA.UserForms.Add(myForm.Name).Show It currentl

Join the discussion →

Getting FFGEN from Verilog Synthesizer

Whenever I pass the following behavioral code through the Design Vision synthesizer, I get the FFGEN instances, meaning the synthesizer is treating my logic as having latch, even though it's supposed to be completely combinational. Code: module decoder ( input [1:0] Op, input [5:0] Funct, output reg[9:0] controls ); // Main Decoder always @(*) begin case (Op) // Data-processing immediate 2'b00: if (Funct[5]) controls = 10'b0000101001; // Data-processing register else controls = 10'b0000001001; // LDR 2'b01: if (Funct[0]) controls = 10'b0001111000; // STR else controls = 10'b1001110100; // B 2'

Join the discussion →

A Sql Query for Looking up International numbers from WHMCS into PBX

I am trying to integrate my WHMCS and PBX together, which i can do via mysql. The problem is WHMCS now stores phone numbers as +44.000 000 0000 and my PBX creates the query as 07000000000 (without spaces) I had the idea of the following, but unfortunately doesn't look at the new replaced numbers with no spaces (SELECT REPLACE(phonenumber, ' ', '') FROM tblclients) UNION (SELECT companyname AS name FROM tblclients WHERE phonenumber LIKE "%xxx xxx xxxx%") UNION (SELECT companyname AS name FROM tblcontacts WHERE phonenumber LIKE "%xxx xxx xxxx%") The actual SQL Query that goes into the the PBX is

Join the discussion →

org.h2.jdbc.JdbcSQLException: Connection is broken: "java.net.ConnectException: Connection refused: connect: localhost" [90067-193]

Can AnyOne tell me What wrong with my code HibernateConfig package com.app.EcommerceBackend.config; import java.util.Properties; import javax.sql.DataSource; import org.apache.commons.dbcp2.BasicDataSource; import org.hibernate.SessionFactory; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.orm.hibernate5.HibernateTransactionManager; import org.springframework.orm.hibernate5.LocalSessionFactoryBuilder; import org.springframework.transaction.an

Join the discussion →

From PyPi to Conda-Forge

I used cookiecutter to create a simple python package that I pushed to Pypi. Next I want to get the package into the Conda ecosystem and found the conda-forge channel really powerful. My only problem is that publishing to conda-forge requires a couple of manual steps including rewriting part of a meta.yaml file. Is there a better way to do this? My current approach: Create Conda Recipe (meta.yaml) using Conda Skeleton Fork Conda Forge Staged Recipes Manually edit some lines in the meta.yaml since conda skeleton recipe is slightly different than what is accepted by conda-forge. Create a Pull Re

Join the discussion →

How import and export components (functions) in ReactJS?

I'm trying to export and import components in my project, but i don't getting. My code of the my main App: import React, { Component } from 'react'; import './App.css'; import Search from './Search'; export default class App extends Component { constructor() { super(); const peoples =[{id:0, name:"Jean"}, {id:1, name:"Jaquinha"}, {id:2, name:"Ricardo"}, {id:3, name:"JaCA"}, {id:4, name:"Letiiicia"}, {id:5, name:"Dai"}, {id:6, name:"Da iIIane"}, {id:7, name:"Tamy"}, {id:8, name:"Tamyresss"}, {id:9, name:"Tamyres"}, {id:10, name:"Abeu"}, {id:11, name:"Abellll"}]; this.state = { elementsPerPage:3

Join the discussion →

nextjs - use _error.js in dev mode

So I am creating a custom error page on my nextjs application. Following the documentation, I created a _error.js file with my view in it (in React) My issue is when I am in dev mode, my _error page is completely ignored (even though it goes through its getInitialProps). The render function seems to be ignored and instead nextjs seems to be using its internal error-debug page. If I am right, that is what this code says from the repo (line 84 for the current version) When I build with as a production env, no problem, my custom error page is picked up. Any idea on how to render my custom error p

Join the discussion →

echo php value into javascript onchange()

I have this html select form, I am using the onchange method to send and xmlhttp request. <select class="form-control form-control-sm" id="sizeselector<?php echo $row["id"]?>" name="sizes" onchange="showColors(<?php echo $row["id"];?>, item, size)"> <?php while($row1 = $result1->fetch_assoc()){?> <option value="<?php echo $row1["size"]?>"><?php echo $row1["size"]?></option> <?php}?></select> <div id="colorselector<?php echo $row["id"]?>"> <p>Text</p> </div> The above code works, but when I change it to get the actual values from the rows... onchange="showColors(<?php echo $row["id"];?>, <?php

Join the discussion →

How to fix concurrent modification exception in Kotlin

This is my code, in which I am adding data to a list: fun bindProcess(listOfDocId: MutableList<String>, isActvityLogEnabled: Boolean): Observable<MutableList<SearchResultModel>> { return Observable.create<MutableList<SearchResultModel>> { var filteredList =CopyOnWriteArrayList<SearchResultModel>()// mutableListOf<SearchResultModel>() val headerItem: SearchResultModel = SearchResultModel() headerItem.type = 0 headerItem.title = context.getString(R.string.top_matches_label) filteredList.add(headerItem) for (row in ContSyncApplication.getContacts()) { if (listOfDocId.contains(row.docId)) { val my

Join the discussion →

How to properly install the libmysql.dll on Windows?

I'm getting the following error message when I try to run an application that connects to a MySQL database instance: "[FireDAC][Phys][MySQL]-314. Cannot load vendor library [libmysql.dll or libmysqld.dll]. Hint check it is in the PATH or application EXE directories, and has x86 bitness.". The error persists even with the libmysql.dll file on the same directory of the application executable.

Join the discussion →

com.amazonaws.SdkClientException: Unable to execute HTTP request: Connect to dynamodb.ap-southeast-2.amazonaws.com:443

I am going through strange error, i am running spring boot locally and connecting to AWS Dynamodb, it returns below exception: EVENT>{"@timestamp":"2018-04-03T17:57:33.173+10:00","@Version":1,"message":"Error while creating connection with DynamoDB","logger_name":"com.DynamoDBRepository","thread_name":"http-nio-8080-exec-1","level":"ERROR","level_value":40000,"name":"xyz","apiVersion":"1","application":"xyz","version":"1.6.37","type":"ERROR"} com.amazonaws.SdkClientException: Unable to execute HTTP request: Connect to dynamodb.ap-southeast-2.amazonaws.com:443 [dynamodb.ap-southeast-2.amazonaws

Join the discussion →

How to shuffle an array of objects in javascript?

The code below works for a normal array but not with an array with object does anybody knows how to do this? const array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; function shuffle(array) { for (let i = array.length - 1; i > 0; i--) { let j = Math.floor(Math.random() * (i + 1)); let temp = array[i]; array[i] = array[j]; array[j] = temp; } return array; } const result = shuffle(array); console.log(JSON.stringify(result));

Join the discussion →

Mixed Content: The page was loaded over HTTPS, but requested an insecure image

I have a domain (let's call it Domain1 or https://img.{domain_name_1}.com) where I stored images for serving a wordpress staging website, which is currently hosted on a different server. For the latter I have only an IP public address (so not a real FQDN at the moment), let's call it Domain2 or https://99.999.999.999. On this server I installed a self-signed SSL certificate, just to encrypt the credential I use for phpMyAdmin and wordpress admin area. Meanwhile, Domain1 is SSL secured by Let's encrypt. I can access Domain1 by http or https indifferently, because I have a redirection from http

Join the discussion →

Visual Studio Code is not showing the output of Python

I am really new to Python and just started the course "Python 3 basics by Sentdex". I am trying to use Python with Visual Studio Code. The downloaded version of Python is 3.6.4. I have installed the Python extension in Visual Studio Code and have followed the procedure. However, I am not able to get any output. Below is the attached screenshot. If I select Python it enters debugging mode. So, there isn't any output.

Join the discussion →

Resolve matrix differential equation with sparse matrix and ojAlgo

I am developping a java evolution tool with ojAlgo, and I try to resolve the following equation : where A is a sparse matrix (for now the dimension of the matrix is 2000 x 2000, it will be scaled later on), A is not symmetric and use only real values. I made some researchs and I tried to find the way to resolve this equation (using SparseStore) on github wiki/javadoc but I didn't find a way to do it. Can you help me find methods/class I should use ? Thank you

Join the discussion →

How to install a program from GitHub?

I am very new to GitHub. Recently I downloaded a program for printing in Sublime Text from GitHub. Here is the link: https://github.com/svenax/SublimePrint But after I downloaded the program called SublimePrint-master.zip, I don't know how to install it in windows. It doesn't look like there is a setup file or installation file after I unzipped SublimePrint-master.zip. Would anyone give me a hint how to install a program from GitHub? Many thanks.

Join the discussion →

Text adventure RPG in batch. General questions

So I decided to learn Batch and I'm trying to program a small RPG/adventure game that is narrative driven for the RPG snuffs at the office. So I'm having a few problems and have a few questions. @echo off color F0 title The Kingdom of Kovalor type Titlescreen.txt pause >nul goto MainMenu :MainMenu cls type mainmenu.txt echo. echo Type in option and press Enter. Set /p menu= if "%menu%" equ "new game" goto NewGame if %menu% equ credits goto Credits if "%menu%" equ "load game" goto LGame echo Try again. if %menu% neq new game goto MainMenu if %menu% neq credits goto MainMenu if %menu% neq load g

Join the discussion →

Gradle Sync Issue Kotlin after Android 3.1 Stable Update

Hey after updating Android Studio to 3.1 Stable version i am getting following error to all my projects. Any help will be appreciated. Could not download kotlin-reflect.jar (org.jetbrains.kotlin:kotlin-reflect:1.1.3-2): No cached version available for offline mode

Join the discussion →

Controlling swipe inputs in unity

I am practicing in Unity; I want to move an object to the right and left according to how I swipe. I have gotten the script so far but the problem occurs when I am playing it. It is setting the objects location to the center; swipe actions are working just fine. However, I don't want it to set the object to the center. Script: public class swipeTest : MonoBehaviour { public SwipeManager swipeControls; public Transform Player; private Vector3 desiredPosition; private void Update() { if (swipeControls.SwipeLeft) desiredPosition += Vector3.left; if (swipeControls.SwipeRight) desiredPosition += Ve

Join the discussion →

HTML & CSS Centering Text and Image Together

I'm getting into the field of web design, and for practice purposes, I'm trying to create responsive HTML and CSS websites modeled after real websites so I only worry about the development, not the design. As of now, I'm redesigning apple.com. My problem is that in the apple.com navigation bar, the Apple logo is consistently around an inch away from the links to other parts of the site. As you resize the browser, it stays around an inch away. The problem is that on my (unfinished) version of the site, the apple logo stays fixed in one position as you resize the browser. Here's my code: html {

Join the discussion →

Getting error E/MediaPlayer: error (1, -19) when trying to stop and play sound again

I have muliple buttons and on clicking them I want a sound. My code goes like this button.setOnClickListener(new Button.OnClickListener() { @Override public void onClick(View view) { if(mSound != null && mSound.isPlaying()){ mSound.stop(); mSound.reset(); mSound.release(); mSound = null; } mSound = new MediaPlayer(); mSound = MediaPlayer.create(getApplicationContext(), R.raw.button); mSound.start(); } }); In OnCreate, I have intitalized mSound like this, mSound = new MediaPlayer(); mSound = MediaPlayer.create(this, R.raw.button); I am getting error (1,-19) as well as (0,38). Note: This is not

Join the discussion →

PCA dimension reducion for classification

I am using principal component analysis on the features extracted from different layers of CNN. I have downloaded the toolbox of dimension reduction from here. I have a total of 11,232 training images and feature for each image is 6,532. So the feature matrix is like that 11232x6532. If I want top 90% features I can easily do that and training accuracy using SVM of reduced data is 81.73% which is fair. However, when I try the testing data which have 2408 images and features of each image is 6,532. So the feature matrix for testing data is 2408x6532. In that case, the output for top 90% feature

Join the discussion →

how to validate email using ruby on rails?

i want to validate email but i couldn't. is there method to validate? param[0] is email. if param[0] =~ Devise.email_regexp is not work. if param[0] =~ Devise.email_regexp {email: param[0], reason: I18n.t("user.error.invalid_email")}

Join the discussion →

videojs with hls plugin: how to limit retries

I use videojs and videojs-contrib-hls to play video in my website. When a video's m3u8 file is loaded successfully and the broswer failed to get one of the ts file, videojs will retry over and over again, with log like this: GET https://[my ts file url] 404(Not Found) VIDEOJS: WARN: Problem encountered with the current HLS playlist. Trying again since it is the final playlist. I want to listen to the error event and limit the retry. Which event(on the player or .tech().hls) should I listen to?

Join the discussion →

TCL - Extract line from text file to TCL Script

Well, i tried to find online my answer but actually I didn't and I really need help.. I have a text file (file.txt) that contain : C:/Users/00_file/toto.odb, dis,455, stre,54, stra,25, C:/Users/00_file/tota.odb, And a TCL script that allows me to read values of each lines : set Infile [open "C:/Users/00_file/file.txt" r] set filelines [split $Infile ","] set Namepath [lindex $filelines 1 0] #*doesn't work* set dis [lindex $filelines 2 0] # *work good* ... The problem is when I want the complete line 1 of the text file with my TCL script, some informations are missing and extra caracter disapea

Join the discussion →

iPhone remote debugging over VPN connection [closed]

When my iPhone is on my local WiFi Xcode sees my iPhone over the network. My Mac Pro development machine is running macOS Server with a VPN server. When I VPN into my Mac Pro from my iPhone my Mac can ping the iPhone over its VPN IP address screenshot (172.22.0.225) and Network Utility is showing that port 62078 (the required port for debugging) is open. screenshot However, when I try to connect via IP in Xcode it says my iPhone is no longer available. screenshot Any suggestions?

Join the discussion →
Older stories