content
stringlengths
263
5.24M
pred_label
stringclasses
1 value
pred_score_pos
float64
0.6
1
const FastMatMulBlock = new FastMatMulBlockClass(); const AttentionBlock = new AttentionBlockClass(); const ResidualBlock = new ResidualBlockClass(); const EmbedBlock = new EmbedBlockClass(); const DeEmbedBlock = new DeEmbedBlockClass(); const GeluBlock = new GeluBlockClass(); const LayerNormBlock = new LayerNormBlockC...
__label__POS
0.665209
package com.opslab; import com.opslab.helper.HexStrHelper; /** * 一些常用的常量 */ public final class Opslab { /** * 日期时间类型格式 */ public static final String DATETIME_FORMAT = "yyyy-MM-dd HH:mm:ss"; /** * 日期类型格式 */ public static final String DATE_FORMAT = "yyyy-MM-dd"; /** * 时...
__label__POS
0.997198
package com.opslab.util; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Collection; import java.util.Map; /** * 提供一些对象有效性校验的方法 */ @SuppressWarnings("rawtypes") public final class CheckUtil { /** * 判断字符串是否是符合指定格式的时间 * * @param date 时间字符串 * @param forma...
__label__POS
1.000004
package com.opslab.util; import com.opslab.helper.RegHepler; import com.opslab.helper.SysHepler; import com.opslab.util.algorithmImpl.FileTypeImpl; import java.io.*; import java.math.BigInteger; import java.net.FileNameMap; import java.net.URLConnection; import java.nio.ByteBuffer; import java.nio.channels.FileChanne...
__label__POS
0.998049
package com.opslab.util; import com.opslab.Opslab; import java.io.ByteArrayOutputStream; import java.io.OutputStreamWriter; import java.io.UnsupportedEncodingException; /** * Description: * 编码相关的封装类 */ public final class CharsetUtil { /** * 将字符编码转换成US-ASCII码 */ public final static String toASC...
__label__POS
0.99955
package com.opslab.util; import java.io.*; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; import java.util.zip.ZipInputStream; import java.util.zip.ZipOutputStream; /** * 压缩文档相关的工具类 * 注意因为jre中自带的java.util.zip.*包不支持中文及加密压缩,如果需要选择使用zip4j包 */ public final class ZIPUtil { /** * 文档压缩 * ...
__label__POS
0.992796
package com.opslab.util; import com.opslab.util.algorithmImpl.BCConvert; import com.opslab.util.algorithmImpl.StringImpl; import java.text.DecimalFormat; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * 提供些常用的字符串相关的工具方法...
__label__POS
0.999963
package com.opslab.util; import com.opslab.Opslab; import java.io.UnsupportedEncodingException; /** * 字符和字符序列常用方法 */ public final class CharUtil { /** * Converts (signed) byte to (unsigned) char. */ public static char toChar(byte b) { return (char) (b & 0xFF); } /** * Conv...
__label__POS
0.991548
package com.opslab.util; import com.opslab.helper.ClassHelper; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.net.URL; import java.util.Properties; /** * 配置相关的一些辅助类 */ public class ConfigUtil { /** * 获取配置文件资源 * * @return */ public static URL f...
__label__POS
0.99224
package com.opslab.util; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.*; import java.util.Enumeration; import java.util.HashMap; import java.util.Map; import java.util.Properties; /** * 提供一些常用的属性文件相关的方法 */ public final class PropertiesUtil { public static Logger logger = LoggerFacto...
__label__POS
0.998621
package com.opslab.util; import java.io.*; /** * 流相关的操作方法封装 */ public final class StreamUtil { /** * Read an input stream into a string */ public final static String streamToString(InputStream in) throws IOException { StringBuffer out = new StringBuffer(); byte[] b = new byte[4096]...
__label__POS
0.999106
package com.opslab.util; import java.io.PrintWriter; import java.io.StringWriter; /** * 异常处理的工具类 */ public final class ExceptionUtil { /** * 只返回指定包中的异常堆栈信息 * * @param e 异常信息 * @param packageName 只转换某个包下的信息 * @return string */ public static String stackTraceToString(Th...
__label__POS
0.9999
package com.opslab.useful; import com.opslab.helper.WebHelper; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequestWrapper; /** * 实现简单的xss过滤 */ public class XssHttpServletRequestWrapper extends HttpServletRequestWrapper { HttpServletRequest xssRequest = null; public ...
__label__POS
0.977433
package com.opslab.helper; import com.opslab.bean.ResultBean; import com.opslab.util.image.CaptchaUtil; import javax.imageio.ImageIO; import java.awt.*; import java.io.File; /** * 提供图片操作的常用方法 */ public final class ImageHelper { /** * 判断呢是否是图片 * * @param filePath 文件路径 * @return */ p...
__label__POS
0.999729
package com.opslab.helper; import com.opslab.bean.BeanStruct; import com.opslab.functions.PropertyFilter; import com.opslab.util.CheckUtil; import com.opslab.util.algorithmImpl.BeanFactory; import java.beans.IntrospectionException; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; i...
__label__POS
0.990032
package com.opslab.helper; import net.sourceforge.pinyin4j.PinyinHelper; import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType; import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat; import net.sourceforge.pinyin4j.format.HanyuPinyinToneType; import net.sourceforge.pinyin4j.format.HanyuPinyinVCharType; i...
__label__POS
0.99987
package com.opslab.helper; import com.opslab.Opslab; import com.opslab.util.CheckUtil; import java.io.ByteArrayOutputStream; import java.util.ArrayList; import java.util.Collections; import java.util.List; /** * 常用类型转换 */ public final class ConvertHepler { /** * 短整型与字节的转换 */ public static fina...
__label__POS
0.996959
package com.opslab.helper; import java.time.*; import java.time.format.DateTimeFormatter; import java.time.temporal.ChronoUnit; import java.time.temporal.TemporalAdjusters; import java.util.ArrayList; import java.util.List; /** * JAVA8时间工具类 */ public class Date8Helper { // 时间元素 public static final String Y...
__label__POS
0.999098
package com.opslab.helper; import com.opslab.Opslab; import com.opslab.util.StringUtil; import java.io.ByteArrayOutputStream; import java.io.OutputStreamWriter; import java.io.UnsupportedEncodingException; /** * Description: * 编码相关的封装类 */ public final class CharsetHepler { /** * 将字符编码转换成US-ASCII码 ...
__label__POS
0.999487
package com.opslab.helper; import com.opslab.util.AssertUtil; import com.opslab.util.ExceptionUtil; import com.opslab.util.FileUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.lang.reflect.Field; import j...
__label__POS
0.949184
package com.opslab.helper; import com.opslab.util.StringUtil; import javax.servlet.ServletRequest; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.UnsupportedEncodingException; import java.net.URLDecoder; import java.net.URL...
__label__POS
0.962844
package com.opslab.helper; import com.opslab.bean.TreeBean; import java.util.ArrayList; import java.util.List; import java.util.Objects; import java.util.stream.Collectors; public class TreeHepler { /** * 将具有父子关系的list集合转换为树形结构 * * @param list * @return */ public static List<TreeBean>...
__label__POS
0.991033
package com.opslab.helper; import com.opslab.util.encrypt.ASEUtil; import com.opslab.util.encrypt.Base64Ext; import com.opslab.util.encrypt.DESUtil; import com.opslab.util.encrypt.Decode; import java.math.BigInteger; import java.nio.charset.Charset; import java.security.MessageDigest; /** * 提供常见的加密方法 */ public cla...
__label__POS
0.999769
package com.opslab.helper; import com.opslab.Opslab; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * 提供一些常用的时间想法的方法 */ public final class DateHelper { //注意SimpleDateForma...
__label__POS
0.994284
package com.opslab.helper; import com.opslab.Opslab; import com.opslab.useful.SSLmiTM; import javax.net.ssl.HostnameVerifier; import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.SSLSession; import java.io.*; import java.net.HttpURLConnection; import java.net.URL; /** * 封装常见的HTTP方法 */ public final class ...
__label__POS
0.935007
package com.opslab.helper; import com.opslab.functions.ObjectFilter; import com.opslab.functions.ObjectHandler; import com.opslab.functions.ObjectProcess; import com.opslab.util.AssertUtil; import com.opslab.util.ZIPUtil; import com.opslab.util.encrypt.Base64; import org.slf4j.Logger; import org.slf4j.LoggerFactory; ...
__label__POS
0.998395
package com.opslab.helper; import com.opslab.util.ArrayUtil; import java.util.*; /** * 随机相关的方法封装 */ @SuppressWarnings("unchecked") public final class RandomHelper { public static final String ALLCHAR = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; public static final String...
__label__POS
0.999943
package com.opslab.helper; import com.opslab.Opslab; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * 提供一些常用的时间想法的方法 */ public final class Date6Helper { //注意SimpleDateFo...
__label__POS
0.994383
package com.opslab.helper; import com.opslab.Opslab; import com.opslab.util.CheckUtil; import com.opslab.util.PropertiesUtil; import com.sun.management.OperatingSystemMXBean; import java.lang.management.ManagementFactory; import java.net.Inet4Address; import java.net.InetAddress; import java.net.InterfaceAddress; imp...
__label__POS
0.996512
package com.opslab.helper; import com.opslab.Opslab; /** * 十六进制字符串相关的一些操作 */ public class HexStrHelper { private static String CHARS_HEX = "0123456789ABCDEF"; private static char[] HEX_CHARS = "0123456789ABCDEF".toCharArray(); /** * @return * @MethodName * @Author liaowenxiong * @De...
__label__POS
0.998046
package com.opslab.helper; import sun.misc.BASE64Decoder; import sun.misc.BASE64Encoder; import java.io.*; /** * 一些pdf的操作 */ public class PdfHelper { /** * Description: 将base64编码内容转换为Pdf * * @param base64编码内容,文件的存储路径(含文件名) */ public static void base64StringToPdf(String base64Content, St...
__label__POS
0.980647
package com.opslab.helper; import com.opslab.Opslab; import com.opslab.util.StringUtil; import com.opslab.util.web.URIPart; import javax.servlet.http.HttpServletRequest; import java.io.ByteArrayOutputStream; import java.io.UnsupportedEncodingException; import java.net.MalformedURLException; import java.net.URL; impor...
__label__POS
0.916502
package com.opslab.helper; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * Description: * 封装一些正则相关的操作 */ public final class RegHepler { /** * Alphanumeric characters */ public static final String REG_ALNUM = "\\p{Alnum}"; /** * Alphabetic characters */ pub...
__label__POS
0.999975
package com.opslab.helper; import com.opslab.Opslab; import com.opslab.util.CheckUtil; import com.opslab.util.algorithmImpl.BCConvert; import java.math.BigDecimal; import java.text.DecimalFormat; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.regex.Matcher; import java.ut...
__label__POS
0.999781
package com.opslab.helper; import com.opslab.functions.ObjectHandler; import com.opslab.functions.ObjectProcess; import com.opslab.util.CheckUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.util.*; /** * 集合对象的一些助手工具类 */ public final class CollectionHelper { private static Logger logge...
__label__POS
0.999895
package com.opslab.helper; import java.math.BigDecimal; import java.math.RoundingMode; /** * 提供一些数字相关的常规操作 */ public class NumberHelper { /** * 默认除法运算精度 */ private static final int DEF_DIV_SCALE = 10; /** * 提供精确的加法运算。 * * @param v1 被加数 * @param v2 加数 * @return 两个参数的和 ...
__label__POS
0.999175
package com.opslab.helper; import java.util.Set; /** * 一些中文相关的帮助类 */ public class ZhCnHepler { /** * 数字金额大写转换 先写个完整的然后将如零拾替换成零 * * @param n 数字 * @return 中文大写数字 */ public static String digitUppercase(double n) { String[] fraction = {"角", "分"}; String[] digit = {"零", "...
__label__POS
0.998632
package com.opslab.helper; import com.opslab.Opslab; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.UnsupportedEncodingException; import java.net.URLDecoder; import java.net.URLEncoder; import java.util.ArrayList; import ja...
__label__POS
0.99402
// 10.exercise.01.cpp // // Write a program that produces the sum of all the numbers in a file of // whitespace-separated integers. // // COMMENTS // // I could have done file reading and sum in the same step, without storaging // numbers in a vector, but I decide to separate it. For a simple task as this // it se...
__label__POS
0.952423
package com.opslab.util.algorithmImpl; import com.opslab.bean.BeanStruct; import com.opslab.util.CheckUtil; import java.beans.BeanInfo; import java.beans.IntrospectionException; import java.beans.Introspector; import java.beans.PropertyDescriptor; import java.lang.reflect.Field; import java.lang.reflect.Method; impor...
__label__POS
0.944516
package com.opslab.util.algorithmImpl; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.util.HashMap; import java.util.Iterator; import java.util.Map; /** * 利用文件头来实现的一些文件类型的方法封装 */ public class FileTypeImpl { public final static Map<String...
__label__POS
0.993238
// 10.drill.02.cpp // // Using the code and discussion in §10.4, prompt the user to input seven // (x,y) pairs. As the data is entered, store it in a vector of Points called // original_points. // // COMMMENTS // // I don't know if I must simply ask the user for seven Points or enforce it. // I will enforce. // W...
__label__POS
0.858026
package com.opslab.util.algorithmImpl; import com.opslab.util.StringUtil; /** * 提供对字符串的全角->半角,半角->全角转换 */ public class BCConvert { /** * ASCII表中可见字符从!开始,偏移位值为33(Decimal) */ static final char DBC_CHAR_START = 33; // 半角! /** * ASCII表中可见字符到~结束,偏移位值为126(Decimal) */ static final cha...
__label__POS
0.995511
package com.opslab.util.algorithmImpl; import com.opslab.util.CheckUtil; import com.opslab.util.FileUtil; import java.io.*; import java.nio.charset.Charset; import java.nio.charset.UnsupportedCharsetException; import java.util.List; /** * 文件编码相关的一些工具函数 */ public class FileEncodingUtil { /** * 把指定文件或目录转换成指...
__label__POS
0.999243
package com.opslab.util.algorithmImpl; import java.io.*; import java.nio.ByteBuffer; import java.nio.channels.FileChannel; /** * 封装了集中常用的文件读的方法 */ public class FileReadImpl { /** * 利用FileChannel直接实现文件的对拷,对于大文件速度特别明显 * * @param source * @param target */ public static void copyFileWi...
__label__POS
0.996904
package com.opslab.util.algorithmImpl; import com.opslab.Opslab; import com.opslab.helper.SysHepler; import java.io.UnsupportedEncodingException; /** * 对比俩个字符串的相似度 */ public class StringImpl { //第一种实现方式 private static String longestCommonSubstring(String strA, String strB) { char[] chars_strA = str...
__label__POS
0.998736
#include "awiki.h" Window* newwindow(void) { char buf[12]; Window *w; w = emalloc(sizeof(Window)); w->ctl = open("/mnt/wsys/new/ctl", ORDWR|OCEXEC); if(w->ctl<0 || read(w->ctl, buf, 12)!=12) error("can't open window ctl file: %r"); ctlprint(w->ctl, "noscroll\n"); w->id = atoi(buf); w->event = winopenfile(w,...
__label__POS
0.787244
package com.opslab.util.image; import com.opslab.util.FileUtil; import javax.imageio.ImageIO; import javax.imageio.ImageReadParam; import javax.imageio.ImageReader; import javax.imageio.stream.ImageInputStream; import java.awt.*; import java.awt.color.ColorSpace; import java.awt.image.BufferedImage; import java.awt.i...
__label__POS
0.989428
package com.opslab.util.image; import com.opslab.util.encrypt.Base64Ext; import com.opslab.util.image.GIF.GifEncoder; import javax.imageio.ImageIO; import java.awt.*; import java.awt.image.BufferedImage; import java.io.*; import java.util.Random; /** * 具体用于实现生成验证码图片的方法 */ public final class CaptchaUtil { prote...
__label__POS
0.943598
package com.opslab.util.image; import java.awt.*; import java.awt.image.BufferedImage; /** * 图片相关的操作类 */ public final class ImageUtil { /** * 重新设定图像的长高宽 * * @param originalImage 图像数据 * @param width 宽 * @param height 高 * @return */ public static BufferedImag...
__label__POS
0.999391
package com.opslab.util.image; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.imageio.ImageIO; import java.awt.image.BufferedImage; import java.io.File; /** * 图片比较 */ public final class ImageCompare { private static Logger logger = LoggerFactory.getLogger(ImageCompare.class); /** ...
__label__POS
0.950508
package com.opslab.util.image; import java.util.Random; /** * 生成图片验证码 */ public final class ImageCaptcha { //指定图片的宽度 private static int width = 200; //指定图片的高度 private static int height = 40; //指定所以的字符 public static String CHAR = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ...
__label__POS
0.999614
#include "awiki.h" void* emalloc(uint n) { void *p; p = malloc(n); if(p == nil) error("can't malloc: %r"); memset(p, 0, n); return p; } char* estrdup(char *s) { char *t; t = emalloc(strlen(s)+1); strcpy(t, s); return t; } char* estrstrdup(char *s, char *t) { char *u; u = emalloc(strlen(s)+strlen(t)+1...
__label__POS
0.803334
// 10.exercise.09.cpp // // Write a program that takes two files containing sorted whitespace-separated // words and merges them, preserving order. #include "std_lib_facilities.h" void get_words(const string& name, vector<string>& words) { ifstream ist{name}; if (!ist) error("Unable to open input file ", na...
__label__POS
0.795739
#pragma lib "libflate.a" #pragma src "/sys/src/libflate" /* * errors from deflate, deflateinit, deflateblock, * inflate, inflateinit, inflateblock. * convertable to a string by flateerr */ enum { FlateOk = 0, FlateNoMem = -1, FlateInputFail = -2, FlateOutputFail = -3, FlateCorrupted = -4, FlateInternal...
__label__POS
0.907063
package com.opslab.util.encrypt; import com.opslab.Opslab; import javax.crypto.Cipher; import javax.crypto.SecretKeyFactory; import javax.crypto.spec.DESedeKeySpec; import javax.crypto.spec.IvParameterSpec; import java.security.Key; /** * Created by 0opslab */ public class DESUtil { // 向量 private final st...
__label__POS
0.993565
#include <u.h> #include <libc.h> #include <bio.h> #include <thread.h> #include "win.h" Window* newwindow(void) { char buf[12]; Window *w; w = emalloc(sizeof(Window)); w->ctl = open("/mnt/wsys/new/ctl", ORDWR|OCEXEC); if(w->ctl<0 || read(w->ctl, buf, 12)!=12) error("can't open window ctl file: %r"); ctlprint(w...
__label__POS
0.754942
package com.opslab.util.encrypt; import com.opslab.Opslab; import javax.crypto.*; import javax.crypto.spec.SecretKeySpec; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.security.InvalidKeyException; import java.security.NoSuchAlgorithmException; import java.security.SecureRandom;...
__label__POS
0.938553
#include <u.h> #include <libc.h> #include <bio.h> #include <thread.h> #include <plumb.h> #include "dat.h" Window* newwindow(void) { char buf[12]; Window *w; w = emalloc(sizeof(Window)); w->ctl = open("/mnt/wsys/new/ctl", ORDWR|OCEXEC); if(w->ctl<0 || read(w->ctl, buf, 12)!=12) error("can't open window ctl file...
__label__POS
0.729232
package com.opslab.util.encrypt; import com.opslab.Opslab; import javax.crypto.Cipher; import java.io.ByteArrayOutputStream; import java.security.*; import java.security.interfaces.RSAPrivateKey; import java.security.interfaces.RSAPublicKey; import java.security.spec.PKCS8EncodedKeySpec; import java.security.spec.X50...
__label__POS
0.989248
package com.opslab.util.encrypt; import com.opslab.Opslab; import java.io.UnsupportedEncodingException; import java.util.Arrays; /** * Base64的编码和解码 */ public final class Base64 { private static final char[] CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".toCharArray(); private st...
__label__POS
0.930848
package com.opslab.util.encrypt; /** * Blowfish加密算法Java实现 */ public class Decode { /** * 比较安全的字符串转换 * * @param str * @return */ public static String str2HexStr(String str) { char[] chars = "0123456789ABCDEF".toCharArray(); StringBuilder sb = new StringBuilder(""); ...
__label__POS
0.999123
package com.opslab.util.ftp; import com.opslab.util.CheckUtil; import com.opslab.util.FileUtil; import org.apache.commons.net.ftp.FTPClient; import org.apache.commons.net.ftp.FTPFile; import org.apache.commons.net.ftp.FTPReply; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.*; import java.uti...
__label__POS
0.991282
package com.opslab.util.ftp; import com.opslab.Opslab; import java.util.HashMap; import java.util.Map; /** * FTP相关的一些配置 */ public class FTPConstant { /** * FTP状态码及其描述 */ public static Map<Integer, String> REPLYCODE = new HashMap<Integer, String>(); //用于编码转换 private static String ISO_ECODI...
__label__POS
0.99639
package com.opslab.util.ftp; import org.apache.commons.net.ftp.FTPClient; import java.io.File; import java.util.List; import java.util.Map; /** * FTP工具类 * * @require apache-commons-net.jar. */ public interface FTPUtil { //判断远程文件是否存在 public boolean isExists(String fileName); //下载远程文件 public bool...
__label__POS
0.999842
package com.opslab.util.web; import com.opslab.util.CharUtil; /** * Enumeration to identify the parts of a URI. * <p/> * Contains methods to indicate whether a given character is valid in a specific URI component. * * @see <a href="http://www.ietf.org/rfc/rfc3986.txt">RFC 3986</a> */ public enum URIPart { ...
__label__POS
0.993416
// 9.exercise.13.Math.cpp #include "9.exercise.13.Math.h" namespace Math { // Math functions int gcd(int a, int b) // Find greatest common divisor by Euclidean algorithm // See: https://en.wikipedia.org/wiki/Euclidean_algorithm { a = abs(a); // we need natural (positive numbers) b = abs(b); if (b > ...
__label__POS
0.645915
// 9.exercise.10.cpp // // Implement leapyear() from §9.8. // // COMMMENTS // // This is easy as we can get the algorithm from the Wikipedia // (https://en.wikipedia.org/wiki/Leap_year): // // Every year that is exactly divisible by four is a leap year, except for // years that are exactly divisible by 100...
__label__POS
0.641267
#include "std_lib_facilities.h" int main() { double total {0}; cout << "Look your pocket!\nHow many pennies do you have? "; int pennies {0}; cin >> pennies; total += pennies; cout << "How many nickels do you have? "; int nickels {0}; cin >> nickels; total += nickels*5; co...
__label__POS
0.990851
#include "std_lib_facilities.h" int main() { cout << "Enter the name of the person you want to write to: "; string first_name {" "}; cin >> first_name; cout << "Enter the age of this person: "; int age {0}; cin >> age; if (age <= 0 || age >= 110) simple_error("you're kidding!"); ...
__label__POS
0.872986
// 6.exericise.09.cpp // // Write a program that reads digits and composes them into integers. For // example, 123 is read as the characters 1, 2 and 3. The program should output // 123 is 1 hundred and 2 tens and 3 ones. The number should be output as an // int value. Handle numbers with one, two, three, or four digit...
__label__POS
0.770311
// 6.exercise.04.cpp // // Define a class Nmae_value that holds a string and a value. Rework exercise 19 in // chapter 4 to use vectoe<Name_value> instead of two vectors. // // 4.exercise.19.cpp // // Write a program where you first enter a set of name-and-value pairs, such as // Joe 17 and Barbara 22. For each pair...
__label__POS
0.652197
// 4.exercise.03.cpp // // Read a sequence of double values into a vector. Think of each value as the // distance between two cities along a given route. Compute and print the total // distance (the sum of all distances). Find and print the smallest and // greatest distance between two neighboring cities. Find and prin...
__label__POS
0.955973
// 4.exercise.14.cpp // // Modify the program described in the previous exercise to take an input value // max and then find all prime numbers from 1 to max. // // Previous exercise: // // Create a program to find all the prime numbers between 1 and 100. There is // a classic method for doing this, called "Sieve of Era...
__label__POS
0.748341
// 4.exercise.20.cpp // // Modify the program from exercise 19 so that when you enter a name, the // program will output the corresponding score or 'name not found'. #include "std_lib_facilities.h" bool name_in(string name, vector<string> names) { bool retval {false}; for (string x : names) if (x ==...
__label__POS
0.908684
// 4.exercise.13.cpp // // Create a program to find all the prime numbers between 1 and 100. There is // a classic method for doing this, called "Sieve of Eratosthenes". If you // don't know that method, get on the web and look it up. Write your program // using this method. // // Comments: // The method (as stated by...
__label__POS
0.647561
// 4.exercise.17.cpp // // Write a program that finds the min, max and the mode of a sequence of // strings. #include "std_lib_facilities.h" int main() { vector<string> sample; cout << "Write a series of strings (end the input with Ctrl+D): "; string element {""}; while (cin >> element) sampl...
__label__POS
0.995096
// 4.exercise.06.cpp // // Make a vector holding ten string values "zero", "one", ... "nine". // Use that in a program that converts a digit to its corresonding // spelled-out value; e.g. the input 7 gives the output seven. Hava // the same program, using the same input loop, convert spelled-out // numbers into their d...
__label__POS
0.947334
// 4.exercise.09.cpp // // Try to calculate the number of rice grains that the inventor asked for in // exercise 8 above. You'll find that the number is so large that it won't // fit in an int or a double. Observe what happens when the number gets too // large to represent exactly as an int and as a double. What is the...
__label__POS
0.99229
G 0 l 5.150 5.810 5.150 5.400 a 5.630 5.810 5.400 5.670 5.150 5.810 a 5.630 5.810 5.400 5.950 5.150 5.810 l 5.630 5.810 5.630 5.400 a 5.630 5.400 5.400 5.260 5.150 5.400 ; G 1 l 6.260 4.290 6.260 3.810 l 6.120 4.190 6.400 4.190 l 6.120 4.090 6.400 4.090 ; G 2 c 3.270 4.090 0.250 t 3.270 4.090 pelm,unicode,9 Term ; G 3 ...
__label__POS
0.953682
// 4.exercise.11.cpp // // Create a program to find all the prime numbers between 1 and 100. One way to // do this is to write a function that will check if a number is prime (i.e., // see if the number can be divided by a prime number smaller than itself) // using a vector of primes in order (so that if the vector is ...
__label__POS
0.996021
// 4.exercise.18.cpp // // Write a program to solve quadratic equations. A quadratic equation is of the // form: ax^2 + bx + c = 0 // If you don't know the quadratic formula for solving such an expression, do // some research. Remenber, researching how to solve a problem is often // necessary before a programmer can...
__label__POS
0.8787
// 4.exercise.16.cpp // // In the drill, you wrote a program that, given a series of numbers, found the // max and min of that series. The number that appears the most times in // a sequence is called the mode. Create a program that finds the mode of a set // of positive integers. #include "std_lib_facilities.h" int ...
__label__POS
0.990808
// 4.exercise.21.cpp // // Modify the program from exercise 19 so that when you enter an integer, the // program will output all the names with that score or score not found. #include "std_lib_facilities.h" bool name_in(string name, vector<string> names) { bool retval {false}; for (string x : names) ...
__label__POS
0.790487
// 4.exercise.15.cpp // // Write a program that takes an input value n and then finds the first // n primes. // // Comments: // I don't think that the Sieve of Eratosthenes is useful in this problem. // We need to simply iterate over natural numbers testing them being prime or // not, until we found the desired numb...
__label__POS
0.999586
// 4.exercise.05.cpp // // Write a program that performs as very simple calculator. Your calculator // should be able to handle the four basic math operations - add, substract, // multiply, and divide - on two input values. Your program should prompt the // user to enter three arguments: two double values and a charact...
__label__POS
0.927888
本文来自 [Mike Ash](https://www.mikeash.com/) 的 [NSObject: the Class and the Protocol](https://mikeash.com/pyblog/friday-qa-2013-10-25-nsobject-the-class-and-the-protocol.html) ,主要是关于 Objective C 为什么会有叫 `NSObject` 的 class 和 protocol. ---- Reader Tomas Bouda 问:`NSObject` protocol 什么鬼?Cocoa 中有两个 NSObjects,一个 class 和一个 pro...
__label__POS
0.989627
// 4.exercise.04.cpp // // Write a program to play a numbers guessing game. The user thinks of a number // between 1 and 100 and your program ask questions to figure out what the // number is (e.g., "Is the number you are thinking of less than 50?"). Your // program should be able to identify the number after asking no...
__label__POS
0.710409
本文来自 [Mike Ash](https://www.mikeash.com/) 的 [Objective-C Message Forwarding](https://www.mikeash.com/pyblog/friday-qa-2009-03-27-objective-c-message-forwarding.html),主要介绍的是 Objective-C 的消息转发机制。 ---- Yuji Tachikawa 建议说说 `@dynamic` properties 的工作机制,接下来我将谈谈这个,并将话题扩展到更普遍的消息转发机制。 ### No Such Method 上周我介绍了下 Objective-C ...
__label__POS
0.776007
// 4.exercise.19.cpp // // Write a program where you first enter a set of name-and-value pairs, such as // Joe 17 and Barbara 22. For each pair, add the name to a vector called names // and the numbers to a vector called scores (in corresponding positions, so // that if names[7]=="Joe" the scores[7]==17). Terminate inp...
__label__POS
0.916951
// 5.exercise.10.cpp // // Write a program that writes out the first so many values of the Fibonacci // series, that is, the series that starts with 1 1 2 3 5 8 13 21 34. The next // number of the series is the sum of the two previous ones. Find the largest // Fibonacci nomber that fits in an int. // // Comments: // S...
__label__POS
0.720046
// 5.exercise.09.cpp // // Modify the program from exercise 8 to write an error if the result cannot be // represented as an int // // Comments: // In Linux I test this program with: // // ( (( N = RANDOM/32 )); echo $N; for i in $(seq $RANDOM); do echo (( RANDOM // - 16536 )); done; echo '|' ) | ./a.out // // It...
__label__POS
0.731025
// 5.exercise.03.cpp // // Absolute zero is the lowest temperature that can be reached; it's -273.15 // ºC, or 0K. The above program, even when corrected, will produce erroneous // results when given a temperature below this. Place a check in the main // program that will produce an error if a temperature is given bel...
__label__POS
0.782659
// 5.10.1.try_this.cpp // // Find a pair of values so that the pre-condition of this version of area // holds, but the post-condition doesn't // // Comments: // As stated in 5.5.3.try_this.cpp, depending on the representational range of // int type, the product of two positive int variables could result, by // overf...
__label__POS
0.933873
// 5.exercise.08.cpp // // Write a program that reads and stores a series of integers and then computes // the sum of the first N integers. First ask for N, then read de values into // a vector, then calculate the sum of the first N values. For example: // // "Please enter the number of values you want to sum:" // // ...
__label__POS
0.735336
// 8.exercise.04.cpp // // An int can hold integers only up to a maximum number. Find an approximation // of that maximum number by using fibonacci(). // // COMMENTS // // As done in previous exercise I don't check for sign on x and y arguments of // fibonacci(). This lets me approximate also the minimum number ...
__label__POS
0.717889
// 8.exercise.09.cpp // // Write a function that given two vector<double>s price and weight computes a // value (an "index") that is the sum of all price[i]*weight[i]. Make sure to // have a weight.size()==price.size(). #include "std_lib_facilities.h" double index(const vector<double>& u, const vector<double>& v) ...
__label__POS
0.980327
# Filter内存马 Filter,顾名思义,是过滤器,在请求到达Servlet前对请求进行过滤和处理。 ![img](assets/img-20250708115736-uahklkv.png) 如图,请求会先到达Filter,最后再传递给Servlet。 我们先定义一个Filter ```java package com.example.memshell; import jakarta.servlet.FilterChain; import jakarta.servlet.ServletException; import jakarta.servlet.http.HttpFilter; import jakarta...
__label__POS
0.63773
import com.sun.tools.attach.VirtualMachine; import java.io.BufferedReader; import java.io.InputStreamReader; import java.net.URL; import java.security.ProtectionDomain; public class test { public static void main(String[] args) throws Exception{ String pid = getPID("org.apache.catalina.startup.Bootstrap")...
__label__POS
0.987412
package com.example.demo.demos.web; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.context.WebApplicationContext; import org.springframework.web.context.request.RequestContextHolder; import org.springframework...
__label__POS
0.905853