w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
See how many aws instances are in each availability zone
As far as i know there's no way to check the amount of instances in an AZ. What you could do is use an Autoscaling group and specify the AZs that you want when creating it. Autoscaling will then disperse the instance load evenly amongst listed AZs AZ = Availability zone

Categories : Amazon

How to program availability check and to create new meeting to Outlook?
Exchange natively shows user calendar availability exposed in EWS (Exchange Web Services), your network administrator must configure Exchange server enabling EWS. But guess what... Office 365 (as I know) have EWS services enabled, due exchange is part of office 365 offer. As EWS are normal Web services you should create a "service stub" or proxy in whatever you use in java to create services references mapping wsdl files. Exchanged EWS is my preferred solution. Hope this helps. This is the reference page, this link show how to use the service references from C# to make the right API calls. http://msdn.microsoft.com/en-us/library/exchange/aa494212(v=exchg.140).aspx static void GetUserAvailability(ExchangeServiceBinding esb) { // Identify the time to compare free/busy information

Categories : Java

AWS Route 53 -- create Hosted Zone with third level Domain Name?
You'll have to go onto your domain registrar and add app.company.com there. Then add a CNAME to point to the Elastic beanstalk endpoint. You can't use Route53 without moving the nameservers to point to AWS

Categories : Amazon

Are object of my classes being created everytime there is a request or does it only create one instance of a class per instance server
Instances of resource classes are created "per-request" by default. You can mark them as singletons however and then one instance would be used for all requests. To do this you can use the following annotations: @com.sun.jersey.spi.resource.Singleton for Jersey 1.x (JAX-RS 1.1) @javax.inject.Singleton for Jersey 2.x (JAX-RS 2.0)

Categories : Java

an enclosing instance that contains Queue.Node is required
This is because your Node inner class is non-static. Non-static classes in Java have an implicit reference to their enclosing class, so they must be instantiated by an instance method of the outer class. Instantiating it like this Queue.Node newNode=new Queue.Node(); is not valid, even though the Node class is public. Declare it with the static keyword to fix this compile issue: the class can be logically made static, because its methods do not require knowledge of the enclosing Queue class.

Categories : Java

Specify a form field as not required at instance creation
Yes, you can control these attributes at the time of initialization in the form's __init__ from django import forms class PersonForm(forms.Form): some_field=forms.CharField(max_length=20) def __init__(self, *args,**kwargs): required = kwargs.get('required', True) super(PersonForm,self).__init__(*args,**kwargs) self.fields['some_field'].required = required and in template_instance template_instance = PersonForm(required=False) You can leave normal_instance = PersonForm() alone, as it is set to required=True by default

Categories : Django

An error in my singleton method, when create an instance. I want one instance only
You check if there is a value but you should check key instead. You should not use in_array() function use array_key_exists() instead. From PHP manual: in_array — Checks if a value exists in an array array_key_exists — Checks if the given key or index exists in the array change if (in_array($class, self::$objects)) { to if (array_key_exists($class, self::$objects)) { Working demo

Categories : PHP

Create EC2 instance from another instance via command line or dynamically
You can utilize EC2 APIs for this purpose. ec2-run-instances (http://docs.aws.amazon.com/AWSEC2/latest/CommandLineReference/ApiReference-cmd-RunInstances.html) is a command that allows you to create a new instance from your own (or public) AMI. You can also specify the number of instances you wish to create. There are also Web Service operation (RunInstances) for this purpose: http://docs.aws.amazon.com/AWSEC2/latest/APIReference/ApiReference-query-RunInstances.html Which one to use is up to you. However, I don't think starting a new instance from a master instance is a good practice in AWS. You can rely on Elastic Load Balancing (http://aws.amazon.com/elasticloadbalancing/) and Auto Scaling (http://aws.amazon.com/autoscaling/) to scale up/down your server fleet depending on incoming t

Categories : Amazon

What does this error mean - "Instance of Num Char required for definition of versioncheck"?
One approach to solving this kind of problem—and one that I can recommend—is to feed your function definition to the compiler without the accompanying type signature and then use the interactive environment to inspect the type that the compiler inferred for the function. In your case, if we define versioncheck [] [] = True versioncheck (x:xs) [] |x /= 0 = False |otherwise = versioncheck xs [] versioncheck (x:xs) (y:ys) | x /= y = False | otherwise = versioncheck xs ys and then, in GHCi, query > :type versioncheck it gives us versioncheck :: (Eq a, Num a) => [a] -> [a] -> Bool making explicit that your function operates on two lists with elements drawn from the same type a and that this

Categories : Haskell

Joda: How to compare date instances in same time zone with different time zone representations?
Just found the answer myself. There's an option for DateTimeFormatter that prevents it from resolving time zone offsets: ISODateTimeFormat.dateTime().withOffsetParsed()

Categories : Misc

How would I create a CBV using django rest framework which will either retrieve a model instance or create a new one?
for classbased views in django-rest-framework this is usually done by: a GET request to the resource will retrieve records a POST request to the same resource will create a record I believe there are a couple examples of this in the django rest framework documentation

Categories : Django

How to handle time zone issue without storing date time as TIMESTAMP WITH TIME ZONE
If you have the names of the time zones, you can use a query similar to the following to adjust alter timestamps: SELECT e.last_updated_date AS cst_last_updated_date, (FROM_TZ(e.last_updated_date, 'US/Central') AT TIME ZONE 'US/Eastern') AS est_last_updated_date FROM events_tbl e; In my experience this will automatically account for DST based on the locale. If you're working with DATES and not TIMESTAMPS, you can also do the following: select CAST (e.last_updated_date AS TIMESTAMP) AS cst_last_updated_date, (FROM_TZ(CAST (e.last_updated_date AS TIMESTAMP), 'US/Central') AT TIME ZONE 'US/Eastern') AS est_last_updated_date from events_tbl e;

Categories : C#

How to create time in a specific time zone with moment.js
In most cases, you can simply do this: moment.tz("2013-08-26 16:55:00", "America/Los_Angeles") If you require input other than ISO8601, then specify the format string as the second parameter, and the time zone as the third: moment.tz("8/26/2013 4:55 pm", "M/D/YYYY h:mm a", "America/Los_Angeles") And if you need to use moment's "strict parsing" mode, then that goes in the third parameter, and the time zone moves to the fourth position: moment.tz("8/26/2013 4:55 pm", "M/D/YYYY h:mm a", true, "America/Los_Angeles")

Categories : Javascript

Which software is required to create android sprites?
What you'll need is a sprite sheet. A series of images on the same bitmap laid out in a grid. For example you would have 8 different sprites of the same character, 1 standing still., 1 left foot forward, 1 right foot forward and jumping and again facing the opposite direction. When you draw the sprite set the coordinates to be drawn and on button presses change the variables controlling the coordinates. A good tutorial is here http://warriormill.com/2009/10/adroid-game-development-part-1-gameloop-sprites/ and a sprite sheet maker can be found here http://www.codeandweb.com/sprite-sheet-maker Hope this helps!

Categories : Android

How to create conditional fields that are required to be filled out
Does "submit" button omit non-displaying field automatically? Do I need add on further javascript to make it only required when appearing? No,It doesn't omit the hidden fields.It submit's them too. And you need to omit them while doing validation. Some thing like using visible seletors if ( $("#targetEleme").is(":visible") ) { //then do this validation }

Categories : Javascript

Should I create the support objects required to use database diagramming?
If these databases aren't yours, I am suggesting not to do any schema changes. it can be a very critical issue. For instance: By adding a Foreign key to a table, can cause a massive error and bugs to the app, without any one to know why. Any modifications or adding new things are real and taking effect immediately.

Categories : Sql Server

Proper way to create an HTML5 input element that is "required"
You can just set it like the others, you can use true or basically any string. inputElement.required = true; or inputElement.required = "required";

Categories : Javascript

What is the right way to create a field variable in a code behind file and when is property required
If you have a data member that you don't want to be accessible to other classes, then you can explicitly make it a simple private field. If you want to add logic to its read and write operations, make a private field but access it through a private property. In any case, if you want to encapsulate the member to make it accessible only to the class, you'll have to make it private and not expose it through any public members.

Categories : C#

Django bulk create for models with multiple required fields
You can do it like this: demographic = Demographic.objects.get(id=7) PersonDemographic.objects.bulk_create( [PersonDemographic(person=person, demographic=demographic) for person in Person.objects.some_query_set()] )

Categories : Django

ArgumentError in SongsController#create missing required :bucket option
In dev and prod env you call: ENV['my bucketname'] In model: ENV['bucketname'] Also a good name for env variable would be: ENV['MY_BUCKETNAME'] In your case: ENV['AWS_BUCKET'] config.paperclip_defaults = { :storage => :s3, :bucket => ENV['BUCKETNAME'], :s3_credentials => { :access_key_id => ENV['my access key'], :secret_access_key => ENV['my secret access key'] } }

Categories : Ruby On Rails

How to create unpublished page post for video using Ads api and what are the params required for create video unpublished pagepost?
Change service call from ← https://graph.facebook.com/ to ← https://graph-video.facebook.com/ then it will Works fine

Categories : Facebook

Is there a way to create a sqllocaldb instance in c#?
I spotted a couple of projects that wrapper the native localdb API. I have not personally tried either of these but the following may be of use to you. http://www.nuget.org/packages/LocalDbApi/ http://sqllocaldb.codeplex.com/

Categories : C#

How do I create a new instance of an ItemCollection
No, you can't create one and no, you do not even need one. Use the ItemsSource property to data bind your data source to the grid instead, as is typical in WPF. The only time when you interact with an ItemsCollection is when directly accessing the Items property of an ItemsControl, i.e. when manually working with the data instead of binding. This type of manipulation is entirely contrary to the spirit of MVVM, so you are not missing anything.

Categories : C#

Interface that contains a way to create an instance
Sounds like you need an abstract factory. In addition to IFoo, create an interface IFooFactory with the CreateFoo method. Give Jim an instance of an object that implements IFooFactory, and Jim would call the CreateFoo method. It could be either Sally or Pat's job to create the instance of the object that implements IFooFactory.

Categories : C#

How to create an instance of a string VB.Net
With the NetworkCredential your supposed to set them not retrieve them from this object. These credentials are passed to the FtpClient. So without being set they are Nothing and hence the error.

Categories : Vb.Net

Create new object from instance of another
I'll try to restate your question before answering it. You're trying to create a typed reference to existing instance. You already have an instance of an object, held in a variable of type object, but want to cast it up in order to be able to access members. By getting variable type in code, you still won't be able to access object members in development time. Using strings to check object type is not a good idea. Working solution to your problem would be following // as is a type of cast. if Receipt is of type cast, // it will return an object and put it into accountUpdater // variable. If Receipt is not of that type, it will place null // into accountUpdater variable var accountUpdater = Receipt.Item as accountUpdater; if (accountUpdater != null) { // Do something with account u

Categories : C#

Create a new instance of T without the new constraint
Use Activator.CreateInstance() for this. See http://msdn.microsoft.com/en-us/library/system.activator.createinstance.aspx for more information on how to use this method. Basically, what you do is: var obj = (T)Activator.CreateInstance(typeof(T)); You can verify whether it has a default constructor by using the GetConstructors() method: var constructors = typeof(T).GetConstructors(); If you find a constructor that has zero parameters, you can use the Activator.CreateInstance method. Otherwise, you use the Factory<T>.CreateNew() method. EDIT: To find out directly whether a constructor without any parameters exist, you can use the following check: if (typeof(T).GetConstructor(Type.EmptyTypes) != null) { // ...

Categories : C#

Where/how should I create instance of my class?
GravCalc IS Main... so if in Main you create GravCalc, you are making a Main again, which then makes a main again, which then eventually runs out of stack. What you want to do is find where the original Main is created and replace it with GravCalc and take out the new GravCalc out of your Main

Categories : C#

Create new instance from singleton
Adding the class definition as a property of the instance is the only way I've ever found to solve this. You may want to standardize on Klass as the property name, that seems to be the way folks are going. The solution might feel a bit dirty, but it has worked really well at least for me. Another enhancement, since I notice you're using a module pattern, is to have the module return an instance. This way it manages the singleton pattern for you, since it will only include each dependency once. Here is what that looks like: define ['models/sprockets'],(Sprocket) -> MyCollection = Backbone.Collection.extend model: Sprocket initialize: -> console.log 'initialized' myCollection = new MyCollection() myCollection.Klass = MyCollection return myCollection # If managed by r

Categories : Javascript

How can I create an instance of this class?
The reason of your error is: The library you use does not support iOS Simulator. For the 2nd error, please make sure you have a valid Apple Developer Account with Developer Certificate and Provisioning Profile ( Team Provisioning Profile is also okay ).

Categories : IOS

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#

IWAB0014E Unexpected exception occurred when traying create webservice for given WSDL:Proxy Authorization Required
This is happening because of improper setup of Axis2. Steps: Download Axis2 : Link--> http://ws.apache.org/axis2/download.cgi Point the Axis2 runtime dir in eclipse : Menu--> Windows--> Preference --> Web Services--> Axis2 Preferences Follow this link for more details: http://www.eclipse.org/webtools/community/tutorials/BottomUpAxis2WebService/bu_tutorial.html

Categories : Java

what are the major steps required to create multiple instances of a meteor.js application running on a single server?
I don't really have an answer to your question... but I just want to remind you of another potential problem that you may run into cuz I see you mentioned python, in other words, you may be running another web app on Apache/Nginx, etc... the problem is Meteor is not very friendly when it comes to co-exist with another http server, the project I'm working on was troubled by this issue and we had to move it to a stand alone server after days of hassle with guys from Meteor... I did not work on the issue, so I'm not able to give you more details, but I just looked up online and found something similar: http://serverfault.com/questions/424693/serving-meteor-on-main-domain-and-apache-on-subdomain-independently. Just something to keep in mind...

Categories : Javascript

Automatically create instance of inheritances
First of all: Your code will not compile as you are missing the defintion of the statics. You need to add int A::state = 0 (or similar) to the code and the same for B::state. Second, an automatic creation of A and B objects is not possible, as the compiler cannot know, what you intentions with the code are. Hence, you need at least to have some declaration of A and B objects in the main. E.g. how should the compiler know, that you need exactly one A and five B objects? So you must state your intention to the comiler: int main(void) { A myA; B myBArray[5]; vector<shared_ptr<Base>> myABCollection; }

Categories : C++

Is there a way to tell java to always create a new instance instead of interning
One option to detect this type of issue is to perform static analysis on the code during your build. I believe FindBugs has a detector for reference equality. See: Suspicious Reference Comparison

Categories : Java

How to Create a new instance of class under an AppDomain
Figured it out. Changed my code to this: AppDomainSetup domainSetup = new AppDomainSetup {PrivateBinPath = binFolder+"\TestProject.dll"}; AppDomain ad = AppDomain.CreateDomain("New domain",null, domainSetup); TestClass remoteWorker = (TestClass)ad.CreateInstanceFromAndUnwrap( binFolder+"\TestProject.dll", typeof(TestClass ).FullName);

Categories : C#

java class to create instance of itself
The problem is that getClass().toString() returns (for example) class com.myproject.fresh.stubClasses.TestModel, with a stray class at the beginning. If you use getName() instead, it should work: Class<?> clazz = Class.forName(getClass().getName()); though if this is "real" code (rather than just figuring-stuff-out code), it's easier to just write this: Class<?> clazz = getClass(); That also lets you make better use of generics: Class<? extends TestModel> clazz = getClass(); Constructor<? extends TestModel> ctor = clazz.getConstructor(); model = ctor.newInstance(); or: return getClass().getConstructor().newInstance();

Categories : Java

Trying to use create a new instance of the MainActivity with a different layout
If you can't just recall your MainActivity with different data in the Adapter, maybe you should move the reusable aspects of the code (the ListView and the loading of the adapter) to a Fragment that can be reused in other Activities. You can't really create a single class that will replace the ListView and Adapter pattern, as there are certain system optimizations made for this pattern, such as using a ViewHolder on recycled views to store any static data (such as views within a list item). If this is all too confusing, I would STRONGLY recommend you watch the Google I/O video on ListViews, if you haven't already. The talk is presented by some of the Android developers who created the ListView, so there's no better source of information.

Categories : Java

create an instance of a class from a string and then use it
After creating a class instance you should retrieve the object itself from the handle: ObjectHandle oh = Activator.CreateInstance(null, "typeName"); object instance = oh.Unwrap();

Categories : C#

How to create an instance of a value type "by reference"
You cannot do what you want to do, at least, not directly. The Color type is a struct. It's a value type. Each instance of Color is a separate copy of the value. It is not possible to get two Color instances to refer to the same object, any more than it is possible for two int instances to refer to the same object. Now, you might be able to hack something by including the Color within your own class. The following has not been tested: public class ColorByReference { Color TheColor {get;set;} } static ColorByReference color = new ColorByReference {Color = new Color(0,0,0,0)}; static void Main(string[] args) { ColorByReference otherColor = color; color.TheColor.B = 100; Console.WriteLine(otherColor.TheColor.B); Console.WriteLine(color.TheColor.B); Console.ReadLi

Categories : C#



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