FAQ Database Discussion Community


Counting the basic operations of a given program

c++,performance,runtime,big-o
I am looking at the following: Operations Counting Example Which is supposed to present the operations count of the following pseudocode: Algorithm prefixAverages(A) Input array A of n numbers Output array B of n numbers such that B[i] is the average of elements A[0], A[1], … , A[i] for i...

Call a GUI from a JButton

java,user-interface,runtime,jbutton
I'd like to call a GUI from a swing component JButton. There will already be a GUI running at this time, but I'd like to execute another one through the use of a JButton. Any help would be greatly appreciated. P.S: I've tried the .show() method, and it takes over...

Start, stop and listen to a process in Java

java,multithreading,asynchronous,process,runtime
I want to start a process with Runtime.exec(). Then I want to know (listen) when the process exits. Also, I want to manually stop the process if some condition met. The code I have now is: public class ProcessManager extends Thread{ private static ProcessManager manager; Process process; private ProcessManager(){ }...

A jar started with Runtime.getRuntime().exec() runs longer than from command line

java,runtime
I have following problem: I have simple .jar program who writes in a text console.. If I start using cmd (java -jar myProgram.jar) the program runs 1 second. But I want to start program from another program using the JButton: startMyProgram.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { //...

XPages Runtime optimized Javascript and CSS resources is not working

javascript,css,runtime,xpages,aggregator
For some time we have not been able to use the "Use runtime optimized JavaScript and CSS resources" feature because the aggregated JS and CSS links are always broken. When I inspect with the F12 IE developer tool, the CSS files just do not load. When I look at script,...

WPF Cannot see image in runtime

c#,wpf,image,runtime
I've created 3 Images for my context menu. The problem is that I can not see them in runtime. (I can see them in the editor window) I've already changed compile type to resource and image type to png (just in case) <Color x:Key="BackgroundColor" A="255" R="19" G="19" B="19"/> <BitmapImage x:Key="BiCut"...

Rename and change folder location of android resource files at runtime

android,runtime,android-resources
Is it possible to rename or change folder location (similar to cut and paste) of android resource files like .png or .xml (in drawable folder) at runtime by program. Also can I rename or create new folder like drawable at runtime.

Script for measuring runtime

time,runtime,elki
If I run an algorithm in an environment (ELKI) and want to measure the time, how can I do that? - Make a script? -let that run 10 seconds and press the run button in the environment to run the algorithm - and subtract the 10 seconds. - or maybe...

What happens when multiple users try to change the same data at the same time in a website's MySQL database?

php,mysql,runtime
Say a PHP script appends some text to an already existing data in a MySQL database. Say the existing data is abc. Now one user wants to append 123 and another wants to append xyz. Both of them run the script at the same time. Whose will be appended first?...

Run-Time Check Failure #2 - Stack around the variable 'length' was corrupted

c++,unicode,windows-runtime,runtime
Hi All, I am working on changing our application to support unicode characteristics . Hence while doing the changes i had to convert all char to wchar_t and we had some wrapper stream classes which i converted to support wchar_t . Now my issue is while doing the change...

What is the runtime for quadratic probing in a HashTable?

hash,hashmap,runtime,hashtable,hashset
This is a similar question to Linear Probing Runtime but it regards quadratic probing. It makes sense to me that "Theoretical worst case is O(n)" for linear probing because in the worst case, you may have to traverse through every bucket(n buckets) What would runtime be for quadratic probing? I...

using derived class in runtime c++

c++,pointers,casting,polymorphism,runtime
this is checking in runtime if mybase class is a derived class. I need to call a member variable from say myDerived.member1 using myBase like myBase.member1 in runtime. Here myBase is a pointer. How to do that. if(dynamic_cast<myDerived*>(myBase)) ...

Hold and get ListView Item index

c#,listview,windows-phone,runtime
I have a ListView with the following items: 1. One 2. Two 3. Three 4. Four 5. Five When I hold one of this itens my hold event is fired and I get the content and the index of the item, but for me get the index I have to...

Change color of text during runtime (Unity)?

colors,unity3d,runtime
I have a GameObject embedded inside my Canvas that has a "Text (Script)" Component. I wish to alter the color.a attribute during runtime of that element. Does anybody have an idea of how to do it? I can't seem to access it with any GetComponent<Type> () command.

Android: The right way to debug an running application (runtime errors/log)

android,debugging,runtime
I am new to Android development. I have been going through the tutorials. I would like to know which is the right way to debug / log an application during its execution. I am guessing I should be able to execute my application directly on my android device and be...

Control Name's in XAML WIndows Phone 8.1 Runtime dont show in CS File

c#,windows,runtime,phone
i'm trying to create a grid in my Windows Phone 8.1 Runtime Project, and everytime i nominate the control, it doesn't recognized in CS file, like: <Grid Grid.Row="1" x:Name="ContentRoot" Height="1168" Width="386" > How can i fix that, its is a bug, or some class is not in CS using ?...

How can i access control name of MapControl inside a Hub Windows Phone 8.1

windows-phone-8.1,runtime
I want create a mapcontrol inside the Hub control, but everytime i tryed access from CS file,i can't find the name! Here is the code! <HubSection Header="Rotas e Mapas" Foreground="White"> <DataTemplate> <Grid> <Maps:MapControl x:Name="MapControl1" MapServiceToken="ubgfhnhduyekheddjd"/> </Grid> </DataTemplate> </HubSection> ...

Error (Run-time error 5) will not raise when “On error resume next” is active

vba,error-handling,runtime,runtime-error
I've provided the actual code I'm using below. The exact condition I'm trying to handle is the strCurrentRev argument as a zero-length string. (e.g. strCurrentRev="") If I comment out the error handling statements, trying to execute the ASC method on a zero-length string throws Run-Time Error 5 for "invalid procedure...

event for runtime controls in c#

c#,events,runtime,controls
i try to make an controls in runtime (not one, "n" controls in runtime) but now i want to create event for every single controls i made one but it just work for the last control i create in runtime how can i create event for every controls? private void...

How to make a ListView in Windows Phone 8.1 where i can put a handler in each item i choose

runtime,windows-phone-8.1
I'm trying to create a ListView in XAML file by this example: <ListView x:Name="listView1" SelectionChanged="ListView_SelectionChanged"> <x:String>Item 1</x:String> <x:String>Item 2</x:String> </ListView> But, how can I handle it if I click in Item 1 to go to other page?...

Add context menu strip during runtime in C#

c#,runtime,contextmenustrip
I am trying to add a context menu strip to buttons that are being created during runtime. I am not trying to add new items to a preexisting strip. Visual Studio is giving me an error saying the index is outside of the bounds. Even though the menu is already...

Is it possible to get type parameters at runtime?

java,generics,runtime,type-erasure
I know that in Java we don't have paramaterized types at run-time, because of the erasure. But is it possible to get those erased parameters at run-time? Let me provide some example: public class MyClass<T>{ }; public static void foo(MyClass<?> p){ //do staff } public void main(String[] args){ MyClass<Integer> i...

The variable 'buff' is being used without being defined

c,arrays,text,runtime
I need to read some data from text file and store it in 2D-array. This code works good: #include <string.h> #include <stdio.h> int main() { FILE *f = fopen("Read.txt", "r"); char buff[100][100]; char str[100]; int i = 0; while(fgets(str, 100, f)) { strcpy(buff[i], str); i++; } return 0; } But...

android draw rectangle with dimensions and modify them in runtime

android,runtime,draw,dimensions
I'm developing an engineering app for android. The thing is that I need to draw: rectangles, figures made of rectangles, and their dimensions. Then if you touch one extreme of one dimension you are able to make that dimension of the rectangle longer or shorter. I am implementing the next...

super class not assignable to class implemented during runtime by asm

java,runtime,java-bytecode-asm,dynamic-class-creation
I have a java class that consist of an inner interface, and plan to implement the implementation class during runtime with asm bytecode injection. package my.example; public class X{ public static interface XInt{ public void getX(); } //the following class that implement the interface will be defined during runtime. //I...

Shouldn't insert just be O(n) not O(1) or O(n) inserting into unsorted linked list?

java,algorithm,for-loop,linked-list,runtime
This falls under "a software algorithm" from stackoverflow.com/help/on-topic, in this case, a software algorithm to add an item to a unsorted array list. This is chart we made in class about the runtimes of operations on different data structures The one I want to focus on is inserting a value...

Execution order of Enum in java

java,enums,compilation,initialization,runtime
I got a question about Enum. I have an enum class looks like below public enum FontStyle { NORMAL("This font has normal style."), BOLD("This font has bold style."), ITALIC("This font has italic style."), UNDERLINE("This font has underline style."); private String description; FontStyle(String description) { this.description = description; } public String...

Need to crop+resize ~300000 files. Runtime = 4+ days. How can I speed up my bash script?

bash,imagemagick,runtime,imagemagick-convert,mogrify
I am working on creating a video timelapse. All the photos I took are .jpg images shot at 4:3 aspect ratio. 2592x1944 resolution. I want them all to be 16:9 at 1920x1080. I have written a little script to do this, but the process is not very fast. It took...

How to check if object has some particular PUBLIC selector at runtime?

ios,objective-c,runtime,respondstoselector
I need to find out if some particular object has some particular selector AND if i may call it. I need to check it at runtime. I know about respondsToSelector: but unfortunaly it also checks protected interface of class. I need to check if the selector exists AND if it's...

Django: Add JS to Form at runtime

javascript,django,runtime
I tried this: my_form.media.add_js(['path-to/foo.js']) But foo.js was never added. I found out that media is a property. This way it gets created each time I use my_form.media. As a result add_js() does only add to a temporary media object, which will be gone in the next Python line. How to...

Variadic Visitor Type Deduction

c++,templates,runtime,variadic-templates
I have a scene graph which contains nodes. Each node has a transform and several components. I have a 2d scene editor and am currently doing the following to select a component to edit: //Within the node class I can grab a list of components template<typename ComponentType = Component> std::vector<SafeComponent<ComponentType>>...

mysqldump command with java Runtime.getRuntime().exec(command) not generating dump

java,runtime,exec,mysqldump
i have tried with the following code snippet: Process p; String command="mysqldump -u'scmuser' -p'scm$123' --routines db_name > /home/ubuntu/wh_demo_db_reset.sql"; p = Runtime.getRuntime().exec(command); the dump file is not generated and not thrown any error. i am unable to predict the exact issue please help me. thanks in advance....

Interpreting Literal Run Time of a Program in Unix

c,unix,runtime
I ran a C program (table.c) using the command: time table to give me the running time and I got: 0.104u 1.179s 0:01.31 96.9% 0+0k 0+48io 0pf+0w I have a few questions: Q1: What does all this mean? Q2: Why are these numbers changing every time I execute my program?...

Update minimum spanning tree if edge is added

algorithm,graph,tree,runtime,big-o
I have a possible solution for the following question, but not sure if correct: Assume we have already found a minimum spanning tree T for a weighted, undirected graph G = (V,E). We would like to be able to efficiently update T should G be altered slightly. An edge is...

Trying to calculate running time of an algorithm

c++,algorithm,runtime,big-o,time-complexity
I have the following algorithm: for(int i = n; i > 0; i--){ for(int j = 1; j < n; j *= 2){ for(int k = 0; k < j; k++){ ... // constant number C of operations } } } I need to calculate the algorithm's running time complexity,...

When are function templates resolved in c++?

c++,templates,pointers,runtime,compile-time
I am a novice c++ programmer and I've been trying to learn more about the language through reading multiple books about the language. There is a section in a book i'm currently reading that talks about how smart pointers have different strategy for using the custom deleter provided by the...

What is a runtime environment for supposedly “no-overhead” systems languages?

language-agnostic,runtime
Specifically, I'm talking more about C++ and Rust than others. I don't understand how C++ has a "runtime" in the sense that Java and C# have a runtime--while Java and C# run on top of a virtual machine with its own encapsulated abstractions and such, I don't get how C++...

Wouldn't this algorithm run in O(m log n)?

java,algorithm,runtime,big-o,time-complexity
I am working on an interview question from Glassdoor Software Engineer The question is     Given a list of one million numbers, how will you find the top n numbers from the list in an efficient way Here is a solution an author gave from same link create a...

How to create moveable (by mouse) buttons at runtime c#

winforms,user-controls,runtime
I am using the following code to create buttons at run-time but how to make them movable (drag-able with mouse on screen anywhere) var b = new Button(); b.Text = "My Button"; b.Name= "button"; b.Click += new EventHandler(b_Click); b.MouseUp += new MouseEventHandler(this.b_MouseUp); b.MouseDown += new MouseEventHandler(this.b_MouseDown); b.MouseMove += new MouseEventHandler(this.b_MouseMove);...

Why is overloading not implemented at runtime?

java,runtime,overloading
Why is overloading generally not implemented at runtime? What are the difficulties/implications in allowing a language to select overloaded implementations at runtime, based on the actual (not declared) parameter type?

Is there any way to print template class object

c++,oop,runtime,template-classes
I am trying to create template class for storing different values, for instance, I have a list, which can hold value of any type. template<class T> class LinkedNode { private: LinkedNode* next; LinkedNode* previous; T data; Is there any way to print value of data. Or in some way specify...

How to put arguments in a function at run time?

c++,linux,runtime,exec,argument-passing
So I am using execlp in my c++ program. execlp is of the form " int execlp(const char *file, const char *arg0,...,const char *argn)" meaning that it can take arbitrary amount of arguments. I just want to know that is there a way I can put arguments inside this function...

PHP static factory method: dynamically instantiate instance of the calling class

php,static,runtime,subclass,factory
This PHP question is related to this question, but is a bit different. I have a static factory method called create() which instantiates a class instance. I want the method to dynamically instantiate an instance of the (sub)class on which it is called. So, the class it instantiates must be...

Unable to run SDL program in Eclipse but able to do so in Windows Explorer

c++,eclipse,windows,runtime,sdl
I have installed and set up SDL and managed to get a tutorial example to build (the tutorial code is from http://zamma.co.uk/setup-sdl2-eclipse-windows/) as a C++ Project in Eclipse. The problem is that when I try to run the application from Eclipse, the window doesn't appear, or perhaps it gets closed...

Use substitution to find out the running time of T(1) = 1 ; T(n) = 4T(n/3) + n

algorithm,runtime
I've got to this point 4^logn + 3n[(4/3)^logn -1] and am having trouble finishing it. Log is base 3.(Wasn't sure how to do subscripts and exponents.) Thanks ....

dbctrlgrid delete and populate entries at runtime

delphi,runtime,parent,delphi-2009
I want to load the content of of dbctrlgrid at runtime (from database). So I encountered several challenges: How to detect if the dbctrlgrid is empty and/or how to clear it. How to put Tlabel and Tdbtext on the panel. The main problem seems to be to find the right...

Theta Runtime of a triple loop that essentially much less than n^3

algorithm,loops,runtime,analysis,big-theta
I was looking at a programming question today and I had an issues finding the theta runtime of it. Basically, within my question, I form the following loop structure: for(int i = 0; i < n; i++) for(int j = i + 1; j < n; j++) for(int k =...

Is it possible to dynamically create a function with a receiver (method) in go?

reflection,methods,go,runtime
I was reading about reflect.MakeFunc and was wondering if there's also a way to create a Method (a function with a receiver) at runtime.

Interpreting Hamming Distance speed in python

python,runtime,timeit,hamming-distance
I've been working on making my python more pythonic and toying with runtimes of short snippets of code. My goal to improve the readability, but additionally, to speed execution. This example conflicts with the best practices I've been reading about and I'm interested to find the where the flaw in...

Efficient run-time type checking in C++

c++,runtime,typechecking
I've two class named 'Expression' and 'BinExp' as following codes: class Expression { public: virtual BinExp* IsBinaryExp() { return NULL; } }; class BinExp : public Expression { public: virtual BinExp* IsBinaryExp() { return this; } }; As example, I've a pointer variable type of Expression* but initialized as new...

Improving run time for R with nested for loops

r,runtime,apply
My reproducible R example: f = runif(1500,10,50) p = matrix(0, nrow=1250, ncol=250) count = rep(0, 1250) for(i in 1:1250) { ref=f[i] for(j in 1:250) { p[i,j] = f[i + j - 1] / ref-1 if(p[i,j] == "NaN") { count[i] = count[i] } else if(p[i,j] > (0.026)) { count[i] = (count[i]...

Calling a non exe (Labview VI) external program into Java

java,process,runtime,inputstream,labview
I have developed a Labview program and i want Java to trigger it open, i have seen many methods to run external exe applications in Java, is it possible to call an non-exe file with the labview file format .vi?

Stop capture element in windows RT

c#,windows-phone,runtime
How do I stop camera element when I do page navigate? I am using this await _mediaCapture.StopPreviewAsync(); but it is not working when I navigate back to my MainPage and I get this error UnhandledException += (sender, e) => { if (global::System.Diagnostics.Debugger.IsAttached) global::System.Diagnostics.Debugger.Break(); }; ...

c# Devexpress Application won't on Client-PC

c#,devexpress,runtime,client
How do I get an application to run on a client-pc? I finished a small application, which I wanted to start on another computer. But when I click on the click and run-exe file, nothing happens. Do I need additional assemblies on the client-pc?...

Are Configuration.ConfigurationSettings.AppSettings values interned strings?

c#,string,garbage-collection,runtime
I read a lot about the behavior of strings in .Net. I knew that literal strings var s = "Hello World!" are interned per default and even if my application no longer reference it, the string will never collected by the garbage collector. What happens to strings which are read...

How do I conditionally use a class in Swift that may not be present in the targeted version of the OS?

ios,swift,runtime,wkwebview
This answer addresses how to use a Swift class from a framework that may not be linked to an app, but is present in the target OS. Relatedly, but a bit different, I'd like to know how to conditionally use a Swift class that may not be included in the...

Is it possible to change launcher icon in android runtime with user selection?

android,runtime,android-launcher
I want to use multiple launcher icon . what i want that user can change launcher icon with his selection is it possible to change launcher icon run time?...

C++ Runtime class switching, relying on base class inheritance

c++,class,runtime
I am not fully versed in C++ and with the current project I am working on, have hit a small snag. I have come across this: http://www.terrainformatica.com/2010/08/cpp-how-to-change-class-of-object-in-runtime/ but I am unsure if this is the solution I am looking for or if there are any better alternatives. My intentions is...

How can I improve my algorithm runtime? cpmoptimithe not to propose

python,algorithm,python-2.7,python-3.x,runtime
I need to find all the combinations flowers. Number of flowers only odd. Purchase amount not greater than the predetermined. def bouquets(narcissus_price, tulip_price, rose_price, summ): count_combinations = 0 for n in xrange(int(summ / narcissus_price) + 1): for t in xrange(int(summ / tulip_price) + 1): if n * narcissus_price + t...

How to list variables for NSManagedObject

ios,core-data,runtime,nsmanagedobject
I needs to list variables for NSManagedObject, I know there is a way to do it using "class_copyIvarList" as given in How do I list all fields of an object in Objective-C? but "class_copyIvarList" isn't working on "NSManagedObject". here is piece of code Im using, which is working perfectly fine...

How to calculate theoretical running time for a created algorithm?

performance,algorithm,loops,runtime,big-o
I need some help analyzing my algorithm to determine its theoretical running time. I think I understand how to analyze most of it. I'm not sure how to analyze the while loop that contains a for loop. Ill provide my algorithm, followed by what I think/know. My Algorithm: def getD(a):...

Error Runtime.getRuntime.exec() Java 1.8

java,runtime
Runtime.getRuntime().exec("color 0a"); So I tried that to change the color of the DOS window and it shows me this: http://postimg.org/image/9o8xj54tf/ The code is just the main method with that inside and it doesn't work, I want to know how to fix this....

Setting the OnClick procedure of a Delphi button at runtime

delphi,button,onclick,runtime
I have a program in which I need to update a database table with information entered into edit boxes, with a button at the end to do the updating. However, the form is created at runtime and all the elements including the button are also created in the same way....

Ruby project Euler #12 efficiency

ruby,performance,optimization,runtime
I'm attempting to do problem #12 on project euler (see quote below) The sequence of triangle numbers is generated by adding the natural numbers. So the 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28. The first ten terms...

Android Studio 1.0.2: java.lang.RuntimeException: Unable to start activity ComponentInfo: java.lang.NullPointerException

java,android,nullpointerexception,runtime
Here is the error: 02-14 02:00:55.663 907-907/com.wlodsgn.bunbunup E/AndroidRuntime﹕ FATAL EXCEPTION: main Process: com.wlodsgn.bunbunup, PID: 907 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.wlodsgn.bunbunup/com.wlodsgn.bunbunup.MenuActivity}: java.lang.NullPointerException at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245) at android.app.ActivityThread.access$800(ActivityThread.java:135) at...

Runtime set property from a string

c#,vb.net,winforms,design,runtime
I have a string stored in database as 'GridColumn1.Caption = "XYZ"' Is there a way to execute this code in runtime (on windows form load) to set GridColumn1's Caption property to "XYZ" in vb.net or in c#? I want to read it from db on form load and set the...

Variable initialization evaluates to something unexpected

c,linux,gcc,initialization,runtime
Why does the int variable nl evaluate to 33881 if you call a printf("%d",nl); after this the following line? nl, nw, nc = 0; How could it possibly evaluate to any other value than 0 before the loop? I am compiling with gcc from the terminal in a crouton/Ubuntu 12.04LTS...

How to bring item to front in FastReport in runtime?

runtime,fastreport
When placing items on FastReport bands, there is a command in designer, to bring item to back or to front. But, there is no such method that can be called in runtime from the script. begin Memo86.BringToFront; // No such method end. How to bring items to back or to...

Get ListViewItem text by index WP RT

c#,listview,windows-phone-8.1,runtime
How do I get a ListViewItem text by this item index? I tried this txt = historico.Items[i].ToString(); but I got this "Windows.UI.Xaml.Controls.ListViewItem" ...

Why this code is getting slower when I use std::algorithms instead of plain loops?

c++,algorithm,optimization,runtime
I am calculating the mean and standard deviation of the elements of a vector. I have two versions of this and I am completely puzzled why the version using the standard algorithms is slower than the one using plain loops. Both version use this struct as return type: struct MeanAndSigma...

Java execute multiple console commands on loaded program

java,console,command,runtime,execute
I want to load a program from the console and then execute commands on it later on. The loading works fine, but how can I execute commands on the loaded program without starting it every time I want to use it? For example: ./randomapp command1 command2 But on Java, I...

C runtime library : what for?

c,operating-system,runtime,libraries
Context: Creating a toy OS, written in assembly and C. X86. 32-bits first, 64-bits then. Currently read how to make a C library and try to understand the underlyings. My question comes from the reading on this page. I read the other SO questions concerning runtime libraries but still don't...

Version of __CLASS__ that binds at run-time rather than at compile-time

php,runtime,subclass,classname,dynamic-binding
In the following PHP code I would like to replace the __CLASS__ magic constant in the Foo class with a function __X__() (or something similar) so that when the method hello() is called from an instance $bar of the Bar class, it prints hello from Bar (instead of hello from...

Prevent Listbox selecting item at the very beginning

c#,winforms,listbox,runtime
I have a problem that has a very bad effect on the runtime of my graphical user interface. I'm Initializing my Form1 (when the GUI opens) with: InitializeComponent(); var fill_listboxes = new FillListBoxes(this); fill_listboxes.fillFromDatabase(); So he opens the function to fill the Listboxes with values from a database (one listbox...

how to pass string arguments in java as argument at runtime

java,runtime,parameter-passing
I am new to Java I need help with as how can I take values at runtime when a Java file is executed. I have Java program where the values of host,user, password and command is hardcoded, how can I parmeterize it. eg, public static void main(String[] args) { String...

Runtime.getRuntime().exec() in loops

java,loops,ffmpeg,runtime,exec
I'm writing a little tool to create some thumbnails in java automatically. therefor I execute Runtime.getRuntime().exec(command); in a for-loop. Now my Problem is, that only the first thumbnail gets created. My code so far: public static void testFFMpeg(File videoFile) throws IOException { FFMpegWrapper wraper = new FFMpegWrapper(videoFile); int length =...

Python: Imported Tkinter program runs itself?

python,import,tkinter,window,runtime
So I'm writing a program for my final year project, and this thing in particular has just been bugging the hell out of me. I've been at it so long and I can't figure it out, so I'm hoping somebody fresh will be able to shed some light on it!...

Getting error 438 in VBA Script

vba,excel-vba,runtime
I have the following code. I debugged and got that the problem is with the IF inside the for. The exact error is: Run Time Error 438 - Object Doesn't Support this Property or Method Any clues what it could be? I appreciate any help. Thanks! Sub dimensiones() Dim Hoja1...

Within Java, how can I execute an external app without its full path

java,path,runtime,execute
If I use the Windows run utility (Windows Key + R), and I type in "chrome.exe" it launches Chrome. Same thing for other applications that have their path in the PATH variable, of course. However, in java if I try this: Runtime.getRuntime().exec("chrome.exe"); It doesn't work. It only works if I...

Scala: binding time

scala,binding,runtime
In the Strategy pattern, implemented like this: object StrategyPattern { def add(a: Int, b: Int) = a + b def subtract(a: Int, b: Int) = a - b def multiply(a: Int, b: Int) = a * b def execute(callback:(Int, Int) => Int, x: Int, y: Int) = callback(x, y) def...

How can i create an interactive terminal session (shell commands) in Java?

java,shell,smtp,runtime
My goal is to reproduce this example, by triggering it from a UI. So I wanted to subsequently launch these commands I have tried to run the very first command using: Runtime.getRuntime().exec(firstCommand); , but then it does go on. openssl s_client -starttls smtp -connect smtp.gmail.com:587 -crlf -ign_eof [... lots of...

Embedded OSGi: accessing dynamically loaded bundle components

java,runtime,osgi,bundle
I'm getting a little lost when dealing with embedding OSGi into an application/library, loading a bundle at runtime and then using that bundle in the host application/library. This is code to load the bundle from my host: // framework is the embedded OSGi framework Bundle b = framework.getBundleContext().installBundle( "file:/project_dir/bundle/MyBundle.jar" );...

Hook into GHC runtime system

haskell,functional-programming,runtime,transactional-memory
I have been looking at how transactional memory is implemented in Haskell, and I am not sure I understand how the STM operations exposed to the programmer hook into the runtime system functions written in C. In ghc/libraries/base/GHC/Conc/Sync.hs of the git repo, I see the following definitions: -- |A monad...

toolbutton with action created at runtime

delphi,runtime,taction
I create with Delphi 2009 Toolbuttons in a toolbar like it is desribed here: Create TToolbutton runtime The difference is that I assign an action also at runtime. My code is as follows: Function TSymbolVisWin.MakeButton(BCnt:integer; Act:TAction):integer; var TB : TToolButton; ACnt, Ind: Integer; begin TB:=TToolButton.Create(ListBar); try with TB {NB} do...

Getting Type of expression which stored in string

c#,.net,reflection,runtime
I have a Dictionary - stored names of variables with their types. Also, I have a string with expression. Is there any way to get Type of this expression? Example: dictionary "x" : List<DateTime> "a" : int string : "x[a+5]" expected result: DateTime In addition, I also know all included...

IS the run time library just some dynamicly linked library files? [closed]

c++,c,windows,dll,runtime
The C standard library for example has some standard functions like printf,. What exactly the relation between the standard library and the run time library ? Is the run time library just the dll's (under windows) part of the standard library? so when I call the printf in my program...

Run a C program from within a C program

c,runtime,system,sh
The question pretty much explains itself I have three different C programs and to try and compare their efficiency I tried to test their runtime by making them run several times varying their parameter (which is proportional to time taken) and write how long it takes each program to run...

Resuming and suspendig WinRT Camera App

c#,windows-phone,runtime,resume,suspend
I have an app with three pages: MainPage, Page2 and Page3. At MainPage I have my camera, at Page2 I have the historical with the scans from MainPage, and my Page3 has some infos about the app. My issue is when I Suspend and when I Resume it. It suspends...

What is the benefit of using associated objects vs static object defined in the category implementation file?

objective-c,properties,runtime,objective-c-category,associated-object
The problem is I don't see the benefit of using associated objects vs static objects defined in the category implementation file with getter/setter methods. I was thinking about defining the getters and setters in the header file of the category. Like this: @interface NSObject (test_static) - (id)getStaticObject; - (void)setStaticObject:(id)a_static; @end...

Update minimum spanning tree if edge is removed

algorithm,graph,tree,runtime,big-o
I am having trouble with the following question: Assume we have already found a minimum spanning tree T for a weighted, undirected graph G = (V,E). We would like to be able to efficiently update T should G be altered slightly. An edge is removed from G to produce a...

Is it possible to allocate the correct amount of space to strings in C during run time?

c,char,runtime,c-strings,dynamic-allocation
Is there any way to allocate exactly enough space during runtime WITHOUT asking the length of the string? int main() { char **tests; int counter; int i; int j; int testCases; scanf(" %d", &testCases); tests = malloc(sizeof(char *) * testCases); for(i = 0; i < testCases; i++) //stuck here, normally...

C# Change File Location For Next Time Program Runs

c#,runtime,savechanges
I am relatively new to C#, however I do have some basic knowledge of code from courses in high school and university. However, there is one thing I have not been able to figure out over the years. I am currently making a Form Application for a database system that...