【Visual Studio Visual VB net】User Account

 Public Class Form1

Dim cmdProcess As Process = New Process() Dim fileArgs As String Dim path As String = "C:\Windows\System32\" Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click fileArgs = "shell32.dll,Control_RunDLL nusrmgr.cpl" cmdProcess.StartInfo.Arguments = fileArgs cmdProcess.StartInfo.WorkingDirectory = path cmdProcess.StartInfo.FileName = "RunDll32.exe" cmdProcess.Start() cmdProcess.WaitForExit() Me.Show() End Sub End Class

【ANDROID STUDIO】Unstructured Concurrency

 package com.example.coroutine


import kotlinx.coroutines.*

class UserDataManager {
suspend fun getTotalUserCount(): Int {
var count = 0
CoroutineScope(Dispatchers.IO).launch {
delay(1000)
count = 50
}

val deferred = CoroutineScope(Dispatchers.IO).async {
//its will delay 3 sec
delay(3000)
return@async 70
}

return count + deferred.await()
}
}

【PYTHON】Mean Estimated Accuracy Naive Bayes

 from pandas import read_csv

from sklearn.model_selection import KFold from sklearn.model_selection import cross_val_score from sklearn.naive_bayes import GaussianNB filename = 'pima-indians-diabetes.csv' names = ['preg', 'plas', 'pres', 'skin', 'test', 'mass', 'pedi', 'age', 'class'] dataframe = read_csv(filename, names=names) array = dataframe.values #splitting the array to input and output X = array[:,0:8] Y = array[:,8] num_folds = 10 seed = 7 kfold = KFold(n_splits = num_folds, random_state = seed) model = GaussianNB() results = cross_val_score(model, X, Y, cv=kfold) print("Mean Estimated Accuracy Naive Bayes: %f " % (results.mean()))

【GAMEMAKER】advance Radar

 Information about object: obj1

Sprite: sprObj1
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent:
Children:
Mask:
No Physics Object
Information about object: objController
Sprite: sprController
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent:
Children:
Mask:
No Physics Object
Draw Event:
execute code:

pen_color=c_black;
pen_size=3;
brush_color=c_green;
draw_rectangle(view_xview[0],view_yview[0],view_xview[0]+100,view_yview[0]+100,false);
brush_color=c_blue;
for (i=0; i<instance_count; i+=1) {
  iii = instance_id[i];
    if (iii != id && iii.visible = true) {
    draw_sprite_ext(iii.object_index,0,view_xview[0]+iii.x/11,view_yview[0]+iii.y/11,0.25, 0.25, 0,-1,1);
  }
}
          
          
          //draw_sprite_scaled(sprPlayer,-1,view_left[0]+objPlayer.x/11,view_top[0]+objPlayer.y/11,0.25);
Information about object: objPlayer
Sprite: sprPlayer
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent:
Children:
Mask:
No Physics Object
Step Event:
execute code:

if keyboard_check(vk_left) then x-=4;
if keyboard_check(vk_right) then x+=4;
if keyboard_check(vk_up) then y-=4;
if keyboard_check(vk_down) then y+=4;

Information about object: object3
Sprite: sprite3
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent:
Children:
Mask:
No Physics Object

【FLUTTER ANDROID STUDIO and IOS】form password strength validation

 import 'package:flutter/material.dart';


void main() {
runApp(MyApp());
}

class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Validation',
home: HomePage(),
);
}
}

class HomePage extends StatefulWidget {
@override
_HomePageState createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
final _formKey = GlobalKey<FormState>();

String _userEmail = '';
String _userName = '';
String _password = '';
String _confirmPassword = '';

void _trySubmitForm() {
final isValid = _formKey.currentState.validate();
if (isValid) {
print('Everything looks good!');
print(_userEmail);
print(_userName);
print(_password);
print(_confirmPassword);
}
}

@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
alignment: Alignment.center,
child: Center(
child: Card(
margin: EdgeInsets.symmetric(horizontal: 35),
child: Padding(
padding: const EdgeInsets.all(20),
child: Form(
key: _formKey,
child: SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
TextFormField(
decoration: InputDecoration(labelText: 'Email'),
validator: (value) {
if (value
.trim()
.isEmpty) {
return 'Please enter your email address';
}
if (!RegExp(r'\S+@\S+\.\S+').hasMatch(value)) {
return 'Please enter a valid email address';
}
return null;
},
onChanged: (value) => _userEmail = value,
),

TextFormField(
decoration: InputDecoration(labelText: 'Username'),
validator: (value) {
if (value
.trim()
.isEmpty) {
return 'This field is required';
}
if (value
.trim()
.length < 4) {
return 'Username must be at least 4 characters in length';
}
return null;
},
onChanged: (value) => _userName = value,
),

TextFormField(
decoration: InputDecoration(labelText: 'Password'),
obscureText: true,
validator: (value) {
if (value
.trim()
.isEmpty) {
return 'This field is required';
}
if (value
.trim()
.length < 8) {
return 'Password must be at least 8 characters in length';
}

if (!RegExp(r'[a-z]').hasMatch(value) == true) {
return "Password must be at least Lower case letter";
}
if (!RegExp(r'\d').hasMatch(value) == true) {
return "Password must be at least have number";
}

if (!RegExp(r'[A-Z]').hasMatch(value) == true) {
return "Password must be at least have Uppercase letter";
}
return null;
},
onChanged: (value) => _password = value,
),
TextFormField(
decoration:
InputDecoration(labelText: 'Confirm Password'),
obscureText: true,
validator: (value) {
if (value.isEmpty) {
return 'This field is required';
}

if (value != _password) {
return 'Confimation password does not match the entered password';
}

return null;
},
onChanged: (value) => _confirmPassword = value,
),
SizedBox(height: 20),
Container(
alignment: Alignment.centerRight,
child: OutlinedButton(
onPressed: _trySubmitForm,
child: Text('Sign Up')))
],
)),
)),
),
),
),
);
}
}

【JAVASCRIPT】canvas realizes colorful clock effect

【VUEJS】 slide able delete function

【ANDROID STUDIO】View Model With Data Binding

 package com.example.databinding


import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.databinding.DataBindingUtil
import androidx.lifecycle.Observer
import androidx.lifecycle.ViewModelProvider
import com.example.databinding.databinding.ActivityMainBinding

class MainActivity : AppCompatActivity() {

private lateinit var binding: ActivityMainBinding
private lateinit var viewModel: MainActivityViewModel
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = DataBindingUtil.setContentView(this, R.layout.activity_main)
viewModel = ViewModelProvider(this).get(MainActivityViewModel::class.java)
binding.myViewModel = viewModel
viewModel.count.observe(this, Observer {
binding.countText.text = it.toString()
})

}
}
package com.example.databinding

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel

class MainActivityViewModel : ViewModel() {
var count = MutableLiveData<Int>()

init {
count.value = 0
}

fun updateCount() {
count.value = (count.value)?.plus(1)
}
}

<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">

<data>
<variable
name="myViewModel"
type="com.example.databinding.MainActivityViewModel" />
</data>

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">

<TextView android:id="@+id/count_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="66sp"
android:textStyle="bold"
android:typeface="serif"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.262" />

<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Click Here"
android:textSize="30sp"
android:onClick="@{()->myViewModel.updateCount()}"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>

</layout>

【FLUTTER ANDROID STUDIO and IOS】Permutation App

 import 'package:flutter/material.dart';


void main() {
runApp(MyApp());
}

class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
// This is the theme of your application.
//
// Try running your application with "flutter run". You'll see the
// application has a blue toolbar. Then, without quitting the app, try
// changing the primarySwatch below to Colors.green and then invoke
// "hot reload" (press "r" in the console where you ran "flutter run",
// or simply save your changes to "hot reload" in a Flutter IDE).
// Notice that the counter didn't reset back to zero; the application
// is not restarted.
primarySwatch: Colors.blue,
// This makes the visual density adapt to the platform that you run
// the app on. For desktop platforms, the controls will be smaller and
// closer together (more dense) than on mobile platforms.
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}

class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);


final String title;

@override
_MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
var lastdivnum = 1,
permObj = [
],
output = '',
order = 1,
prefix = {
"setprefix": '',
"setsuffix": '',
"objdelimiter": '',
"objjoin": ''
};
final controllerOutput = TextEditingController();

@override
void initState() {
super.initState();
}

@override
void dispose() {
controllerOutput.dispose();
super.dispose();
}

permute() {
var permute = (v, {m = false}) {
var p = -1,
j,
k,
f,
r,
l = v.length,
q = 1,
i = l + 1;
--i;
q *= i;
var x = [new List(l), new List(l), new List(l), new List(l)];
j = q;
k = l + 1;
i = -1;
for (; ++i < l; x[2][i] = i, x[1][i] = x[0][i] = j /= --k) {

}

for (r = new List(q); ++p < q;) {
r[p] = new List(l);
i = -1;
for (; ++i < l; --x[1][i] != --x[1][i]) {
x[1][i] = x[0][i];
x[2][i] = (x[2][i] + 1) % l;
if (x[3][i] != null) r[p][i] = m ? x[3][i] : v[x[3][i]];
f = 0;

for ((x[3][i] = x[2][i]); !(f == 0); f = !f) {
for (j = i; j == true; x[3][--j] == x[2][i] &&
(x[3][i] = x[2][i] = (x[2][i] + 1) % l && f == 1)) {

}
}
}
}

return r;
};
var perobjs = new List();
var perobjscnt = 0;
var permobj = '';

for (var x = 0; x < permObj.length; x++) {
permobj = permObj[x]["value"];
if (permobj != '') {
perobjs.add(permobj);
perobjscnt++;
}
}
var pre = prefix["setprefix"].replaceAll(r'/\\x/g', '\n');
var suf = prefix["setsuffix"].replaceAll(r'/\\x/g', '\n');
var joinobjs = prefix["objdelimiter"].replaceAll(r'/\\x/g', '\n');
var joinperms = prefix["objjoin"].replaceAll(r'/\\x/g', '\n');

var out = permute(perobjs).map((objs) {
return objs[0] != null ? objs.join(joinobjs) + "\n" : perobjs.join(
joinobjs) + "\n";
});

setState(() {
output = out = out.join(joinperms);
});

controllerOutput.text = output;
print(output);
}

var todo = List<Widget>();
int _index = 0;

void _add() {
int keyValue = _index;
permObj.add({'id': _index, 'value': '',});
var _formdataIndex = permObj.indexWhere((data) => data['id'] == keyValue);

todo = List.from(todo)
..add(Column(
key: Key("${keyValue}"),
children: <Widget>[
ListTile(
leading: Text('Name: '),
title: TextField(
onChanged: (val) {
permObj[_formdataIndex]['value'] = val;
},
),
),
],
));
setState(() => ++_index);
}


@override
Widget build(BuildContext context) {
return Scaffold(
floatingActionButton: FloatingActionButton(
onPressed: permute,
child: Icon(Icons.link),
),
appBar: AppBar(
title: Text(widget.title),
actions: <Widget>[
FlatButton(
child: Icon(Icons.add, color: Colors.white,),
onPressed: _add,
),
],
),
body: Center(
child: SingleChildScrollView(
child: Column(
children: [
...todo,
TextField(controller: controllerOutput, maxLines: 10,)],
),
),
),
);
}
}

【Visual Studio Visual Csharp】HTTP Download

using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using System.Net; // make sure that using System.Net; is included using System.Diagnostics; // make sure that using System.Diagnostics; is included namespace HttpDownloadC { public partial class Form1 : Form { public Form1() { InitializeComponent(); } WebClient webClient = new WebClient(); private void button1_Click(object sender, EventArgs e) { webClient.DownloadProgressChanged += new DownloadProgressChangedEventHandler(webClient_DownloadProgressChanged); webClient.DownloadFileCompleted += new AsyncCompletedEventHandler(webclient_DownloadFileCompleted); // start download webClient.DownloadFileAsync(new Uri(textBox1.Text), @"C:\\MYRAR.EXE"); } void webClient_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e) { double bytesIn = double.Parse(e.BytesReceived.ToString()); double totalBytes = double.Parse(e.TotalBytesToReceive.ToString()); double percentage = bytesIn / totalBytes * 100; progressBar1.Value = int.Parse(Math.Truncate(percentage).ToString()); } void webclient_DownloadFileCompleted(object sender, AsyncCompletedEventArgs e) { MessageBox.Show("Saved as C:\\MYRAR.EXE", "Httpdownload"); } } }

The Weekender: Moon metaphors, procrastinating monks, and a visit to a cheese factory

What we’re reading, watching, and listening to this week ͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ...

Contact Form

Name

Email *

Message *