bit

MATLAB - Find contour of a binary bit map?

匿名 (未验证) 提交于 2019-12-03 02:14:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a 10x10 binary bit map as follows. I am looking for an efficient way of finding its contour in MATLAB. (I have tried letting every value "look around" its neighbors' values and decide, but it is too inefficient. I expect the algorithm to scale up.) false false false false false false false false false false false false true true true true true true false false false true true true true true true true true false false true true true true true true true true false false true true true true true true true true false false true true true

Assembly compiled executable on Bash on Ubuntu on Windows doesn't produce output

匿名 (未验证) 提交于 2019-12-03 02:14:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've been looking at a tutorial for assembly, and I'm trying to get a hello world program to run. I am using Bash on Ubuntu on Windows. Here is the assembly: section .text global _start ;must be declared for linker (ld) _start: ;tells linker entry point mov edx,len ;message length mov ecx,msg ;message to write mov ebx,1 ;file descriptor (stdout) mov eax,4 ;system call number (sys_write) int 0x80 ;call kernel mov eax,1 ;system call number (sys_exit) int 0x80 ;call kernel section .data msg db 'Hello, world!', 0xa ;string to be printed len equ

32 bit signed multiplication without using 64-bit data type?

匿名 (未验证) 提交于 2019-12-03 02:14:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to do 32-bit signed multiplication without using 64-bit data type. My inputs are in Q1.31 (both) format. input1 = A32 (Ah Al) - higher, lower half's of A32 input2 = B32 (Bh Bl) - higher, lower half's of B32 Result should be in Q1.31 format, leave the overflow case I need C code for the above. Please provide the explanation with formats also. 回答1: Signed Q1.31 format is a fully fractional format capable of representing operands between -1 and almost +1. The scale factor is 2 31 . This means that when each Q1.31 operand is stored in a

Can PHP tell if the server os is 64-bit?

匿名 (未验证) 提交于 2019-12-03 02:14:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I am dealing with Windows here. I know you can use the $_SERVER['HTTP_USER_AGENT'] variable to detect the OS of the browser viewing the page, but is the any way that PHP can detect the server's OS? For my program's UI I am using a PHP webpage. I need to read a key in the registry that is in a different location on a 64-bit OS (It is under the Wow6432Node Key). Can PHP tell what OS it is running on? Can PHP tell if the OS is 64-bit or 32-bit? 回答1: Note: This solution is a bit less convenient and slower than @Salman A's answer . I

How do I convert an integer to binary in JavaScript?

匿名 (未验证) 提交于 2019-12-03 02:13:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I’d like to see integers, positive or negative, in binary. Rather like this question , but for JavaScript. 回答1: This answer attempts to address integers with absolute values between Number.MAX_SAFE_INTEGER (or 2**53-1 ) and 2**31 . The current solutions only address signed integers within 32 bits, but this solution will output in 64-bit two's complement form using float64ToInt64Binary() : // IIFE to scope internal variables var float64ToInt64Binary = (function () { // create union var flt64 = new Float64Array(1) var uint16 = new Uint16Array

push on 64bit intel osx

匿名 (未验证) 提交于 2019-12-03 02:12:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to push 64 bit address on stack as below, __asm("pushq $0x1122334455667788"); But I get compilation error and I can only push in following way, __asm("pushq $0x11223344"); Can someone help me understand my mistake? I am new to assembly, so please excuse me if my question sounds stupid. 回答1: x86-64 has some interesting quirks, which aren't obvious even if you're familiar with 32-bit x86... Most instructions can only take a 32-bit immediate value, which is sign-extended to 64 bits if used in a 64-bit context. (The instruction encoding

How do you create a yes/no boolean field in SQL server?

匿名 (未验证) 提交于 2019-12-03 02:11:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: What is the best practice for creating a yes/no Boolean field when converting from an access database or in general? 回答1: The equivalent is a bit field. In SQL you use 0 and 1 to set a bit field (just as a yes/no field in Access). In Management Studio it displays as a false/true value (at least in recent versions). When accessing the database through ASP.NET it will expose the field as a boolean value. 回答2: The BIT datatype is generally used to store boolean values (0 for false, 1 for true). 回答3: You can use the bit column type. 回答4: You can

The specified DSN contains an architecture mismatch between the Driver and Application. JAVA

匿名 (未验证) 提交于 2019-12-03 02:11:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to connect to a database made by MS Access using Java, but I cannot seem to manage. I am using ODBC and I'm getting this exception: java.sql.SQLException: [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application My Java: package javaapplication2; import java.sql.Statement; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; /** * * @author Owner */ public class JavaApplication2 { /** * @param args the

What operations and functions on +0.0 and -0.0 give different arithmetic results?

匿名 (未验证) 提交于 2019-12-03 02:11:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: In C, when ±0.0 is supported, -0.0 or +0.0 assigned to a double typically makes no arithmetic difference. Although they have different bit patterns, they arithmetically compare as equal. double zp = +0.0; double zn = -0.0; printf("0 == memcmp %d\n", 0 == memcmp(&zn, &zp, sizeof zp));// --> 0 == memcmp 0 printf("== %d\n", zn == zp); // --> == 1 Inspire by a @Pascal Cuoq comment , I am looking for a few more functions in standard C that provide arithmetically different results. Note: Many functions, like sin() , return +0.0 from f(+0.0) and -0

How to determine whether a given Linux is 32 bit or 64 bit?

匿名 (未验证) 提交于 2019-12-03 02:11:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: When I type uname -a , it gives the following output. Linux mars 2.6.9-67.0.15.ELsmp #1 SMP Tue Apr 22 13:50:33 EDT 2008 i686 i686 i386 GNU/Linux How can I know from this that the given OS is 32 or 64 bit? This is useful when writing configure scripts, for example: what architecture am I building for? 回答1: Try uname -m . Which is short of uname --machine and it outputs: x86_64 ==> 64-bit kernel i686 ==> 32-bit kernel Otherwise, not for the Linux kernel, but for the CPU , you type: cat /proc/cpuinfo or: grep flags /proc/cpuinfo Under "flags"