size

GCC C++ “Hello World” program -> .exe is 500kb big when compiled on Windows. How can I reduce its size?

非 Y 不嫁゛ 提交于 2019-11-26 22:08:19
I just recently started learning C++ - I am using nuwen's version of MingW on Windows, using NetBeans as an IDE (I have also MSDN AA Version of MSVC 2008, though I don't use it very often). When compiling this simple program: #include <iostream> using namespace std; int dog, cat, bird, fish; void f(int pet) { cout << "pet id number: " << pet << endl; } int main() { int i, j, k; cout << "f(): " << (long)&f << endl; cout << "dog: " << (long)&dog << endl; cout << "cat: " << (long)&cat << endl; cout << "bird: " << (long)&bird << endl; cout << "fish: " << (long)&fish << endl; cout << "i: " << (long

Can a window be resized past the screen size/offscreen?

一个人想着一个人 提交于 2019-11-26 22:05:52
问题 My purpose is to size a window to a width/height greater than the size of my physical screen programmatically under Win32. How can I do this? On my systems it seems the maximum size of a given window is bound by the size of my screen whether programmatically or whether sizing manually by dragging the sizing cursor. I have tried programmatically with SetWindowPos() and MoveWindow() and both cap the size of the target window. Oddly I know some people do not have this 'cap' so I wonder whether

Is there an easy way to tell if a class/struct has no data members?

孤街浪徒 提交于 2019-11-26 22:03:07
问题 Hallo, is there some easy way in C++ to tell (in compile-time) if a class/struct has no data members? E.g. struct T{}; My first thought was to compare sizeof(T)==0 , but this always seems to be at least 1. The obvious answer would be to just look at the code, but I would like to switch on this. 回答1: Since C++11, you can use standard std::is_empty trait: https://en.cppreference.com/w/cpp/types/is_empty If you are on paleo-compiler diet, there is a trick: you can derive from this class in

Python Tkinter: Attempt to get widget size

*爱你&永不变心* 提交于 2019-11-26 21:48:17
问题 I am trying to find the size of my window by using the winfo_geometry() function but it ends up returning 1x1+0+0 I have also tried winfo_height, winfo_width but i keep getting 1 CODE from tkinter import * root=Tk() root.geometry('400x600') print (root.winfo_width()) print (root.winfo_height()) print (root.winfo_geometry()) root.mainloop() 回答1: You are trying to get the dimensions before the window has been rendered. Add a root.update() before the print s and it shows the correct dimensions.

How to change size of split screen emacs windows?

喜欢而已 提交于 2019-11-26 21:09:06
I have emacs split horizontally - on top I'm editing Perl code, the bottom is the shell. By default emacs makes the two windows equal in size, but I'd like the shell buffer smaller (maybe half the size?). I was wondering how I could do that. With the mouse, you can drag the window sizes around. Click anywhere on the mode line that is not otherwise 'active' (the buffer name is safe, or any unused area to the right hand side), and you can drag up or down. Side-to-side dragging requires a very precise click on the spot where the two mode lines join. C-x - ( shrink-window-if-larger-than-buffer )

Why QVector::size returns int?

被刻印的时光 ゝ 提交于 2019-11-26 21:09:00
问题 std::vector::size() returns a size_type which is unsigned and usually the same as size_t , e.g. it is 8 bytes on 64bit platforms. In constrast, QVector::size() returns an int which is usually 4 bytes even on 64bit platforms, and at that it is signed, which means it can only go half way to 2^32. Why is that? This seems quite illogical and also technically limiting, and while it is nor very likely that you may ever need more than 2^32 number of elements, the usage of signed int cuts that range

要开始准备找工作了,昨天闲时就自己写了个数据结构排序类,包括了堆排序,归并排序,速度排序,插入排序。...

 ̄綄美尐妖づ 提交于 2019-11-26 20:40:43
要开始准备找工作了,昨天闲时就自己写了个数据结构排序类,包括了堆排序,归并排序,速度排序,插入排序,正在继续完善中...... SortAlgorithm.h 代码如下: #pragma once #include <iostream> #include <vector> #include <cmath> using namespace std; class SortAlgorithm { public: SortAlgorithm(void); ~SortAlgorithm(void); void heapsort(vector<int> &n); void mergesort(vector<int> &n); void quicksort(vector<int> &n); void insertsort(vector<int> &n); private: void Down(vector<int> &n, int hole, int L); void mergeSort(vector<int> &n, vector<int> &tmp, int s, int e); void merge(vector<int> &n, vector<int> &tmp, int s, int mid, int e); void quickSort(vector<int> &n, int s,

What is the difference between Width and ActualWidth in WPF?

若如初见. 提交于 2019-11-26 20:28:54
I am currently working with Panel s in WPF, and I noticed that as regards the Width and Height properties, there are also two other properties called ActualWidth and ActualHeight . ActualWidth Gets the rendered width of this element. This is a dependency property. (Inherited from FrameworkElement.) Width Gets or sets the width of the element. This is a dependency property. (Inherited from FrameworkElement.) Reference: MSDN Can anyone point out the differences between the two and when to use either one ? Muad'Dib Width / Height is the requested or layout size. If you set to Auto, then the value

How to know the size of a variable in MATLAB

北城余情 提交于 2019-11-26 20:21:08
问题 I have variables in MATLAB, I've checked their class using class() but I also want to know the size that they take in the memory. More accurately, I know that they are of double type, and I want to make sure that they are 32-bit double and not 64-bit. The version of the MATLAB I'm using is R2009b. 回答1: You can use whos to obtain an array of structures that describe, amongst other things, the size in bytes of each variable. Note that a double is, by definition, 64-bit! 回答2: I wrote a simple

Completely remove (old) git commits from history

落爺英雄遲暮 提交于 2019-11-26 19:58:29
问题 I'm starting a project using git where I'll be committing very large files, but only a few times a week. I've tried to use git as-is and it seems to store the entire file in each commit where it is changed. This will not work for this project, the repository would grow out of control. So, I want to reduce the size of the repository. My first thought was to "simply" remove all commits older than say two weeks, or only keep e.g. five commits in the history (this is probably better :)) I've