w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
AWS - Automatic deployment (.NET) to CloudFormation stack
cloud-init is used with windows too. See the documentation for bootstrapping Windows stacks.

Categories : Amazon

How to pass call stack information to an exception using EurekaLog?
EurekaLog exposes several event handlers like OnExceptionNotify. You can implement these in your code. For example: procedure EurekaLogExceptionNotify( EurekaExceptionRecord: TEurekaExceptionRecord; var Handled: Boolean); Here you can see a TEurekaExceptionRecord which is defined in ExceptionLog.pas. But you maybe just own the non-source version which works just fine. The record has a EurekaExceptionRecord.CallStack list. This proprietary list can be converted to TStringsusing the CallStackToStrings method which is also defined in the ExceptionLog unit. Here is an example where I write the CallStack into a StringList. CallStackList := TStringList.Create; try CallStackToStrings(EurekaExceptionRecord.CallStack, CallStackList); LogMessage := 'An unhandled exception occured. He

Categories : Delphi

how to dump the call stack information for native(C/C++) process explicitly when it is not crashed in linux
Throw an exception and catch it immediately. I'm not familiar enough with C but in java this would look like this: try { throw new RuntimeException("bla bla"); } catch (Exception ex) { ex.printStackTrace(); }

Categories : Android

Why won't CloudFormation execute my command?
Your commands block should be nested inside the config block, at the moment it is at the same level in the hierarchy. "AWS::CloudFormation::Init" : { "config" : { "files" : { "c:\Packages\WebDeploy_amd64_en-US.msi" : { "source" : "http://download.microsoft.com/download/1/B/3/1B3F8377-CFE1-4B40-8402-AE1FC6A0A8C3/WebDeploy_amd64_en-US.msi" } }, "commands" : { "1-installwebdeploy" : { "command" : "msiexec.exe /i c:\Packages\WebDeploy_amd64_en-US.msi ADDLOCAL=ALL /qn /norestart" } } }, }

Categories : Amazon

Why won't my CloudFormation script download a file?
Jonathon, I tried your template and the file downloaded successfully for me. You can check the cfn logs on the instance. They are in c:cfnlog. My cfn-init.log shows: 2013-07-19 21:30:18,269 [DEBUG] Parent directory c: est does not exist, creating 2013-07-19 21:30:18,269 [DEBUG] Writing content to c: estgoogle-logo.png 2013-07-19 21:30:18,269 [DEBUG] Retrieving contents from http://www.google.com/images/srpr/logo4w.png 2013-07-19 21:30:18,316 [DEBUG] No mode specified for c: estgoogle-logo.png 2013-07-19 21:30:18,316 [WARNING] Unsupported OS for setting owner/group: nt And my cfn-wire.log shows: 2013-07-19 21:30:18,269 [DEBUG] Request: GET http://www.google.com/images/srpr/logo4w.png [headers: {'Accept-Encoding': 'identity, deflate, compress, gzip', 'Accept': '*/*', 'User-Agent': 'pyth

Categories : Amazon

Is it possible to create a SNS subscription with CloudFormation without creating a topic?
As you already discovered, AWS CloudFormation doesn't provide the expected AWS::SNS::Subscription resource (yet) and I'm not aware of this being possible by any other means, unfortunately - guess the rationale is that both are either managed within a template or externally, but your use case is sound and I can see no fundamental reason why this shouldn't be available (maybe they'll add it at some point, AWS is usually expanding their APIs over time to address such inconsistencies/missings).

Categories : Amazon

Installing Windows applications/extensions with Amazon CloudFormation
For your example of WebDeploy, you could add this: "C:\Webdeploy\WebDeploy_amd64_en-US.msi" : { "source" : "http://download.microsoft.com/download/1/B/3/1B3F8377-CFE1-4B40-8402-AE1FC6A0A8C3/WebDeploy_amd64_en-US.msi" } as a element of this section of the template "WindowsServer": { "Type" : "AWS::EC2::Instance", "Metadata" : { "AWS::CloudFormation::Init" : { "config" : { "files" : { You could then add this command: "1-installwebdeploy" : { "command" : "msiexec.exe /i C:\Webdeploy\WebDeploy_amd64_en-US.msi ADDLOCAL=ALL /qn /norestart" } to the list of commands.

Categories : Amazon

Generating subnet CIDR blocks programmatically in CloudFormation templates (or adding integers together)
My solution for these kinds of issues was to use a legitimate programming language to compile a template into a CloudFormation JSON document. I used PHP 5.4, Twig and Symfony Console, but YMMV. Essentially, you do the math ahead of time in the programming language, then use that data as you write-out your JSON document.

Categories : Amazon

How can we write a function List multiPop(int k) that pops k elements from the stack or until the stack is empty?
Translate the following concept in to Java: create a list to store the popped members in. while (the stack is not empty and we have to pop more elements) { add a popped member from the stack to the list } return the list. Done

Categories : Java

Disadvantages of increasing Stack Size and difference between Stack Commit and Reserve
The OBVIOUS consequence of increasing the stack-size is more memory usage. Since the stack isn't enormous in comparison to overall memory in most cases, it's not a big issue. Obviously, if there are many threads using large stacks each, then that can amount to a large amount of the available memory in the machine - particularly if the machine hasn't got huge amounts of memory in the first place. "Reserved" space is allocated but not actually physically present until it has been "touched" - in other words, the physical memory space is not allocated for the stack here - just some space taken out of the virtual memory map for the allocation (so, if you are tight on virtual space because your application needs as much memory as it can get in a 32-bit environment, then it may still be a fact

Categories : C++

How to find the call stack when there is just a corrupt stack corefile?
Displaying the call stack requires correct instruction pointer (eip), stack pointer (esp) and valid stack contents. From your output it looks like the stack had been corrupted and the previous function returned to some random address (eip=0x04229c7a). So, you are out of luck. Try running your program under valgrind.

Categories : C

Column stack and row stack with H5py to existing datasets
After rereading some of the documentation on H5py, I realized my mistake. Here is my new script structure that allows me to stack arrays in the HDF5 file: import h5py import numpy arr1 = numpy.random.random((2000,2000)) with h5py.File("Plot0.h5", "w") as f: dset = f.create_dataset("Plot", data = arr1, maxshape=(None,None)) dsetX, dsetY = 2000,2000 go = "" while go == "": go = raw_input("Current Size: " + str(dsetX) + " " + str(dsetY) + " Continue?") arr2 = numpy.random.random((2000,2000)) with h5py.File("Plot0.h5", "r+") as f: dset = f["Plot"] print len(arr2[:]) print len(arr2[0][:]) change = "column" dsetX, dsetY = dset.shape if change == "column": x1 = dsetX x2 = len(arr2[:]) + dsetX

Categories : Python

Is the vim clipboard a stack? If yes, how can I paste copied data from that stack?
I wouldn't say it is a stack. it works like stack ( for deletion) . I think you need to take a look "numbered registers". Vim has 0-9 numbered registers. If you think it as a stack, the size of the stack is 9 (1-9) for deletion. Yanked things were stored in register 0 and "", no stack structure. I said it works "stack like" but not stack (for deletion) because, with stack data structure, you could not randomly fetch element. you can just pop or push. but with vim's register, you could get any (0-9) element by "1 "3 "5 for example, and keep the "stack" without changing. read :h registers for detail.

Categories : Vim

stack columns in dataframe, and also stack index column
Is this what you're after? In [11]: df1 = df.set_index(['aware', 'aware_2', 'aware_3', 'resp']) In [12]: df1.columns.name = 'heading' In [13]: df1.stack() Out[13]: aware aware_2 aware_3 resp heading 1 0 1 1 respondent a brand volvo engine p country swe age 23 volvo True 0 0 1 2 respondent b brand volvo engine None country swe age 45

Categories : Python

Stack by pointers in C working except at stack underflow
When you create the stack you allocate space for a node -- and don't fill it with anything. So after the call to create_stack() you have a blank node on your stack already. I guess you don't want that, doing just void create_stack(stack_node **top, int *status) { *top = NULL; *status = PUSH -1; } will work just fine. You allocate the memory during the push() call anyway any you check for top_stack == NULL during the functions. Alternatively you could have a flag in your stack node to indicate it's not used (then during push you'd not create a new one) but that's too complex for what you want here.

Categories : C

how to construct a string of physical subnet ids to create db subnet group on the fly in a cloudformation script?
I run into the same issue, after working with AWS support I understood that List of String does not mean what we initially thought. Also, if you want to place the DB inside a VPC you must not use AWS::RDS::DBSecurityGroup objects. Here is a full sample, it took me a while to get it working: "dbSubnetGroup" : { "Type" : "AWS::RDS::DBSubnetGroup", "Properties" : { "DBSubnetGroupDescription" : "Availability Zones for RDS DB", "SubnetIds" : [ { "Ref" : "subnetPrivate1" }, { "Ref" : "subnetPrivate2" } ] } }, "dbInstance" : { "Type" : "AWS::RDS::DBInstance", "Properties" : { "DBInstanceIdentifier" : { "Fn::Join" : [ "", [ { "Ref" : "AWS::St

Categories : Amazon

VBA to Copy Information From a Folder of Files and Compile Information to a Single Workbook
This is not the full code, but it should help you. When you work with multiple workbooks keep track of them. For example start with: Dim CurrWB As Workbook Set CurrWB = ActiveWorkbook Then in the cycle: Dim WB As Workbook For Each StrFile In var Set WB = Workbooks.Open(loc & StrFile) ... WB.Close Next StrFile Inside the cycle you can find the area to copy doing something like: R1 = 1 Do While WB.Sheets("Sheet name").Cells(R, 2) <> "Starting text" R1 = R1 + 1 Loop R2 = R1 + 1 Do While WB.Sheets("Sheet name").Cells(R2, 2) <> "Ending text" R = R + 1 Loop For R = R1 to R2 CurrWB.Sheets("Report").Cells(RReport, 3) = WB.Sheets("Report").Cells(R, 3) RReport = RReport + 1 Next R

Categories : Excel

Reply mail structure information: how to retrieve sent and received information
There's no standard for the structure of a reply email. It's not usually done using multipart email, it just uses human-readable text, often with > prefixes to denote quoted text. This allows replies to be interspersed inline with the quoted material. The only standard features of replies are a couple of headers: In-Reply-To: <ID> and References: <ID1>, <ID2>, <ID3>, ... In-Reply-To contains the message ID of the message that was replied to. References is a growing list of message IDs -- when you reply, you take the original message's reference list and append the ID of the message being replied to at the end. See RFC 5322 for more details about these headers.

Categories : PHP

In linux, all kernel processes share the same kernel stack, each user process has its own stack, correct?
Incorrect. There's one kernel address space, and no kernel processes. There are kernel threads, and there are user space threads that enter the kernel. These run in the kernel address space. Each of these has a separate stack, within the kernel address space.

Categories : Linux

how to get the information of about database events and actor information
Look at the MODULE, ACTION and CLIENT_INFO columns of V$SESSION. Then, in the package(s) and/or trigger(s) you suspect are performing the update, call DBMS_APPLICATION_INFO.SET_MODULE and DBMS_APPLICATION_INFO.SET_ACTION: BEGIN DBMS_APPLICATION_INFO.SET_MODULE(trigger_name, 'trigger start'); -- some code... DBMS_APPLICATION_INFO.SET_ACTION('updating employee'); -- code which updates the employee table DBMS_APPLICATION_INFO.SET_ACTION('doing something else'); -- more code... DBMS_APPLICATION_INFO.SET_MODULE(NULL, NULL); END; See also the example provided in the usage notes.

Categories : Oracle

Thresholding for tiff stack looks at entire stack instead of individual tiff image
To correct a fluorescence signal bleaching over time, consider using the bleach corrector plugin for ImageJ. When thresholding a stack in ImageJ you can calculate the threshold separately for each slice: Image > Adjust > Threshold... leave Stack histogram unchecked to get a preview for the threshold calculated based on the current slice click on Apply in the dialog, choose Calculate threshold for each image to apply the chosen thresholding method to each stack slice separately. In order to get the macro source code for this procedure, start the ImageJ macro recorder via Plugins > Macros > Record... before starting.

Categories : Matlab

Stack in assembly vs stack in c?
The stacks are exactly the same. One can write a program mixed assembly / C and they use the same stack. The C compiler uses some conventions on how to use the stack : a well-formed stack frame is filled in at each function entry ; and cleaned-up at function leaving. There are compiler directives specific for altering the stack management. For example : gcc stack checking Some references on the web : google : c stack frame In Assembly, the stack has to be managed entirely by the programmer. It is a good practise to have rules on how to manage the stack (and mimicking C rules for example) The stack management instructions are also quite processor dependant (instructions like push and pop on x86, or stmia / ldmfd on ARM. Similarly, some processors have dedicated registers for stack poin

Categories : C

Switching from one navigation stack to another navigation stack using popViewController
NSInteger index = 0; for (UIViewController *view in self.navigationController.viewControllers) { if([view.nibName isEqualToString:@"YourViewController"])//put any `XIB name` where u want to navigate break; index = index + 1; } //[[self navigationController] pushViewController:[[self.navigationController viewControllers] objectAtIndex:index] animated:YES]; [[self navigationController] popToViewController:[[self.navigationController viewControllers] objectAtIndex:index] animated:YES];

Categories : Iphone

Stack - what exactly is it?
Depends on the context, but besides the algorithmic structure, stack usually means the technology your platform is built upon. Example: Stack on networking could mean: TCP/IP, SSH, Bluetooth or the different technologies providing you connectivity. Stack on OS means the OS itself and the libraries available for your use. Stack on Programming languages might be the Java EE stack, which means Java Enterprise APIs will be leveraging your coding. Hope it made sense. :)

Categories : PHP

What is "stack hog"
"Stack hog" is an informal name used to describe functions that use significant amounts of automatic storage (AKA "the stack"). What exactly counts as "hogging" varies by the execution environment: in general, kernel-level functions have tighter limits on the stack space - just a few kilobytes, so a function considered a "stack hog" in kernel mode may become a "good citizen" in user mode. A common reason for a function to become a stack hog is allocating buffers or other arrays in the automatic memory. This is more convenient, because you do not need to remember to free the memory and check the results of the allocation. You could also save some CPU cycles on the allocation itself. The downside is a possibility of overflowing the stack, wich results in panic for kernel-level programs. Tha

Categories : Linux

Why there is no Queue or Stack API in jdk
There is, for instance, LinkedList which implements Deque, which has methods to be used as either a Stack or Queue. There's even a Stack class, but it doesn't belong to the Collections Framework.

Categories : Java

How much data can you put on the stack?
In Visual C++ the default stack size is managed by the linker option /STACK (doc). By default it is 1 MB. Note that each new thread will have its own stack, and you can specify the initial size with parameter dwStackSize in function CreateThread. If it is 0 it will default to the one used in the linker command. About your other questions, there is no way to query the current/maximum stack size. To avoid problems it is better to use the heap for any significant memory allocation.

Categories : C++

How do I stack data in R?
The easiest and the fastest way to do this, if you're (or wish you to be) familiar with data.table package is this way (not tested): require(data.table) in_pth <- "path_to_csv_files" # directory where CSV files are located, not the files. files <- list.files(in_pth, full.names=TRUE, recursive=FALSE, pattern="\.csv$") out <- rbindlist(lapply(files, fread)) list.files parameters: full.names = TRUE will return the full path to your file. Suppose your in_pth <- "c:\my_csv_folder" and inside this you've two files: 01.csv and 02.csv. Then, full.names=TRUE will return c:\my_csv_folder\01.csv and c:\my_csv_folder\02.csv (full path). recursive = FALSE will not search inside directories within your in_pth folder. Assume you've two more csv files in c:\my_csv_folder\another_folder.

Categories : R

Why we do this with the stack pointer?
Looks Intel x86 at first sight. 'Something' usually be the total length of all local (stack allocated) variables if this appears in the beginning of an assembly subroutine. Since the stack grows downwards ie towards lower addresses, this reserves space for them. Are you sure the second line is exactly what you wrote? esp is already pointing to free area so before your routine calls itself recursively or calls another function the parameters can be pushed on the stack below your locals. I don't see the point of loading something to esp right after it was adjusted to accommodate the local vars unless it is used to allow the (next) callee to access the caller's stack frame, like in Pascal when you have nested functions.

Categories : Assembly

ViewController Stack
I'm not sure I fully understand the issue, but here's some advice that I hope is useful: A UINavigationController is especially well suited for a stack of vcs, especially, it seems to me, in the case you present. The main vc can check the user's logged in state and either present the login vc or not. It can begin by assuming the user has more than one game to choose from and build the vc stack as follows: - (void)viewDidAppear:(BOOL)animated { // notice I moved the logical or to make the BOOL more meaningful BOOL isUserLoggedIn = [[NSUserDefaults standardUserDefaults] boolForKey:@"userLoggedIn"] || (!setAuthenticationKey || [setAuthenticationKey isKindOfClass:[NSNull class]]); if (!isUserLoggedIn) { SelectGameVC *selectGameVC = // not sure how you build this, eith

Categories : Iphone

How the offset comes in stack?
Linux 2.6.18-194.el5 #1 SMP Tue Mar 16 21:52:39 EDT 2010 x86_64 ... followed by 4 bytes for pointer "p" ... You are on a 64 bit architecture, so a pointer occupies 64 bit = 8 bytes: #include <stdio.h> int main() { int a = 0x12345678; int *p = &a; printf("%zu ", sizeof(p)); printf("%zu ", sizeof(a)); return 0; } $ gcc -std=c99 -Wall -pedantic -o sample sample.c $ ./sample 8 4 Detailed stack analysis: When entering func(), after executing the first two instructions, the stack looks like this (assumed that each rectangle is 4 bytes of memory): 0x0000000000400528 <func()+0>: push %rbp 0x0000000000400529 <func()+1>: mov %rsp,%rbp +..........+ | RET ADDR | (from CALL) +----------+ |RBP (high)| +..........| |RBP (low) | <== RSP,

Categories : C

Can I restore stack with add sp etc
That will work provided the arithmetic is done correctly. My usual bug is being off-by-one on such things. You might also have a look at the enter and leave instructions to do something similar.

Categories : C

Stack with AddUniqueItem
Yes, it's possible, you just need to remove and then re-add all of the items in the stack. public static void PushUnique<T>(this Stack<T> stack, T item , IEqualityComparer<T> comparer = null) { comparer = comparer ?? EqualityComparer<T>.Default; var otherStack = new Stack<T>(); while (stack.Any()) { var next = stack.Pop(); if (!comparer.Equals(next, item)) otherStack.Push(next); } foreach (var next in otherStack) stack.Push(next); stack.Push(item); }

Categories : C#

css stack center div on top of two others
Try this: #middle{ z-index:10; border-radius:10px; border:15px solid #232323; background: #232323; width:400px; height:200px; text-align:center; top:180px; left: 50%; margin-left: -215px; /* This is half the total width (width + border + padding) */ position:absolute; }

Categories : CSS

Does each thread have its own stack?
Yes threads have their own stacks and their own kernel stacks (e.g. linux). When a thread makes a system call, you trap into kernel mode (from user mode), you pass the arguments to the kernel, the arguments are checked, the kernel does w/e it needs to do (in the kernel stack), returns the final value back to the thread and you go back to user mode.

Categories : C++

Way to get around stack size
You can create a new thread with the stacksize you want... var tcs = new TaskCompletionSource<BigInteger>(); int stackSize = 1024*1024*1024; new Thread(() => { tcs.SetResult(Factorial(10000)); },stackSize) .Start(); var result = tcs.Task.Result; But as mentioned in comments, an iterative way for this would be better..

Categories : C#

Stack points one above the other
None of the built in positions quite do this, and geom_dotplot isn't quite right either because it only works in one dimension. I've cobbled together a new position which does the right sort of thing, but requires manual tweaking to get everything right. library("proto") PositionNudge <- proto(ggplot2:::Position, { objname <- "nudge" adjust <- function(., data) { trans_x <- function(x) { lx <- length(x) if (lx > 1) { x + .$width*(seq_len(lx) - ((lx+1)/2)) } else { x } } trans_y <- function(y) { ly <- length(y) if (ly > 1) { y + .$height*(seq_len(ly) - ((ly+1)/2)) } else { y } } ddply(data, .(group), transform_position, trans_x=trans_x, trans_y=trans_y) } })

Categories : R

Why this stack smashing?
char time_buf[32] = {0}; /* format time as `14 Jul 20:00:08`, and exactly 16 bytes */ strftime(time_buf, sizeof(time_buf), "%d %b %H:%M:%S", localtime(&now)); nb_bytes = snprintf(msg, sizeof(msg), "%s", time_buf); So effectively time_buf and msg contain the same data. snprintf returns the number of characters that would have been successfully written to msg not counting the null character. vsnprintf(msg + nb_bytes, MAX_LOG_MSG_SZ, fmt, ap); You are trying to write from the address given by msg+nb_bytes. You had 16 characters in msg. But you claim that you have MAX_LOG_MSG_SZ which is 32 characters. You are trying to write to end of the string. Perhaps fmt contains more than 15 characters. vsnprintf(msg + nb_bytes, MAX_LOG_MSG_SZ - nb_bytes, fmt, ap); This time you properly sub

Categories : C

using “push” and “pop” in a stack
Your push should be (*top)++; stack[*top] = value; That is first increment to the next empty position and then insert. The top variable always points to the top element. Therefore to push, first increment then assign. To pop, first extract the value at top and then decrement. Note: the above line can be clubbed to stack[++(*top)] = value In the current code, at the first push, your code with stack[*top++] = item, with the post increment attempts to assign the value to the current value of *top which is -1 and then increment, which is wrong. With respect to this modification of push routine the pop routine is okay.

Categories : C

Stack vs Heap in C/Java
There is no way to create objects on the stack in Java. Java also has automatic garbage collection, so you don't have any way of deleting objects. You just let all references to them go out of scope and eventually the garbage collector deals with them.

Categories : Java



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.