- 博客(44)
- 资源 (1)
- 收藏
- 关注
原创 关于pytorch官网教程中的What is torch.nn really?(三)
What is torch.nn really?的最后一部分内容,包括CNN和GPU
2022-12-26 12:45:30 515 1
原创 关于pytorch官网教程中的What is torch.nn really?(二)
使用`torch.nn.functional`,`nn.Module`,`nn.Parameter`,`nn.Linear`,`optim`,`Dataset`,and `DataLoader`重构了之前手搓的神经网络
2022-12-17 13:06:31 489
原创 关于pytorch官网教程中的What is torch.nn really?(一)
pytorch官网教程中What is torch.nn really?的一些学习体会
2022-12-15 11:21:41 555
原创 关于jupyter notebook、pytorch、cuda、anaconda的一些问题(更新中)
使用jupyter notebook+pytorch中的一些问题
2022-11-09 16:06:52 295
原创 关于刷新Listview中model
这是在解决如标题所说问题时在stackflow上搜到的一篇帖子,确实解决了问题Refresh QML Listview from Slot
2021-12-15 11:02:06 444
原创 用c++/qml/js 获取高德地图逆地理编码
当然,这里只是大体描述一下这个流程,无需纠结一些细节,比方说一些设置啊,样式啊等等。首先,是几个资源文件,我把相关的html、js都加到了资源文件里边,不想加的当然也可以。其中qwebchannel.js是qt官方提供的必须的文件,具体就不说了。其它几个文件如下:map.html<!doctype html><html lang="en"> <head> <meta charset="utf-8"> <meta http
2021-12-01 11:31:25 1180
原创 postgres批量删除多表数据的一个存储过程
create or replace procedure del_data_gt_6_months() as $$declare my_tablename record ; tablename_cur cursor for select tablename from pg_tables where tablename like 'dds%';begin for my_tablename in tablename_cur loop 10',my_tablename.table
2021-11-17 10:06:27 836 1
原创 QT 插件开发的一些问题
用Creator创建plugin工程时,到了这一步之后,Creator就会创建几个文件,这些就不多说了。看生成的test.h文件:#ifndef TEST_H#define TEST_H#include <QGenericPlugin>class test : public QGenericPlugin{ Q_OBJECT Q_PLUGIN_METADATA(IID QGenericPluginFactoryInterface_iid FILE "untitled
2021-08-18 21:59:50 921
原创 Qt 使用openssl库
然而为了能够运行,还需要在编译生成文件的目标目录中也放一份,或者通过设置环境变量来确保程序可以找得到这些文件。安装QT时如果选择了支持openssl,那么qt就会编译一个版本的openssl库,通常会放在几个地方,这里就不多说了,在安装目录找一找就是。实际上qt自己差不多也是用的同样文件名的几个文件,之所以不使用qt自带的库,是懒得一个个找了,而且也不确定自己的程序能用。这里想说的是,在运行的时候,程序一定要能够找得到上面图片里边的这几个文件,不论是在系统环境变量中设置。相应的,在pro文件中加上。...
2021-04-13 15:57:50 2652
原创 Libevent book 笔记(11) Connection listeners accepting TCP connections
文章目录Creating or freeing an evconnlistenerevconnlistener_newevconnlistener_new_bindevconnlistener_freeRecognized flagsThe connection listener callbackEnabling and disabling an evconnlistenerevconnlistener_disableevconnlistener_enableAdjusting an evconnliste
2020-05-26 18:40:56 333
原创 Libevent book 笔记(10) Evbuffers utility functionality for buffered IO
文章目录Creating or freeing an evbufferevbuffer_newevbuffer_freeEvbuffers and Thread-safetyevbuffer_enable_lockingevbuffer_lockevbuffer_unlockInspecting an evbufferevbuffer_get_lengthevbuffer_get_contiguous_spaceAdding data to an evbuffer: basicsevbuffer_addev
2020-05-26 18:35:59 386
原创 Libevent book 笔记(9) Bufferevents advanced topics
文章目录Paired buffereventsbufferevent_pair_newbufferevent_pair_get_partnerFiltering buffereventsbufferevent_filter_newLimiting maximum single read/write sizebufferevent_set_max_single_readbufferevent_set_max_single_writebufferevent_get_max_single_readbufferev
2020-05-26 18:10:44 473
原创 Libevent book 笔记(8) Bufferevents concepts and basics
文章目录Bufferevents and evbuffersCallbacks and watermarksDeferred callbacksOption flags for buffereventsWorking with socket-based buffereventsCreating a socket-based buffereventbufferevent_socket_newLaunching connections on socket-based buffereventsbuffereven
2020-05-26 17:53:00 287
原创 Libevent book 笔记(7) Utility and portability functions
Helper functions and types for Libevent文章目录Helper functions and types for LibeventBasic typesevutil_socket_tStandard integer typesMiscellaneous compatibility typesTimer portability functionsevutil_timeraddevutil_timersubevutil_timerclearevutil_timerissete
2020-05-26 17:19:46 346
原创 Libevent book 笔记(6) Working with events
文章目录Constructing event objects`event_new()/event_free()`例子The event flagsAbout Event PersistenceCreating an event as its own callback argumentevent_self_cbarg例子Timeout-only eventsConstructing signal events例子Caveats when working with signalsSetting up event
2020-05-26 17:12:24 346
原创 Libevent book 笔记(5) Running an event loop
文章目录Running the loopevent_base_loopevent_base_dispatchStopping the loop接口例子: Shut down immediately例子: Run an event loop for 10 seconds, then exit.Re-checking for eventsevent_base_loopcontinueChecking the internal time cacheevent_base_gettimeofday_cachedeve
2020-05-26 16:22:02 214
原创 Libevent book 笔记(4) Getting an event_base
文章目录Creating an event_baseSetting up a default event_baseevent_base_newSetting up a complicated event_baseevent_configevent_config_avoid_methodevent_config_require_featuresevent_config_set_flagevent_config_set_num_cpus_hintevent_config_set_max_dispatch_int
2020-05-26 16:15:06 224
原创 Libevent book 笔记(3) Setting up the Libevent library
文章目录Log messages in Libevent接口例子调试记录Handling fatal errors接口Memory management接口例子注意Locks and threadingPtheads和Windows接口其它接口例子Debugging lock usage接口注意Debugging event usage接口注意例子Detecting the version of Libevent接口例子:编译时检查例子:运行时检查Freeing global Libevent struct
2020-05-26 16:03:00 305
原创 Libevent book 笔记(2) Preliminaries
文章目录Libevent from 10,000 feetThe LibrariesThe HeadersIf you have to work with an old version of LibeventLibevent from 10,000 feetlibevent由以下这些组件或者说部分组成:evutil对不同平台的网络实现的一个通用的抽象。或者说,提供了一个通用的接口,封装了底层不同平台的网络实现。主要这里指的是平台的网络模块的抽象或者封装。比方说recv或者send函数在不同平台可
2020-05-26 15:51:47 188
原创 Libevent book 笔记(1) A tiny introduction to asynchronous IO
闲话不多说,略过一些无关内容,直接入正题。文章目录第一个例子第二个例子第一个例子/* For sockaddr_in */#include <netinet/in.h>/* For socket functions */#include <sys/socket.h>/* For fcntl */#include <fcntl.h>#include <event2/event.h>#include <assert.h>#in
2020-05-26 15:44:32 239
原创 关于`QObject: Cannot create children for a parent that is in a different thread`
作为一个qt初学者,免不了要踏入QObject: Cannot create children for a parent that is in a different thread这个坑,不论是官方文档、stackoverflow还是csdn,看了半天也摸不着头脑,只好老老实实研究错误代码,最终解决了问题,这里记录一下。代码从这里开始,一些不同重要的内容就略去了。Class Worker:pu...
2020-05-02 17:37:53 3717 9
原创 《C++ Template》笔记 Chapter 28 Debugging Templates
文章目录28.1 Shallow InstantiationConcept Checking28.2 Static Assertions28.3 Archetypes28.4 Tracers28.5 Oracles模板调试有两个挑战。一个是对模板开发者的:对于符合文档要求的任意模板参数,如何确保模板都能够正常工作。另一方面,则是对模板的使用者:当模板不能像文档所说的那样工作时,怎样找出不符合文档...
2019-12-10 18:20:22 298
原创 《C++ Template》笔记 Chapter 27 Expression Templates
文章目录27.1 Templates and Split Loops27.2 Encoding Expressions in Template Arguments27.2.1 Operands of the Expression Templates27.2.2 The `Array` Type27.2.3 The Operators27.2.4 Review27.2.5 Expression Te...
2019-12-08 17:54:12 323
原创 《C++ Template》笔记 Chapter 26 Discriminated Unions
文章目录26.1 Storage26.2 Design26.3 Value Query and Extraction26.4 Element Initialization,Assignment and Destruction26.4.1 Initialization26.4.2 Destruction26.4.3 AssignmentSelf-AssignmentExceptionsstd::la...
2019-12-05 20:33:28 356
原创 《C++ Template》笔记 Chapter 25 Tuples
文章目录25.1 Basic Tuple Design25.1.1 Storage25.1.2 Construction25.2 Basic Tuple Operations25.2.1 Comparison25.2.2 Output25.3 Tuple Algorithms25.3.1 Tuples as Typelists25.3.2 Adding to and Removing from a...
2019-11-18 17:17:38 523
原创 《C++ Template》笔记 Chapter 24 Typelists
文章目录24.1 Anatomy of a Typelist24.2 Typelist Algorithms24.2.1 Indexing24.2.2 Finding the Best Match24.2.3 Appending to a Typelist24.2.4 Reversing a Typelist24.2.5 Transfoming a Typelist24.2.6 Accumulat...
2019-10-21 18:31:22 282
原创 《C++ Template》笔记 Chapter 23 Metaprogramming
文章目录The State of Modern C++ Metaprogramming23.1.1 Value Metaprogramming23.1.2 Type Metaprogramming23.1.3 Hybrid Metaprogramming23.1.4 Hybrid Metaprogramming for Unit Types23.2 The Dimensions of Reflec...
2019-10-15 17:46:33 441
原创 《C++ Template》笔记 Chapter 22 Bridging Static and Dynamic Polymorphism
文章目录22.1 Function Objects,Pointers,and `std::function<>`22.2 Generalized Function Pointers22.3 Bridge Interface22.4 Type Erasure22.5 Optional Bridging22.6 Performance Considerations静态多态与非多态代码有同...
2019-10-12 15:32:19 413
原创 《C++ Template》笔记 Charpter 21 Templates and Inheritance
文章目录21.1 The Empty Base Class Optimization(EBCO)21.1.1 Layout Principles21.1.2 Members as Base Classes21.2 The Curiously Recurring Template Pattern(CRTP)21.2.1 The Barton-Nackman Trick21.2.2 Operator ...
2019-10-08 17:20:20 527
原创 《C++ Template》笔记 Charpter 20 Overloading on Type Properties
文章目录20.1 Algorithm Specialization20.2 Tag Dispatching20.3 Enabling/Disabling Function Templates20.3.1 Providing Multiple Specialization20.3.2 Where Does the EnableIf Go?20.3.3 Compile-Time `if`20.3.4 ...
2019-09-28 17:44:44 297
原创 《C++ Templates》笔记 Charpter 19 Implementing Traits(4)
文章目录19.8 Type Classification19.8.1 Determining Fundamental Types19.8.2 Determining Compound TypesPointersReferencesArraysPointers to Members19.8.3 Identifying Function Types19.8.4 Determining Class Ty...
2019-09-24 16:59:15 193
原创 《C++ Templates》笔记 Charpter 19 Implementing Traits(3)
文章目录19.6 Detecting Member19.6.1 Detecting Member TypesDealing with Reference TypesInjected Class Names19.6.2 Detecting Arbitrary Member Types19.6.3 Detecting Nontype MembersDetecting Member FunctionsD...
2019-09-22 14:26:22 191
原创 《C++ Templates》笔记 Charpter 19 Implementing Traits(2)
文章目录19.4 SFINAE-Based Traits19.4.1 SFINAE Out Function OverloadsAlternative Implementation Strategies for SFINAE-based TraitsMaking SFINAE-based Traits Predicate Traits我们来看看这里发生了什么。19.4.2 SFINAE Out P...
2019-09-16 16:40:56 379 3
原创 《C++ Templates》笔记 Charpter 19 Implementing Traits(1)
Charpter 19 Implementing Traits文章目录Charpter 19 Implementing Traits19.1 An Example:Accumulating a Squence19.1.1 Fixed Traits19.1.2 Value Traits19.1.3 Parameterized Traits19.2 Traits versus Policies an...
2019-09-04 18:11:55 179
原创 《C++ Templates》笔记 Chapter 18 The Polymorphic Power of Templates
Chapter 18 The Polymorphic Power of Templates文章目录Chapter 18 The Polymorphic Power of Templates18.1 Dynamic Polymorphism18.2 Static Polymorphism18.3 Dynamic versus Static PolymophismTerminologyStren...
2019-09-01 19:43:24 160
原创 《C++ Templates》笔记 Chapter 16 Specialization and Overloading - Charpter 17 Future Directions
C++ Templates : Chapter 16 Specialization and Overloading文章目录C++ Templates : Chapter 16 Specialization and Overloading16.1 When “Generic Code” Doesn’t Quite Cut It16.1.1 Transparent Customization16.1...
2019-08-30 18:43:58 405
原创 《C++ Templates 》笔记 Chapter 14 Instantiation - Chapter 15 Template Argument Deduction
C++ Templates PartII(2):Templates in DepthChapter 14 Instantiation14.1 On-Demand Instantiationtemplate<typename T> class C; //#1 只是声明C<int>* p=0; //#2 没问题,不需要知道C<int>的定义templ...
2019-08-22 18:42:53 472
原创 《C++ Templates》笔记 Chapter 12 Fundamentals in Depth-Chapter 13 Names in Templates
文章目录Chapter 12 Fundamentals in Depth12.1 Parameterized Declarations12.1.1 Virtual Member Functions12.1.2 Linkage of Templates12.1.3 Primary Template12.2 Template Parameters12.2.1 Type Parameters12.2.2...
2019-08-07 17:25:32 221
原创 《C++ Templates》笔记 PartI:The Basics
C++ Templates PartI:The Basics文章目录C++ Templates PartI:The BasicsChapter 1 Function Templates1.1 A First Look at Functiion Templates1.1.1 Defining the Template1.1.2 Using the Template1.1.3 Two-Phase...
2019-07-25 17:24:30 890
翻译 Go 笔记 反射
Go 笔记 反射文章目录[Go 笔记 反射](https://blog.golang.org/laws-of-reflection)类型和接口反射要知道的第一件事:从接口的值到反射对象的反射反射要知道的第二件事:从反射对象到接口的值的反射反射要知道的第三件事:要改变一个反射对象,其值必须是可设置的结构` Struct`结论类型和接口go是静态类型语言,所以type MyInt intv...
2019-07-24 22:52:52 139
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人