message

How do I raise the same Exception with a custom message in Python?

[亡魂溺海] 提交于 2019-12-02 13:52:56
I have this try block in my code: try: do_something_that_might_raise_an_exception() except ValueError as err: errmsg = 'My custom error message.' raise ValueError(errmsg) Strictly speaking, I am actually raising another ValueError , not the ValueError thrown by do_something...() , which is referred to as err in this case. How do I attach a custom message to err ? I try the following code but fails due to err , a ValueError instance , not being callable: try: do_something_that_might_raise_an_exception() except ValueError as err: errmsg = 'My custom error message.' raise err(errmsg) Johan

ejabberd 16.06 + mysql 5.5.50, message history is not saved

孤街醉人 提交于 2019-12-02 13:01:00
I use ejabberd 16.06 + mysql 5.5.50, message history is not saved. My ejabberd.yml: ## MySQL server: odbc_type: mysql odbc_server: "freldo" odbc_port: 3306 odbc_database: "ejabberd" odbc_username: "ejabberd" odbc_password: "ejabberd" modules: ... mod_mam: db_type: odbc default: always for the formation of the database structure, I used: mysql.sql I get an error: @ejabberd_sql:check_error:1039 SQL query 'SELECT timestamp, xml, peer, kind, nick FROM (SELECT timestamp, xml, peer, kind, nick FROM archive WHERE username='test' and bare_peer='misha@freldo' ORDER BY timestamp DESC limit 21) AS t

Java - Printing a message when data exceeds limit?

☆樱花仙子☆ 提交于 2019-12-02 12:37:47
I've got my code working, it's not pretty but it doe's the job :) Now I want to write a piece of code that stops the data from being loaded if there is 19 or more pieces of data in the text file and then display a message saying Invalid input for example. I'm not sure how to do this so any help would be appreciated. package stackandqueue; import java.util.*; import java.util.Stack; import java.util.Queue; import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.util.LinkedList; import java.util.StringTokenizer;

Count unreaded Number of missed call and message in Windows phone

送分小仙女□ 提交于 2019-12-02 12:24:47
How to display badge of unread message and call in windows phone 8 application? I want display notification count in my application icon when I open application at that time it will remove like call and message application. I know the tile notification but i don't know how remove badge when I open application Note: how to send and receive toast notification with badge I got the solution... Handle tile pragmatically in windows phone. ShellTile tile = ShellTile.ActiveTiles.First(); if (null != tile) { // create a new data for tile StandardTileData data = new StandardTileData(); tile foreground

show loading message while loading contents in asp using jquery ajax

本小妞迷上赌 提交于 2019-12-02 11:36:06
In my asp site i'm trying to fetch user details from Active directory on page load. I like to show "loading.gif" image untill I get details. Could some help me as i'm new to jquery Simple form of AJAX is the .get() method which should be enough for your needs. First of all, add a placeholder in your HTML where the loading image will appear then when you have the contents loaded, those contents will be placed instead of the image. For example: <div id="ContentsPlaceholder"></div> The jQuery code would now be: $(function() { $("#ContentsPlaceholder").html("<img src='Loading.gif' />"); $.get(

Infinite windows message loop

落爺英雄遲暮 提交于 2019-12-02 11:18:15
I have this message loop in my program: while (true) { if (PeekMessage(&msg, window, 0, 0, PM_REMOVE)) { if (msg.message == WM_QUIT) { MessageBox(NULL, L"Quit", L"", 0); break; } TranslateMessage(&msg); DispatchMessage(&msg); } else { Render(); } } This loop never ends. It never displays the message box even though main window disappears. Here is the WndProc code: switch (msg) { case WM_CLOSE : DestroyWindow(hwnd); break; case WM_DESTROY : PostQuitMessage(0); break; default : return DefWindowProc(hwnd, msg, wParam, lParam); break; } return 0; Could someone please help me? I am literally

Sencha Touch 2: tapping Ext.Msg.show that have no buttons

送分小仙女□ 提交于 2019-12-02 10:16:57
I want to display the popup message without any buttons. Ext.Msg.show({ title: '', message: 'Some text goes here...', buttons : [] }); It works fine. How to make it disappeared when you tap on it? I tried for you and i got what you want Ext.Msg.show({ title: 'Title', message: 'Some text goes here...', itemId : 'showMsg', buttons : [], listeners:[ { element: 'element', delegate: '', event: 'tap', fn: function() { this.hide(); } }] }); 来源: https://stackoverflow.com/questions/17596316/sencha-touch-2-tapping-ext-msg-show-that-have-no-buttons

Show a “Please Wait” Message or a Progress Bar while Files Download

可紊 提交于 2019-12-02 09:56:34
I use the following WordPress admin notice to prompt users to download some files. I would like to include either a progress bar or at least a "Downloading - Please wait" message while files are downloading. Any ideas? I've tried several jQuery solutions but could get nothing to work. I'm a total noob when it comes to jQuery. /* Ask user to download GeoIP database files. */ add_action( 'admin_notices', 'lsmi_dl_admin_notice' ); add_action( 'network_admin_notices', 'lsmi_dl_admin_notice' ); // also show message on multisite function lsmi_dl_admin_notice() { $dir = dirname( __FILE__ );

thinkphp5.1 Excel 文件上传(1)

做~自己de王妃 提交于 2019-12-02 09:09:55
1. 下载扩展包: composer require phpoffice/phpspreadsheet 2. html 页面 {include file="public/meta" /} <article class="page-container"> <form class="form form-horizontal" id="myform" enctype="multipart/form-data"> <div class="row cl" style="margin-bottom: 60px"> <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span> 单文件上传:</label> <div class="formControls col-xs-8 col-sm-9 skin-minimal"> <input class="amend-logo-img-choose-file" type="file" name="file" id=""> </div> </div> <hr> <div class="row cl" style="margin-top: 60px"> <label class="form-label col-xs-4 col-sm-3"><span class="c-red

VBS Replace message box instead of place on top

試著忘記壹切 提交于 2019-12-02 04:23:47
问题 I have this VBS script to create a message box. x=msgbox("The message" ,6, "Title") But if i run another script with a different message it puts it on top. The vbs is been called from a batch file with this code: @echo off & %temp%\message.vbs My question is how do i make it so it replaces the message rather than putting it on top. 回答1: VBScript allows replacing the text in the window, even from different scripts. Uses HTA, no temp files. showmessage "Time is " & now sub showmessage(text) '