我使用的IM不支持查看以前的聊天记录,也不能更改我的IM.所以我每次都要将聊天复制到文本文件中.
我正在使用Emacs.Is有哪些方法我可以突出显示包含参与者姓名的行如下所示?
===> **[Vivek Kumar]**
Hi, how are you doing!
===> **[Mr X Y Z]**
fine
===> **[Vivek Kumar]**
sdfksd;fks;
Run Code Online (Sandbox Code Playgroud)
编辑1:
早些时候,当我访问gvim时,我会使用该highlight.vim插件.
我正在学习shell脚本!同样我尝试在ubuntu终端上使用curl下载facebook页面.
t.sh内容
vi@vi-Dell-7537(Desktop) $ cat t.sh
curlCmd="curl \"https://www.facebook.com/vivekkumar27june88\""
echo $curlCmd
($curlCmd) > ~/Desktop/fb.html
Run Code Online (Sandbox Code Playgroud)
运行脚本时出错
vi@vi-Dell-7537(Desktop) $ ./t.sh
curl "https://www.facebook.com/vivekkumar27june88"
curl: (1) Protocol "https not supported or disabled in libcurl
Run Code Online (Sandbox Code Playgroud)
但是如果直接运行命令那么它工作正常.
vi@vi-Dell-7537(Desktop) $ curl "https://www.facebook.com/vivekkumar27june88"
<!DOCTYPE html>
<html lang="hi" id="facebook" class="no_js">
<head><meta chars.....
Run Code Online (Sandbox Code Playgroud)
如果有人让我知道我在剧本中所犯的错误,我将不胜感激.
我已经验证了curl库启用了ssl.
在下面的代码中获取编译器错误,这些代码std::exception 在linux上引入了g ++ 4.8.2.任何有关此错误即将发生的建议将非常有帮助.
#include <iostream>
#include <stdexcept>
void function()
{
std::exception e((char*)"mmmm");
throw e;
}
int main(int argc, const char* arg[]) {
try {
function();
}
catch(const std::exception& e) {
e.what();
}
return 0;
}
Run Code Online (Sandbox Code Playgroud)
错误:
$ g++ t.cpp
t.cpp: In function ‘void function()’:
t.cpp:6:33: error: no matching function for call to ‘std::exception::exception(char*)’
std::exception e((char*)"mmmm");
^
t.cpp:6:33: note: candidates are:
In file included from /usr/include/c++/4.8/ios:39:0,
from /usr/include/c++/4.8/ostream:38,
from /usr/include/c++/4.8/iostream:39,
from t.cpp:1:
/usr/include/c++/4.8/exception:63:5: note: std::exception::exception()
exception() _GLIBCXX_USE_NOEXCEPT { } …Run Code Online (Sandbox Code Playgroud) 我创建了一个用于创建gtk主窗口的简单类.
我想知道将类成员函数作为参数传递给G_CALLBACK函数的正确方法是什么?
为什么
g_signal_connect(button,"clicked",G_CALLBACK(&MainWindow:nButtonClicked),NULL);
不好?
#include <gtk/gtk.h>
class MainWindow {
public:
MainWindow();
~MainWindow();
void onButtonClicked(GtkWidget* button, gpointer* data);
void showWindow();
private:
GtkWidget* window;
GtkWidget* button;
};
MainWindow::MainWindow()
{
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
g_signal_connect(window, "delete_event", G_CALLBACK(gtk_main_quit), NULL);
button = gtk_button_new_with_label("click here");
g_signal_connect(button, "clicked", G_CALLBACK(&MainWindow: nButtonClicked), NULL);
gtk_container_add(GTK_CONTAINER(window), button);
}
MainWindow::~MainWindow()
{
}
void MainWindow::onButtonClicked(GtkWidget* button, gpointer* data)
{
g_printerr("button clicked\n");
}
void MainWindow::ShowWindow() {
gtk_widget_show_all(window);
}
int main(int argc, char* argv[]) {
gtk_init(&argc, &argv);
MainWindow mainWindow;
mainWindow.showWindow();
gtk_main();
return 0;
}
Run Code Online (Sandbox Code Playgroud) 我有一个要从 2 个地方使用的组件
<comp-a></comp-a>.当使用具有角度材质对话框的相同组件时,我必须注入以下依赖项
constructor(
public dialogRef: MatDialogRef<CTConfigurationComponent>,
@Inject(MAT_DIALOG_DATA) public dialogData: any,
) {}
Run Code Online (Sandbox Code Playgroud)
尝试使用@Optional(),@Skip()但没有成功。
问题 -1 : 1. 是否可以告诉 angular DI 跳过一些依赖项?
尝试过public injector: @Injector,并在构造函数调用中
this.dialogRef = this.injector.get(MatDialogRef<CTConfigurationComponent>);
Run Code Online (Sandbox Code Playgroud)
也不工作。
编辑-1:
(method) Injector.get(token: any, notFoundValue?: any)
Run Code Online (Sandbox Code Playgroud)
问题2:
notFoundValue的Injector.get时候,我们是通过构造函数做DI?任何建议或解释都会有所帮助
在Vim 7.3中,即使光标已经在第一行上,也要按“ K ” 键,或者进行复制等操作,都会有很多闪烁,并且缓冲区窗口也会使其颜色反转。
有什么办法可以解决它。
我有一条线的起点和终点坐标.我想在此末尾画出另一条线,使它们彼此垂直.
我试图使用普通几何体来做到这一点.MFC中是否存在任何高级API.
谢谢
在下面的代码中,有3个对象的d1和d2被创建用于执行push_back().一个是我创建时,一个是调用v.push_back()而另一个是实际复制到向量中{我不确定}.
如果不在C++ 03中使用std :: vector,最好的办法是避免这种情况吗?
#include <iostream>
#include <vector>
#include <string>
using namespace std;
struct Details
{
string fname;
string lname;
string address;
int age;
};
int main(int argc, char **argv)
{
vector<Details> v;
Details d1;
d1.fname = "vivek";
d1.lname = "kumar";
d1.address = "New Delhi";
d1.age = 25;
v.push_back(d1);
Details d2;
d2.fname = "some name";
d2.lname = "some lastname";
d2.address = "some address";
d2.age = 25;
v.push_back(d2);
return 0;
}
Run Code Online (Sandbox Code Playgroud) 创建一个如下所示的组件
<div class="test-search-field"
[ngClass]="{'expanding': expanding}">
<ng-content></ng-content>
</div>
Run Code Online (Sandbox Code Playgroud)
此组件的用户将input在使用此组件时添加一个元素。
<my-input-container>
<input type="search" placeholder="Search">
</my-input-container>
Run Code Online (Sandbox Code Playgroud)
我想从组件中获取这个输入元素,但是在使用@ContentChild.
@ContentChild('input') inputElemRef: ElementRef;
ngAfterContentInit() {
setInterval(() => {
console.log(this.inputElemRef);
}, 2000);
Run Code Online (Sandbox Code Playgroud)
但这inputElemRef总是未定义的。
谁能告诉我我在这里犯了什么错误。
试图用它的大写变体替换_(字符).例如:
hello_string_processing_in_python to helloStringProcessingInPython
Run Code Online (Sandbox Code Playgroud)
由于字符串在Python中是不可变的,如何有效地完成字符串替换?
ss = 'hello_string_processing_in_python'
for i in re.finditer('_(\w)', ss):
????
Run Code Online (Sandbox Code Playgroud) 如何创建ResponseBody用于模拟以下服务的对象?
public interface SBRestfulApi {
@FormUrlEncoded
@POST("authentication/google_login/")
Call<ResponseBody> auth(@Field("id_token") String idToken);
}
Run Code Online (Sandbox Code Playgroud)
编写了以下用于模拟的类,但无法创建MediaType它,因为它的构造函数是私有的。
处理它的任何替代方法。
我正在尝试根据表达式启用/禁用按钮,如下面的代码所示。
但是,只要curPage变量值更改,该按钮就不会再次启用。
如何在angularjs中处理这种情况?
<button
id="prevPage"
ng-click="prevPageBtnClicked($event)"
ng-disabled="{{curPage == 1}}">
Previous
</button>
<button
id="nextPage"
ng-click="nextPageBtnClicked($event)"
ng-disabled="{{curPage == totalPage}}">
Next
</button>
Run Code Online (Sandbox Code Playgroud)
更新1:控制器代码
var myController = app.controller("mainCtrl", function($scope, $http) {
$scope.logs = {};
$scope.curPageLogs = {};
$scope.itemPerPage = 15;
$scope.curPage = 1;
...
$scope.nextPageBtnClicked = function(event) {
if ($scope.curPage < $scope.totalPage) {
$scope.curPage += 1;
}
$scope.generateCurPageLogs();
}
$scope.prevPageBtnClicked = function(event) {
if ($scope.curPage > 1) {
$scope.curPage -= 1;
}
$scope.generateCurPageLogs();
}
Run Code Online (Sandbox Code Playgroud)