我刚刚开始学习F#,并尝试了来自wiki的代码:
我更喜欢使用制表符空格,所以我将代码更改为:
#indent "off"
open System
open System.Windows.Forms
let form = new Form(Visible=true, TopMost=true, Text="Welcome to F#")
let label =
let temp = new Label()
let x = 3 + (4 * 5)
temp.Text <- sprintf "x = %d" x
temp
form.Controls.Add(label)
[<STAThread>]
Application.Run(form)
Run Code Online (Sandbox Code Playgroud)
输出是:
Microsoft(R)F#2.0编译器版本4.0.30319.1版权所有(c)Microsoft Corporation.版权所有.
fstest2.fs(1,1):警告FS0062:此构造用于ML兼容性.考虑使用扩展名为".ml"或".mli"的文件.您可以使用'--mlcompatibility'或'--nowarn:62'禁用此警告.
fstest2.fs(9,2):错误FS0010:表达式中出现意外关键字'let'或'use'.预期'in'或其他标记.
fstest2.fs(13,1):错误FS0597:连续参数应该用spac es或tupled分隔,涉及函数或方法应用程序的参数应该用括号括起来
fstest2.fs(9,14):错误FS0374:赋值左侧的表达式无效
fstest2.fs(16,1):错误FS0010:定义中的意外标识符
猜猜错误是在let标签块的某个地方,但无法弄明白.
我的笔记本上有2个本地回购.第一个是Fresh.fossil(http://chiselapp.com/user/johnfound/repository/FreshIDE/
),位于C:\FASM\STUFFS
,第二个是book.fossil(http://clone:clone255@www.fossil-scm.org/schimpf-book book.fossil
),位于C:\Downloads\Software
.
我想更新第二个,所以我首先做的是fossil open book.fossil
,并且发生了错误:
C:\ Downloads\software\fossil.exe:存储库不存在或位于不可读的目录中:C:/Downloads/software/Fresh.fossil
更新第一个回购时没有发生此错误.知道为什么吗?
此 Python 代码以全屏方式显示图像:
blank_image = cv2.imread('blank.jpg')
cv2.namedWindow("bw", cv2.WND_PROP_FULLSCREEN)
cv2.setWindowProperty("bw", cv2.WND_PROP_FULLSCREEN, cv2.cv.CV_WINDOW_FULLSCREEN)
cv2.imshow("bw", blank_image)
cv2.waitKey(0)
Run Code Online (Sandbox Code Playgroud)
问题是代码将在没有键盘的 Linux 机器上运行。调用 waitKey 意味着 UI 处理要等到按键事件发生时才会进行,因此矛盾。
那么除了waitKey还有什么办法吗?
编辑-dialog.component.html
<div id="edit-dialog">
<table>
<tbody>
<tr>
<td><div mat-dialog-content>
<mat-form-field class="example-full-width">
<input matInput placeholder="Nama profil" #input1>
</mat-form-field>
</div></td>
<td><div mat-dialog-content>
<mat-form-field class="example-full-width">
<input matInput placeholder="MSISDN" #input2>
</mat-form-field>
</div></td>
<td><div mat-dialog-content>
<mat-form-field class="example-full-width">
<input matInput placeholder="Paket aktif" #input3>
</mat-form-field>
</div></td>
<td><div mat-dialog-content>
<mat-form-field class="example-full-width">
<input matInput placeholder="IMSI" #input4>
</mat-form-field>
</div></td>
<td> <div mat-dialog-content>
<mat-form-field class="example-full-width">
<input matInput placeholder="ACC" #input5>
</mat-form-field>
</div></td>
</tr>
<tr>
<td><div mat-dialog-content>
<mat-form-field class="example-full-width">
<input matInput placeholder="HPLMNwAcT" #input6>
</mat-form-field>
</div></td>
<td><div mat-dialog-content>
<mat-form-field class="example-full-width">
<input matInput …
Run Code Online (Sandbox Code Playgroud) 我已成功使用Angular mat-table来显示数据库中的数据:
<mat-form-field>
<input matInput (keyup)="applyFilter($event.target.value)" placeholder="Search">
</mat-form-field>
<mat-table #table [dataSource]="dataSource" matSort>
<ng-container matColumnDef="iccid">
<mat-header-cell *matHeaderCellDef mat-sort-header> ICCID </mat-header-cell>
<mat-cell *matCellDef="let element"> {{element.iccid}} </mat-cell>
</ng-container>
<ng-container matColumnDef="euicc">
<mat-header-cell *matHeaderCellDef mat-sort-header> EUICC </mat-header-cell>
<mat-cell *matCellDef="let element"> {{element.euicc}} </mat-cell>
</ng-container>
<ng-container matColumnDef="msisdn">
<mat-header-cell *matHeaderCellDef mat-sort-header> MSISDN </mat-header-cell>
<mat-cell *matCellDef="let element"> {{element.msisdn}} </mat-cell>
</ng-container>
<ng-container matColumnDef="status_paket_data">
<mat-header-cell *matHeaderCellDef mat-sort-header> Status paket data </mat-header-cell>
<mat-cell *matCellDef="let element"> {{element.status_paket_data}} </mat-cell>
</ng-container>
<ng-container matColumnDef="status_sms">
<mat-header-cell *matHeaderCellDef mat-sort-header> Status SMS </mat-header-cell>
<mat-cell *matCellDef="let element"> {{element.status_sms}} </mat-cell>
</ng-container> …
Run Code Online (Sandbox Code Playgroud) 我正在尝试构建一个涉及NDK的Android项目:CoolMicApp-Android(已经安装了最新的Android Studio和NDK)
我正确地遵循了建筑笔记。在Android Studio中加载项目时,会出现一些错误:
生成命令失败。
使用参数{NDK_PROJECT_PATH = null APP_BUILD_SCRIPT = C:\ Users \ Cipta-NB \ StudioProjects \执行'C:\ Users \ Cipta-NB \ AppData \ Local \ Android \ Sdk \ ndk-bundle \ ndk-build.cmd'时出错CoolMicApp-Android \ app \ src \ main \ jni \ Android.mk NDK_APPLICATION_MK = C:\ Users \ Cipta-NB \ StudioProjects \ CoolMicApp-Android \ app \ src \ main \ jni \ Application.mk APP_ABI = armeabi NDK_ALL_ABIS = armeabi NDK_DEBUG = 0 APP_PLATFORM = android-16 NDK_OUT = …
我的简单理解是OllyDbg是一个用户模式调试器,可用于调试"普通"应用程序.WinDbg是一个内核模式调试器,您可以使用它来调试自身.
是对的吗?
假设我有一个简单的文本,一杯不错的奶茶,它将与密钥12345进行XOR密码交换.
这个Java代码:
import sun.misc.BASE64Encoder;
import sun.misc.BASE64Decoder;
public class XORTest {
public static void main(String args[]){
String plaintext = "a nice cup of milk tea";
String key = "12345";
String encrypted = xor_encrypt(plaintext, key);
String decrypted = xor_decrypt(encrypted, key);
System.out.println("Encrypted: "+encrypted);
System.out.println("Decrypted: "+decrypted);
}
public static String xor_encrypt(String message, String key){
try {
if (message==null || key==null ) return null;
char[] keys=key.toCharArray();
char[] mesg=message.toCharArray();
BASE64Encoder encoder = new BASE64Encoder();
int ml=mesg.length;
int kl=keys.length;
char[] newmsg=new …
Run Code Online (Sandbox Code Playgroud) 我正在研究 Gmail API。假设我有兴趣查看哪封邮件包含字符串“foobar2000”。
到目前为止,这是我的代码:
主程序.java
package manhattan.email.bot;
import com.google.api.client.googleapis.javanet.GoogleNetHttpTransport;
import com.google.api.services.gmail.model.Message;
import com.google.api.services.gmail.model.MessagePart;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets;
import java.security.GeneralSecurityException;
import java.util.List;
import java.util.Properties;
import manhattan.email.bot.google.GmailCredentials;
import manhattan.email.bot.google.GmailService;
import manhattan.email.bot.google.GmailServiceImpl;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.codec.binary.StringUtils;
public class Main {
static final String MY_EMAIL = "xxxxx@gmail.com";
static final String MY_CLIENT_ID = "xxxxxapps.googleusercontent.com";
static final String MY_CLIENT_SECRET = "xxxxx";
static final String MY_ACCESS_TOKEN = "xxxxx";
static final String MY_REFRESH_TOKEN = "xxxxx";
public static void main(String[] args) {
try {
GmailService gmailService = …
Run Code Online (Sandbox Code Playgroud) 我刚才读这个:
在C ++(和C99)中,我们可以按引用传递,它提供与指针传递相同的性能。
因此,我尝试了以下简单代码:
#include <stdio.h>
void blabla(int& x){
x = 5;
}
int main(){
int y = 3;
printf("y = %d\n", y);
blabla(y);
printf("y = %d\n", y);
}
Run Code Online (Sandbox Code Playgroud)
输出为:
gcc test.c -o test -std=c99
test.c:3:16: error: expected ';', ',' or ')' before '&' token
test.c: In function 'main':
test.c:10:2: warning: implicit declaration of function 'blabla'
Run Code Online (Sandbox Code Playgroud)
现在我很困惑。C99确实支持引用传递吗?
angular ×2
java ×2
android ×1
android-ndk ×1
c99 ×1
cryptography ×1
debugging ×1
encryption ×1
f# ×1
fossil ×1
gmail ×1
gmail-api ×1
google-api ×1
indentation ×1
ollydbg ×1
opencv ×1
php ×1
python ×1
windbg ×1