w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Is it possible for a message producer to get acknowledgement of message receipt from activemq?
Hope this would help to resolve your concern http://wso2.com/library/articles/2013/01/jms-message-delivery-reliability-acknowledgement-patterns/

Categories : Wso2

How to get Acknowledgement from Kafka
What I found so far is in 0.8 they have introduced the following way to choose from the offset for reading .. kafka.api.OffsetRequest.EarliestTime() finds the beginning of the data in the logs and starts streaming from there, kafka.api.OffsetRequest.LatestTime() will only stream new messages. example code https://cwiki.apache.org/confluence/display/KAFKA/0.8.0+SimpleConsumer+Example Still not sure about the acknowledgement part

Categories : Apache

How to get acknowledgement after sending sms successfully?
-you need to make a recieve data event; Imports System Imports System.IO.Ports Class PortDataReceived Public Shared Sub Main() Dim mySerialPort As New SerialPort("COM1") mySerialPort.BaudRate = 9600 mySerialPort.Parity = Parity.None mySerialPort.StopBits = StopBits.One mySerialPort.DataBits = 8 mySerialPort.Handshake = Handshake.None AddHandler mySerialPort.DataReceived, AddressOf DataReceivedHandler mySerialPort.Open() Console.WriteLine("Press any key to continue...") Console.WriteLine() Console.ReadKey() mySerialPort.Close() End Sub Private Shared Sub DataReceivedHandler( sender As Object, e As SerialDataReceivedEventArgs) Dim sp As SerialPort = CType(sender, SerialPort) Dim indata As

Categories : Vb.Net

Soap client acknowledgement
I would solve this by adding a parameter to the web method call that the caller can set. <WebMethod()> _ Public Function DeleteFile(ByVal fileID As String, clientAcknowledgement As Boolean) As Boolean If clientAcknowledgement Then DeleteFileByID(fileID) End If End Function If the developer that calls this method is lazy and just sets it to true all of the time without prompting the end user, then it is their responsibility to answer to their users. You could get pretty complex with scenarios to call one method then another, but at the end of the day, the developer consuming the web services can circumvent just about anything you put into place and you have no real guarantee that the end user has been asked unless you implement the code yourself. UPDATE After c

Categories : Vb.Net

TCP IP Server with acknowledgement and receive data again
I don't see any error in the program, except these comments: // Don't use the b.Length in this command: string hexStr = ConvertAsciiToHex(Encoding.ASCII.GetString(b, 0, b.Length)); // use k instead, the numbers actually read, not the length of the buffer. string hexStr = ConvertAsciiToHex(Encoding.ASCII.GetString(b, 0, k)); while (socket.Poll(-1, SelectMode.SelectRead)) { // b has been allocated, don't need this // b = new byte[1000]; k = socket.Receive(b); if (k > 0) { count++; Console.WriteLine("Reading Client Data - Count - " + count.ToString() + " and lenght " + k.ToString(); // use k not Length hexStr = ConvertAsciiToHex(Encoding.ASCII.GetString(b, 0, k /*b.Length*/)); File.WriteAllText(@"C:ClientFiles estD

Categories : C#

getting the total consumption
if You MUST have trigger - it shoud be like that: DELIMITER $$ CREATE TRIGGER `chg_consumption` BEFORE INSERT ON `consumption` FOR EACH ROW BEGIN SET NEW.total_consumption=(SELECT MAX(total_consumption)+new.consumption FROM consumption); END; $$ DELIMITER ; p.s. and make total_consumption int(11) not null, nullable or default 0 EDIT: improve from SUM(total_consumption) for MAX(total_consumption) as @calcinai suggestion

Categories : Mysql

How to get battery consumption value for an iOS app (x mAh/min)?
Instruments won't give you a pretty picture like this but it will show you CPU, GPU usage which should generally be an indicator of battery drain and is certainly an good way to look at your application's performance/hardware utilization.

Categories : IOS

Youtube API Consumption & Caching
You can probably do this using Memcache, keying off a combination of the query and penguin. You have to do a bit more legwork yourself, but I've found that it's usually better for me to write my own caching because caching can lead to a ton of bugs when you turn it on too early. Here's what your code might do: Check for @videos in your cache. Keyed by a concatenation of access token and query. If there's a cache miss, do the fetch and store the results in the cache. If there's a cache hit, return what's in the cache. Deserialize, and store it in @videos One quick question: is there a reason you are making @client an instance variable? You probably are doing this in a controller and don't need this in the view, so as a general principle you should limit the scope of what is available

Categories : Ruby On Rails

Objects consumption pattern
The issue I am dealing with is how to keep in sync PixelSelection with the Bitmap Why don't you add a reference to Bitmap into PixelSelection? public class PixelSelection { string GenericAttribute; int X; int Y; private readonly Bitmap bitmap; public PixelSelection(string myAttribute, int x, int y, Bitmap bitmap) { GenericAttribute = myAttribute; X = x; Y = y; this.bitmap = bitmap; } }

Categories : C#

Java - sending a message to WebSphere message broker and its altering my message
How are you reading the message after it is received? are using readUTF method? If you have used writeUTF while sending a message, then you must use readUTF method retrieve the message body after receive. The "n" could actually be the length of the XML message as, in UTF string, the first two bytes indicate the length of the string that follows.

Categories : Java

Application Battery Consumption Tool
PowerTutor is an application for Google phones that displays the power consumed by major system components such as CPU, network interface, display, and GPS receiver and different applications. The application allows software developers to see the impact of design changes on power efficiency. Application users can also use it to determine how their actions are impacting battery life. PowerTutor uses a power consumption model built by direct measurements during careful control of device power management states. This model generally provides power consumption estimates within 5% of actual values. A configurable display for power consumption history is provided. It also provides users with a text-file based output containing detailed results. You can use PowerTutor to monitor the power consump

Categories : Android

DataTable memory huge consumption
DataTables are a generic solution of putting tablular data into memory and adding lots of table-related features. If the overhead is not acceptable for you have the option to 1) write your own DataTable class that eliminates the overhead that you don't need 2) Use an alternate representation that still accomplishes what you need, perhaps POCO based, or maybe an XMLDocument (May have just as much overhead maybe more, never really worried about it). 3) Stop trying to load everything into memory and just bring data in as needed from your external store.

Categories : C#

Memory consumption of jars with many classes?
Memory consumption will be higher due to sheer size of jars that need to be opened and processed. But as for the classes - no, in general classes are loaded "on demand", apart from perhaps a handful from the bootstrap classpath. It does depend on the classloader implementation indeed, though. As for cleanup of unused classes... yes, the JVM does that, in a manner similar to ordinary, reachability-based garbage collection. Be wary of classloader leaks though - sometimes the class object remains reachable in a not-at-all-obvious way, which manifests itself especially nasty in containers, and easily leads to te dreaded OutOfMemoryException: PermGen space exceptions.

Categories : Java

Multiple Consumption of single stream
Yes, it's possible, easy and common. The following is a piped data stream from a single source to multiple sources. It shows you the one anonymous callback function that gets placed on the event loop that contains the write function streams that do the actual write work: var fs = require('fs'); var rs1 = fs.createReadStream ('input1.txt'); var ws1 = fs.createWriteStream('output1.txt'); var ws2 = fs.createWriteStream('output2.txt'); rs1.on('data', function (data) { console.log(data.toString('utf8')); ws1.write('1: ' + data); ws2.write('2: ' + data); }); An easier way is to use the .pipe() functions. var fs = re

Categories : Node Js

Pointers - decreasing memory consumption
Yes, this is a good way. It is called Flyweight pattern. But instead of static fields consider using factory of objects. This will make your code more testable in the long run. In computer programming, flyweight is a software design pattern. A flyweight is an object that minimizes memory use by sharing as much data as possible with other similar objects; it is a way to use objects in large numbers when a simple repeated representation would use an unacceptable amount of memory. Often some parts of the object state can be shared, and it is common practice to hold them in external data structures and pass them to the flyweight objects temporarily when they are used. A classic example usage of the flyweight pattern is the data structures for graphical representation of characters in

Categories : Java

Memory consumption of WPF application in TaskManage
WPF applications use relatively large amount of memory compared to Winforms applications. But even then, while yoour app is running, the OS will give it memory as it is needed by the app. At a certain moment, your app will do a garbage collect and basically memory is released. You can do a simple trick to release some memory by minimizing your app. see also: http://windows.microsoft.com/en-my/windows-vista/what-do-the-task-manager-memory-columns-mean

Categories : C#

Case classes memory consumption
If you share the entity definitions, then you only need to calculate one object reference per Entity for them. The size of an object reference is specified by the JVM

Categories : Scala

Viewing power consumption of Android app
Android shows it in battery settings, e.g., "MyApp: 30%", but can apps directly read that value? Not through the Android SDK. There's probably a way to get that from some Linux /proc entry, but I don't know off the top of my head how.

Categories : Android

Huge memory consumption of UniversalImageLoader
For all the other people out there having the same issues: I managed to minimize my Memory usage and get rid of the OutOfMemoryException by following these guidelines: https://github.com/nostra13/Android-Universal-Image-Loader#useful-info The most important part for me was to reduce the ThreadPoolSize down to 2. I could not feel any performance changes after setting it down. ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(c) .threadPoolSize(2) .build(); DisplayImageOptions options = new DisplayImageOptions.Builder() // other options .bitmapConfig(Bitmap.Config.RGB_565) .imageScaleType(ImageScaleType.EXACTLY) // other options .build(); This reduced my applications total memory consumption by about 35%.

Categories : Android

How to reduce real memory consumption ios
Images once loaded into memory lose (most of?) their compression. So unfortunately, the images may not look big when on disk (bundled in the app) but they can be a lot bigger once loaded into your app. one 2898x779 image in ram will effectively use 2898x779x4 bytes = ~9mb, compare that with how big your image is on disk and you should see the difference. so to actually answer your question, either downsize your images (because your devices screen is probably not that big, unless retina ipad or something) or use a CATiledLayer which will only load up parts of the image that are visible on the screen, and not the whole image.

Categories : Iphone

Memory consumption differs by environment
This is a common problem which we normally face when we work on Different Environments. This is because System configuration, Windows etc differs from system to system. In this particular case as we see its a big difference, probably there is some loops or memory is not freed at regular intervals. Few steps: Try to get root of the problem i.e. which method is taking time. Use Loggers like nlog. Try using profilers if you are using Sql Server And the third is use ants-performance-profiler Also it depends on number of user hitting on site and some deadlock conditions. There can be numerous reasons for the same.

Categories : Asp Net

'Clean' consumption of Localisation Logic in ASP.NET MVC
You can create a decorator over IMenuRepository menuRepository which will do the localization when you call _menuRepository.GetMenu(MENU_TYPE), Code will look something like this: public class LocalizerDecorator : IMenuRepository menuRepository { private IMenuRepository originalRepository; private ILocalizeMenus menuLocalization; public LocalizerDecorator(IMenuRepository originalRepository, ILocalizeMenus menuLocalization) { this.originalRepository = originalRepository; this.menuLocalization = menuLocalization; } public Menu GetMenu(string MENU_TYPE) { var result = this.originalRepository.GetMenu(TYPE); this.menuLocalization.LocalizeAllText(result); return result; } } Then you need to configure you DI

Categories : C#

SQL - daily water consumption. Difference between days
since the consumption is never going to decrease (hour to next hour), can you not take MAX(consumption) - MIN(consumption) for each date? Update: You may have to do MIN(consumption_today) - MIN(consumption_yesterday) to include and account for all consumption that happened between last reading of yesterday and first reading of today.

Categories : SQL

What are the good implementation practices to minimize RAM consumption
Be careful about scope of objects. Make sure you are handling the memory deallocation after an object is no longer needed. I'm not sure I understand your use functions as much as possible(?). Functions require overhead, every call causes a little bit of extra memory to be taken up because it has to store a few pointers and a little bit of information about the method on the call stack. So, while that may help keep your source code clean - it won't lower your memory usage (it'll probably increase it). One way to get the best of both worlds in C is to use inline functions - which suggests to the compiler that it should not create an actual function, but rather just insert that block of code wherever it is used. Keep in mind that efficient code usually has a more machine level look to it (mea

Categories : C

How does streams in Java affect memory consumption?
All of the answers above are great answers but I don't believe they answer your original question about memory consumption. In Java you can look at streams in multiple ways. First you have Raw streams which are the lowest level stream and interact with the underlying OS (File, Network etc) with minimal memory overhead. Second are Buffered streams which can be used to wrap a raw stream and add some buffering and significantly improve performance. Stream buffering adds a fixed amount of memory overhead for buffering and can be set by your application. Not sure what the default is but it is probably something minimal such as 32K. The third type of stream is a memory stream (i.e. ByteArrayInput/Ouput) these use as much memory as you write to them and will grow as needed and not dispose of th

Categories : Java

Mysql server huge memory consumption
Read this: http://www.chriscalender.com/?p=1278 Open my.cnf and add this at the end: performance_schema=0 Restart your services. From 620MB I have now 38MB memory used.

Categories : Misc

How to minimize memory consumption from PHP Spider when using curl_multi_getcontent()?
This is your problem: "I'm currently writing a spider function in PHP that recursively crawls across a website" Don't do that. You are going to get into an infinite loop and cause a denial of service. Your real problem is not running out of memory. Your real problem is that you are going to take down the sites you are crawling. Real webspiders do not attack your website and hit every page boom boom boom like you are doing. The way you are doing it is more like an attack than a legitimate webcrawler. They are called "Crawlers" because they "crawl" as in "go slow." Plus, a legitimate webcrawler will read the robots.txt file and not read pages that are off limits according to that file. You should do it more like this: Read ONE page and save the links to a database where the URL

Categories : PHP

Fetch Unit consumption date-wise
There's a couple of ways to get the resultset. If you can live with an extra column in the resultset, and the order of the columns, then something like this is a workable approach. using user variables SELECT d.Date , IF(@prev_units IS NULL ,@diff := 0 ,@diff := d.units - @prev_units ) AS `Units_used` , @prev_units := d.units AS `Units` FROM ( SELECT @prev_units := NULL ) i JOIN ( SELECT t.Date, t.Units FROM mytable t ORDER BY t.Date, t.Units ) d This returns the specified resultset, but it includes the Units column as well. It's possible to have that column filtered out, but it's more expensive, because of the way MySQL processes an inline view (MySQL calls it a "derived table") To remove that extra column

Categories : Mysql

How can I provide Metadata from my WCF service for consumption in Breeze
You can return Breeze 'native' metadata simply by returning the metadata in json form. Something like this: [HttpGet] public String Metadata() { var folder = Path.Combine(HttpRuntime.AppDomainAppPath, "App_Data"); // metadata.json is the name of a file containing your metadata - pick any file name you like. var fileName = Path.Combine(folder, "metadata.json"); var jsonMetadata = File.ReadAllText(fileName); return jsonMetadata; } where the syntax of the metadata file is described here: Breeze metadata format.

Categories : Wcf

SQL - calculate consumption of materials based on recipe
Add Raw Materials and Recipe to your FROM clause with the appropriate joins. Group by raw materials. Remove id_product and price from your group by statement. Change the aggregation in your select to sum(products.price*orderscontent.qnt). I'm guessing at your column names in Recipes and Raw Materials but here's the general idea. select Recipes.ID_RAW_MATERIALS, sum(OrdersContent.QNT) as QNT_Sum, sum(Products.Price * OrdersContent.QN)) as Value from Orders, OrdersContent, Products, Recipes, RawMaterials where Orders.ID = OrdersContent.ID_Order and Products.ID = OrdersContent.ID_Product and Recipes.ID_PRODUCT = Products.ID AND Recipes.ID_RAW_MATERIAL = Rawmaterials.ID group by Recipes.ID_RAW_MATERIALS

Categories : SQL

Interpreting memory consumption of program using pugixml
Your assumptions are incorrect. Here's how to estimate pugixml memory consumption: When you load the document, the entire text of the document gets loaded to memory. So that's 50 Mb for your file. This comes as 1 allocation from xml_document::load_file -> load_file_impl In addition to that, there's the DOM structure that contains links to other nodes, etc. The size of the node is 32 bytes, the size of the attribute is 20 bytes; that's for 32-bit processes, multiply by 2 for 64-bit processes. This comes as many allocations (each allocation is roughly 32kb) from xml_allocator. Depending on the density of nodes/attributes in your document, memory consumption can range from, say, 110% of the document size (i.e. 50 Mb -> 55 Mb) to, say, 600% (i.e. 50 Mb -> 300 Mb). When you destroy pugixm

Categories : C++

concurrent_queue memory consumption exploded, then program crashed
I build and tested your code with VS'13 and Boost 1.52 on a simple dual-core. And as already said, because your producer-consumer design doesn't define a threshold to block the producer when the stock (the concurrent_queue) reach a given level, The producer push too many data in the queue and as consequence the memory increase, windows start swapping, freeze, process can crash if it exceed the max commit size, etc .... Note that the commit size limit depend of several factor, compiler, compiler option, OS on which your program run, ... So in the following I added a way to block the Producer if the queue size reach a threshold, and if the queue size goes below the threshold the consumer awake the producer. With those change, we add some synchronization and that can limit a bit the paral

Categories : C++

Storage consumption when installing boost libraries into a git repository
Based on what you are saying it sounds like it is possible for you guys to use a .gitignore file to solve your problem. A .gitignore file would let you ignore the parts of your boost library that are not changing. You can create a .gitignore file in unix as followed: touch .gitignore # or nano .gitignore You'll want to make sure that your .gitignore file is at the top of your project directory up there with your .git folder. Once you have a .gitignore file, you can put file and directory paths that you do not want git to track in there like so: # This is the titan project gitignore file # this section includes general files that should be ignored *.txt .project *.csv # these are general places to ignore in this project .settings/ # this would let you ignore a directory from boost bo

Categories : GIT

How to reduce memory consumption when app is minimized for x amount of time
The symptomes you describe seem to indicate that your machine lacks physical memory. When you minimize an application and activate another, the minimized application has many of its memory pages swapped out to disk. When you activate back the application, pages belonging to other applications are swapped out to disk and the perviously swapped out pages belonging to the application you just activated are swapped into physical memory, taking a long time due to the relatively slowness of the hard drive. Solution: Add more RAM, it's relatively cheap. If your O.S. is 32 bit, you can go up to 4GB. If your O.S. is 64 bit, whatever your motherboard supports is the limit.

Categories : C#

Battery consumption needed for continuous speech recognition
Predicting the battery consumption will be near impossible as it depends on several factors: The device's processing power The device's screen size, type and brightness The internet connection speed on the device (most speech recognition services send the data to a server) The efficiency of the hardware microphone Other background processes running on the device Even if everything was in ideal conditions, the simple fact that different devices have different screens, processors and battery capacity will make it impossible to predict the consumption.

Categories : Android

Tools to analyze Hadoop Network Bandwith consumption
There is a whole host of metrics supplied by Ganglia monitoring, when that is activated in your cluster (though I'm not sure if it provides bandwidth consumption). There is information on it here and here and a nice demo page here.

Categories : Networking

Implications of using GLSurfaceView on power consumption and battery life
Have you set the render mode to RENDERMODE_ONDEMAND? See docs here: http://developer.android.com/reference/android/opengl/GLSurfaceView.html#setRenderMode(int)

Categories : Android

Reg syncfusion grid dispose memory consumption issue
Grid Control can be disposed by using "Dispose()" method. The Latest version of syncfusion will dispose the grid controls without any memory leak. Kindly, check disposing the object with latest version.

Categories : C#

Basic WCF - how will the consumption of a WCF service translate to a 'real-life' deployment?
You will see that in your app.config file the url is saved. If you deploy your service to a live server you will only need to change the config to look at the new url. Hope I understood your question.

Categories : C#

Optimising memory consumption for Grails applications deployed on Raspberry Pi
I would not recommend running any non-"Hello World" style Grails application on Raspberry Pi. In general, 512MB of RAM would be a minimum, in order to have a decent performance on a medium to smaller application. Tomcat memory usage + your app memory usage on 512MB of RAM doesn't look good on Raspberry Pi to me... See the second answer from Igor on this related SO question. Please consider other alternatives Spring MVC or something more lightweight(Not too many proxies, low amount of reflection in the Web Framework, etc.).

Categories : Grails



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