w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
socat how to receive large amount of messages store these messages and acknowledge each message
Although this question is quite old now, this would have worked: socat tcp-listen:5678,reuseaddr,fork 'system:echo +OK!!open:recv.data,create,append' Source: Dual inter addresses

Categories : Misc

Regarding Akka message transfer performance: many small messages or less large messages?
For messages passed in Akka on the same machine, I don't think it matters a lot whether you use small message or an aggregation of messages as single message. The additional overhead of many calls versus having to loop while processing the aggregation is minimal I think. I would prefer using small messages because it keeps the system simpler. However, when sending messages over the network Akka is using HTTP and so there is the additional HTTP overhead costs for setting up a connection etc. Therefore you might choose here to aggregate some messages into a single message. However, this also depends on your use case. Buffering implies waiting for more until there are enough (or a timeout occured). If you cannot wait, e.g. because you need fast responses, then you still need to send each mes

Categories : Performance

Django log messages not processing correctly. Messages to multiple files
You have two different loggers, named '' (the root logger) and 'auth'. The order in which your two statements appear: logger = logging.getLogger('') logger = logging.getLogger('auth') obviously makes a difference when you call logger.info(...) as in the two cases you will be calling the method on two different loggers. You might wish to change your code to root_logger = logging.getLogger('') logger = logging.getLogger('auth') and then call methods on either root_logger or logger as appropriate.

Categories : Python

Prevent p:messages component from showing messages which are already shown in p:message
i used the following JS function oncomplete of blur event and it works fine: function hideRequiredMessage(){ var ErrorMessagesSpans= document.getElementById("myform:messages").getElementsByClassName("ui-messages-error-summary"); if(ErrorMessagesSpans!=null && ErrorMessagesSpans.length > 0){ var ErrorMessageSpan=ErrorMessagesSpans[0]; if(ErrorMessageSpan.innerHTML==''){ //ErrorMessageSpan.className = ''; ErrorMessageSpan.parentNode.removeChild(ErrorMessageSpan); } } }

Categories : Validation

Receiving messages from and sending messages to RabbitMq from WSO2 esb (v. 4.6.0)
This is because you have not set the content type and content Encoding when sending the message. Please make sure you set the contentType and contentEncoding in the builder. builder.contentType("text/xml"); builder.contentEncoding("utf-8");

Categories : Wso2

Open iOS Messages app and go directly to the Inbox/Messages list
Unfortunately there are only two URL schemes for Messages, "sms:" , that opens the "New message" screen "sms:1-408-555-1212" , that opens the "New message" screen with the number provided As Apple developer documentation refers: https://developer.apple.com/library/ios/featuredarticles/iPhoneURLScheme_Reference/iPhoneURLScheme_Reference.pdf [Link updated]

Categories : IOS

How to achieve complex messages using GWT i18n Messages interface
I Don't think it can be done, only for plural count and enums you can specify mutliple messages for the same method. In this case you need to create 3 methods and do the testing on the variants in your own code.

Categories : Gwt

How to make p:messages keep messages until errors are fixed
Set each ajax update tag with process="@form". I suspect the reason why a validation message is displayed for only a single component at a time is that each ajax request only processes a single component. As a result, only one component will ever fail validation at a single time and only one validation message will be queued. By setting each you'll ensure that each component in the form goes thru validation during processing and their respective validators will kick in.

Categories : Validation

Global messages not displaying in
As there is no template attribute in ui:composition I assume the page is top level one. Then h:body is missing, here is an example: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich"> <h:head/> <h:body> <h:form ..... </h:body> </html>

Categories : JSF

jms persistent messages and order of messages obtained
If you are consuming messages in parallel, then due to the nature of threading there can never be a guarantee that they will be completed in exactly the order they were sent in - only that they will be handed off to consumers in order. If there are only certain messages that absolutely, positively must be ordered (usually related to a transaction/account), you can use Message Groups feature to associate groups with consumers - a kind of sticky load balancing. Acknowledging messages by yourself is most definitely possible, but probably not needed. The MessageListenerContainer has a acknowledge attribute which if set to transacted will result in the message only being acknowledged as consumed once the MessageListener has completed executing, without an exception being thrown. No transaction

Categories : Spring

ActiveMQ stops sending messages to Queue Consumer in case of consumer not acknowledging messages
I had tried out lot of different configurations to resolve this issue by setting different activemq attributes like prefetch policy, maxpagesize etc. but none of them really helped. By referring to @Jake's comment I got to know about monitoring activemq using JMX via JConsole. This is a very handy tool to monitor and manage your activemq. Here are few article which you may find useful. 1. Monitoring activemq 2. Connecting activemq JMX using JConsole By monitoring the queue attributes I figured out that memoryLimit attribute had very low value assigned to it (just 1mb). Increasing the value of the attribute solved my issue. JMS started sending messages without waiting for acknowledgement. For testing purpose I had changed the value for memoryLimit in the conf/activemq.xml configuration

Categories : Java

Git "discrepancy": `git diff` does not take commit messages into consideration but SHA-1 generation takes commit messages while computing SHA-1
git diff is about the changes in actual content and not the meta data. Consider the use case where a commit was cherry picked from another branch. Many a times, you want to know if the same content is there in both the branches, and not if both branches have the same commit. That is where git diff comes into the picture. The commit hashes are of course for commits, and will take the metadata into consideration. The actual way to see difference in two branches IS git diff. If two branches have the same hash for their heads, they do have same content. But if they don't, they need not necessarily have different content. You might also look at git log -p command to see if it suites your purpose.

Categories : GIT

How to ensure that JMS messages read within a rolled back session are processed after never-before-read messages?
I am not aware of feature in Sonic MQ which supports your requirements out-of-the-box, but there are other options: Use a second queue for failed messages. So failed messages are sent again on another queue. Processing could start, if the first queue is empty, for example. Resend the message on the same queue (with same or even with a lower priority) In both cases, after the message has been sent, there is a normal commit on the main queue. Related: Message processing with priorities. A quote from James Shek's answer: JMS Spec states: "JMS does not require that a provider strictly implement priority ordering of messages; however, it should do its best to deliver expedited messages ahead of normal messages."

Categories : Java

Need Suggestion on Smart GWT
Yes, the Java is necessary for Smart GWT. Despite the fact that you can use declaratively defined datasources for data binding and UI can be modeled by XMLs (UiBinder) a lot of common glue stuff have to be done still in plain old Java. An easy way to learn Smart GWT is to open the showcase, find an example what you like and click on View Source button. If you are a JavaScript devel, you can use directly the SmartClient library, because Smart GWT is a Java wrapper of it. see 2. :) Useful links: forum FAQ Start Guide in pdf Showcase

Categories : Java

Get only largestChangeId in smart way
You can get largestChangeId only by using About.get() with fields parameter specified. GET https://www.googleapis.com/drive/v2/about?fields=largestChangeId This will simply return { "largestChangeId": "{{WHAT_YOU_WANTED}}"; } And you're already doing it in a smart way :)

Categories : Objective C

smart solution of SQL injection
The code should begin attempting to stop SQL injection on the server side prior to sending any information to the database. I'm not sure what language you are using, but this is normally accomplished by creating a statement that contains bind variables of some sort. In Java, this is a PreparedStatement, other languages contains similar features. Using bind variables or parameters in a statement will leverage built in protection against SQL injection, which honestly is going to be better than anything you or I write on the database. If your doing any String concatenation on the server side to form a complete SQL statement, this is an indicator of a SQL injection risk.

Categories : Mysql

Add image to smart art layout through c#?
ActivePresentation.Slides(2).Shapes(1).SmartArt.Nodes(2).Shapes(1).Fill.UserPicture "path and file name" Please refer this link

Categories : C#

How to get URL of Smart Poster in app launched by AAR
Adding this into manifest did the trick: <intent-filter> <action android:name="android.nfc.action.NDEF_DISCOVERED" /> <category android:name="android.intent.category.DEFAULT"/> <data android:scheme="http" android:host="demo.com" /> </intent-filter> The app is not starting because of the AAR however but as a result of "catching" the url of smart poster... EDIT: In the end we decided to use custom MimeType that we are catching in our app (via intent-filter)

Categories : Android

smart tv channel display
You need to use web device API <script src="$MANAGER_WIDGET/Common/webapi/1.0/webapis"></script> and then you can get access to webapis object. For more info look here: http://www.samsungdforum.com/Guide/ref00011/deviceapi_tv.html

Categories : Javascript

AngularJS and "smart" Caching
http://jsfiddle.net/G23h7/ I created two services to accomplish what I think you're trying to accomplish. The first provides the core functionality to take in a promise and an object (or array) and updates said object or array when the promise resolves. There's a GUI for you to play around with it. The second service integrates that into $http. Basically you can do smartHttp.forArray(config) and smartHttp.forObj(config) in lieu of $http(config). If you end up using this and want to use the $http shortcut methods then that should be straightforward to implement. This is untested - so consider it as pseudocode. If you're instantly returning a cached value/dud value it doesn't really make sense to use a promise for the return value of your smartHttp service (unless you were trying to

Categories : Caching

Smart App Banner in Facebook
Smart App Banners require a meta tag in the header of the page. They cannot be used in frames. So without access to the source code of Facebook and Twitter, this isn't possible. http://developer.apple.com/library/ios/#documentation/AppleApplications/Reference/SafariWebContent/PromotingAppswithAppBanners/PromotingAppswithAppBanners.html

Categories : Iphone

Smart way to concat two Sets
Try var concatSet =Set1 .SelectMany( item => Set2, (i1, i2) => (i1 + i2) );

Categories : C#

My panel not showing in Smart GWT
As it is not recommended at all to mix (for example gwt and smartgwt) I guess it's same thing with Gxt widgets by expérience (with gwt mix) even if it happen to work you never know when you will have a crazy behavior..;

Categories : Gwt

Smart sorting in python
Something like: >>> s = ['aaaa.143', 'aadf.23', 'aaaa.8'] >>> def key_f(x): ... head, tail = x.split('.', 1) ... return (head, int(tail)) ... >>> sorted(s, key=key_f) ['aaaa.8', 'aaaa.143', 'aadf.23'] Although this can be done with lambda, it is better to separate key calculation into separate function.

Categories : Python

Change color of smart tag
It's in Tools/Options/Environment/Fonts and Colors: Show settings for: Text Editor Display Items: Compiler Error You can change the Item Foreground property to get the color of the squiggly to change.

Categories : Visual Studio

Indexers(Smart array)
It's failing because the compiler could not find a property named Count. Instead, it found a method—either one which isn't shown here, or if Program implements IEnumerable<object>, then it's likely Linq's Count extension method. Try adding a Count property to Program class Program { ... public int Count { get { return this.array.Count; } } } That will solve the compiler error. Now, if you want to know why it's using indexers… well I suppose because your teacher wanted to illustrate how they can be used. Indexers are just a bit of syntactic sugar which just make writing code like p.GetItem(i) look cleaner, p[i].

Categories : C#

PHP smart || (OR) operator just like in Javascript
the line $filename = 'filename'. (isset($file['filename2']) ? '2' : '1'); is same as if(isset($file['filename2']){ $filename='filename2'; }else{ $filename='filename1'; } || is used if you have multiple conditions in your if and if even one pf them is true, it'll be true. The ?: is a ternary operator

Categories : PHP

What's the smart way to aggregate data?
The reason this isn't straight forward is that the structure of your data is not consistent, so you couldn't build a library simply for it. Your state, region column is basically an index column, and you want to index across part of it. tapply is designed for this, but there's no reason to build in a function to do it automatically for this specific scenario. You could do it without creating the column though tapply(outcome,gsub(",.*$","",testset$regions),sum) The index column just replaces the , and everything after it, leaving the index column. PS: you have a slight typo in your example, your data.frame should be testset <- data.frame(regions,outcome)

Categories : R

Does iOS have an API for accessing smart cards
yes, require proprietary SDK.. For example you can easily use: UniMag, Mobile MagStripe Reader "..reader that works with various mobile devices.., ...Plugs into audio headphone jack – no cables..." The SDK is there... in page... http://www.idtechproducts.com/products/mobile-readers/112.html another reader with own SDK: http://www.magtek.com/support/software/programming_tools/

Categories : IOS

LG Smart tv Volume Controlling
Take a look at Connect SDK. We offer this capability on Android, iOS, and PhoneGap/Cordova for the 2012, 2013, and 2014 model year LG Smart TVs. http://www.connectsdk.com/ http://connectsdk.com/apis/1-2-1/ios/volumecontrol/

Categories : Javascript

Is the C# or JIT compiler smart enough to handle this?
The C# compiler will not optimize this, and will emit just all operations for calling the property getters. The JIT compiler on the other hand, might do a better job by inlining those method calls, but won't be able to optimize this any further, because it has no knowledge of your domain. Optimizing this could theorethically lead to wrong results, since your object graph could be constructed as follows: var father = new Father { Child = new Child { Father = new Father { Child = new Child { Father = new Father { ... } } } }; Or does it take longer to run codesnippet #1? The answer is "Yes", it would take longer to run the first code snippet, because neither C# nor the JIT can optimize this away.

Categories : C#

SMART vector for RAW pointers in C++11?
"You" could write a simple wrapper to free the memory: struct PointVectorWrapper { vector<Point> points; ~PointVectorWrapper() { for (Point& p : points) { DeallocPoint(p); } } PointVectorWrapper& operator=(const PointVectorWrapper&) = delete; PointVectorWrapper(const PointVectorWrapper&) = delete; }; // Now the usage is simple and safe: PointVectorWrapper points; // ... populate points ... Foo(points.data(), points.size()) But this seems a little "adhoc". What's a more standard/reusable solution?

Categories : C++

Smart PHP compression code
Try it! Undefined constants are assumed to be strings. This is what it looks like with notices enabled: Notice: Use of undefined constant T - assumed 'T' in D:wwwhtdocs estindex.php on line 1 Notice: Use of undefined constant q - assumed 'q' in D:wwwhtdocs estindex.php on line 1 Deprecated: Function split() is deprecated in D:wwwhtdocs estindex.php on line 12 We're no strangers to love You know the rules and so do I [...] Never gonna say goodbye Never gonna tell a lie and hurt you

Categories : PHP

Are there any smart print methods in Python?
You can use collections.Counter if the order doesn't matter: >>> from collections import Counter >>> a = [2,2,2,1,1,1,1,1,1,1] >>> ",".join(("%s*%s" % (item, count) for item, count in Counter(a).iteritems())) '1*7,2*3'

Categories : Python

Hide URL bar without hiding Smart App Banner on iOS
I use: $(document).ready(function () { mob.SetUpEvents(); setTimeout(function () { if (jQuery("html.iphone").length > 0) { jQuery('html').css( "height", ( jQuery(window).height() + 60) + 'px'); window.ScrollTo(0, 1); } }, 400); }); I hope this helps!

Categories : Javascript

Using a different input for filtering using Smart Table
If you dig into the Smart-Table.debug.js file you will find this bit of code: angular.module("partials/globalSearchCell.html", []).run(["$templateCache", function($templateCache) { $templateCache.put("partials/globalSearchCell.html", "<div class="pull-left form-group"> " + " <input type="text" class="form-control" placeholder="Search" ng-model="searchValue"/ style="margin: 0;"> " + "</div>"); }]); Put whatever you want in there as an input as long as it has ng-model pointing to searchValue. If your situation is more complicated than that, let me know.

Categories : Angularjs

gtkmm manage/add vs smart pointers:
I don’t think it's practical to use shared_ptr for widgets if you don't need to keep a reference to that widget after you add it. You are better off having a managed widget instead using shared_ptr. The nice thing about the gtk::manage is that you can create the object on the heap and add it to the container and forget about it, and when that container is destroyed it will destroy the widget. As a general rule I create my widgets managed if I don't need to reference them after I add them to a container, if I do need to reference them, I allocate a pointer.

Categories : C++

Ajax uploadify on smart phones
uploadify will not work on even for the HTML5 release, You need to do some coding or you can use other tools like Aurigma or Plupload. You can also use an upload plugin for jQuery mobile, I think you will have the best answer in this discussion in jQuery forum.

Categories : Javascript

Is there a XMLout type command for XML::Smart?
From the POD: CREATING-XML-DATA ## Create a null XML object: my $XML = XML::Smart->new() ; ## Add a server to the list: $XML->{server} = { os => 'Linux' , type => 'mandrake' , version => 8.9 , address => '192.168.3.201' , } ; ## The data now: ## <server address="192.168.3.201" os="Linux" type="mandrake" version="8.9"/> ## Or save it directly: $XML->save('newfile.xml') ;

Categories : Perl

Update a smart pointer using a reference
Don't pass the address of a stack allocated object to a std::shared_ptr. toy will be destructed at the end of its scope and the std::shared_ptr will attempt to delete something that was not newd. The address held by a std::shared_ptr must be that of a dynamically allocated object (although a custom deleter can be provided, but that is not the case here). To change the object that a std::shared_ptr is managing use std::shared_ptr::reset().

Categories : C++



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