Posts

Featured post

verilog - Systemverilog dynamic casting issues -

i've code snippet following in testbench function void write_to_port( my_data_type_base data ); my_data_type_extended data_ext; if(!$cast(data_ext, data)); `uvm_error(get_type_name(), "failed cast"); `uvm_info(get_name(), $psprintf("data_ext :\n%s", data_ext.sprint()), uvm_medium) // write data_ext out port.... endfunction when run it, i'm getting uvm_error "failed cast." i'm not quire sure why $cast not returning 1. can see, i'm printing out extended class data item after casting uvm_info. can see it's being cast properly. if don't use $cast if condition, don't runtime error. isn't coding practice use if dynamic cast check if $cast returning 1 ? what might reason behind cast not returning 1 in above case? i think semicolon on line 'if' not belong? i think consumes if statement, , uvm_error executes regardless of how if evaluates: if(!$cast(data_ext, data)); <- no semico

c# - GameObjects vibrate when in contact with terrain. -

first rather know why happening fix. knowing allow me learn while cut , paste code won't. (an alternative fix nice , thank baffles me , want know why). set up: have primitive shape go (gameobject) spawn above terrain. go has rigid body , attach script it. seed.cs class inherits several functions class called body. once spawned go falls , comes contact terrain , problems happen. go can either go through terrain, stuck half inside, falls stuck , thrown out of ground, or if fall slow enough continuously vibrate. i have tried changing collision detection 3 different types prior running scene on go had little affect. found did work while scene running change collision detection 1 option , problem seems disappear. can throw change in start function of body class , works fine. actual options collision detection irrelevant fixing problem requires change it. continuous discrete or discrete continuousdynamic fact change makes problem go away. i'm hoping has idea why is. scale

python - Setuptools include script in source package -

i'm using setuptool make python packages, , want scripts included in source packages generated i.e. ez_setup.py install setuptools if not installed. i can find how include files in distribution, don't want files want include required running setup.py python install/build package. how can set them included in source packages, , not installed on users system. i found solution, problem lot of documentation poorly worded manifest applies source packages , hence files listed in manifest.in added manifest, , included in source package . see https://docs.python.org/2/distutils/sourcedist.html , setup tools fork of distutils. p.s. don't worry of setup tools documentation makes sound adds files egg manifest doesn't, source distribution affected.

django - tortoisehg ignore file is not ignoring *.pyc and *.db files -

i have ignore file: syntax: glob *.pyc *.db mysite/app/migrations/** it ignoring migration files not pyc , db files. why this? the usual answer have run hg add on .pyc , .db files. try running $ hg locate "set:hgignore() , not ignored()" to see tracked files match .hgignore patterns. use $ hg forget "set:hgignore() , not ignored()" to make mercurial forget them.

wpf - DbSet.Load() method is too slow -

i have sqlite database, contains 1 table named "main". each record of table contains 2 fields: id (integer, primary key) , name (string). there 100 records in database. using entity framework power tools i've created code first model existing database. model rather simple: // mainmap.cs public class mainmap : entitytypeconfiguration<main> { public mainmap() { // primary key this.haskey(t => t.id); // properties this.property(t => t.name) .isrequired() .hasmaxlength(50); // table & column mappings this.totable("main"); this.property(t => t.id).hascolumnname("id"); this.property(t => t.name).hascolumnname("name"); } } // main.cs public partial class main { public long id { get; set; } public string name { get; set; } } // maincontext.cs public partial class maincontext : dbcontext { static maincontex

What kind of memory protections does Mac OSX 10.9 have compared to others? -

i have small project work on in free time runs 32- , 64-bit assembler code managed .net assemblies based on operating system on. can see techniques use shell code run in template, pretty basic stuff. https://github.com/brandonprry/metafang2/blob/master/metasploitpayloadutility/generaltemplate.txt the methods work on windows , linux fine, expected unix way of executing code work on mac , doesn't. selinux enabled (and sure other pax , grsec), not achieve execution. totally expected though. my question is, mac protect memory? have similar mechanisms selinux? on slight tangent, if does, looking implement similar code @ bottom of page circumvent selinux , see if worked on mac well. http://www.akkadia.org/drepper/selinux-mem.html

file - How HTTP downloads are segmented inside TCP packets? -

Image
i'm trying figure out how http server encoding/spliting file during http download. when i'm using wireshark can find 4 http headers (see below) , bunch of tcp packets without headers. know how tcp packets formed , if can retrieve concrete data them (like name of file, id or substantial). first header : get /upload/toto.test http/1.1 host: 192.168.223.167:90 connection: keep-alive accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 user-agent: mozilla/5.0 (windows nt 6.1; wow64) applewebkit/537.36 (khtml, gecko) chrome/35.0.1916.114 safari/537.36 accept-encoding: gzip,deflate,sdch accept-language: fr-fr,fr;q=0.8,en-us;q=0.6,en;q=0.4 range: bytes=3821-3821 if-range: "40248-5800428-4fab43ec800ce" second header : http/1.1 206 partial content date: sat, 31 may 2014 21:25:31 gmt server: apache/2.2.22 (debian) last-modified: sat, 31 may 2014 15:59:21 gmt etag: "40248-5800428-4fab43ec800ce" accept-ranges: bytes content-le