messages

Customize Authentication - Login Symfony2 Messages

谁说胖子不能爱 提交于 2019-11-27 13:13:15
So I'm reading the security chapter of Symfony2 Book. I understand everything, but I'd like to customize the error message if a there is a login error. In which file can I change this? This is the template: {% if error %} <div>{{ error.message }}</div> {% endif %} <form action="{{ path('login_check') }}" method="post"> <label for="username">Username:</label> <input type="text" id="username" name="_username" value="{{ last_username }}" /> <label for="password">Password:</label> <input type="password" id="password" name="_password" /> {# If you want to control the URL the user is redirected to

Java, How to get number of messages in a topic in apache kafka

試著忘記壹切 提交于 2019-11-27 06:24:32
I am using apache kafka for messaging. I have implemented the producer and consumer in Java. How can we get the number of messages in a topic? The only way that comes to mind for this from a consumer point of view is to actually consume the messages and count them then. The Kafka broker exposes JMX counters for number of messages received since start-up but you cannot know how many of them have been purged already. In most common scenarios, messages in Kafka is best seen as an infinite stream and getting a discrete value of how many that is currently being kept on disk is not relevant.

h:messages does not display messages when p:commandButton is pressed

旧城冷巷雨未停 提交于 2019-11-27 04:33:55
I have a problem with the h:messages tag in JSF that simply does not show any messages. In the Glassfish log are no errors when I click the button. The setup is as follows: test.xhtml: <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui" xmlns:j="http://primefaces.org/ui" xmlns:f="http://java.sun.com/jsf/core"> <h:head> <title>test</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> </h:head> <h:body> <h:messages globalOnly="true"/> <h:form id="loginform"> <p

Android - Hide all shown Toast Messages

冷暖自知 提交于 2019-11-27 03:37:10
How do I remove all toast messages currently displayed? In my App, there is a list, when a user clicks on an item, a toast message is displayed, 10 items - 10 toast messages. So if the user clicks 10 times, then presses the menu button, they have to wait for some seconds until they're able to read the menu option text. It shouldn't be like that :) Mudar My solution was to initialize a single Toast in the activity. Then changing its text on each click. Toast mToast = Toast.makeText(this, "", Toast.LENGTH_SHORT); if (a) { mToast.setText("This is a"); mToast.show(); } else if (b) { mToast.setText

What is the difference between WM_QUIT, WM_CLOSE, and WM_DESTROY in a windows program?

戏子无情 提交于 2019-11-27 02:53:46
I was wondering what the difference between the WM_QUIT, WM_CLOSE, and WM_DESTROY messages in a windows program, essentially: when are they sent, and do they have any automatic effects besides what's defined by the program? adf88 They are totally different. WM_CLOSE is sent to the window when "X" is pressed or "Close" is chosen from window menu. If you catch this message this is your call how to treat it - ignore it or really close the window. By default, WM_CLOSE passed to DefWindowProc causes window to be destroyed. When the window is being destroyed WM_DESTROY message is sent. In this stage

Grails - getting a message value from controller

北慕城南 提交于 2019-11-27 00:28:39
问题 How can I get a value from message properties outside of GSPs? For instance, the equivalent of <g:message code="some.message"/> but in a controller? 回答1: Inside a controller or a taglib, you can use the following : g.message(code: 'some.message') However, inside domain classes or services, you need to inject messageSource and call getMessage() method from Sping class AbstractMessageSource. This snippet shows you how to do that: import org.springframework.context.i18n.LocaleContextHolder as

How many database columns associated with a SMS in android?

倾然丶 夕夏残阳落幕 提交于 2019-11-26 22:42:03
问题 I want to read all the messages and their respective details from my phone. For this I am using the Uri like this: Uri sms = Uri.parse("content://sms/"); But I don't know how many columns in database which are associated with this uri. I want to display the following information: Message Type Sender Number Message Body Timestamp Please can anybody enumerate the total column names? 回答1: package com.readsms; import android.app.Activity; import android.content.ContentResolver; import android

Instagram login programmatically

北城余情 提交于 2019-11-26 20:16:35
问题 I'm trying to programmatically login to Instagram via my own website because I want to retrieve direct messages from Instagram (this requires a login as it is not supported in the Instagram API (yet)). But the Instagram login page requires cookies to login. I keep getting the message that the page could not be loaded and that I might need to enable cookies. Is there any way possible to login programmatically via PHP to Instagram? This is what I have so far. $ch = curl_init('https://instagram

Disable messages upon loading a package

筅森魡賤 提交于 2019-11-26 18:51:16
I have a package in R (ROCR) that I need to load in my R environment. Upon loading the package, a set of messages are printed. This is ordinarily fine, but since the output of my R script is being used for further analysis I want to completely disable all of this output. How do I do that? Furthermore, I'd prefer to do it without having to modify ROCR at all, so that future users of this script don't have to do that either. So far: sink() doesn't work here - redirecting both stdout and std err to /dev/null does nothing for me. Unsurprisingly, options(warnings=-1) does nothing either, since

Customize Authentication - Login Symfony2 Messages

女生的网名这么多〃 提交于 2019-11-26 18:15:56
问题 So I'm reading the security chapter of Symfony2 Book. I understand everything, but I'd like to customize the error message if a there is a login error. In which file can I change this? This is the template: {% if error %} <div>{{ error.message }}</div> {% endif %} <form action="{{ path('login_check') }}" method="post"> <label for="username">Username:</label> <input type="text" id="username" name="_username" value="{{ last_username }}" /> <label for="password">Password:</label> <input type=