Member Avatar

As part of a project to manage my collection of photos, I wanted to add the capability of displaying a series of files as thumbnails. This posed me with three problems: 1. how to preserve the aspect ratio of the original images 1. how to generate the thumbnails without tying up the application 1. how to avoid running out of memory Because generating thumbnails of images is (I think) of reasonably wide interest I thought I'd write it up as a code snippet. To recreate the project, start with a blank form and add two buttons, btnDetails and btnThumbs. Add …

Member Avatar
+3 forum 8
Member Avatar

I just started using python a couple of days ago, so I am a complete beginner. Basically what I am trying to do is the following. Imagine that I have a string variable such as: food = 'bread' I want to create another variable (integer or another type) so that its name is 'bread', in other words the new variable name should be the value of the string variable "food". How can I do such an assignment? My guess is that it should not take more than two or three lines. I read up and am thinking that I need …

Member Avatar
+1 forum 8
Member Avatar

Hi all I have a datagridview with 2 columns. fist column is Datagridview combobox the second is a datagridtextbox. I'm trying to fill the second column based on the combobox selection . The Method that captures the selected item does not track which row is being edited. I have tried using the Mouse up and Cell edit events but they were unsuccessful. This is the code that I use to capture which item has been selected. Private Sub DGV_LinesItem_EditingControlShowing(ByVal sender As System.Object, ByVal e As DataGridViewEditingControlShowingEventArgs) Handles DGV_LinesItem.EditingControlShowing Dim editingComboBox As ComboBox = e.Control AddHandler editingComboBox.SelectedIndexChanged, AddressOf Me.editingComboBox_SelectedIndexChanged End Sub …

+1 forum 0
Member Avatar

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
+0 forum 7
Member Avatar

ok i dont really know how to explain this but... c:=readkey; case (c) of #13:Halt; #27:goto menu else goto quit; as you can see above if you press Esc(which is 13) the program quits and if you press Enter(which is 27) it gos to the menu. I want to know if theres a list somewhere which tells me the number for each keyboard number. does anyone know where i can find 1?

Member Avatar
+0 forum 5
Member Avatar

Dear All, Good Morning! I am facing this issue i tried a lot but not able to find the issue with this function when i call this function i get error Argument not specified for parameter 'LVL' of 'Public Function UL(LVL As String) As String' The code is listed below, if someone can help me on this i will be greatful. Public Function UL(ByVal LVL As String) As String Dim con As OracleConnection = New OracleConnection(My.Settings.ConnectionString) Dim com As OracleCommand = Nothing Dim userLevel As String = True Try con.Open() com = New OracleCommand("SELECT LVL FROM Users WHERE Username = …

Member Avatar
+0 forum 1
Member Avatar

Sorry for the lousy title, "InterProcess Communication" was too long Basically, I'm looking to use the native `_winapi` and `msvcrt` modules to launch an integrated python interpreter and communicate with it over pipes I can't find anything on Google or DDG, and I've been searching for days, but nobody uses these modules for some reason... I already have the foundation with a 1-way Parent->Child pipe that works, but it's giving me a few issues: 1: I can't seem to get a 2nd Child->Parent pipe to run without the program hanging 2: the output of the subprocess only prints after the …

Member Avatar
+0 forum 22
Member Avatar

I have written a code to generate bar codes and saved them to a pdf file . The code executes successfylly but the PDF file does not open saying giving an error whome picture I am uploading. Please see my code and Picture with the error. ![barcodeError.PNG](/attachments/large/4/466b7c7d36a50fd6f88d0a7f157907c8.PNG) public void createPDF(String pdfFileName,String myString) throws FileNotFoundException{ Document doc = new Document() ; PdfWriter docwriter = null; try{ docwriter = PdfWriter.getInstance(doc, new FileOutputStream("C:\\Users\\hp430\\Desktop\\barcodes\\"+pdfFileName)); doc.addAuthor("Saboor Siddique"); doc.addCreationDate(); doc.addProducer(); doc.addCreator("SunSoftTechnologies"); doc.addTitle("Barcode Test"); doc.setPageSize(PageSize.LETTER); doc.open(); PdfContentByte cb= docwriter.getDirectContent(); Barcode128 code128 = new Barcode128(); code128.setCode(myString.trim()); code128.setCodeType(Barcode128.CODE128); code128.setBarHeight(5f); code128.setX(0.1f); Image code128Image = code128.createImageWithBarcode(cb, null, null); code128Image.setAbsolutePosition(10, 700); code128Image.scalePercent(125); …

Member Avatar
+1 forum 4
Member Avatar

[CODE]#include <iostream> using namespace std; int main() { int a,b,c, ope; cout<<"enter a value" << endl; cin >> a; cout<<"enter b value" <<endl; cin >> b; cout<<"enter operation (+ - * / and %)"; cin>> ope; if (ope == +) { c=a+b; cout<< c; break; } if (ope == -) { c=a-b; cout<< c; break; } else if (ope == *) { c=a*b; cout<< c; break; } else if (ope == /) { c= a/b; cout<< c; break; } else if (ope == %) { c=a%b; cout<< c; } else cout<<"entered wrong input"; return 0; } [/CODE] whats wrong with …

Member Avatar
+0 forum 11
Member Avatar

Hey guys, I would like some help regarding saving or reading to or from a bin file. I've read several online tutorials about file input/output, however it doesn't given specific information when applying it to both an array of structures. My knowledge of pointers is weak, as I constantly need to look over examples to get an idea of whats going on. Heres my attempt: [CODE] #define PLANET_SIZE 10 /* Called from function */ save(planet_t writePlanet[], *totalSize); /* define as int* totalSize */ read(planet_t *writePlanet); typedef struct{ char name[20]; }planet_t; /* Save to file */ void save(planet_t writePlanet[], int totalSize){ …

Member Avatar
+0 forum 8
Member Avatar

I have a program that i need to convert from java to c++... i just need help doing it... heres the java: [code] /* Name: Joseph Coleman Class:CSCI 1302 Assignment: Employee + ProductionWorker Academic Honesty: The integrity of students and their written and oral work is a critical component of the academic process. The submission of another?s work as one's own is plagiarism. Students shall be guilty of violating the honor code if they: 1. Represent the work of others as their own. 2. Use or obtain unauthorized assistance in any academic work. 3. Give unauthorized assistance to other students. …

Member Avatar
+0 forum 10
Member Avatar

I made a JavaFX Discord Server for people who like to talk about JavaFX stuff, or need help with certain projects, I really like to work with java, especially with people who are working with JavaFX (: Here is the discord link: https://discord.gg/yZ3Y3Fd or https://discord.gg/AzFaNU

Member Avatar
+1 forum 1
Member Avatar

How do I make a cube in javafx that have 6 different textures on each side of the cube? The only way I know how to solve this, is by making 6 imageviews and give them each a specific coordinates that make them look like a cube. Is there a other way to do this? Like, I like to give the cube later on lighting, and some rotations. It will be more complex if I use this method. Btw, I heard about Triangle Mesh, but I don't know how TextureCoords works. handy links: https://docs.oracle.com/javase/8/javafx/api/javafx/scene/shape/TriangleMesh.html https://docs.oracle.com/javase/8/javafx/api/javafx/scene/shape/Box.html

Member Avatar
+0 forum 7
Member Avatar

Hi! It's been a while since I last posted here. I've just gotten started with Windows Service, and have created a sort of 24/7 service to update a database. But because it's my very first project (besides the tutorial one) I feel that I could use some assistance in checking it over. The intent is to have it run a method from a class at about once every 24 hours. If anyone of you clever people could spare a moment to see if I've made mistakes. (Ignore the database connections. Those work) Imports System Imports System.Timers Imports System.Runtime.InteropServices Public Class …

Member Avatar
+0 forum 4
Member Avatar

hi there i have some python coding which i need to convert to java can ne1 help me please email me back if you can help then i will show you the coding much appriciated

Member Avatar
+0 forum 10
Member Avatar

Python-wxPython Tutorial This tutorial will take you through the basics of wxPython. ##Introduction: Let's face it. I am a dinosaur. I got my computer science degree in the mid 70s. And it won't be long before **I** am in **my** mid 70s. So why am I trying to learn Python? Mostly because learning new things keeps my brain active. And besides, nobody on Daniweb seems to be asking questions about vb.Net anymore. So I thought I'd give it a try. After a few weeks of puttering I managed to learn enough Python to rewrite all of my vbscripts (stop laughing, …

Member Avatar
+8 forum 28
Member Avatar

Hi. I just installed Code Blocks. I want to just get started with programming. It seems that I have to configure Code Blocks therefore, setting up a compiler. How should this be done? Help Leon

Member Avatar
+0 forum 4
Member Avatar

Hi. I want to detect a face and draw line exactly around the face to crop it. I searched a lot and used the EmguCV face detector. but now my code just draw a "rectangle" around the face and if I crop it, I will have a rectangle with a face inside it and it's not useful for me. this is the core of my simple code: CascadeClassifier _cascadeClassifier = new CascadeClassifier(Application.StartupPath + "/haarcascade_frontalface_alt_tree.xml"); using (var firstImage = Image.FromStream(saveImageStream)) { var bgrImage = new Image(new Bitmap(firstImage)); Image grayFrame = bgrImage.Convert(); var faces = _cascadeClassifier.DetectMultiScale(grayFrame, 1.01, 1, Size.Empty); foreach (var face …

Member Avatar
+1 forum 4
Member Avatar

How can I show a div when menu item is clicked in angular? The Div show fine when I click list item, but dsn't disappear when I navigate to other menu items. <li><a class="nav-link slots" (click)="showme = true" >Slots</a> <div ng-hide="showme"> <div class="ribbon" *ngIf="game.categories[0]"> <span>TOP</span> </div> <div class="ribbon" *ngIf="game.categories[2]"><span>NEW</span></div> </div> TS file: showme : boolean = false;

+1 forum 0
Member Avatar

Hi all, here is a small program I have worked on over these last two days, I have submitted it in the hopes of some constructive criticism and suggestions (please be kind, this is one of my earlier C projects lol). This is a small console application that simulates a contact management database. The data that a user inputs is saved to an external dat file (contactdatabase.dat) which is created the first time a user saves and exits. This project also employs the use of Malloc(), which is used to allocate memory on the fly (at runtime) for dynamic data …

Member Avatar
+1 forum 6
Member Avatar

Hi all, I'm having some issues with the Scanner not waiting for input from the keyboard. The first method processChoice takes the userChoice and the idea is that in the switch statement there is a call to a method getUserInputForProcessing that takes the action and there scanner takes an input but it's not passing the control to the keyboard, it goes directly to the Exception because nextLine is empty, not entirely sure why. Is that because it's inside a switch statement? public void processChoice(int userChoice, BookManager bookManager) { switch(userChoice) { case 0: System.out.println("Goodbye."); System.exit(0); break; case 1: System.out.println("You chose READ"); …

Member Avatar
+0 forum 9
Member Avatar

Tyl is a programming language that is intended for curious people who are interested in software development, as well as for intermediate and experienced developers who want to try a different programming language. Some of Tyl features: - Clean code - Symbolized keywords - One-line statements - System modules & functions - Cascaded variables declaration - Automatic type inference Tyl Software includes the following modules: - Tyl Symbolizer - Tyl Parser - Tyl Statement Generator - Tyl Launcher - Tyl Compiler - Web Files Generator & Automation Details can be found at: Tyl Official Website: https://tyl-lang.dev Twitter: https://twitter.com/TylLang (@TylLang) Facebook: …

Member Avatar
+1 forum 8
Member Avatar

What are all num referring to ? class Sample { int num; void method() { num = 1; int num = num = 2; num = 3; } }

Member Avatar
+0 forum 4
Member Avatar

How can I minify my code in here, I am giving each 23 total imageview a eventhandler. code works, but I like to make the code shorter. I tried to use for loops to shorten the code. here is a example what I tried to do: for (int i = 0 ; i < imgArrayList.size() ; i++) { imgArrayList.get(i).setOnMouseClicked(new EventHandler<MouseEvent>() { @Override public void handle(MouseEvent event) { selectedTile = i; } }); } but it can't because, the "i" inside the handle method is final. I can't pass the "i" inside the handle method. my goal is, that a specific …

Member Avatar
+1 forum 4
Member Avatar

Hi, I have an idea of building an API for **Machine-to-machine payments.** The API will enable to assign wallets to connected devices, record available amounts of something valuable, as well as all incoming and outgoing movements of value. Would love to hear back from developers who are seeking to address the issue of M2M payments. * Which challenges around M2M payments are you trying to solve? * Which technology do you use? Appreciate your feedback a lot!

Member Avatar
+1 forum 1
Member Avatar

Looking to create an asset for the Unity Asset store in C#. I don't want to give away the source code, yet I want users to be able to purchase + download my work and use it in their projects. I'm not sure what this is called or how to do it. Any ideas? Much appreciated!

Member Avatar
+0 forum 1
Member Avatar

I am working on a problem for which i have already developed a solution, but i am new to OPP prgramming and started learning recently. Would request OPP Gurus to provide suggestions for the better designs, keeping scalability, extendability of (course readability) in mind. Also,I would like to extend the the current program for mutiple random players and winner is decided based on max number of votes. But there are rules: 1)Currently i have 6 players, out of which any number of players might contest(taken from std::input or cmd args) 2)Contestants are not aware of other contestants. 3)Each contestant has …

Member Avatar
+2 forum 1
Member Avatar

Hi. I was wondering if anyone could help me with checking for a valid move in Othello. I was thinking about hard=coding everything but that takes too long. this is what i have so far: 1. Check which direction is valid (adjacent piece is different from piece being placed) 2. Go in that direction(s) and if: 1. hit the end, or hit a empty space return false 2. hit another piece, keep going 3. hit my own piece, stop

Member Avatar
+0 forum 9
Member Avatar

Help me , Search data with dataGuidViewer and print that searching result (vb.Net). I am try verious Code thous are found youtube, but it not work...... Please Help me VB.Net (2010, 2012,2013,)

Member Avatar
+0 forum 2
Member Avatar

hello, i'm newbie here and also in programming world. so I would to request help from pros here. my question is, how to print out number entered in random in ascending order WITHOUT USING ARRAY AND FUNCTION? let say the user key in 4, 56, 31, 90, 11 and the output would be 4, 11, 31, 56, 90. hope anyone would help me. thank you.

Member Avatar
+0 forum 28

The End.