FAQ Database Discussion Community


How to change default mouse hover behavior on dynamically generated buttons

c#,wpf,code-behind,dynamically-generated,mousehover
I am a relatively new user of WPF and have run into a problem regarding dynamic Button generation and Buttons' default hover properties. I am currently working on an application where a significant number of buttons are being generated on a Canvas in the code behind. The contents of each...

Is there a way to generate a list of indices using numpy

python,numpy,dynamically-generated,indices
Can I use numpy to generate repeating patterns of indices for example. 0, 1, 2, 3, 4, 5, 0, 6, 7, 8, 9, 10, 0, 11, 12, 13, 14, 15 or 0,1,2,1,2,3,4,5,6,5,6,7 Is there a method in numpy i can use to generate these lists between a range ? currently...

Android changing text on buttons programatically

android,button,android-linearlayout,dynamically-generated
I am making a grid of buttons 4 wide, 9 tall, all of the buttons are invisible and no text on them, I then programatically add text to them and make them visible (basically I am using the invisible buttons because any of the 36 buttons can become visible due...

Dynamically create all objects contained in file

java,object,dynamically-generated
I am developing a program to mark algorithms submitted by a group of students; each student will submit their own .java files. I would like to place these .java files into a folder and run my program. My program would then instantiate each class in the folder and add it...

Create EF models over command line or c#

c#,entity-framework,cmd,dynamically-generated,ef-database-first
I'm using EF for database access with database first convention. Is it possible, to generate the entity framework models over c# or the command line? Important is, that no visual studio is required for that. I've searched but could not find any thing, besides the visual studio ui. Thank you!...

document.getelementById doesn't work on dynamically generated divs

javascript,html,getelementbyid,dynamically-generated
I am trying to update the content of a dynamically generated div with .innerHTML and getElementById, but when I test it, I get an error: "Uncaught TypeError: Cannot set property 'innerHTML' of null" I also tried using alert() and checking the value of quizDiv at breakpoints. Well, here's my JS...

Building chained function calls dynamically in PHP

php,function,object,dynamically-generated,kirby
I use PHP (with KirbyCMS) and can create this code: $results = $site->filterBy('a_key', 'a_value')->filterBy('a_key2', 'a_value2'); This is a chain with two filterBy. It works. However I need to build a function call like this dynamically. Sometimes it can be two chained function calls, sometimes three or more. How is that...

Removing Controls from Form (Doesn't hit every Control I want to remove)

c#,forms,controls,dynamically-generated
I am dynamically adding some Controls to my Form and it works quite well but when I want to remove them again, it only removes a few of them in a weird (random) pattern (2 controls here, 2 there,...). I tried using: foreach (Control item in this.Controls.OfType<Control>()) { if (item.Tag...

More elegant way to form n-digit range of numbers

python,python-3.x,numbers,range,dynamically-generated
I need to form a range of numbers depending on input param n. If n=1 range is range(0, 10), if n=2 then range(10, 100). I have a code, but it looks ugly, maybe there is better way. start = 0 if n == 1 else int('1' + '0' * (n...

AnguarJS: Bind dynamically created controls to model

angularjs,data-binding,dynamically-generated
I need to create a GUI on the fly depending on the input of the user. One use case is, that the user enters the number of headlines he/she wants to have on a generated report. Therefore I render input controls via ng-repeat which works fine. In those rendered input...

Browser doesn't show dynamically generated CSS in JSP

css,servlets,dynamically-generated
I'm writing simple web app which generates simple CSS file for user. I've mapped servlet for writing CSS on specific tag, and depending of the user's session attributes, I use PrintWriter for generating CSS stylesheet. Problem: Stylesheet doesn't have any effect. Chrone shows it was downloaded (inspect element -> network),...

Programmatically generate list of combinations other lists

python,list,combinations,dynamically-generated
I want to create a list of possible combinations of a list of lists (example will explain better) list=[[a,b],[c,d],[f]] The result should be acf adf bcf bdf The length of the list can vary, and the length of the lists within the variable list can also vary. How would I...

Clarification of steps while generating of OpenCV libraries using CMake

c++,opencv,visual-c++,cmake,dynamically-generated
I have generated the OpenCV libraries using CMake a couple of times using tutorials available online, albeit without completely understanding the process. Here is the process that I follow Configure CMake to build the OpenCV binaries (eg with QT, TBB, without CUDA, OpenCL etc) Generate the binaries using CMake The...

Check if 3/9 texts of dynamically created JButtons matches? (for Tic Tac Toe game)

java,swing,for-loop,jbutton,dynamically-generated
JButton button[] = new JButton[9]; for(int i = 0;i < button.length; i++){ button[i] = new JButton(); button[i].setText(Integer.toString(i+1)); frame.add(button[i]); button[i].addActionListener(this); } What I have is 9 JButtons with name "button". To determine a win, how can I check if 3 button(either in rows, columns, or diagonal) matches. Thanks in advance....

Android EditText setHint's font size dynamically

android,android-edittext,font-size,dynamically-generated
I've been struggling with setting size of hints in my EditText. The hint's font size becomes too large and the layout starts to look horrible! EditText dummy = new EditText(); dummy.setHint("some hint"); How do I dynamically and programmatically change the hint's font size w.r.t my priorly set MAX_HINT_SIZE (in pixels)?...

Dynamically create compiled binary with go

dynamic,go,compilation,dynamically-generated
First sorry for perhaps a bad title - I imagine a lot of the difficulty I'm experiencing relates to not knowing the correct terminology for what I'm trying to achieve. In Go, I wish to have a program which when run can dynamically create a secondary binary. To illustrate with...

Adding Dynamically ImageViews to horizontal scrollview in android

android,imageview,horizontalscrollview,dynamically-generated
I'm trying to show images dynamically by string as ID and want to display it in Horizontal scroll-view as i have 13 cards which can't be fit on screen Here is my code its working fine but i want it in Horizontal Scroll View int resID = getResources().getIdentifier(resourceName, "id", getPackageName());...

Generate sheets corresponding to row values (duplicate values exist)

excel-vba,error-handling,dynamically-generated,worksheet
I have a main worksheet (Install_Input) where sheet number, test section, and material are manually entered by user. (Below: illustration of Install_Input ws: Range A1:C8) Sheet# | TestSection | Material .....1.....|..........A..........|.STEEL.| .....2.....|..........B..........|.PLASTIC.| .....3.....|..........C..........|.STEEL.| .....5.....|..........G..........|.STEEL.| .....2.....|..........F..........|.PLASTIC.| .....2.....|..........A..........|.STEEL.| .....5.....|..........D..........|.PLASTIC.| I want to generate sheets...