w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
Amazon S3 or simliar object store for Dedicated server
It's possible to use S3 from any server, it doesn't need to be hosted on Amazon EC2 for S3 to work. Same goes for RDS. But keep in mind that the quality of the internet connection between your current hosting provider and the AWS endpoints will affect your app's performance. If the latency and speed of this connection is an issue, it would probably be better to host your app on EC2.

Categories : Amazon

Hit counter - do I need a dedicated table?
I think it is just too much work to have dedicated table for this. Do it only if really required. Otherwise it is just a waste of time and resources. Field in existing table that gets incremented, and eventually a cookie to disable incrementing on refresh is just fine.

Categories : PHP

Dedicated Initializer in Objective-C
If a class has several init methods, one of them is the "designated initializer". This is the one that calls [super initXXX]. In your example, initWithFirstName:LastName:DOB: would be the designated initializer and should look like this: -(id)initWithFirstName:(NSString *)aFirstName LastName:(NSString *)aLastName DOB:(NSString *)aDateOfBirth { self = [super init]; if (self) { _firstName=aFirstName; _lastName=aLastName; _dateOfBirth=aDateOfBirth; } return self; } (I have changed the type of the dateOfBirth property and the DOB argument to NSString and will explain that later.) All other init methods just call the designated initializer (and not [super initXXX]), in your example init: -(id)init { return [self initWithFirstName:@"Ankit" LastNa

Categories : Objective C

Why is there no dedicated type for filehandles?
Well, you can do this: *FOO = *BAR{IO} but, honestly, the use of bareword filehandles (ones that look like FOO) is best left behind. Its a historical artifact, made obsolete with Perl 5.6 (many years ago). Instead, you should put filehandles in scalars: open my $foo, '<', 'filename'; my $line = <$foo>; # ⋮ And then, of course, you can copy them like any other scalar $bar = $foo. Also, you generally want to avoid two variables with the same name, as it can get confusing. my @a = (1, 2, 3); my $a = 4; my %a = (5 => 6, 7 => 8); say $a, $a[0], $a{5}; # the scalar, the array, the hash (in that order) say @a{5,7}; # the hash

Categories : Perl

Dedicated C# class to update progressbar
If you're doing your work, and calling UpdateProgress, on the UI thread then it won't update until you finish the work and the UI thread can do other work (like refresh the UI). So this will never work. If you're doing your work on a background thread, then you need to use a Dispatcher to marshal the setting the value to the UI thread. Here's an example from http://tech.pro/tutorial/800/working-with-the-wpf-dispatcher if (!myCheckBox.Dispatcher.CheckAccess()) { myCheckBox.Dispatcher.Invoke( System.Windows.Threading.DispatcherPriority.Normal, new Action( delegate() { myCheckBox.IsChecked = true; } )); } else { myCheckBox.IsChecked = true; }

Categories : C#

cannot get irssi to work on bluehost dedicated IP
make sure that you ask them if 6667 is open outbound TCP and UDP . sometimes they can mistake it for inbound or only open TCP for example. You can telnet to your irc host on port 6667 even if something is not listening on the bluehost side, assuming IRC is up and accepting connections, and bluehost has the port opened, a telnet from your bluehost account to the IRC server will work fine.

Categories : Misc

Dedicated drawing surface in Java?
If you don't need Accelerated Graphics, you can draw onto a BufferedImage with Graphics2D. Once you have your data in the BufferedImage, you can simply paint the BufferedImage onto the component. This will avoid any sort of flickering you are talking about. Creating the BufferedImage is easy: int w = 800; int h = 600; BufferedImage bi = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB); Then you can draw objects onto it with a graphics context (Possibly in your own render function): Graphics2D g = bi.createGraphics(); g.drawImage(img, 0, 0, null); //img could be your sprites, or whatever you'd like g.dipose();//Courtesy of MadProgrammer //You own this graphics context, therefore you should dispose of it. Then when you repaint your component, you draw the BufferedImage onto it as

Categories : Java

suhosin patch dedicated file log
Yes, you can set this up, multiple ways: If you want to keep using your system's syslog: There's suhosin.log.syslog.facility ini setting, you can choose one of the USER facilities that no other application use on your system. Most syslog daemons have various filtering capabilities to decide where a message should be sent. You will have to check what your system is running, there are many popular syslog daemons are rsyslog, dsyslog, syslog-ng. They all have their own configuration formats, but they all should be able to filter based on facility. In most of them, you can also filter on program name or match patterns against the log message itself. In a sysklogd, rsyslogd, dsyslog style config file this would look something like when matching facility: local5.* /var/log/suhoshin_ale

Categories : PHP

Algorithm for creating dedicated paths between two nodes
Do a DFS and when you see a visited node, duplicate it, break the link through which you just visited and mark the new node as visited and continue dfs from this node. This method does not visit node multiple times and hence is the fastest(meaning it will visit H1 just exacyly 2 times not n or k times). This is linear in terms of output graph. That is if the output graph has V' vertices and E' edges its order is O(V'+E'). You can not achieve better as you must visit everything in output graph atleast once.

Categories : Algorithm

Is there a dedicated solr function to return index?
Please refer to examples #4 & #5 from the Examples page for the Solr PECL client. Then you can build a query that searches across and returns all fields, like the following: $options = array ( 'hostname' => SOLR_SERVER_HOSTNAME, 'port' => SOLR_SERVER_PORT); $client = new SolrClient($options); $query = new SolrQuery(); $query->setQuery('*:*'); // *:* means search all fields for all values. $query->setStart(0); $query->setRows(100000); //very large to ensure all rows are returned. $query->addField('*'); // * will return all fields $query_response = $client->query($query); $query_response->setParseMode(SolrQueryResponse::PARSE_SOLR_DOC); $response = $query_response->getResponse(); print_r($response); For more details on querying Solr

Categories : PHP

Trying to Implement Node.js and Socket.io on dedicated server
It looks like you're listening on port 80 instead of 8080, and you will need to point your script block to your server, so try <script src="http://localhost:8080/socket.io/socket.io.js"></script> needs to be <script src="http://mydomain.com:80/socket.io/socket.io.js"></script> or better yet <script src="/socket.io/socket.io.js"></script> If that doesn't work, make sure you check for any errors under the network tab of your debugger window (presuming you're using chrome) to make sure you're loading that socket.io.js file correctly.

Categories : Node Js

How to check whether dedicated cache worker role is available or not?
You can do that by handling the DataCacheException. For instance: DataCache cache = null; try { cache = new DataCache("MyCache"); } catch (DataCacheException cacheError) { // Handle exception: couldn't create DataCache object } try { cache.Put("test",test); } catch (DataCacheException cacheError) { // Handle exception: couldn't store object in cache } See Exception Handling Overview (Windows Server AppFabric Caching) for a list of properties you can inspect on this exception and Common Exceptions (Windows Server AppFabric Caching) for a list of common errors you should be able to handle, including Timeout and RetryLater.

Categories : Azure

How to manage list with dedicated add and remove button?
How can I make a UI so that I can grow this list how much I want(for as of now 3 is ok). Use a ListView with a CustomAdapter. This will allow you to show as many rows as necessary. Within the getView() method. Create a separate layout that will be inflated in your Adapter class that will look something like <ImageView .../> <TextView .../> <ImageButton .../> <ImageButton .../> 2.How to use add and remove button which will work for there row only. Set the onClick inside the getView() method of the CustomAdapter you are going to create Adapter Class ListView Example

Categories : Android

Moved to a dedicated server - automated web emails not sending?
Stop php mail() being treated as spam mail You must to add a needle headers: Sample code : $headers = "From: myplace@example.com "; $headers .= "Reply-To: myplace2@example.com "; $headers .= "Return-Path: myplace@example.com "; $headers .= "CC: sombodyelse@example.com "; $headers .= "BCC: hidden@example.com "; if ( mail($to,$subject,$message,$headers) ) { echo "The email has been sent!"; } else { echo "The email has failed!"; } ?>

Categories : PHP

Javascript dedicated web worker to send messages on demand
This is not a good pattern. Workers are single-threaded, so at any given moment, they can either: perform a calculation, send an event, or respond to an event. While your worker is calculating, it cannot respond to events. When you send a request for the latest prime, you must wait for the worker to finish what it is doing before it can process your request. Of course, you can use setTimeout (or other methods) to allow the browser to "interrupt" the current work (see Javascript - how to avoid blocking the browser while doing heavy work?), but the entire point of workers is to save you from resorting to such needless complexity. A better pattern would be a non-worker variable that holds the latest prime, and is updated by the worker whenever it find a new prime. You can query that vari

Categories : Javascript

It possible in Resteasy to extract the URI mapping to an external, dedicated file?
As far as I know this is not currently supported as part of the JAX-RS specification, but I could see you being able to do this with byte code insertion at runtime using something like javassist. Basically you would add the @Path annotations to the your resource classes at runtime with the values loaded from your uri mapping file. Once the annotations were added to the resource you would then inject them into Resteasy.

Categories : Rest

How to setup a private dedicated Node.js Ubuntu Server?
what do i need to install to properly run node.js apps on my network on a dedicated ubuntu server? You just need to install nodejs. nodejs can run on any port, so you don't need Apache or anything else. how do i install the latest nodejs,npm,and the init files on ubuntu server Try to follow the steps outlined in this guide: http://howtonode.org/how-to-install-nodejs . Use the instructions for Ubuntu. when i reboot the app starts automatically every time One way to do this is to write a small script that will run on boot. The script would contain the instruction: nodejs /path/to/app/app.js Check out this SO answer on how to run a script on boot: Files and scripts that execute on boot

Categories : Node Js

Could i use a dedicated (separate) cluster for appfabric session storage?
Yes, you can. When you configure the AppFabric Sesison State Provider, you can provide a dataCacheClient name. It's the name of the dataCacheClient section to use from the dataCacheClients configuration section. By default, the provider will use the dataCacheClient section named “default”. , such as <sessionState mode="Custom" customProvider="AppFabricCacheSessionStoreProvider" compressionEnabled="false"> <providers> <add name="AppFabricCacheSessionStoreProvider" type="Microsoft.Web.DistributedCache.DistributedCacheSessionStateStoreProvider, Microsoft.Web.DistributedCache" cacheName="default" useBlobMode="true" dataCacheClientName="dataCacheClient1"/> </providers> </sessionState&g

Categories : Misc

Do i really need a Dedicated IP address to send push notifications to APNS
No you don't. Shared hosting plans tend to have controlled environments that you, as a shared user, can't really change, such as open or blocked ports. Is there any way you can check if connections through port 2196 are being successfully established (not necessarily to Apple)? Some low-cost, shared plans are known for blocking some juice in favour of stability and security. Also check if your push certs are properly uploaded. Cheers.

Categories : PHP

Dedicated misc buffer in Emacs (autocomplete, function info etc.)
(I'm assuming you mean a dedicated window instead of a dedicated buffer.) If you keep a window open without doing any other window-splitting commands, help/repl buffers will automatically use it. You can change the size of the window as described in this question. If you want to do be able to do normal window manipulation but have help windows be a certain size, I suggest you investigate temp-buffer-show-hook, a hook that is run when temporary buffers (such as help buffers) are shown. I haven't tried it, but it would probably be possible to set it to a function that arranges your window configuration in a particular way.

Categories : Emacs

Performance and memory of prototype pollution vs dedicated library object
Modifying objects you don't own is definitely bad idea. The choice here is rather architectural: if you have to store a date persistently, then use a private property of the constructor: function DateLib() { this._dateObject = new Date(); } DateLib.prototype.getDateString = function () { return this._dateObject.toDateString() }; var dateLib = new DateLib(); dateLib.getDateString(); If you just want to do some manipulation with a date, create a method: var DateLib = { toDateString: function (date) { return date.toDateString() } } DateLib.toDateString(new Date()); As it comes to the performance, all approaches are equally fast (thanks to Bergi, alternative test by Esailija). Note: this is not browser comparison test. Tests were performed on a different machines, so on

Categories : Javascript

What are the pros & cons of using Google CSE vs implementing dedicated search engine for a site like stackoverflow?
This depends on the content of your site, the frequency of the updates, and the kind of search you want to provide. For example, with StackOverflow, there'd probably be no way to search for questions of an individual user through Google, but it can be done with an internal search engine easily. Similarly, Google can outdate their API at any time; in fact, if past experience is any indication, Google has already done so with their Google Web Search API, where a lot of non-profits that had projects based on such API were left on the street with no Google options for continuation of their services (paying 100 USD/year for only 20'000 search queries per year, may be fine for a posh blog indeed, but greatly limits what you can actually use the search API for). On the other hand, you probably

Categories : Search

Serve dedicated HTML page to Google crawler without changing the URL to make for dynamic content
The solution is to add the meta tag: <meta name="fragment" content="!"> More details there.

Categories : Ajax

Ajax view updates doesn't work properly in custom components with dedicated java class
I discovered where the problem is. I thought that when a component gets updated it was entirely reprocessed, but it doesn't happen in some occasions. For some reason, it seems that when ui:repeat is used, JSF tries to retard the component reset. A solution is to explicitly recalculate the list when getList() is called: It was like this before: public ArrayList<String> getList() { if (null == list) generateList(); return list; } } If I remove the verification for null it works. In my opinion that's what was happening: when the component was updated the list still had the values calculated before, it was not null and no recalculation was done. In the time between one request and another, the component was getting reconstructed. With the component reseted, list

Categories : JSF

using zmq PUSH socket per producer thread vs dedicated zmq thread for all threaded producers
A lot depends on how many producers there are. If there are only a handful, then having one socket per thread is manageable, and works well. If there are many, then a producer-consumer queue with a single socket pushing (effectively being a consumer of the queue and singe producer for downstream sockets) is probably going to be faster. Having lots of sockets running is not without cost. The main pro of the first case is that it is much more easily scaled out to separate processes for each producer, each one single-threaded with its own socket.

Categories : Multithreading

How to install/configure new software in newly created amazon instances using Amazon SDK in java?
The Amazon API primarily controls infrastructure. It does not have any control as to what happens inside the instance. There are a couple of ways you can bootstrap your instance and install software. You can use user-data to pass a script that will run on first launch. You could use a provisioning system like chef or puppet. You could roll your own if it works better for you.

Categories : Amazon

Connecting an Azure worker role to a dedicated cache worker role
Hello maybe you should try to set the connection between them using Inter Role Communication, you can find an answer for how to make the inter role communication in the following stackoverflow website: How to do inter-role communication with Azure? you can also find more details in the following link: http://blogs.msdn.com/b/avkashchauhan/archive/2011/10/30/communication-between-windows-azure-roles.aspx I hope this helps you solve your problem please let me know if you need anything else.

Categories : Caching

installing php and apache on Amazon EC2 instances
Have you read the error message ? Read again: Error: httpd24-tools conflicts with httpd-tools-2.2.25-1.0.amzn1.x86_64 Error: php54-common conflicts with php-common-5.3.27-1.0.amzn1.x86_64 You are trying to install HTTPD 2.4 when you appear to have HTTPD 2.2 installed and same thing with php, namely, you have PHP 5.3 installed and you are trying to install 5.4. A simple way to confirm this is to type in the following into bash: php -v httpd -V If you want to install newer versions then remove the older versions. yum remove httpd-tools-2.2.25-1.0.amzn1.x86_64 php-common-5.3.27-1.0.amzn1.x86_64

Categories : PHP

How to estimate the number of instances in Amazon EMR?
I know if you use the CLI tool to create your Job Flow and add the steps, then you can run both of the steps one after another on the same job flow and they will be counted within the same hour. I believe if you use the GUI then you can not re-use the job flow and so you may get charged one hour for each job. I haven't tried this though so may be wrong there. Check this article which is where I got the information: https://cwiki.apache.org/confluence/display/MAHOUT/Mahout+on+Elastic+MapReduce

Categories : Hadoop

node.js performance for amazon EC2 instances with ECU's
Amazon ECU are virtual core because they are basically virtual sever with 2 real core of a xeon processor.So a box with real 2 core will perform better than a virtual ECU.And also I dont think than amazon ECU are the same thing like the real cpu core Amazon elastic cloud. As far i am working with nodejs and EC2 on my production server i simply set up two thing to utilize the max cpu power of a m1.large instance. Multiple node process behind the nginx as reverse proxy load-balencer a. I set up different nodejs process on different port. b. On front of them an nginx load balancer o distribute the load across each thread. I have also tries hands with forking child process with main thread using Cluster module . I finally ends up with nginx and coz its have less management than cluster a

Categories : Node Js

What are the sizes of cache memory in amazon ec2 instances?
You are talking about memory available to the instance, memcached can be configured to use as much or as little memory as you want it to. If your application caching needs are still small, you might be able to do all the caching on the application server. On a micro instance you have 613 MB of memory total. If you want memcached to behave effectively, you need to keep the entire application in memory. Being that some of the memory is needed to run the system, you probably have only about 213MB that you can effectively use to run memcached. Use too much, and it will push some of the memory into swap, and slow down the system.

Categories : Caching

do we need 3*N instances on amazon ec2 to host N mongodb shards?
So there is some really good documentation which is the recommended cluster setup in terms of phisycal instance separation. There should be considered two things (at least) separately. One is replication and for this one see this documentation : http://docs.mongodb.org/manual/core/replica-set-members/ Which means you have to have at least two data nodes (due to HA) in a replicaset and can have one arbiter which is not holding data just participate in election as it is described in the docs linked above. You need an odd number of setmembers due to the primary has to be elected by a majority inside the replicaset. The other aspect is sharding. Sharding needs some additional metadata maintaining layer which is achived through additional processes these are configuration servers and mongos

Categories : Mongodb

Amazon S3 Bucket Policy: How to lock down access to only your EC2 Instances
I have investigated this further and come up with a simpler solution for security through obscurity. I am using really long UserAgent strings as Auth. this makes the bucket policy look like: { "Statement": [ { "Effect": "Allow", "Principal": { "AWS": "*" }, "Action": "s3:GetObject", "Resource": "arn:aws:s3:::[REPLACE WITH YOUR BUCKET NAME]/*", "Condition": { "StringEquals": { "aws:UserAgent": "deployPackages-4d8ae3a6-6efc-40dc-9a7c-bb55284b10cc-4d8ae3a6-6efc-40dc-9a7c-bb55284b10cc" } } } ] } more details: http://www.diaryofaninja.com/blog/2013/07/24/scorched-earth-deployments-on-amazon-ec2-teamcity-amp-web-deploy-ndash-part-1-amazon

Categories : Amazon

Amazon OpsWorks Custom Cookbooks not updating when using Load-based instances
According to the opsworks documentation: http://docs.aws.amazon.com/opsworks/latest/userguide/workingcookbook-installingcustom-enable-update-.html To manually update custom cookbooks Update your repository with the modified cookbooks. AWS OpsWorks uses the cache URL that you provided when you originally installed the cookbooks, so the cookbook root file name, repository location, and access rights should not change. For Amazon S3 or HTTP repositories, replace the original .zip file with a new .zip file that has the same name. For Git or Subversion repositories, edit your stack settings to change the Branch/Revision field to the new version. On the stack's page, click Run command and select the update custom cookbooks command.

Categories : Amazon

LocationManager region monitor is not what I expected. The region boundary looks bigger than my settings
My experience is that this is normal behavior. I've been using region monitoring for about 2.5 years now and since iOS 6, the -didExitRegion delegate takes much longer to trigger than the -didEnterRegion. I also had this behavior confirmed by an Apple Engineer during WWDC 2013. It doesn't sound as if they plan to improve the accuracy, rather delay, in the exit events. According to the engineer, the OS takes a lot longer to decipher that you've left because it has to completely get out of range of known Wifi networks and to new cell towers. It is much easier to determine you've arrived than it is to determine you've left. If it is only taking 300M or so to trigger your geofence (outside the 300M radius), I'd say you are probably within the operating limits of the geofence. If you need prec

Categories : IOS

How to disable a region when a child window pops up in another region in prism mef wpf
You can bind your viewModel's main content's attribute IsEnabled to a boolean property IsPopupGone. In the constructor of your toolbar subscribe EventAggregator to an event PopupWindowStateChanged and payload as a boolean. Then when your popup window(s) display, publish this event with True, and when closed publish as False. private bool isPopupGone = true; // default/original state assumed to be no childs showing public bool IsPopupGone { get { return isPopupGone; } set { isPopupGone = value; /* implement notifypropertychanged */ } } public ToolbarViewModel(IEventAggregator eventAggregator) { EventAggregator = eventAggregator; EventAggregator.GetEvent<PopupWindowStateChanged>().Subscribe(UpdateEnabledState); } public void UpdateEnabledState(bool isPopupShowing

Categories : Wpf

Emacs: select a region and type to delete the region
I don't think it does it out of the box, it looks like you have to turn on delete-selection-mode as per this article on EmacsWiki. So, basically put the following line into your .emacs: (delete-selection-mode 1)

Categories : Emacs

HBase region over region servers load not balanced
Are you using sequential rowkeys, like timestamp?If that is the case you might end up with RegionServer Hotspotting, putting uneven load on the servers. Avoid using sequential keys, if you can. If it is not possible create pre-splitted tables.

Categories : Hadoop

How can I get the country and region code using geolocation instead of full country and region names
You should use the short_name value for the country, which is the two-digit country code. These are ISO standard codes and should be the basis for your database lookup, not the localized country name.

Categories : Javascript

Amazon Flexible Payments Service (Amazon FPS) IPN Verification PHP IPNVerificationSampleCode.php
Put correct define('AWS_ACCESS_KEY_ID', 'XXXXXXXXXXXXXXXXXX'); define('AWS_SECRET_ACCESS_KEY', 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX); it will word correct also change Introduction: Amazon FPS sends you outbound notifications in the form of GET and POST on your ReturnURL and IPN endpoints respectively. When you handle these notifications, we recommend you to validate the signature to ensure that the notification actually originated from us. You can validate the signature using signature version 2 with a server-side call to the VerifySignature API. In this call, you send the entire URL including the HTTP parameters received to FPS VerifySignature API and it will return a Boolean that indicates whether the signature was validated. Samples using this API to validate the signature are in

Categories : Amazon



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