hello coders, i hope you all are going well, one thing blows my mind today in c i can't explain it this is why title is akward, so the thing is i have an array called tab[n] i wanted to invert it elements from tab[0] to tab[n-1] and and the tab[midle] would remain the same so i used intermediate variable x, max, half, what i get in resutl is just unexpected because before the entering the loop for the value of max is equal to 14 once once in the for loop max is equal to 0 i don't understand …

Member Avatar
Member Avatar
+0 forum 5

I have the following problem. when i pres buttun printpreview (button 5) the the print preview fires up. and when i close the print preview without printing and minimize the form (after close the printpreview), and when i maximize the form again the image in the picturebox is turned 90 dergees. How is that pissible ? i have the following code for print preview. Public Class Form1 Dim fotoheight As Integer Dim fotowidth As Integer Private Sub Button5_MouseDown(sender As Object, e As MouseEventArgs) Handles Button5.MouseDown If e.Button = MouseButtons.Left Then If PictureBox1.Image Is Nothing Then MessageBox.Show("Er is niets te printen, …

Member Avatar
Member Avatar
+0 forum 4

Define a class named Pair where the data(state) part contains two double-typed numbers, num1 and num2. The method(behaviour) part contain the following methods: o getSum() – returns the result of adding num1 with num2 o getdifference() – returns the result of substracting num2 from num1 o getProduct() - returns the multiplication of num1 with num2 o getAverage() – returns the average of num1 & num2 o getMax() - returns the larger of the two numbers o getMin() – returns the smaller of the two numbers You also need to define a constructor method as described below: public Pair(double aFirst, double …

Member Avatar
Member Avatar
+0 forum 1

Anyone have a shell script to remove controlM character from all the files in a directory

Member Avatar
Member Avatar
+0 forum 14

Hi guys, I have a problem. I'm using CPUSim Wombat 1 to write a program. The goal is to display the numbers that the user has entered in the order they've been entered. What I'm stuck on is the storages. It's currently in a loop. The sentinel value is 0. If I create a storage for one number, the contents will be overwritten when the user enters the next number and the previous number will be lost. I've thought of jumping out of the loop and creating permanent storages but the problem is that only one number can be stored. …

Member Avatar
+0 forum 0

Good Evening, I'm working on my final project and I'm having an issue with reading input from a file and converting the string into an integer - specifically with the first character being read from the file. Here is the data in the .txt file created in notepad: 6 -1 -1 -1 2 -1 -1 -1 9 -1 1 -1 3 -1 7 -1 5 -1 -1 -1 3 -1 -1 -1 1 -1 -1 -1 9 -1 -1 -1 -1 -1 2 -1 2 -1 -1 8 7 5 -1 -1 3 -1 -1 5 -1 1 -1 4 …

Member Avatar
Member Avatar
+0 forum 1

Hi guys. My task is to write a wombat 1 machine language program in CPUSIM that outputs the radix(only base 2 to 8 inclusive) reperesentation of a number. We have to ask the user for 2 inputs - first is the value to convert(cannot be negative) and second is the radix base. Then do division and note each remainder and display in the correct order. We were also told that not all values will be able to be converted and that we have the choice of how many spaces to set aside for the remainders. I've managed to get a …

Member Avatar
Member Avatar
+0 forum 7

Hello All, I have experienced a very strange problem in my application. When I launch my WPF application, it loads fine with a window and button, upon clicking the button, it launches another form which is also fine but in this second form, when I click some button, it launches a window with a blank screen (yet I am quite sure it has got many controls to show on the screen). I have already checked `DelegateCommand`, `Events`, `Methods` but still facing the same issue. I tried deleting some files as suggested by Google in "C:\Windows\ServiceProfiles\LocalService\AppData\Local" as `~FontCache-S-1-5-21-2260904419-1400770398-4175912926-283977.dat`, `~FontCache-System.dat`, `~FontCache-FontFace.dat` but …

Member Avatar
Member Avatar
+0 forum 17

Hello all, I have a code to encrypt data in C# and I want it to b decrypted in Java... following is the C# code [CODE]string Encrypt(string textToEncrypt, string key) { RijndaelManaged rijndaelCipher = new RijndaelManaged(); rijndaelCipher.Mode = CipherMode.CBC; rijndaelCipher.Padding = PaddingMode.PKCS7; rijndaelCipher.KeySize = 0x80; rijndaelCipher.BlockSize = 0x80; byte[] pwdBytes = Encoding.UTF8.GetBytes(key); byte[] keyBytes = new byte[0x10]; int len = pwdBytes.Length; if (len > keyBytes.Length) { len = keyBytes.Length; } Array.Copy(pwdBytes, keyBytes, len); rijndaelCipher.Key = keyBytes; rijndaelCipher.IV = keyBytes; ICryptoTransform transform = rijndaelCipher.CreateEncryptor(); byte[] plainText = Encoding.UTF8.GetBytes(textToEncrypt); return Convert.ToBase64String(transform.TransformFinalBlock(plainText, 0, plainText.Length)); }[/CODE] and the java decryption is as follows... [CODE]String …

Member Avatar
Member Avatar
+0 forum 8

hello ! i want to develop the keycounter , i mean i want to get the total no. of key pressed by the user in the specific time , i have a code of keylogger , i can use it to get the text in that time period and after that just get its length , but i dont want to use this . here is a code of VB.net which i found so for on msdn Private Shared keyPressCount As Long = 0 Private Shared backspacePressed As Long = 0 Private Shared returnPressed As Long = 0 Private Shared …

Member Avatar
Member Avatar
+1 forum 7

write c++ programming that calculate electricity bill with persons name and id

Member Avatar
Member Avatar
-1 forum 5

hello guys I want to know about dependency injection in angular 4 and spring , so I gonna start with what I know : in angular 4 we inject the dependency by setting the service ( or something else ) in the constructor's arguments of component, and despite we inject many times from many components the same service, the value of the variable in this service stay the same (I mean the value still intact) for example : if we have service S with variable VARS, and tow component C1 and C2, and we inject the dependencie to S by …

Member Avatar
+0 forum 0

I have to iterate data through some DIV's. I don't know how to share and debug the code with others, so I decided to put the code in C# in a console application if you don't mind. Problem is that I cannot close section div in this iteration. If you have a better idea, please, share. I'm stuck. Thank you. string[] someWords = { "auto", "botox", "amater", "test_phase", "warengruppen", "axel" }; List<char> letters = new List<char>(); Array.Sort(someWords); someWords.ToList(); //fill b list with alphabet foreach (var characters in someWords) { if (!letters.Contains(characters[0])) { letters.Add(characters[0]); } } letters.Sort();//make it asc int i …

Member Avatar
Member Avatar
+0 forum 3

Hi I have a broblem with my label text. The code is Public Class Form5 Dim a As Integer Dim currentDate As DateTime = DateTime.Now Dim jaarnu As Integer = currentDate.Year Private timeLeft As Integer Dim WithEvents timer As New Timer Dim milliseconds As Integer Dim monthnumber As Integer Dim v As Integer Dim h As Integer Dim maand As Integer Dim dagnummer As Integer Dim montnaam As Integer Private Sub Form5_Load(sender As Object, e As EventArgs) Handles MyBase.Load timeLeft = 10 Label30.Text = jaarnu Dim currentDate As DateTime = DateTime.Now Dim days As Integer = currentDate.Date.Month Dim dagmaadn As …

Member Avatar
Member Avatar
+0 forum 4

Hi, I am developing my own designer and got stuck at a point where I need to establish or implement some business logic whenever any UI Element is dragged and determine if that falls withing the boundaries of another parent control (specifically TabControl or GroupBox), so that the next time we drag the parent, the child moves with it (and of course, in case of TabControl, the child becomes part of the selected TabItem only and the other TabItems would still be shown with empty content). I also want to implement the reverse behaviour, that is, whenever a child is …

Member Avatar
Member Avatar
+0 forum 3

Good Evening, I'm working on a program that will allow user input and will take that input, insert it into blank spots into an email template, and then prepopulate the email template in Outlook so all an analyst would need to do is click a the send button - basically a dummy proof program to send emails to customers. Creating the interface and reading the information entered isn't an issue; however, I just figured out how to get an email to open but have no idea how to format the body. The below code I just happened upon at https://stackoverflow.com/questions/25189365/shellexecute-for-mailto-doesnt-work-with-google-chrome …

Member Avatar
Member Avatar
+0 forum 4

Hi, i was working on a code for a vending machine and i do consider myself to be a beginner, anyway i feel my code is much longer than it needs to be and i want someone to show me a new, shorter way of presenting it. import time print ("Welcome to the Python Vending Machine.") # Asking the user how much money they wish to enter. number_of_10p = int(input("How many 10 pence coins would you like to insert? ")) while number_of_10p < 0: number_of_10p = int(input("Please enter a positive number.")) number_of_20p = int(input("How many 20 pence coins would you …

Member Avatar
Member Avatar
+0 forum 5

Hi all, The continuing quest to master Tkinter has led to this implementation of the dots and boxes game. The rules are well-known: each player gets to create a new line between two dots (single-click near the line you wish to create). If a player creates a box, he gets a point *and* gets to go again. (Two boxes gets two points, but only one extra turn.) The highest score out of 81 boxes wins! Please feel free to mercilessly criticize the UI or the code; I'm looking to improve it and submit to the Code Snippets thread. Thanks, Jeff …

Member Avatar
Member Avatar
-1 forum 5

I do non know how to call my getdaycode function correctly into my main function. Also, when that isn't the problem, the day showing up below header and it messes with the ordering of the days messing up the calendar. Those are my two big problems at this point, I will enjoy working through this with someone... I am really confused.. I am brand new at programming with no background. (This makes it very difficult).[ ](http://writer4sale.com/)For any help Appreciated! #define _CRT_SECURE_NO_WARNINGS #include <stdio.h> int getdaycode(int month, int year); void printheader(int month, int year); int getndim(int month, int year); int main() …

Member Avatar
Member Avatar
+1 forum 1

Hi, I’m currently looking to write a program, most likely in Python. Now, I have an odd question. Is it possible to limit this program to running on specific hardware? Could I prevent it from running on a computer that doesn’t have a certain piece of hardware?

Member Avatar
Member Avatar
+0 forum 3

Hi guys, I'm playing around ith optionals a little, but I'm not surewhether this is the correct behavious as I'm getting a null pointer exeption (I thought the point of Optionals was not to get a null pointer.) SO I'm setting an object to null and before calling toString on it I'm using isPresent() on it. Here is the code: package optional_test; import java.util.Optional; public class Optional_test { public static void main(String[] args) { Optional<Customer> customer1 = Optional.ofNullable(new Customer("John", "Doe")); Optional<Customer> customer2 = null; if(customer1.isPresent()){ System.out.println(customer1.get()); } if(customer2.isPresent()){ System.out.println(customer2.orElse(new Customer("Unknown", "Unknown"))); } } } And the cCustomer class: package optional_test; …

Member Avatar
Member Avatar
+0 forum 4

I trying to write a `spring batch` using `SpringBoot`. At first the program will read data from database, then write it to `.csv` file format. This is the code I have tried **Reader** @Bean public ItemReader<A> Reader() throws Exception { List list = new ArrayList<>(); JdbcCursorItemReader<A> reader = new JdbcCursorItemReader<A>(); JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource); String sql = "SELECT ID AS id FROM TABLE_A "; list = jdbcTemplate.query(sql, new Mapper()); // store all retrieved data to list reader.setSql(sql); reader.setDataSource(dataSource); reader.setRowMapper(new Mapper()); if (list != null) { for (A c : (List<A>) list) { c.setId("123"); // overwrite the id c.setState("Active"); } …

Member Avatar
Member Avatar
+0 forum 1

Hi all, So before I went and posted ~800 lines of code, I have 2 questions: 1: What is the preferred way for us to post "complex" C++ (of course, this is just a .h, .cpp, and main cpp but it's still a lot of lines) that wont just be obnoxious to read/debug? (I guess.. what is the proper etiquette here?) 2: Maybe I don't have to post it, and I can get theory help - I have a socket server that spawns threads with mutexes to control everything as needed (I think I am doing it right). When I …

Member Avatar
Member Avatar
+0 forum 7

Hi, i wasn't sure about the title of my question, hope its okay. Anyway, the program i have is suppose to read a binary file then find for specific bytes like this: bytes1 = bytearray(b'\x41\x64\x6F\x62\x65\x20') filename = "portrait1.dng" with open(filename, "rb") as binaryfile: with open("foundhex.txt", "w") as found: found.write("File that is analysed : " + filename + "\n") found.write("Date of analysis : " + str(today) + "\n") while True: read_file = bytearray(binaryfile.read(1024)) find_bytes1 = read_file.find(bytes1, 0) if fine_bytes1 != -1: with open("foundhex.txt", "a") as found1: found1.write("Found 41646F626520 at : " + str(find_bytes1) + "\n") if not read_file: break basically, it …

Member Avatar
Member Avatar
+0 forum 3

I had been writing a program that enforces the loop instruction with indirect addressing but I need it to copy a string from source to target, reversing the character order in the process. I need to use the variables: source BYTE "This is the source string",0 target BYTE SIZEOF source DUP('#') After that I need to insert the following statements right after the loop to display the hexadecimal contents of the target string: [CODE] mov esi, OFFSET target : offset of variable mov ebx, 1 : byte format mov exc, SIZEOF target : counter call DumpMem[/CODE] so far this is …

Member Avatar
Member Avatar
+0 forum 8

The End.