w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Implementing RAID-i using RAID-0 and FUSE
FUSE is not really an appropriate way to do this. It's intended to be used to implement a filesystem, and that isn't really what you're trying to do here -- FUSE will pass you events like "get me all files in this directory", which is considerably higher-level than you're after. (You'd probably rather have simple events like "read this block".) There is a project to allow a block device to be implemented in userspace (BUSE), but it's pretty preliminary. I'm not sure how well it'll work for this.

Categories : Misc

Recording high quality video using Flash and Red5 Media Server
You need to use // Ensure that no more than 43690.6(43K/second) is used to send video. camera.setQuality(43690.6,0); This works for me. I used Amazon EC2 extra large instance.

Categories : Actionscript

@media configuring for high res / ipad / iphone
Here is a clinical example for applying media queries (Fiddle): @media (max-width: 480px) { body { background: red; } } @media (min-width: 481px) { body { background: blue; } } The stylesheet functions as follows: When your viewport is wider than 480 pixels, blue background is rendered Narrower viewports are rendered red. Note that there is a difference between using max-width and max-device-width. The latter gives you the maximum device width, which does not allow you to as easily test your queries by resizing your browser window.

Categories : HTML

Multi Client Server, Multi interface, Multi IP version Socket
You're not missing anything. It is accepting connections to ::1 you said? Then it will accept ipv6 connections. And since IPv6 is backwards compatible, if you've created the correct ipv6 socket, it should be able to send and receive ipv4 packets as well.

Categories : C

What's the relationship between bitwise capacity and bit capacity?
It is the same thing. It just means that you have twice as many bits to represent your value, which means you can store much larger numbers. Numeric capacity is therefore tied to bitwise capacity since the more bits the higher numeric capacity. With a 64 bit data type you can represent your value using 64 bit binary numbers

Categories : C#

PostgreSQL: Inserting High Quantity in Multi Tables with Foreign Keys
You can have a foreign key relationship and insert null in the referencing table: create table t (i int primary key); create table t2 (i int references t (i)); insert into t2 (i) values (null); INSERT 0 1 insert into t2 (i) values (1); ERROR: insert or update on table "t2" violates foreign key constraint "t2_i_fkey" DETAIL: Key (i)=(1) is not present in table "t". Or have a special value like zero or -1 in the referenced table to be used for "orphan" subevents. To lessen the load you can insert the subevents in a single command: insert into subevent (subevent_type, subevent_value) values (@subevent1_type, @subevent1_value), (@subevent2_type, @subevent2_value);

Categories : C#

Setting Up a linux raid from dd images
Well "mdadm --assemble" would have been a better choice before running "mdadm --create" Running --create should be your last resort. With your --create command the problem is you most likely specified the wrong drive order or the wrong raid parameters. With --assemble mdadm does all that work so the easiest way forward is probably to create new images and try... mdadm -v --assemble /dev/md0 /dev/loop0p1 /dev/loop1p1 /dev/loop2p1 /dev/loop3p1

Categories : Linux

Which of Yesod's Warp and snap-server should I choose for a high-performance application server?
I would highly recommend making the choice between Warp/Yesod and Snap based on which system provides you with the best set of tools for creating your application. Both Warp and Snap are using the same underlying GHC I/O manager, and both are highly optimized. I would be surprised if a well written application for each system, doing anything non-trivial, showed a significance performance gap. Your last paragraph is a bit vague, but I think the basic answer for either Warp or Snap is to just write your code, and the I/O manager will scale as well as possible. If you really find concurrent connections to be the bottleneck, you could consider trying out the prefork technique, using GHC 7.8 (not yet released, but has a much improved I/O manager), or using multiple servers.

Categories : Haskell

SQL server 2012 : SQL query to get list of database for which a server is secondary in high availability configuration
So, I don't have an exact query for you but it shouldn't be too hard to do, there are 2 DMVs to look at for this: sys.dm_hadr_availability_group_states - This will tell you about the availability groups and which servers are primary/secondary replicas for each sys.dm_hadr_database_replica_states - This will tell you about the databases within each availibility group and what state they are in Join the two of these together on the group_id column and you will be able to see what databases are in which availability group and which servers are acting as primary/secondary replicas. Links to the docs here: AlwaysOn Availability Groups Dynamic Management Views and Functions

Categories : Sql Server

Magento Media Multi Store Setup
In magento you can set different media url for every store, but there is no standard way for setting up different media folder every store. Try to this link: http://magento.stackexchange.com/questions/4373/every-store-have-their-own-media-folder/4389#4389

Categories : Magento

How can I use Multi Media Uploader in the WordPress Plugins?
Here is the example how you can use the wordpress multimedia uploader for more than one field or as many fields. The JS code and html code looks like this How it works Add upload_image_button class on each upload button on the basis of this class click function triggers to fetch the wordpress multimedia uploader , see i have used the prev() property to get the previous element to the clicked one formfieldID=jQuery(this).prev().attr("id"); and then i have assigned the image url returned by uploader to formfieldID <input id="upload_image1" type="text" name="upload_image1" value="<?php echo $upload_image1;?>" /> <input class="upload_image_button" type="button" value="Upload image 1" /> <input id="upload_image2" type="text" name="upload_image2" value="<?php

Categories : Javascript

nodejs&couchbase work with multi-core cpu and multi-server
The creation of multiserver couchbase cluster is easy as a pie - just install couchbase on new server and add it to cluster with one button. Nodejs scaling is more difficult. If you have realtime game (i.e. you use websockets to handle players communication) you should look to nosql databases that have "pub-sub" out of the box (i.e. redis). There are some utils that implement "pub-sub" for memcached, but they are very ugly and their performance isn't good. But if your game isn't realtime (i.e. your game is like FarmVille) you can use couchbase as a "shared" layer between nodejs threads and servers.

Categories : Node Js

Does Iostat show the correct output for linux md raid
The zeros are actually the correct result (in a way) considering the values of the virtual layer itself. Hopefully, your virtual layers (mdadm arrays) are fast enough that they are always zero. For example, avgqu-sz is number of requests in queue, but it passes the request to the disk almost immediately.

Categories : Linux

Sprite to cater for multi device sizes vs Media query for individual images
Assuming that you're describing three different sizes, there are two ways this can be approached (that I've tried at any rate): Build up the sprite to include all three image sizes and switch the background-position (using media queries). Make the sprite once at the largest size, and use the CSS3 background-size property to scale up/down the image. I personally tend to opt for the background-size approach (although also tend to combine this with a second version of the sprite at 2x the size for retina images). Do bear in mind that background-size doesn't currently have complete coverage, but there are the normal three vendor prefixes you can use, plus the 'normal'. Eg: -webkit-background-size: 100px 100px; -moz-background-size: 100px 100px; -o-background-size: 100px 100px; background

Categories : CSS

Is it feasible to send media files(images/ video/ pdf etc...) from a server to another server through Html Fom?
1. Usage of ftp (make sure to use an encrypted connection, not plain ftp) and scp, where you can use ssh public key authentication, which is equally safe as storing your mysql password, just make sure the credentials are not accessible. You will need any kind of authentication anyway (also for html/php) 1a. Rsync + crontab Isn't it possible to use some kind of cronjob and rsync to do the task? 2. To receieve send a file with curl <?php $url = 'http://target-server/accept.php'; //This needs to be the full path to the file you want to send. $file = realpath('./sample.jpeg'); // the post fields. // note the "@", to denote that the file path should be evaluated $post = array( 'extra_post_field' => '123456', 'file_contents' => '@' . $file ); $ch = curl_init(); curl_setop

Categories : PHP

how to use shared preference on multi textview,multi checkbox,multi button and multi edit box in android?
Use these method to save and get values from any where in your app change parameter according to your requirment this method to save value in shared prefrences public static void setPref(Context c, String pref, String val) { Editor e = PreferenceManager.getDefaultSharedPreferences(c).edit(); e.putString(pref, val); e.commit(); } this method to get value from shared prefrences public static String getPref(Context c, String pref, String val) { return PreferenceManager.getDefaultSharedPreferences(c).getString(pref, val); }

Categories : Android

Java High-load NIO TCP server
Your logic around writing is faulty. You should attempt the write immediately you have data to write. If the write() returns zero it is then time to register for OP_WRITE, retry the write when the channel becomes writable, and deregister for OP_WRITE when the write has succeeded. You're adding a massive amount of latency here. You're adding even more latency by deregistering for OP_READ while you're doing all that.

Categories : Java

High performance socket server (like MMO)
There: C# SocketAsyncEventArgs High Performance Socket Code; based on things I have learnt from this (and some other resources) I have written a high performance TCP server which is handling more than 7000 clients. Edit: Other good .NET code bases I studied to some extend are fracture (F#), SocketAwaitable and SuperSocket. I especially like fracture because of it's simple (not naive) and smart buffer pool handling but (as the version I've worked with) it does not provide a separate pool for acceptors; which I've done myself easily based on the already provided pool.

Categories : C#

Server high ping with Node.JS
The most common problem is when someone connects, your logic in node.js blocks and holds execution cursor, and then releases it after some delay that involves every other callback to wait. As node is async and single threaded process, you should avoid any blocking operations as much as possible. Use async operations with MySQL, and make sure all your internal logic is not blocking. Although more information regarding your logic would be helpful.

Categories : Node Js

High-load java server
I do not think that Idea 3 would be over engineering, and I'd hit that road. Building @MessageDriven Bean "adapter" that handles incoming socket connections in the onMessage method is easy to develop and from there you're in the well scaling EE world. You your case, you might even want to rely on UDP. See following example: http://www.apprigger.com/2011/06/javaee-udp-resource-adapter-example/ But from my point of view there are other important reasons to go this way. Some pointers: 1.) As you've already mentioned. Building an own Socket Server handling threads and requests is a lot of work, and at the end you might build your own little "application server". 2.) Don't be afraid of using an application server. Of course people tend to call such a platform "overhead". Though when I did

Categories : Java

TCP/UDP high-performance server under linux
Your basic approach is right. Start by studying the infamous C10K problem and how it was overcome. Once you understand the major bottlenecks in various implementations, you need to consider the following as part your design process : Minimise thread creation/deletion cycles. Always choose an "event-based" model over a blocking model. Basically the one-thread-per-request model is preferred for its simplicity of implementation. But it does NOT scale well with the number of concurrent requests. When designing systems required to support more than a few 1000 concurrent requests, one prefers the use of sockets over threads. The optimum number of "worker-threads" to instantiate depends upon : Load (number of concurrent requests) System (CPU, RAM) Since this is a very popular probl

Categories : Linux

.Net Multi threaded application slow on a powerful server vis a vis regular server
Your question is a little vague especially since we have no code to work with or any idea of the framework. But I can think of some general things that might be causing your problem. First off just because you add more cores doesn't mean you will get better processing, in fact depending on how the code is written, you could get the exact opposite which is what you are seeing. My primary suspicion would be that you have some common object(s) that all your task are using which your tasks end up fighting over resulting in bottlenecks. So my first question would be do you have any shared resources among tasks? Basically are the tasks that you are spawning individual units of work (i.e. have no dependencies shared between tasks)? Another warning sign that you have a bottleneck is your CPU usag

Categories : C#

High performace server for 1x1 pixels (500M GET requests per day)
Nginx is indeed a good candidate for this and already has built in support for empty GIFs (see http://wiki.nginx.org/HttpEmptyGifModule). Disk I/O will probably be the biggest issue for this server because of the access logging. The only way to figure out the performance of the different EC2 instances is to test them. If one EC2 instance does not offer the performance you need, or if you need any redundancy for this service, you should also look into using a load balancer (either an AWS Elastic Load Balancer or your own custom one). You could also set up multiple smaller servers in different geographical regions and use DNS latency based routing to route requests to them (use either AWS Route 53 latency based routing or another DNS solution). This would significantly reduce the connect

Categories : Nginx

SQL Server 2008 R2 - Subquery to return range high
One of your problems here is that neither table, and especially the PHASE_KEYS_D table, have primary keys. It's almost always a good idea for all tables to have primary key, and preferably non-intelligent keys (meaning no data is represented in them, they're just dumb ids). This is how straight forward the query becomes when you have a primary key: alter table phase_keys_id add phase_id int not null identity (1,1) select p.phase_id,max(h.prhigh) from phase_keys_d p inner join stock_hist h on h.DSEQKEY between p.BEGKEY and p.ENDKEY group by p.phase_id And if you wanted to show the max with each detail row: ;with z as ( select h.dseqkey,p.phase_id,h.prhigh from phase_keys_d p inner join stock_hist h on h.DSEQKEY between p.BEGKEY and p.ENDKEY ) select z.dseqkey, z.

Categories : Sql Server

SQL Server 2012 Always on has high logcapture wait type
Don't troubleshoot problems on your server by looking at total waits. If you want to troubleshoot what is causing you problems, then you need to look at current waits. You can do that by either querying sys.dm_os_waiting_tasks or by grabbing all waits (like you did above), waiting for 1 minute, grabbing all waits again, and subtracting them to see what waits actually occurred over that minute. See the webcast I did for more info: Troubleshooting with DMVs That aside, HADR_LOGCAPTURE_WAIT is a background wait type and does not affect any running queries. You can ignore it.

Categories : Sql Server

High performance real time project .NET, SQL Server
I’d start of by making estimates based on following data with the goal of estimation number of requests per minute or second. Average number of moving markers at any time. If you have 200 vehicles to track how many do you expect to be moving simultaneously? Does time of the day matter? If it does make sure you make calculations based on the peak hours. How many simultaneous requests from users do you expect? If you have 800 users are they going to be using the application throughout the whole day or only several times a day or once a week? Once you get the data multiply it by at least 3. This will accommodate for all false assumptions you may have made in the calculations and allow for future growth. Once you get the final number it will be a lot easier to decide whether you need

Categories : C#

Media server vs normal server
Googling will find you better results for a comparison between Apache vs Nginx than anyone on this site can give you. It is too broad of a question and can be highly subjective. Media Files Media in a django context generally refers to files that have been uploaded by end users. It is common to have a django view that initially uploads the users file, but then any future access to it is served by a traditional web server like nginx.See the docs for more info. Static Files Static in a django context refer to images, javascript and css files. While developing your site, the built-in django development server will serve these files for you. However, when moving to production you will want to use a traditional web server like apache to serve these files. See the docs for more details. Dyn

Categories : Django

How to send high rate of data ~30-100Hz to web server and/or bluetooth
A websocket sounds like a very good solution - keeping the socket open will avoid the overhead of setting up and tearing down a connection every time. Have a look at http://autobahn.ws/android - I've only tried it briefly, but it seems to work very well.

Categories : Android

High clock speed vs multiple cores/CPUs in a web server
There are two different situations that we can consider: - One kind of processor that is just used for calculations for a single program. In this situation, the Processor speed is more important as the user want the ability to do quickly and efficiently. Its not the case with web server. - On the other hand the processor used for multiple programs running at the same time. ( concurrent processes) The second is where multiple cores come in handy, as each program can be assigned to a separate core, thus freeing each program from 'bottle-necking' each other. - From Intel :) Software developers can no longer rely on increasing clock speeds alone to speed up single-threaded applications; instead, to gain a competitive advantage, developers must learn how to properly design their applic

Categories : PHP

Azure Could Computing high availoability vs NEO4J high availability?
The short answer is probably yes. Windows Azure provide you infrastructure that allow you to build high availability system, it won't make any system high available by magic. As NEO4J is state-full, each node (with only one node Azure don't give you any SLA, you instance will be down) will need to share some state and the way to do it will be dependent on how NEO4J is working. So you will need to rely on NEO4J mechanism to do it. I don't know how NEO4J is working but you won't be able to skip designing an high available architecture around NEO4J using Windows Azure infra. Cloud may be a magic buzz word that can make things append on management level, but when we are on hard real world level Harry magic wand doesn't exist.

Categories : Neo4j

How to upload a high resolution image to Server in Base64 Converted String
Probably you might be getting an exception on byte[] b = baos.toByteArray(); To handle that you want to consider recycling your images. Also, using Multipart is considered a better option, since you are using Base64 you might want to ponder on Jen's Post too. One more suggestion is, if you are on API level 11 or more then you may consider using: android:largeHeap="true" Which will help you to carry out your conversions and processing safely(Provided that you are not leaking any variable). For more information on this, see the documentation on Application. Let me know if you still face any issues.

Categories : Android

nodejs HTTP server can't handle large response on high load
Right now all strings are first converted to Buffer instances. This can put a heavy load on the garbage collector to cleanup after each request. Running your application with --prof and examining the v8.log file with tools/*-tick-processor and you may see that. There is work being done to correct this so strings are written out to memory directly then cleaned up when the request is complete. It has been implemented for file system writes in f5e13ae, but not yet for other cases (much more difficult to implement than it sounds). Also converting strings to Buffers is very costly. Especially for utf8 strings (which are default). Where you can, definitely pre-cache the string as a Buffer and use it. Here is an example script: var http = require('http'); var str = 'a'; for (var i = 0; i <

Categories : Node Js

CPU usage not maximized and high synchronization in server app relying on async/await
It sounds like your server is almost completely asynchronous (async MSMQ, async DB, async HttpClient). So in that case I don't find your results surprising. First, there is very little CPU work to do. I'd fully expect each of the thread pool threads to sit around most of the time waiting for work to do. Remember that no CPU is used during a naturally-asynchronous operation. The Task returned by an asynchronous MSMQ/DB/HttpClient operation does not execute on a thread pool thread; it just represents the completion of an I/O operation. The only thread pool work you're seeing are the brief amounts of synchronous work inside the asynchronous methods, which usually just arrange the buffers for I/O. As far as throughput goes, you do have some room to scale (assuming that your test was floodin

Categories : C#

quicksand sorting price values low to high / high to low
val() gives you a string, so > and < comparisons are lexographical (not numeric). Try wrapping the values in parseInt() or parseFloat(). Make sure to add appropriate error handling as well.

Categories : Jquery

media server with sip functionality
There are some open source VoiceXML interpreters/browsers and some open source SIP media servers, but I am not aware of a good open source solution that supports both. OpenVXI is a popular VoiceXML interpreter that many commercial IVR systems are based on. VoiceGlue is an open source implementation that combines OpenVXI with Asterisk under the GPL license. You could try integrating OpenVXI with an open source SIP media server. You can get a list of open source SIP solutions here. Integrating the two is not a small task. Nor is learning and supporting some of these open source solutions. If you are not tied to open source I would look at Voxeo Prophecy. This is an excellent VoiceXML platform that uses SIP as main telephony interface. It is a software only solution that you can get two p

Categories : Misc

Flash Media Server, HLS and FLV
i'm actually not about FMS.. i work with Wowza and i suppose you'll need something like nDVR feature or have someone write special module for you that will split live stream into small recordings, and so you'll need to play playlist of such recorded files from your iPhone. hopefully someone will recommend true solution, not just some assumptions :)

Categories : IOS

Varnish High DB Connections In High Traffic
Mostly spiking backend connections has little to do with your varnish configuration but alot to do with the cachability of your site. Are there cookies that prevents you from caching efficiently? You can chose to strip them or remove all but chosen ones, there are examples for both on the varnish site. Do a varnishstat and check your hit rates during peaks. Is it a good cache hitratio? Is it the same as during low load? If it's the same or higher in low load it's easy to work on improving it at any time. Do a varnishtop -i txurl to see what requests are the most frequently sent to backend servers. Maybe it's some URLs that are just not cached due to faulty headers? Maybe some pages can be cached longer? Maybe some parts of the pages can be cached with ESI? Make sure your varnish is not

Categories : Mysql

Looking for Video streaming in ios using Wowza Media Server
You can create a mobile application using adobe air. Based on that just code a regular video chat application using NetConnection and NetStream, there are a lot of tutorials over the web about it.

Categories : Iphone

Broadcast a program's audio to a media server
ffmpeg is an excellent option for this, transcoding and feeding into other streaming servers is where it shines, currently I'm using the following command to transcode an RTMP stream to 16x9 pixels in raw RGB24 format while also deleting the audio channel[s]: ffmpeg -re -i http://192.168.99.148:8081/ -an -vf scale=16:9 -pix_fmt rgb24 -f rawvideo udp://127.0.0.1:4000 Of course the possibilities are limitless, if you can give more specific info about your case I might be able to help you construct the needed commands.

Categories : Linux

Adobe Media Server scaling on Amazon Web Services (AWS)
CloudFront acts as a caching layer, for each edge location. If the content is not available at the edge location, it connects to EC2, retrieves the data and passes it on. So as far as I know, if using CloudFront, you shouldn't need such a large EC2 instance. I've tested this extensively with static resources, I didn't need it for live streaming yet, but the same principles should apply. This post on the AWS website from 2012 seems to confirm my hypothesis: http://aws.amazon.com/about-aws/whats-new/2012/03/29/amazon-cloudfront-improves-live-streaming-support-with-adobe-fms/ So basically, as long as the EC2 instance is strong enough to stream to all CloudFront edge location simultaneously, you should be fine.

Categories : Amazon



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