[Solved] Find smallest even from array. and also average of even and odd numbers?

Try this. package lesson5; import java.util.Scanner; public class task3 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int [] masarray = new int [10]; int a,b,c,d,f,g,j,m,n,l; int flag_even =0; int min_even = 0; float sum_even=0; float sum_odd=0; int total_even=0; int total_odd=0; System.out.println(“input first number of array”); a=sc.nextInt(); masarray [0]= a; System.out.println(“input … Read more

[Solved] Modify csv files?

well firstly you need to find all the files in your directory that are CSV files: import os for file in os.listdir(“/mydir”): if file.endswith(“.txt”): #here is where we will process each file now to process each file you need to open it: csv_file = open(file, mode=”r”) now we can read in the data: data = … Read more

[Solved] Textbox as Input in an SQL Query in Access

No code needed – as @Nathan_Sav said a – a quick search will find what you’re after (I find “reference main form from subform” gives the best page at the top – http://access.mvps.org/access/forms/frm0031.htm ) SELECT * FROM Employees WHERE [First Name]=Forms![Form1]![txtFirstName] AND [Last Name]=Forms![Form1]![txtLastName] txtFirstName & txtLastName are the names I gave to the text … Read more

[Solved] Powershell & Regex – How to find and delete uppercase characters from file names in directory [closed]

since this got answers, for full clarity: Remove -WhatIf when you’re running it. Get-ChildItem | Rename-Item -NewName {$_.Name -creplace “[A-Z]”} -WhatIf This pipes Get-ChildItem into Rename-Item and then Sets the NewName to be the old name, except we’ve case-sensitively replaced any capital letters with nothing. 3 solved Powershell & Regex – How to find and … Read more

[Solved] Get latlng and draw a polyline between that two latlng

/*This is script*/ var x=0; var map; var prepath; var path = null; var current_lat = 28.6667; var current_lng = 77.2167; function initialize() { var myLatLng = new google.maps.LatLng(28.6667, 77.2167); var mapOptions = { zoom: 3, center: myLatLng, mapTypeId: google.maps.MapTypeId.TERRAIN }; map = new google.maps.Map(document.getElementById(‘map-canvas’), mapOptions); //alert(“sdf”) google.maps.event.addListener(map, “click”, function (e) { //delete old //alert(“sdf123”) … Read more

[Solved] Insert A Character After 7 Characters (C#) [closed]

Short Answer You can use String.Insert. String.Insert public string Insert( int startIndex, string value ) startIndex Type: System.Int32 The zero-based index position of the insertion. value Type: System.String The string to insert. Explanation This Method inserts a string into another string at the specified index position. The first parameter, startIndex is the zero-based index position … Read more

[Solved] PHP usort item missing keys to top [duplicate]

return 1; in your first if there makes no sense – returning 1 means, $a is supposed to be considered greater than $b. So whenever either one of them is missing that value, you always say the first one should be considered the greater one. The return value of the callback function only decides, whether … Read more

[Solved] isolate data from a string

This code: inp = “((Matrix(v1: (1, 0, 0); v2: (0, 1, 0); v3: (0, 0, 1); off: (0, 0, 0)),Matrix(v1: (1, 0, 0); v2: (0, 1, 0); v3: (0, 0, 1); off: (-38.805, 0, 1333.283)),Matrix(v1: (1, 0, 0); v2: (0, 1, 0); v3: (0, 0, 1); off: (-77.609, 0, 2666.566)),Matrix(v1: (1, 0, 0); v2: (0, … Read more

[Solved] how to check numbers in a list in python

Here is a cleaned-up version: from itertools import cycle BASE = ord(‘a’) – 1 def str_to_nums(s): “”” Convert a lowercase string to a list of integers in [1..26] “”” return [ord(ch) – BASE for ch in s] def nums_to_str(nums): “”” Convert a list of integers in [1..26] back to a lowercase string “”” return “”.join(chr(n … Read more