I am supposed to sort an array in ascending order..I have tried but then i cant get the results i want.I also tried to look it up in this forum but i still can't get it...Here is part of the code:[ICODE]void sort() { int size=10; int j,temp,i; for(i=0;i<(size-1);i++) { for(j=i+1;j<size;j++) { if(queue[i]>queue[j]) { temp=queue[i]; queue[i]=queue[j]; queue[j]=temp; } } } cout<<"Status: sorting done."<<endl; }[/ICODE] The result i getting is zero for everything...Please help me..

Member Avatar
Member Avatar
-1 forum 11

I am making a ping pong game using JavaFX, but before I am going to make that, I like to test the KeyEvents. I made a simple ping pong game about 2 years ago, but I like to improve my game. And was pretty bad controlls back when I made the ping pong game, because of the not smooth controls. so here is the problem: whenever I holdpress A and switch quickly to holdpress D or D to A, same with (W to S and S to W). it just takes a little break and then move, is there something …

Member Avatar
Member Avatar
+0 forum 4

So I am making a responsive audio waveform, if you don't know what that is, it is something like this: (btw this is my goal to make those audio waveforms). https://i.ytimg.com/vi/J7uN-SQtOYI/maxresdefault.jpg https://www.youtube.com/watch?v=OVMuwa-HRCQ https://www.youtube.com/watch?v=SCD2tB1qILc I don't know how to describe it, so just look at the videos and image. but my question is, how do I get the values from the "AudioSpectrumListener", it has a lambda expression. And I need the value of the magnitude. So I can print out the values. Later I will use the values to make rectangles and that rectangles will change height shape because of the …

Member Avatar
Member Avatar
+0 forum 17

I'm reading data from SQLite database table. If the SQLiteDataReader encounters a negative double an InvalidCastException is thrown. Here is my code. public void DBToArray() { string stm = "SELECT * FROM mtable"; SQLiteCommand cmd = new SQLiteCommand(stm, sqlcon); SQLiteDataReader rdr = cmd.ExecuteReader(); while (rdr.Read()) { Console.WriteLine( rdr.GetInt32(0) + " " + rdr.GetString(1) + " " + rdr.GetString(2) + " " + rdr.GetString(3) + " " + rdr.GetInt32(4) + " " + rdr.GetDouble(5) + " " + /* -5.0 no good */ rdr.GetString(6) + " " + rdr.GetString(7) ); } } Just wondering if anyone has encountered and solved this …

Member Avatar
Member Avatar
+0 forum 2

I am making a program, and I don't know why my program becomes unresponsive, when I click the button ): I have a feeling its because of this: "connection = server.accept();" I don't know how to fix it. I am trying to recreate this: https://stackoverflow.com/questions/18505123/how-to-use-client-chat-on-different-pc but in javafx. package yeetYeet; import java.io.EOFException; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.net.ServerSocket; import java.net.Socket; import javafx.animation.AnimationTimer; import javafx.application.Application; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.control.TextArea; import javafx.scene.control.TextField; import javafx.scene.paint.Color; import javafx.stage.Stage; public class Server extends Application{ private ObjectOutputStream output; private ObjectInputStream input; private ServerSocket server; private Socket connection; //set up and …

Member Avatar
Member Avatar
+0 forum 16

I have been wrestling with this for two days now and getting nowhere. Something is broken, either the GridSizer control or me. I'm hoping it's me and someone can show me the problem. I've stripped my app of non-essentials. What I am building is a Sudoku app which consists of several nested controls, as can be seen in the atached image. The outer frame contains the puzzle which contains a 3x3 grid of panes. Each pane contains a 3x3 grid of tiles and each tile contains a 3x3 grid of digits. So far so good. Except for the layout. I …

Member Avatar
Member Avatar
+0 forum 1

When we build an application, which layer should we start with? From top (UI) to bottom(Data Layer) or bottom to top?

Member Avatar
Member Avatar
+1 forum 6

Hi! I want to learn programming. I'm 14 years old and very fond of computing. The only problem I face is *Which programming language should I learn?* or should I learn *Programming* i.e I learn the basics of programming so that I will be capable of learning any programming language. Also, when you recommend me one of the choice I stated above then please give me resources for learning e.g book names or some websites which will start me learning from scratch. Furthermore, I want to state that I want to create cool games, softwares or even Operating Systems from …

Member Avatar
Member Avatar
+0 forum 8

Hi all, I have 2 form and a main.py in the project: ffrend.py and fmain.py main.py: from PyQt4 import QtCore, QtGui from fmain import * if __name__ == "__main__": import sys app = QtGui.QApplication(sys.argv) MainWindow = QtGui.QMainWindow() ui = Ui_MainWindow() ui.setupUi(MainWindow) MainWindow.show() app.exec_() fmain.py (there is a button to execute the following function) def friendNetWork(self): form = QtGui.QWidget() ui = Ui_ffriend() ui.setupUi(form) form.show() app.exec_() When I run main.py, the fmain form is shown. When I click the button on fmain form, the friendNetWork will be executed and create another widget. But...I received the error in console :(...And the python is …

Member Avatar
Member Avatar
+0 forum 6

Hello friends I would love to have your help with a blocking for hours. In summary, I have to read an XML file and retrieve information with the VB.Net language. I would like to recover the "name", the "checkvalue" and the "compositekey" That's the structure of my xml file: <supercollection **name**="BF000000.hks"> <collections> <collection maxdukptkeyindex="17" maxmskeyindex="13" merchantid="" applicationcertificate="Only Collection Certificate" applicationname="Only Collection Application" name="Only Collection"> <mskeys> <key index="1" **checkvalue**="E8F71A" variantindex="0" verifycheckvalue="yes" keylength="32" **compositekey**="BA03BDBDF091092C26B9D22A2922F504" usage="1" encryptionmode="TECB" name="Key"> <type>Master</type> </key> </mskeys> <dukptkeys></dukptkeys> </collection> </collections> </supercollection>

Member Avatar
Member Avatar
+0 forum 5

Hi, I have a .csv file in an AWS machine i wanted to convert that .csv file to .dat file? Can you please help me? Thansk, Swetha. G

Member Avatar
Member Avatar
+0 forum 2

I am doing a college project and need to display client status in form of coloured * by using an enum with flags...Now i know how the enum works but the problem is I need to show more than one * within the same field (lable or anything else) but each * with a different colour according to the creteria... Now i cant use label.forecolour cause that sets the whole lables' colour... Can anyone give me some advise?

Member Avatar
Member Avatar
+0 forum 11

I'm having a problem with my python installation. The packages that came with the installation work just fine but when I try to use other installed packages I run into problems. For example, I installed a package `pymsgbox` using pip from an admin shell. When I run a sample script from the command line as in `sample`, I get ModuleNotFoundError: No module named 'pymsgbox' but when I run it by `python sample.py` it works fine. Likewise if I load it into IDLE and run it from there. Suggestions?

Member Avatar
Member Avatar
+0 forum 8

Because Microsoft will be removing vbScript in the next version of Windows, I have been busy converting my utility vbScripts into Python. Part of this is a library of functions that I keep in `D:\include`. I'd like to maintain this system in Python, but the import process is rather clumsy. I have to import sys sys.path.insert(0,r'D:\include') Only after that can I import a file. The documentation is somewhat obtuse but I gather my best option is to add the file `D:\include__init__.py`. As long as that folder is known to Python I could then do from include import myfile1 to include …

Member Avatar
Member Avatar
+0 forum 5

Have two CSV files containing client records and need to compare the two and then output to a third file those rows where there are differences to the values within the record (row) as well as output those records (rows) on the second file that are not on first file . Example: File 1: KeyField,Name,City, Zip,Location 123,Fred,Chicago,60558,A2 234,Mary,Orlando,12376,4L6 345,George,Pittsburgh,40567, 22 456,Peter,Topeka,00341,234 567,Doc,Birmingham,76543,H86 File 2: KeyField,Name,City,Zip,Location 123,Fred,Chicago,60558,A2 234,Mary,Orlando,12376,4L6 345,George,Boston, 40567,22 456,Peter,Topeka,00341,234 567,Doc,Birmingham,7654,H86 678,Isabel,Guadalajara,87654,M111 The results should create a file containing : 345,George,Boston,40567,22 678,Isabel,Guadalajara,87654,M111 The following code gets me in the neighborhood as a visual check: import os import difflib f=open('original.csv','r') #open …

Member Avatar
Member Avatar
+0 forum 10

Are there any differencies between these two code ? if (!a.equals("")) { editDate.setText(a) } and if (a!="") { editDate.setText(a) }

Member Avatar
Member Avatar
+1 forum 2

Hi. I'm trying to create a Traffic simulator and I'm stuck on how to get a Car object to turn into a road. I've managed to have a car go straight (which is really easy anyway lol) but I can't really find a way to get it to turn into a road, specifically a left turn. The code I have currently is this: [CODE]import java.applet.*; import java.awt.*; import java.awt.geom.AffineTransform; public class Traffic3 extends Applet implements Runnable { //thread variables Thread t; int i; //double buffer variables Image offscreenImage; Graphics offscr; int width; int height; //car //coordinates for lanes //south road, …

Member Avatar
Member Avatar
+0 forum 10

I have a problem with my datagridview. And the following happens I have several buttons to load the datagridview. All these buttons are working correct So datagridview is loading as expected. Only when i press the right or the left arrow butoon and when then datagridview wil be selected with the arrow buttons then the datagridview will be cleared so all datarows in datagridview are gone. How can i disable the arrow buttons when datagridview not is focused ?

Member Avatar
Member Avatar
+0 forum 1

hi...can someone help me?? a program that i can print barcode from a vb6 application? once i entered data, (i have already a format for the barcode value), it will print the barcode once.. then, enter again info, then print.. i have a sato barcode printer ct400.is there any configuration in the printer or i just need code???? thanks..

Member Avatar
Member Avatar
+0 forum 5

Hi all I have a x32 bit application on a windows10 x64 machine. The application was working fine untill I change the connection string from OLEDB to ODBC with a DSN. Since my application x32 bit I created a x32 bit DSN to an ACCESS db wich also is a x32 (Office 365). When I run the application I receive the error, cannot open database (Unknown) it may not be a database that your application recognizes. I can oppen the Database from Access fine no pronblem, I also recreated the 32bit DSN dultiple times and the problem still precistes.

Member Avatar
Member Avatar
+0 forum 5

dear all i have a invoice table now in that datagrid table i have 4 columns itemcode itemdescription qty price now what i need is user come to itemcode and whenever he type itemcode, he should get a list of initial alphabetic itemnames like if i type A so itemcode must show all items codes related to A and when i get my required itemcode, after pressing enter it should fill the related field (item description,qty,price) please guide with codes thanks

Member Avatar
Member Avatar
+0 forum 7

Hi everyone! I'm making an application which requires users with different permissions/previleges to login and use the application.For example, if the user is "admin", all menu items in the menu bar are shown and enabled. If the user is say "user_group1", some of the menu items are to be hidden. The same for "user_group2", "user_group3", "user_group4" and so on. I could put a code for each specific user in each form but that's a great deal since users and their user groups may be added after application deployment. So it has to be something flexible. I want the user "Administrator" …

Member Avatar
Member Avatar
+0 forum 24

Hi guys, i'm having a difficulty to set the path in vb.net.i put the code in the module and every time i run the code it throws error "Could not find file 'C:\Users\Abdueie\Desktop\BMS\Bridge Asset Management\Bridge Asset Management\bin\Debug\Adigrat.accdb'." here's the code Public conn As OleDbConnection = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0; Data Source= .\\Adigrat.accdb;Persist Security Info=False")

Member Avatar
Member Avatar
+2 forum 12

Hi guys, I seem to have an issue with a boolean method returining a value. Here is the code excerpt - irrelevant code omitted: public class StreamsTest { public static void main(String[] args) { String[] arr = new String[]{"a", "b", "c"}; //convert array to string with streams List<String> list = Arrays.stream(arr).collect(Collectors.toList()); isElementInIt(list); } static boolean isElementInIt(List<String> list) { if(list.isEmpty()) { return false; } else { for (String string : list) { if (string.contains("a")) { return true; } else { return false; } } } } } STS says that the isElementInIt method should return a boolean value, but it's already …

Member Avatar
Member Avatar
+0 forum 2

Hi, I'm writing in C my program and I have a problem with this pieces of code: //lib.h typedef struct Array { char **array; char *searchDirPath; char *searchFile; char *tmpFileName; int tmpFile; int arraySize; int currIndex; } Array; // lib.c Array* createArray(int size) { Array* newArray = calloc(1,sizeof(Array)); newArray->array = calloc((size_t)size,sizeof(char*)); newArray->arraySize = size; newArray->currIndex = 0; char fileName[] = "tmpXXXXXX"; newArray->tmpFile = mkstemp(fileName); newArray->tmpFileName = fileName; showYourself(newArray); return newArray; } void showYourself(Array* a) { printf("\n\n==========================================\n"); printf("\nShowing myself:\n arraysize: "); printf(sizeof(a->array)); printf("\nSearch directory path: "); printf(a->searchDirPath); printf("\nSearch file path: "); printf(a->searchFile); printf("\nTmp file: "); printf(a->tmpFileName); printf("\nArray size: "); printf("%d",a->arraySize); printf("\nCurrent …

Member Avatar
Member Avatar
+0 forum 2

Hello, I found this code in a thread from about 18 months ago in a post by 'woooee' - [CODE]def func_1(): print " func_1 test" def func_2(): print " func_2 test" def func_3(): print " func_3 test" def func_4(): print " func_4 test" ##---------------------------------------------------------------- ## dictionary = list of function to call and menu choice to print menu_d = { 1:['func_1()', '1)Load'], 2:['func_2()', '2)Save'], 3:['func_3()', '3)Add Phone Number'], 4:['func_4()', '4)View Phone Number'], 5:["", "5)Exit"]} choice = 0 while choice != 5: print "\nSelect an Option\n" for j in range(1, 6): print menu_d[j][1] ## print list's element #1 for key=j choice …

Member Avatar
Member Avatar
+0 forum 8

I'm trying to add insert functionality to a textbook code example. I have an "off by one" error and I can't think of a way to fix it. Here's my attempt below: template< class NODETYPE > void List< NODETYPE >::insertMiddle( const NODETYPE &value, int position ) { ListNode< NODETYPE > *newPtr = getNewNode( value ); ListNode< NODETYPE > *curr = firstPtr; ListNode< NODETYPE > *curr2 = firstPtr; if ( isEmpty() ) firstPtr = lastPtr = newPtr; else { if (position == 1) insertAtFront( value ); cout << "curr->data is: "<<curr->data<<endl; for (int i = 1; i != position; ++i) curr …

Member Avatar
Member Avatar
+0 forum 3

Hi, something weird happened with my program, I mean when I run it I see only grey frame (like I had only JFrame object in my app), then I minimalize application, maximalize it and only then I see all components painted (JButton, rectangels and lines inside Jpanel,...). Changing of frame size helped too, but now I have fixed size, so this is not anoption. Can you tell me what can cause that behaviour. This is class which draw everything: public class Simulation{ JFrame frame; JPanel background; RoadSystem roads; Stats stats; Settings settings; JButton startButton; public Simulation() { frame = new …

Member Avatar
Member Avatar
-1 forum 2

Hello! I am interested in the issue of protecting the code from hacking. Do you protect your code from decompiling and hacking? Why did the question arise? I worked in a team that developed games for Android. They all used obfuscators! So almost no one could hack their application. Now I am interested in the topic of code protection. I looked at the existing topics, they are slightly outdated (8-10 years ago were relevant). Use / not use obfuscator? Which to choose?

Member Avatar
Member Avatar
+1 forum 15

I am writing an application which will process data over night. When it's finished a report is printed out. I am wanting the report to be printed to 3 different printers on the same network. Is it possible to do this? All three printers are installed on the pc. Thanks in advance PG

Member Avatar
Member Avatar
+0 forum 3

The End.