I'm trying to get my JPanel (JFrame?) to resize itself to fit randomly drawn shapes. I have a shape superclass and right now I'm working with my line subclass. Everything is working fine except I can't figure out how to make the shapes fit the size of the JPanel. Should I limit the size of the shapes or could someone suggest a way to dynamically set the size of the Jpanel based on the maximum size of the shapes? (I'll eventually want to do this with several shape types in the same panel). I'm thinking a for loop grabbing the …

Member Avatar
Member Avatar
+0 forum 4

I've been studying TDD for a few years and read quite a few books but none that good to be honest. Can anyone recomend any good ones. I'm not interested in BDD but am keen on anything that tackles the many problems of mocking intrinsic MVC objects.

Member Avatar
Member Avatar
+1 forum 1

I am using PySide2 for GUI. I have a "Rename Project" QAction. The function must be like this: 1. set enable to false if tab name is "*Untitled" or file is unsaved. 2. set enable to True if file is loaded. How to do this? 3. Whenever switching to tab, these functions should be observed.

Member Avatar
Member Avatar
+1 forum 5

Hi I have python code that can list all drive letters but now I need also list the name of drive letter (Label) and the size of hard drive like below! Ltr Label Size ---- ------ --------- C Windows 800 GB E Local Disk 200 GB F My Passport 500 GB Y Secret 1 GB import string from ctypes import windll def get_drives(): drives = [] bitmask = windll.kernel32.GetLogicalDrives() for letter in string.ascii_uppercase: if bitmask & 1: drives.append(letter) bitmask >>= 1 return drives if __name__ == '__main__': print (get_drives()) # On my PC, this prints ['A', 'C', 'D', 'F', 'H'] …

Member Avatar
Member Avatar
+1 forum 1

I have 30 functions like this void func1(int *var1, int *var2) { func2(var1, var2); } void func2(int *var1, int *var2) { func3(var1, var2); } void func3(int *var1, int *var2) { func4(var1, var2); } I do not need var3 until func15. Is there a way to fix this mistake without having to change all the function calls and headings? var3 needs to be remembered every time I get to func15. I only use var3 in func15 though so I really do not want to have to change all of my function calls and headings. It obviously can't be a local variable …

Member Avatar
Member Avatar
+0 forum 4

How can I make this to continue until the user presses N? I've tried using while(1), while( option == 'y' || option == 'Y') but it kept giving an error for that, and if/else statements but no luck. So I decided to try a do while statement and same results, it seems it is working, but I don't know what I'm doing wrong. I even tried moving all the statements to different areas and still nothing. #include <stdio.h> #include <time.h> #include <stdlib.h> enum meme {YEE, KNUCKLES, DOGE, HARAMBE, BUTKUS}; int dankestmemes(void); // function prototype int main(void) { srand(time(NULL)); // randomize …

Member Avatar
Member Avatar
+0 forum 10

I need a form that accepts two operands and an operator from the user and then performs the requested operation. Specifications Before performing the calculation, the application should check that both operands are numeric and that the operator is one of the following: + add - subtract * multiply / divide It should also check that both operands are between 0 and 1,000,000 (non-inclusive). To perform this data validation, code IsPresent, IsDecimal, and IsValidData methods as described in chapter 7 of the book. In addition, code an IsOperator method that checks for a valid operator. Code a private method named …

Member Avatar
Member Avatar
+0 forum 10

I have a program that is meant to display the total, average, student name and letter grade for a student. I'm almost done writing it but I have no idea how to make it loop so it goes back to step 1 from step 4. Everything I've read on using "while" loops hasn't really been helpful to me with this particular application. import java.util.Scanner; public class Averages5 { public static void main(String[] args) { // variable declaration String name; int mark1, mark2, mark3 ; int grade = 0; int A, B, C, F; double average; // input Scanner input = …

Member Avatar
Member Avatar
+0 forum 2

This may sound wierd, or easy, I just don't have a statistics background. How do I alter the statistical value of an array of emmitted random numbers? I am completely capable of using ranges, or creating an algorithim, I just need pseudo code or a brief description to guide me through the process. This is not homework. This would mean I essentially generate randoms, and the final result has a statistical probability. Thanks!

Member Avatar
Member Avatar
+0 forum 3

Howdy All - I am just wondering if anyone has successfully converted a *massive* (subjectivity implied) COBOL application to another language. If so, into which language was your system converted and when was this done? What were the potholes you, no doubt, hit? Was the conversion far more expensive than anticipated? What hidden costs were exposed? Was there a performance gain/loss in the new language? Did anyone convert from COBOL to PL/SQL? to T-SQL? to Java? to C#.NET? Thanks, and have a great day!

Member Avatar
Member Avatar
+0 forum 10

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

how avoid memory leaks? from here: http://www.winprog.org/tutorial/bitmaps.html i learned: GetDC() - ReleaseDC() BeginPaint() - EndPaint() CreateCompatibleDC() - DeleteDC() i must get the old selected object. select it when isn't needed and then delete it. so seen these constructor and desctructor: image(const int width, const int height) { if (isimgused==true) delete img; isimgused=false; if(isGDIPLUSIniciated==false) { Gdiplus::GdiplusStartup(&m_gdiplusToken, &gdiplusStartupInput, NULL); isGDIPLUSIniciated=true; } SelectObject(hdcimage, obj); DeleteObject(btBitmap); DeleteObject(obj); DeleteDC(hdcimage); hdcimage = CreateCompatibleDC(NULL); btBitmap = CreateBitmap(width,height,1,32,NULL); obj = SelectObject(hdcimage, btBitmap); framecount=1; imageheight=height; imageweight=width; } ~image() { if(isimgused==true) delete img; if(isGDIPLUSIniciated==true) Gdiplus::GdiplusShutdown(m_gdiplusToken); SelectObject(hdcimage, obj); DeleteObject(btBitmap); DeleteDC(hdcimage); } and these function: void DrawHICONtoHDC(HDC hdc, HICON hIcon, int PosX=0, …

Member Avatar
Member Avatar
+1 forum 3

Halli Hallo i hope im at the right Place. I want to get started with API-Gateway(s). Currently im running 5 Microservices written in Java (Spring-Boot) deployed via Docker. Each Microservices is protected via Keycloak. I want to use a API-Gateway so that i can combine every MS into 1 Link: * demo.com/api/ms1 * demo.com/api/ms2 * ... And more important i want to have the Authorization at one Place and not in everysingle Microservice. I found a couple of Solutions but im not sure which to use or if i maybe should write my own one? I was intrested in checking …

Member Avatar
Member Avatar
+1 forum 1

The API docs are now found at [ Java Development Kit Version 11 API Specification](https://docs.oracle.com/en/java/javase/11/docs/api/)

Member Avatar
Member Avatar
+0 forum 3

If you have a counter that gets incremented through multiple functions, is it better to use a global counter or pointer counter? They both work just curious which is better and why.

Member Avatar
Member Avatar
+0 forum 3

I have a table that contains some cubes with servers and active status (see attached image): note: CUBE1 is repeated intentionally. The idea is the same cube is getting synced from the same server 1 as a data source (process_server) onto different target servers (query_server; say server2 is in region A and server 3 is in region B). The way the environment is set up is both servers have to be active/active status (meaning TRUE) except for some additional test cases, i am setting to false sometimes one or the other. I have the following script now calling the cube …

Member Avatar
Member Avatar
+0 forum 1

Hi guys : Any help with this please! script1.py in 192.168.1.10 x = 10 script2.py in 192.168.1.20 if x == 10: print x else: print "sorry" how can apply this between two scripts in same network. Thanks for all

Member Avatar
Member Avatar
+0 forum 4

Hi, I Have below table I want all rows with all coloumn from below table where ActCode is 1162828 and sum of DocAmount for DocNo. i.e where the docNo is repeated i want only one row with sum of amount of all repeated rows. ** "Select *, Sum (DocAmount) from TblPurLedTranData whre TblPurLedtranData.ActCode='" & 1162828 & "' Groupby DocNo " ** PosDate DocDate DocNo DocAmount DueDate Status Period DocType FinYear Chan ActCode 10/10/2018 12/10/2018 369896     36980      11/11/2018 INV      5         PUST       2018       PUST       1243684    10/10/2018 12/12/2018 665        36000      11/01/2019 INV …

Member Avatar
Member Avatar
+0 forum 1

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

[B]Hi all.. I need to do a condition check in a script. The same condition check needs to be repeated in another script. So, I am looking for a way, where i can set, say a flag in the first script ,upon meeting the condition, and be able to access that flag in another script, instead of repeating the check all over again. Hope I am clear in explaining what I want to do. Can anyone pls give me suggestions? [/B]

Member Avatar
Member Avatar
+0 forum 13

Hi guys, I took it upon myself to learn the mysteries of linux. I'm trying to write a shell that can handle more than one pipe. Here's the code: [CODE] typedef struct command_link{ char *command; char *argv[MAX_ARGS]; int argc; struct command_link* next; int isPiped; }command_t; int pipedCommand(command_t *command) { int fd[2]; int status; int isFirstPipe = 1; int pid = -1; status = pipe(fd); if (status < 0) { printf("\npipe error"); return -1; } while (1) { pid = fork(); if (pid < 0) /*handle fork error*/ { printf("\nfork error"); return -1; } else if (pid == 0) /*handle son …

Member Avatar
Member Avatar
+0 forum 5

Hi all, I need to read a text file (I've attached it, you can take a look), and then store all the numbers in it into a 2D array. After which, I need to parse it. I need urgent help here! ):

Member Avatar
Member Avatar
-2 forum 49

Question from codility test Write a function: class Solution { public int solution(int[] A); } that, given an array A of N integers, returns the smallest positive integer (greater than 0) that does not occur in A. For example, given A = [1, 3, 6, 4, 1, 2], the function should return 5. Given A = [1, 2, 3], the function should return 4. Given A = [−1, −3], the function should return 1. Write an efficient algorithm for the following assumptions: > > N is an integer within the range [1..100,000]; > each element of array A is an …

Member Avatar
Member Avatar
+0 forum 8

Moderators: Please dont delete this post as it is featured A part of an assignment I have due. The assignment states - A program that prints out lines of asterisks, based on the values determined by the user input. The program first asks for the minimum number of asterisks, the maximum number of asterisks, and the interval. It then prints lines of asterisks, starting with a line with the minimum number of asterisks, and ending with a line with the maximum number of asterisks. The increment of the numbers of asterisks is specified by the interval value. At the end …

Member Avatar
Member Avatar
+0 forum 6

I was so amazed at how easy it was to embed google maps into a vb app I decided to post a quick example to help anyone get started. This is a simple example. Google's api has all kinds of things to help customize your map. You can find out anything you need to know from here: [url]http://code.google.com/apis/maps/documentation/javascript/reference.html[/url] You will need to: Create a new windows forms app. Add a class named GoogleControl and paste the GoogleControl code into it. Add a new html doc to the project and name it GoogleMap.htm and set its Build action to CopyIfNewer Copy …

Member Avatar
Member Avatar
+4 forum 46

Hi, How can I pass a c# string to C++ side of the app? Right now, I have all handling in Const char * format . When I pass c# string, c++ working fine when using Platform::String . But there is no good way of converting Platform::String to const char *. Any inputs from your side? Any help will be appreciated. Thanks.

Member Avatar
Member Avatar
+0 forum 9

Above program takes input of coefficient and power separately of 2 different polynomials add them up to a new polynomial.It is successfully compiled and executed in DEV CPP as C file.It Turbo C compiler add void before main function to avoid warning messages.

Member Avatar
Member Avatar
-1 forum 6

Hi, Front end Vb6, back end.. access... connection.. ODADB... can someone please help me with the code for login and password.

Member Avatar
Member Avatar
-6 forum 15

I have class with main method like: public class Main { public static void main(String[] args) { long timeCheck; long periodOfTime; ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(2); long initialDelay = 0; // the time from now to delay execution long period = 1; // the period between successive executions scheduler.scheduleAtFixedRate(new FeedReader(img, url, title, price), initialDelay, period, TimeUnit.DAYS); ... ... } } and another class with some code: public class FeedReader implements Runnable { private String img; private String url; private String title; private String price; public FeedReader(String img, String url, String title, String price) { this.img = img; this.url = url; this.title …

Member Avatar
Member Avatar
+0 forum 8

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

The End.