w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How do I force Amazon EC2 instance to use my Elastic IP when I FTP out to a remote server?
FTP has two modes of operation - active and passive. Quoting wikipedia: FTP may run in active or passive mode, which determines how the data connection is established.In active mode, the client creates a TCP control connection. In situations where the client is behind a firewall and unable to accept incoming TCP connections, passive mode may be used. In this mode, the client uses the control connection to send a PASV command to the server and then receives a server IP address and server port number from the server, which the client then uses to open a data connection from an arbitrary client port to the server IP address and server port number received To summarize, in active mode, the server will attempt to create a connection BACK to the client. Since you client's IP is a private o

Categories : Amazon

Amazon Elastic Load Balancer (ELB) url not resolved by instance attached to it
This is normal, if I correctly understand your testing framework. The way that ELB is scaling, it starts out running on a very small machine, and as traffic increases, it's directed to even larger and larger machines. However, ELB is not configured to handle flash traffic, especially from a small number of hosts, as is the case with a load testing scenario. This is because the DNS record is changed whenever ELB scales, and it sometimes takes a while to propagate. Load testing frameworks sometimes cache the DNS lookup, making things even slower. The official ELB documentation (http://aws.amazon.com/articles/1636185810492479) states that traffic should not be increased by more than 50% every 5 minutes. I found that scaling takes even longer if you're looking to get over 150-200k RPM.

Categories : Wcf

how to configure Elastic Beanstalk to deploy code to an instance but not add it to the load balancer
For the most part, though not straight forward, you could provide a .config file in .ebextensions to run your script files. This example of speeding up a deploy shows running some scripts and moving data back and forth. Better yet, the author describes the sequence and deployment process. I'm just embarking on this type of container customization. I have read of others dropping files in the /opt/elasticbeanstalk/hooks/appdeploy/pre and /opt/elasticbeanstalk/hooks/appdeploy/post directories, much of which can be derived by reading the post linked above. Also note that you can include the content of a script in the yaml .config file such as this which I found yesterday: files: "/opt/elasticbeanstalk/hooks/appdeploy/post/99_restart_delayed_job.sh": mode: "000755" owner: root

Categories : Ruby On Rails

Elastic Beanstalk's Elastic Load Balancer name
Unfortunately the answer is no to the first 2. The last one, you are able to do it, but it more or less goes against the flow of Elastic beanstalk. You would need to create your own ELB with whatever name you like and then put it in front ot the instance that is created by beanstalk. You would need need to delete the ELB that beanstalk created so that it's not sitting there costing you money. I can't remember if beanstalk boots its environments via an AutoScaling group, but if it does, you'll need to associate that AutoScaling group with your new ELB. After creating and syncing all of that up, you need to point your CNAME to your new custom made ELB. That should work.

Categories : Amazon

Running only one instance of an application,(Quit new instance and Display old instance or give Focus)
What you need to do is to add this to your main class: [DllImport("user32.dll")] static extern bool SetForegroundWindow(IntPtr hWnd); Then you need to obtain a reference to the process that is already running, and then call the SetForegroundWindow method like this: SetForegroundWindow(SameProcess.MainWindowHandle); You do not need to kill the current process like you are currently doing, just return after focusing the other process' main window as shown above This is a full working example: [DllImport("user32.dll")] static extern bool SetForegroundWindow(IntPtr hWnd); /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main() { var currentProcess = Process.GetCurrentProcess(); foreach (Process p in Process.GetP

Categories : C#

How to access pointer of a class pointing to another pointer of a class pointing to a value
In the simplified pseudocode that you have posted, you are accessing the myvalue attribute correctly and since it is zero-initialized in the A's constructor and being incremented afterwards, there is no reason why its value should become negative. This seems to be rather caused by some bug (hidden within your real code) that rewrites myvalue's value. But what catches my attention more is that you have: class C { public: C() { bPtr = new B(); } B* bPtr; Now if the lifetime of instance of B contained within instance of C is tied to the lifetime of that instance of C, it seems to be reasonable for the bPtr to be aggregated by value ~> i.e. to be an object with automatic storage duration rather than a pointer: class C { public: C() { } B b; which will reduce the ugly memory management c

Categories : C++

Pointer isn't pointing
Ignoring the sizeof() problems, the issue here is that you are making an explicit copy of the _TYPE_Object fields given to createObject(), including the position, by doing: object[index].position = insertionObject->position; So there is no reason for the position in the copy (which is what you are printing) to be modified when you change the original (through smile.position.x = 55). If you want to insert a reference to the original object and not make a copy, then you must make an array of pointers instead of an array of objects themselves.

Categories : C

More than 2 Cname pointing to one URL
Yes it is, but I think for SEO reasons it is not a good idea. Better would be: URL:xyz Primary website: AA CNAME XY Second site: BB redirect 301 to AA

Categories : Misc

maven pointing to JRE instead of jdk
From the Maven Properties Guide: ${java.home} specifies the path to the current JRE_HOME environment use with relative paths to get for example: ${java.home}../bin/java.exe java.home property is not the same thing as JAVA_HOME environment setting. It is actually dynamic property showing you which JRE is running your code.  Try setting the java.home property correctly and see if it works.

Categories : Java

C, last element of the list pointing on nothing
If it worked for you, that just means you got lucky, and the eax register happened to be zero when the condition fell through. So it was as if you had a return NULL at the end of the function. When I tested this in my compiler, that wasn't the case, and the code didn't work. For me, the eax register held the value of lis, so it was as if you had return lis at the end of the function. That just produced a list that looped forever.

Categories : C

JQuery source pointing to a URL
Depending on the host, there would potentially be better caching. Also less latency for the requests in itself. It's essentially a CDN to optimize serving up source from redundant nodes rather than your single node which could cause a bottleneck.

Categories : Jquery

MVC URL pointing to the wrong Web API Controller
If this is a WebAPI Controller, then you can only have one GET method per controller. WebAPI was designed to only have 5 calls, GET (one item / list items), POST, PUT and DELETE per entity type. This allows for REST URLs, such as Folders/Get/5, Folders/Get etc. You should add another API Controller for PromotionType. Have a run through this tutorial here. http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/tutorial-your-first-web-api

Categories : Asp Net Mvc

Pointing CodeLite to new compiler (GCC 4.8.x)
I just discovered the existence of CodeLite by reading your question. I found very quickly the instructions to use clang in CodeLite Just follow them, substituting gcc-4.8 (or your full path to your gcc 4.8) for clang and g++-4.8 for clang++ BTW, I hope you did compile GCC 4.8.1 with the --program-suffix=-4.8 option to its ..../configure script.

Categories : C++

Pointing to this object vba syntax
in VBA you use Me instead of this by the way in VBA you use Dim not Declare and you don't have { and } you simply end it with End Classso your code should look like this Public Class1 Set Class2.Propertyname = Me End Class Public Class2 Dim Propertyname as Class1 End Class hope this helps

Categories : Vba

Pointing a vector to an array
This must be an assignment as 3 other people seem to be doing the same thing. You don't need your card listing to be a std::string[]. You can use std::array which will give you the standard STL iterator methods while still being a simple array. Either way, you can load them into a vector using the std::vector's iterator constructor: // assuming data is loading into myarray and myarray_size is the size of the array std::vector<std::string> cards(myarray, myarray + myarray_size); You can access the vector's data directly (if needed) by using &cards[0] which will give you a pointer to the first element in the array. That said, if you use the STL templates, you will improve your code and learn the language much more efficiently.

Categories : C++

How can I have ld add symbols pointing to a section?
The easiest thing to do is to put them into a section that has a valid C identifier as it's name. For example, use: __attribute__((section("mystuff"))) and you'll have automagic variables __start_mystuff and __stop_mystuff which will give you the start and end addresses of the section which you can declare in your source as extern variables. EDIT: this is completely GCC specific!

Categories : C

Dereferencing pointers without pointing them at a variable
// This works int* colin; *colin = 5; Welcome to undefined behavior: the fact that it does not crash does not mean that it works. Accessing uninitialized pointer is always wrong, yet sometimes it does not crash. couldn't deference and assign unless you either malloc'd space for it or set it to the address of another variable This is correct. In general, you need to point your pointer to some place that has been allocated to your program. There are multiple ways of doing that, but they all boil down to one of the two scenarios that you describe - the pointer is pointed either to a dynamically allocated memory (i.e. malloc), or to statically allocated memory (i.e. a variable).

Categories : C

auto_ptr pointing to a dynamic array
The array will not be deleted correctly. auto_ptr uses delete contained_item;. For an array it would need to use delete [] contained_item; instead. The result is undefined behavior. As James McNellis said, you really want std::vector here -- no new, no auto_ptr and no worries.

Categories : C++

Is one using-statement enough for all variables pointing to one IDisposable?
I think this is what you're trying to do: public class MySqlClass : IDisposable { private SqlConnection conn { get; set; } public MySqlClass(string connectionstring) { conn = new SqlConnection(connectionstring); } public void DoSomething1(string tsql) { using (SqlCommand comm = new SqlCommand(tsql, conn)) { conn.Open(); } } public void DoSomething2(string tsql) { using (SqlCommand comm = new SqlCommand(tsql, conn)) { conn.Open(); } } //DISPOSE STUFF HERE } Use... using (MySqlClass MySQL = new MySqlClass()) { MySQL.DoSomething1(); MySQL.DoSomething2(); } * UPDATE * Updated >>>> EXAMPLE <<<<< Point is you create single instan

Categories : C#

2 Left Joins pointing 1 table
Quick guess: SELECT * FROM dvcam LEFT JOIN format AS format1 ON dvcam.ID_Format=format1.ID_Format, originaltape LEFT JOIN format AS format2 ON originaltape.RO_Format=format2.ID_Format

Categories : SQL

URL Rewrite : Pointing wildcard url to its subfolder
Enable mod_rewrite and .htaccess through httpd.conf and then put this code in your .htaccess under DOCUMENT_ROOT directory: Options +FollowSymLinks -MultiViews # Turn mod_rewrite on RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([^/]+)/.*$ /$1/index.php [L]

Categories : Apache

grails app war pointing to two different datasources(oracle and SQL)
I would configure the DataSource for different environments. I understand you want the application instance to access only one database at a time. So in one war, the app will connect do SQL Server, and in the other instance war, the app will connect to Oracle. If this is the correct understanding, I would do the following in the DataSource.groovy file: environments { sqlserver { dataSource { dbCreate = "none" url = "jdbc:mysql://localhost:3306/mydb" driverClassName = "com.mysql.jdbc.Driver" dialect = "org.hibernate.dialect.MySQL5InnoDBDialect" username = "dbowner" password = "xxxxx" logSql = false pooled = true properties { maxActive = 30 // -1 para sem

Categories : Grails

Best way to add documentation to vb.net project pointing to an article on the web
How about a works cited page (text file in your solution) and then comments in code files where the code is actually used. This gives you and the other developers some immediate context of where it came from, but the solution level text file provides an artifact in your software process. The VB.NET XML comment (''') would allow for IntelliSense documentation as well, which may be overkill, but it would be available to developers at code implementation time.

Categories : Vb.Net

Pointing to the WSDL inside of project
Generate stubs dynamically at deploy time Do not include stub implementation classes in your generic build Make sure Webservice is up and running for respective environment At deploy time, execute a script that will generate stubs based off WSDL that is published for respective environment

Categories : Maven

Two different variables pointing to the same memory location
This isn't possible the way you mean. You can't set pitch = 20 and get vector[0] == 20; primitives, at least, don't work that way in Java. What you could do, though -- what you should do -- is create a class named Vector with methods named setPitch, getPitch, etc, and use the float[3] as an internal implementation detail.

Categories : Java

EF4 - foreign key pointing to multiple tables
One approach would be to make Project and Experiment inherit from a base class. public class Model { // other common fields... public virtual ICollection<Attachment> Attachments { get; set; } } public class Project : Model { // project fields... } public class Experiment : Model { // experiment fields... } public class Attachment { // other fields... public virtual Model Model { get; set; } } You will have to do some casting to figure out what Model is for a given attachment. var project = attachment.Model as Project; if (project != null) { // you have a project } var experiment = attachment.Model as Experiment; if (project != null) { // you have an experiment } Or you can tell EF to only give you attachments for a certain type of Model

Categories : Entity Framework

How can I have one annotation pointing to several points in matplotlib?
You are looking for some similar to? import matplotlib.pyplot as plt import numpy as np a = np.ones(100) multi = np.arange(0,100,5) plt.ylim(-0.5,10) for x in multi: plt.annotate("a=5k",xy=(x,1),xytext=(x,1+4*np.random.rand()), arrowprops=dict(facecolor='black', shrink=0.05)) plt.plot(a,'k.') plt.show()

Categories : Python

Pointing wsdl file from pom.xml in webapp
You can refer path, using maven property ${basedir}. <wsdl>${basedir}/src/main/webapp/WSDL/NewWebService.wsdl</wsdl> or <file>${basedir}/src/main/webapp/WSDL/NewWebService.wsdl</file> or something else. (You didn't say anything about used maven-plugin)

Categories : Maven

Arrows pointing to data from label
Although this doesn't answer your question exactly, I wanted to include some pictures of what I mean, so I put it in an answer. If rank is really what you want to show, then I especially recommend the heat map. Except that instead of using the rate as the y-axis, you use the rank, and you use the rate as the fill color. Here is what I mean: # I think your rank was broken -- but I might be missing something. tempDf$real.rank<-unlist(by(tempDf$arate,tempDf$adate,rank)) ggplot(tempDf, aes(x = adate ,fill = arate, y = real.rank)) + ] geom_tile() + geom_text(aes(label=id),color='white') If you really wanted to emphasize the change in rank, you could draw lines in between the letters: ggplot(tempDf, aes(x = adate ,fill = arate, y = real.rank)) + geom_tile() + geom_text(ae

Categories : R

How to call a method by pointing with a variable
have you tried $class->$method();? but you should check if $method is a valid and callable function name before you try to call it. if (method_exists($class, $method)) $class->$method();

Categories : PHP

How to open Google map pointing to Address that is specified in TextBox in WPF?
To do this using Bing Maps you simply need to create the correct URL to the Bing Maps site and open it from code. You can find documentation on how to create URL's to the Bing Maps site here: http://onlinehelp.microsoft.com/en-gb/bing/ff808440.aspx

Categories : C#

Matplotlib streamplot arrows pointing the wrong way
You can specify the arrow style with arrowstyle='->'. Try both of these and see if this works for you: plt.streamplot(xi, yi, dx, dy, color='c', density=1, arrowsize=3, arrowstyle='<-') plt.streamplot(xi, yi, dx, dy, color='c', density=1, arrowsize=3, arrowstyle='->')

Categories : Python

How to filter out nonexistent object that a foreign key is pointing to
Here is what I would do.. valid_people_ids = Person.objects.all().values_list('id', flat=True) bad_pr_people = PR.objects.exclude(person_id__in=valid_people_ids) Hope that helps.

Categories : Django

Pointing a domain to a specific controller/action ASP.NET MVC
You can provide each customer a new subdomain. If http://www.abc.com is your main website domain, then your customer acme can have a domain as http://acme.abc.com You can't give directly a new domain to every customer, this is the way out of it.

Categories : Asp Net Mvc

Please help in pointing the error message in the folowing log snippet
This is the error from your LogCat : FATAL EXCEPTION: main 09-02 04:29:32.066: E/AndroidRuntime(781): java.lang.RuntimeException: Unable to start activity ComponentInfo{hellog.diwesh.NugaBest/helog.diwesh.NugaBest.BTSmartSlavemodule}: android.util.AndroidRuntimeException: requestFeature() must be called before adding content

Categories : Android

Laravel 4: pointing a form to a controller function
You can do it like {{ Form::open( array('url' => URL::to('user/search')) ) }} Because you don't have a name for the route. To define a name for the route, use following syntax, Route::post('user/search', array( 'as' => 'userSearch', 'uses' => 'UserController@search' )); So, you can use the route by it's name, as {{ Form::open( array('route' => 'userSearch') ) }} // 'search' method will be invoked Also, you can directly use the action of a controller as {{ Form::open( array('action' => 'UserController@search') ) }} Check Routing and Form.

Categories : Laravel

Spring Social & JPA - Having two datasources pointing to the same database
Downside of this solution is that you need to reduce maximum capacity of connection pool. Example: imagine that you have a connection pool with max 30 connections in it. Now you want to add another datasource for Spring Social. I suppose that each your user will use 2 datasources simultaneously. So you need 2 connection pools with max 15 connections in each. Now it will be much easier to hit the limit.

Categories : Java

Pointing to User Defined ADTs inside another ADT in C
You call SomeFunction with a pointer to a pointer to an outsideADT_T structure (double reference), whereas SomeFunction is declare to just take a pointer to that structure (single reference). Try this: outsideADT_T outsidePTR; // <-- notice the lack of '*' SomeFunction(&outsidePTR); Furthermore, you dereference insidePTR1 without initializing it. You'll need to allocate some memory for it at the beginning of SomeFunction: outsidePTR->insidePTR1 = malloc(sizeof(insideADT1_T)); Same goes for insidePTR2.

Categories : C

How do I compare objects pointing to a different place in memory?
Actually, for these kinds of comparisons of the value possessed by these same types of objects, you need to define your own comparison operator like <=> or whatever sign you like, but don't override default operators like ==. That may lead to a problem. See "Ruby Equality And Object Comparison."

Categories : Ruby

Codeception - pointing DB to MAMP MySQL server
Have you tried this at all - might work for you too.. class_name: TestGuy modules: enabled: [Filesystem, TestHelper, WebHelper, PhpBrowser] config: PhpBrowser: url: 'http://localhost/yourapp/' curl: CURL_RETURNTRANSFER: true Let me know how that works for you :) http://codeception.com/docs/modules/PhpBrowser

Categories : PHP



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