size

Why are my WPF window sizes defaulting to be huge

送分小仙女□ 提交于 2019-11-28 06:58:27
问题 I have a wpf application with a few forms. At design time they are small, and they are not set to auto size. However at run time they are giant, even with no content in them to make them big. Why is this happening? Here is one of the forms <Window x:Class="SuperPluginPicker" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas

How many characters in varchar(max)

假装没事ソ 提交于 2019-11-28 06:43:14
How many characters can a SQL Server 2008 database field contain when the data type is VARCHAR(MAX)? From http://msdn.microsoft.com/en-us/library/ms176089.aspx varchar [ ( n | max ) ] Variable-length, non-Unicode character data. n can be a value from 1 through 8,000. max indicates that the maximum storage size is 2^31-1 bytes. The storage size is the actual length of data entered + 2 bytes. The data entered can be 0 characters in length. The ISO synonyms for varchar are char varying or character varying. 1 character = 1 byte. And don't forget 2 bytes for the termination. So, 2^31-3 characters.

Does the size of the integer or any other data types in C dependent on the underlying architecture?

别说谁变了你拦得住时间么 提交于 2019-11-28 06:39:29
问题 #include<stdio.h> int main() { int c; return 0; } // on Intel architecture #include <stdio.h> int main() { int c; return 0; }// on AMD architecture /* Here I have a code on the two different machines and I want to know the 'Is the size of the data types dependent on the machine ' */ 回答1: see here: size guarantee for integral/arithmetic types in C and C++ Fundamental C type sizes are depending on implementation (compiler) and architecture, however they have some guaranteed boundaries. One

$_FILE upload large file gives error 1 even though upload_max_size is bigger than the file size

北慕城南 提交于 2019-11-28 06:19:38
I have a simple upload form with: enctype="multipart/form-data"/> and input type="hidden" name="MAX_FILE_SIZE" value="5900000" /> And the following settings, that are applied (checked through phpini()) in php.ini: upload_max_filesize = 7MB memory_limit = 64M post_max_size = 8MB I try to upload a file that is small - 500k and it goes through I try to upload a file that is 5MB (smaller than both upload_max_filesize and post_max_size settings) and it fails with error code 1: which says is: UPLOAD_ERR_INI_SIZE Value: 1; The uploaded file exceeds the upload_max_filesize directive in php.ini. Anyone

C++ explicit关键字

时光总嘲笑我的痴心妄想 提交于 2019-11-28 05:46:36
首先, C++中的explicit关键字只能用于修饰只有一个参数的类构造函数, 它的作用是表明该构造函数是显示的, 而非隐式的, 跟它相对应的另一个关键字是implicit, 意思是隐藏的,类构造函数默认情况下即声明为implicit(隐式). 那么显示声明的构造函数和隐式声明的有什么区别呢? 我们来看下面的例子: class CxString // 没有使用explicit关键字的类声明, 即默认为隐式声明 { public: char *_pstr; int _size; CxString(int size) { _size = size; // string的预设大小 _pstr = malloc(size + 1); // 分配string的内存 memset(_pstr, 0, size + 1); } CxString(const char *p) { int size = strlen(p); _pstr = malloc(size + 1); // 分配string的内存 strcpy(_pstr, p); // 复制字符串 _size = strlen(_pstr); } // 析构函数这里不讨论, 省略... }; // 下面是调用: CxString string1(24); // 这样是OK的, 为CxString预分配24字节的大小的内存 CxString

Why is my C++ executable so big? [duplicate]

北城余情 提交于 2019-11-28 05:43:38
问题 Possible Duplicate: GCC C++ “Hello World” program -> .exe is 500kb big when compiled on Windows. How can I reduce its size? I've just started reading some C++ online tutorials and the first lesson was the Hello World program. When I compile the program to an executable, the size is over 400kb even though it's just a simple Hello World console program. Should it be this big? If not, why is it happening? Am I doing something wrong? Here is the source: #include <iostream> using namespace std;

Find files with size in Unix [closed]

会有一股神秘感。 提交于 2019-11-28 05:40:00
I am looking for a Unix command to print the files with its size. I used this but it didn't work. find . -size +10000k -print. I want to print the size of the file along with the filename/directory. find . -size +10000k -exec ls -sd {} + If your version of find won't accept the + notation (which acts rather like xargs does), then you might use (GNU find and xargs , so find probably supports + anyway): find . -size +10000k -print0 | xargs -0 ls -sd or you might replace the + with \; (and live with the relative inefficiency of this), or you might live with problems caused by spaces in names and

图片压缩

独自空忆成欢 提交于 2019-11-28 05:13:14
将图片压缩成jpg或png $type = explode('/', $file->type); $mainType = $type[0]; $subType = $type[1]; $isImage = $mainType == 'image'; $isGif = $subType == 'gif';//gif压缩会变静态的,所以过滤掉 if ($isImage) { $maxSize = 1024 * 1024; if (!$isGif) { //图片进行压缩 $file->data = $this->compressImage($file->data, $maxSize); } //生成文件 } function compressImage($data, $maxSize, $percent = 1) { $size = strlen($data); if ($size <= $maxSize) { return $data; } $img = imagecreatefromstring($data); $width = imagesx($img); $height = imagesy($img); $newWidth = $width * $percent; $newHeight = $height * $percent; $newImg =

CentOS7.x系统根目录分区扩容

…衆ロ難τιáo~ 提交于 2019-11-28 05:09:20
说明:系统版本为 Linux version 3.10.0-327.el7.x86_64 step1. 查看现有磁盘信息,可以看出根分区有45G [root@DEV-CMDB-DB02 ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/centos_mb--centos7-root 45G 9.8G 35G 23% / devtmpfs 5.9G 0 5.9G 0% /dev tmpfs 5.9G 84K 5.9G 1% /dev/shm tmpfs 5.9G 8.9M 5.9G 1% /run tmpfs 5.9G 0 5.9G 0% /sys/fs/cgroup /dev/sda1 497M 142M 356M 29% /boot tmpfs 1.2G 16K 1.2G 1% /run/user/42 tmpfs 1.2G 0 1.2G 0% /run/user/0 step2. 查看新增加的磁盘信息 [root@DEV-CMDB-DB02 ~]# fdisk -l Disk /dev/sda: 53.7 GB, 53687091200 bytes, 104857600 sectors Units = sectors of 1 * 512 = 512 bytes Sector size

[APIO2009]抢掠计划

匆匆过客 提交于 2019-11-28 04:52:31
洛咕 题意:Siruseri 城中的道路都是单向的。 \(M\) 条道路由 \(N(N,M<=500000)\) 个路口连接。按照法律的规定, 在每个路口都设立了一个 Siruseri 银行的 ATM 取款机。令人奇怪的是,Siruseri 的酒吧也都设在路口,虽然并不是每个路口都设有酒吧。Banditji 计划实施 Siruseri 有史以来最惊天动地的 ATM 抢劫。他将从市中心 出发,沿着单向道路行驶,抢劫所有他途径的 ATM 机,最终他将在一个酒吧庆 祝他的胜利。使用高超的黑客技术,他获知了每个 ATM 机中可以掠取的现金数额。他希 望你帮助他计算从市中心出发最后到达某个酒吧时最多能抢劫的现金总数。他可 以经过同一路口或道路任意多次。但只要他抢劫过某个 ATM 机后,该 ATM 机 里面就不会再有钱了.求Banditji最多能抢劫到多少钱? 分析:tarjan缩点后,整个图变成了一个有向无环图,我们从起点所在的强连通分量开始跑spfa最长路即可. #include<iostream> #include<cstdio> #include<algorithm> #include<cstring> #include<cmath> #include<queue> #include<map> #include<set> #define ll long long using