[Solved] Extract gz and convert csv to xlsx

While I agree the OP does not appear to have done their fair share of figuring this out (how hard is Google?), I know someone else will be looking in the future. Posting information will help them. @OP, I’m not going to do all your file handling work for you but here is the basic … Read more

[Solved] Have an issue with input command

For something to be a string in Python, it needs quotes around it. Right now Python thinks that O etc. are variables. Fixed: x = input(“Enter your blood type: “) if x == ‘O’: for y in range(6): print(“O O O O O O”) elif x == ‘A’: for y in range(6): print(“A A A … Read more

[Solved] Looping in Python

You could put everything in a while loop which could repeat forever or until a user types a certain phrase. import math import sys import os print (“This program will calculate the area, height and perimeter of the Triangles: Scalene, Isosceles, Equilateral and a Right Angled Triangle.”) while True: # calculate the perimeter print (“Please … Read more

[Solved] When to use return statements in Scala?

The key is to understand in Scala if-else expressions are just that – expressions, not control structures. Hence if (x == 5) “equal to 5″ does not mean “if x equals five, then return five”, instead it means something like “if x equals five, then evaluate this expression to five, otherwise evaluate to uknown value.” … Read more

[Solved] Concept of creating Array of structures in C with three properties [closed]

Hi You can Implement a three dimensional array to store the RGB values and then do the operation you want. The dummy code looks some thing like this: #define TOTAL_NO_OF_PIXEL 1080 //For example total 1080 no of pixels are there int RGBcolor[3][TOTAL_NO_OF_PIXEL]; int main() { for(int cnt=0;cnt<TOTAL_NO_OF_PIXEL;cnt++) { RGBcolor[0][cnt] = RED; RGBcolor[1][cnt] = GREEN; RGBcolor[2][cnt] … Read more

[Solved] This code is showing errors.What is wrong with this code? [duplicate]

It is asking you to handle the Exceptions that are being thrown from the methods that you have used. Surround them in a try catch block. public void method(){ try { File file = new File(“D:/projects/tFile.txt”) ; file.createNewFile(); FileOutputStream fout = new FileOutputStream(file); String s = “IPL is very entertaining tournament”; byte []b = s.getBytes(); … Read more

[Solved] How to print out a 2d array in a certain way? (Java) [closed]

You want to start with the last element in the last column, and go backwards by columns first. So all you need to do is change the direction and order of your loops: for(int m=column – 1;m>=0;m–) { for(int i=row – 1;i>=0;i–) { System.out.print(charArray[i][m]) } System.out.println(); } solved How to print out a 2d array … Read more

[Solved] C# Inserting values into database using switch case

Let’s clean up the code a little bit and make it a little more reusable first: foreach (int thisColor in allColors) { List<Subject> subjectsForThisColor = subjects.Where(x => x.Color == thisColor).ToList(); foreach (Subject s in subjectsForThisColor) { test += s.SubjectName + ” -” + s.Color + “\n”; switch (s.Color) { case 1: updateOneRow(“Monday”, “first”, s.SubjectName, null); … Read more

[Solved] I want to close the website if the user answers yes [duplicate]

below script will only work in Firefox.if we enable the settings allow_scripts_to_close_windows. For that 1.Open FireFox 2.Enter about:config in Address bar 3.It will open a Config page of Firefox 4.Search allow_scripts_to_close_windows 5.It will show allow_scripts_to_close_windows.by default value will be false.To enable double click on the allow_scripts_to_close_windows row.It will change to true 6.Close Firefox Then execute … Read more

[Solved] 2 dimensional array simple understanding

No, buffersRing[ringNum]+1 // refers to a pointer to an array element is not the same as buffersRing[ringNum][1] // refers to the actual array element The first one is the one you want. 0 solved 2 dimensional array simple understanding