Search Results

Search found 63 results on 3 pages for 'cil'.

Page 2/3 | < Previous Page | 1 2 3  | Next Page >

  • Calling private constructors with Reflection.Emit?

    - by Jakob Botsch Nielsen
    I'm trying to emit the following IL: LocalBuilder pointer = il.DeclareLocal(typeof(IntPtr)); il.Emit(OpCodes.Ldarg_0); il.Emit(OpCodes.Stloc, pointer); il.Emit(OpCodes.Ldloca, pointer); il.Emit(OpCodes.Call, typeof(IntPtr).GetMethod("ToPointer")); il.Emit(OpCodes.Ret); The delegate I bind with has the signature void* TestDelegate(IntPtr ptr) It throws the exception Operation could destabilize the runtime. Anyone knows what's wrong? EDIT: Alright, so I got the IL working now. The entire goal of this was to be able to call a private constructor. The private constructor takes a pointer so I can't use normal reflection. Now.. When I call it, I get an exception saying Attempt by method <built method> to access method <private constructor> failed. Apparently it's performing security checks - but from experience I know that Reflection is able to do private stuff like this normally, so hopefully there is a way to disable that check?

    Read the article

  • How do i prevent my code from being stolen?

    - by Calmarius
    What happens exactly when I launch a .NET exe? I know that C# is compiled to IL code and I think the generated exe file just a launcher that starts the runtime and passes the IL code to it. But how? And how complex process is it? IL code is embedded in the exe. I think it can be executed from the memory without writing it to the disk while ordinary exe's are not (ok, yes but it is very complicated). My final aim is extracting the IL code and write my own encrypted launcher to prevent scriptkiddies to open my code in Reflector and just steal all my classes easily. Well I can't prevent reverse engineering completely. If they are able to inspect the memory and catch the moment when I'm passing the pure IL to the runtime then it won't matter if it is a .net exe or not, is it? I know there are several obfuscator tools but I don't want to mess up the IL code itself. EDIT: so it seems it isn't worth trying what I wanted. They will crack it anyway... So I will look for an obfuscation tool. And yes my friends said too that it is enough to rename all symbols to a meaningless name. And reverse engineering won't be so easy after all.

    Read the article

  • Visual Studio & RAD support for coding directly in IL?

    - by jdk
    For the longest time I've been curious to code in Intermediate Language just as an academic endeavour and to gain a better understanding of what's "happening under the hood". Does anybody provide Visual Studio support for *IL in the form of: project templates, IntelliSense integration, and those kind of RAD features? Edits: I don't mean restricted to out of the box support. For example, I can download Visual Studio extensions to support Python, COBOL, etc. Want the same for *IL. There is a stand-alone Intermediate Assembler tool.

    Read the article

  • dpkg E: Sub-process /usr/bin/dpkg returned an error

    - by user81269
    I decided to shift around my partitions on my hard drive for a fresh install of Kubuntu. I booted my Ubuntu 10.10 live disc, shifted everything around and attempted to install grub and it didn't work, so I burnt an Ubuntu 12.04 disc and installed it. I got the computer working and wanted to install some packages, but didn't have an internet connection at the time. So (I know this was stupid) I got some debs from previous versions of Ubuntu, as I needed my music, and the other install took a long of time to boot. Once I got my internet connection back, everything worked ok, for a little while. Then I stumbled upon this problem after removing ten broken packages using synaptic: drhax@Spamotard:~$ sudo apt-get install -f Reading package lists... Done Building dependency tree Reading state information... Done The following packages will be REMOVED: libgtk2.0-cil 0 upgraded, 0 newly installed, 1 to remove and 417 not upgraded. 1 not fully installed or removed. After this operation, 2,638 kB disk space will be freed. Do you want to continue [Y/n]? y (Reading database ... 103052 files and directories currently installed.) Removing libgtk2.0-cil ... E: File does not exist: /usr/share/cli-common/packages.d/policy.2.6.gtk-dotnet.installcligac dpkg: error processing libgtk2.0-cil (--remove): subprocess installed post-removal script returned error exit status 1 Errors were encountered while processing: libgtk2.0-cil E: Sub-process /usr/bin/dpkg returned an error code (1) Help would be appreciated. This is my first post, but I do know fair bit about Ubuntu, so feel free to point out any stupid mistakes I have made.

    Read the article

  • How to recover dpkg from corrupted downloads?

    - by rocker9455
    I just upgraded to the 10.10 RC earlier and had a few problems with graphic drivers (x didnt start) But i have remedied that now. When i run 'sudo apt-get install -f' i get this: will@UbuntuBox:/mnt/slax$ sudo apt-get install -f [sudo] password for will: Reading package lists... Done Building dependency tree Reading state information... Done Correcting dependencies... Done The following extra packages will be installed: libmono-wcf3.0-cil openoffice.org-calc openoffice.org-core The following NEW packages will be installed: libmono-wcf3.0-cil The following packages will be upgraded: openoffice.org-calc openoffice.org-core 2 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. 16 not fully installed or removed. Need to get 0B/32.5MB of archives. After this operation, 1,929kB disk space will be freed. Do you want to continue [Y/n]? Y (Reading database ... 201565 files and directories currently installed.) Preparing to replace openoffice.org-calc 1:3.2.1-6ubuntu2~10.04.1 (using .../openoffice.org-calc_1%3a3.2.1-7ubuntu1_i386.deb) ... Unpacking replacement openoffice.org-calc ... xz: (stdin): Compressed data is corrupt dpkg-deb: subprocess <decompress> returned error exit status 1 dpkg: error processing /var/cache/apt/archives/openoffice.org-calc_1%3a3.2.1-7ubuntu1_i386.deb (--unpack): short read on buffer copy for backend dpkg-deb during `./usr/lib/openoffice/basis3.2/program/libscfiltli.so' dpkg: regarding .../openoffice.org-core_1%3a3.2.1-7ubuntu1_i386.deb containing openoffice.org-core: openoffice.org-core conflicts with openoffice.org-calc (<< 1:3.2.1-7ubuntu1) openoffice.org-calc (version 1:3.2.1-6ubuntu2~10.04.1) is present and installed. dpkg: error processing /var/cache/apt/archives/openoffice.org-core_1%3a3.2.1-7ubuntu1_i386.deb (--unpack): conflicting packages - not installing openoffice.org-core Unpacking libmono-wcf3.0-cil (from .../libmono-wcf3.0-cil_2.6.7-3ubuntu1_all.deb) ... dpkg-deb (subprocess): data: internal gzip read error: '<fd:0>: data error' dpkg-deb: subprocess <decompress> returned error exit status 2 dpkg: error processing /var/cache/apt/archives/libmono-wcf3.0-cil_2.6.7-3ubuntu1_all.deb (--unpack): subprocess dpkg-deb --fsys-tarfile returned error exit status 2 Errors were encountered while processing: /var/cache/apt/archives/openoffice.org-calc_1%3a3.2.1-7ubuntu1_i386.deb /var/cache/apt/archives/openoffice.org-core_1%3a3.2.1-7ubuntu1_i386.deb /var/cache/apt/archives/libmono-wcf3.0-cil_2.6.7-3ubuntu1_all.deb E: Sub-process /usr/bin/dpkg returned an error code (1) Any idea how i can get the broken packages fixed? Cheers, Will

    Read the article

  • Simple search form passing the searched string through GET

    - by Brian Roisentul
    Hi, I'd like my Search form to return the following url after submit: /anuncios/buscar/the_text_I_searched My form is the following: <% form_for :announcement, :url => search_path(:txtSearch) do |f| %> <div class="searchBox" id="basic"> <%= text_field_tag :txtSearch, params[:str_search].blank? ? "Busc&aacute; tu curso r&aacute;pido y f&aacute;cil." : params[:str_search], :maxlength=> 100, :class => "basicSearch_inputField", :onfocus => "if (this.value=='Busc&aacute; tu curso r&aacute;pido y f&aacute;cil.') this.value=''", :onblur => "if(this.value=='') { this.value='Busc&aacute; tu curso r&aacute;pido y f&aacute;cil.'; return false; }" %> <div class="basicSearch_button"> <input type="submit" value="BUSCAR" class="basicSearch_buttonButton" /> <br /><a href="#" onclick="javascript:jQuery('#advance').modal({opacity:60});">Busqueda avanzada</a> </div> </div> <% end %> My routes' line for search_path is this: map.search '/anuncios/buscar/:str_search', :controller => 'announcements', :action => 'search' Well, this will work if I manually type the url I want in the brower, but definitely, if you look at the form's url, you'll find a ":txtSearch" parameter, which is not giving me the actual value of the text field when the form is submitted. And that's what I'd like to get! Could anybody help me on this?

    Read the article

  • Unable to fix broken packages with sudo apt-get install -f

    - by Bob
    Here's my result, of sudo apt-get install -f. i have Ran it twice and got negative result. I believe there is an error at "error in Version string '0:3.6.1-dates for language English Translation data updates for all supported packages for: English" This same statement "error in Version string, caused me three days of attempting to download version 12.04. There is a bug report concerning the quoted text as well. Is there anyway to download the version without the language packs, why would I corrupt version 11.10? Also, when attempting to download Synaptic using sudo apt-get install synaptic, I get the same error message. Again I point out the initial download problems and the same error message receipt. Thanks b0b@b0b-IC780M-A:~$ sudo apt-get install -f [sudo] password for b0b: Reading package lists... Done Building dependency tree Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 298 not upgraded. b0b@b0b-IC780M-A:~$ sudo apt-get install -f Reading package lists... Done Building dependency tree Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 298 not upgraded. b0b@b0b-IC780M-A:~$ sudo apt-get upgrade install Reading package lists... Done Building dependency tree Reading state information... Done The following packages have been kept back: linux-headers-generic software-center The following packages will be upgraded: accountsservice acpi-support acpid aisleriot alsa-utils app-install-data-partner appmenu-qt apport apport-gtk apt-transport-https apt-utils aptdaemon aptdaemon-data apturl apturl-common banshee banshee-extension-soundmenu banshee-extension-ubuntuonemusicstore baobab bind9-host binutils bluez-alsa bluez-cups bluez-gstreamer brasero brasero-cdrkit brasero-common checkbox checkbox-gtk command-not-found command-not-found-data compiz compiz-core compiz-gnome compiz-plugins-default compiz-plugins-main-default cups cups-bsd cups-client cups-common cups-ppdc deja-dup desktop-file-utils dnsutils empathy empathy-common eog evince evince-common evolution-data-server evolution-data-server-common file-roller firefox firefox-globalmenu firefox-gnome-support gbrainy gcalctool gconf2 gconf2-common gedit gedit-common ghostscript ghostscript-cups ghostscript-x gir1.2-atspi-2.0 gir1.2-gconf-2.0 gir1.2-gnomebluetooth-1.0 gir1.2-gtk-3.0 gir1.2-gtksource-3.0 gir1.2-totem-1.0 gir1.2-unity-4.0 gir1.2-webkit-3.0 gnome-accessibility-themes gnome-bluetooth gnome-control-center gnome-control-center-data gnome-desktop3-data gnome-font-viewer gnome-games-common gnome-icon-theme gnome-mahjongg gnome-online-accounts gnome-orca gnome-power-manager gnome-screenshot gnome-search-tool gnome-session gnome-session-bin gnome-session-canberra gnome-session-common gnome-settings-daemon gnome-sudoku gnome-system-log gnome-system-monitor gnome-utils-common gnomine gstreamer0.10-gconf gstreamer0.10-plugins-good gstreamer0.10-pulseaudio gvfs gvfs-backends gvfs-bin gvfs-fuse gwibber gwibber-service gwibber-service-facebook gwibber-service-identica gwibber-service-twitter hpijs hplip hplip-cups hplip-data indicator-datetime indicator-session indicator-sound isc-dhcp-client isc-dhcp-common jockey-common jockey-gtk language-selector-common language-selector-gnome libaccountsservice0 libapt-inst1.3 libarchive1 libasound2-plugins libatk-adaptor libbind9-60 libbrasero-media3-1 libcamel-1.2-29 libcanberra-gtk-module libcanberra-gtk0 libcanberra-gtk3-0 libcanberra-gtk3-module libcanberra-pulse libcanberra0 libdecoration0 libdns69 libebackend-1.2-1 libebook1.2-12 libecal1.2-10 libedata-book-1.2-11 libedata-cal-1.2-13 libedataserver1.2-15 libedataserverui-3.0-1 libevince3-3 libgconf2-4 libgnome-bluetooth8 libgnome-control-center1 libgnome-desktop-3-2 libgoa-1.0-0 libgrip0 libgs9 libgs9-common libgtk-3-bin libgtksourceview-3.0-0 libgtksourceview-3.0-common libgweather-3-0 libgweather-common libgwibber-gtk2 libgwibber2 libhpmud0 libimobiledevice2 libisc62 libisccc60 libisccfg62 libjasper1 liblightdm-gobject-1-0 liblwres60 libmetacity-private0 libmission-control-plugins0 libmono-zeroconf1.0-cil libnautilus-extension1 libnm-glib-vpn1 libnm-glib4 libnm-util2 libnotify0.4-cil libnux-1.0-0 libnux-1.0-common libpam-gnome-keyring libreoffice-emailmerge libreoffice-style-human libsane-hpaio libsmbclient libsnmp-base libsnmp15 libsyncdaemon-1.0-1 libt1-5 libtotem0 libubuntuone-1.0-1 libubuntuone1.0-cil libunity-2d-private0 libunity-core-4.0-4 libunity6 libusbmuxd1 libwbclient0 libwebkitgtk-1.0-0 libwebkitgtk-1.0-common libwebkitgtk-3.0-0 libwebkitgtk-3.0-common libxml2 linux-generic linux-image-generic metacity metacity-common mobile-broadband-provider-info modemmanager mousetweaks multiarch-support nautilus nautilus-data nautilus-sendto-empathy network-manager nux-tools onboard openssl pulseaudio pulseaudio-esound-compat pulseaudio-module-bluetooth pulseaudio-module-gconf pulseaudio-module-x11 pulseaudio-utils python-apport python-aptdaemon python-aptdaemon-gtk python-aptdaemon.gtk3widgets python-aptdaemon.gtkwidgets python-brlapi python-cups python-cupshelpers python-gobject-cairo python-httplib2 python-launchpadlib python-libxml2 python-pam python-papyon python-pkg-resources python-problem-report python-pyatspi2 python-software-properties python-ubuntuone-client python-ubuntuone-storageprotocol samba-common samba-common-bin seahorse shotwell simple-scan smbclient sni-qt software-properties-common software-properties-gtk sudo system-config-printer-common system-config-printer-gnome system-config-printer-udev telepathy-indicator telepathy-mission-control-5 thunderbird thunderbird-globalmenu thunderbird-gnome-support tomboy totem totem-common totem-mozilla totem-plugins ttf-opensymbol ubuntu-desktop ubuntu-minimal ubuntu-standard ubuntuone-client ubuntuone-client-gnome ubuntuone-couch unity unity-2d unity-2d-launcher unity-2d-panel unity-2d-places unity-2d-spread unity-common unity-lens-applications unity-services update-manager update-manager-core update-notifier update-notifier-common usbmuxd vim-common vim-tiny vinagre vino xorg xserver-xorg xserver-xorg-input-all xserver-xorg-video-all xserver-xorg-video-intel xserver-xorg-video-openchrome xul-ext-ubufox 296 upgraded, 0 newly installed, 0 to remove and 2 not upgraded. Need to get 0 B/159 MB of archives. After this operation, 10.1 MB of additional disk space will be used. Do you want to continue [Y/n]? y Extracting templates from packages: 100% Preconfiguring packages ... dpkg: error: parsing file '/var/lib/dpkg/available' near line 4131 package 'python-zope.interface': error in Version string '0:3.6.1-dates for language English Translation data updates for all supported packages for: English . language-pack-en-base provides the bulk of translation data and is updated only seldom. This package provides frequent translation updates.': version string has embedded spaces E: Sub-process /usr/bin/dpkg returned an error code (2) b0b@b0b-IC780M-A:~$

    Read the article

  • Can you use the Phoenix compiler as a more powerful NGEN?

    - by TraumaPony
    In case you don't know of Phoenix, it's a compiler framework from Microsoft that's apparantly going to be the foundation of all their new compilers. It can read in code from CIL, x86, x64, and IA64; and emit code in x86, x64, IA64, or CIL. Can I use it to transform a pure .Net app into a pure native app? By which I mean, it will not have to load any .Net .dll (not even mscoree), and will have the same semantics? This is excluding Reflection, of course.

    Read the article

  • Why does the Ternary\Conditional operator seem significantly faster

    - by Jodrell
    Following on from this question, which I have partially answered. I compile this console app in x64 Release Mode, with optimizations on, and run it from the command line without a debugger attached. using System; using System.Diagnostics; class Program { static void Main() { var stopwatch = new Stopwatch(); var ternary = Looper(10, Ternary); var normal = Looper(10, Normal); if (ternary != normal) { throw new Exception(); } stopwatch.Start(); ternary = Looper(10000000, Ternary); stopWatch.Stop(); Console.WriteLine( "Ternary took {0}ms", stopwatch.ElapsedMilliseconds); stopwatch.Start(); normal = Looper(10000000, Normal); stopWatch.Stop(); Console.WriteLine( "Normal took {0}ms", stopwatch.ElapsedMilliseconds); if (ternary != normal) { throw new Exception(); } Console.ReadKey(); } static int Looper(int iterations, Func<bool, int, int> operation) { var result = 0; for (int i = 0; i < iterations; i++) { var condition = result % 11 == 4; var value = ((i * 11) / 3) % 5; result = operation(condition, value); } return result; } static int Ternary(bool condition, in value) { return value + (condition ? 2 : 1); } static int Normal(int iterations) { if (condition) { return = 2 + value; } return = 1 + value; } } I don't get any exceptions and the output to the console is somthing close to, Ternary took 107ms Normal took 230ms When I break down the CIL for the two logical functions I get this, ... Ternary ... { : ldarg.1 // push second arg : ldarg.0 // push first arg : brtrue.s T // if first arg is true jump to T : ldc.i4.1 // push int32(1) : br.s F // jump to F T: ldc.i4.2 // push int32(2) F: add // add either 1 or 2 to second arg : ret // return result } ... Normal ... { : ldarg.0 // push first arg : brfalse.s F // if first arg is false jump to F : ldc.i4.2 // push int32(2) : ldarg.1 // push second arg : add // add second arg to 2 : ret // return result F: ldc.i4.1 // push int32(1) : ldarg.1 // push second arg : add // add second arg to 1 : ret // return result } Whilst the Ternary CIL is a little shorter, it seems to me that the execution path through the CIL for either function takes 3 loads and 1 or 2 jumps and a return. Why does the Ternary function appear to be twice as fast. I underdtand that, in practice, they are both very quick and indeed, quich enough but, I would like to understand the discrepancy.

    Read the article

  • Opening cursor files in a graphics editor?

    - by sdaau
    I'm looking at /usr/share/icons/DMZ-White/cursors, and there is: $ tree -s /usr/share/icons/DMZ-White/ /usr/share/icons/DMZ-White/ +-- [ 4096] cursors ¦   +-- [ 14] 00008160000006810000408080010102 -> v_double_arrow ... ¦   +-- [ 5] 9d800788f1b08800ae810202380a0822 -> hand2 ¦   +-- [ 8] arrow -> left_ptr ¦   +-- [ 15776] bd_double_arrow ¦   +-- [ 15776] bottom_left_corner ¦   +-- [ 15776] bottom_right_corner ¦   +-- [ 15776] bottom_side ... ... a bunch of files without extension, that GIMP cannot open. Is there an editor where these files can be opened - or at least a converter to something like .png? I can note that ImageMagick display also failed to open these files... Found also Gursor Maker - Cursor Editor for X11/GTK+; got the CVS code from SourceForge - it still uses Numeric (the old name of numpy), so to run it, you'll have to do: #from Numeric import * from numpy import * ... in xcurio.py, curxp.py, gimp.py, colorfunc.py - and comment the #from xml.dom.ext.reader import Sax2 in lsproj.py. With that, I got it running 11.04: ... but cannot get any files to open? So I thought I should grep for paths, nothing much came up - and when I looked into cursordefs.py, I simply had to paste this: CURSOR_ICON = gtk.gdk.pixbuf_new_from_xpm_data([ "10 16 3 1", " c None", ". c #000000", "+ c #FFFFFF", ".. ", ".+. ", ".++. ", ".+++. ", ".++++. ", ".+++++. ", ".++++++. ", ".+++++++. ", ".++++++++.", ".+++++....", ".++.++. ", ".+. .++. ", ".. .++. ", " .++. ", " .++. ", " .. "]) Heh :) In any case, doesn't look like it will be much usable on newer Ubuntus, unfortunately... Just tested XMC plugin as well - on 11.04, has to be built from source (from the link in the accepted answer); the requirements on my system resolved to: sudo apt-get install libgimp2.0-dev libglib2.0-0-dbg libglib2.0-0-refdbg libglib2.0-cil-dev libgtk2.0-0-dbg libgtk2.0-cil-dev ... after that, the configure/make procedure in the INSTALL file works. Note that this plugin is a bit "sneaky": ... that is, you should use "All files" (as there are no extensions); cursor previews at first will not be rendered. Then open one cursor file; after it has been opened, then there is a preview in the File/Open dialog; but other than that, it works fine...

    Read the article

  • Possible to Inspect Innards of Core C# Functionality

    - by Nick Babcock
    I was struck today, with the inclination to compare the innards of Buffer.BlockCopy and Array.CopyTo. I am curious to see if Array.CopyTo called Buffer.BlockCopy behind the scenes. There is no practical purpose behind this, I just want to further my understanding of the C# language and how it is implemented. Don't jump the gun and accuse me of micro-optimization, but you can accuse me of being curious! When I ran ILasm on mscorlib.dll I received this for Array.CopyTo .method public hidebysig newslot virtual final instance void CopyTo(class System.Array 'array', int32 index) cil managed { // Code size 0 (0x0) } // end of method Array::CopyTo and this for Buffer.BlockCopy .method public hidebysig static void BlockCopy(class System.Array src, int32 srcOffset, class System.Array dst, int32 dstOffset, int32 count) cil managed internalcall { .custom instance void System.Security.SecuritySafeCriticalAttribute::.ctor() = ( 01 00 00 00 ) } // end of method Buffer::BlockCopy Which, frankly, baffles me. I've never run ILasm on a dll/exe I didn't create. Does this mean that I won't be able to see how these functions are implemented? Searching around only revealed a stackoverflow question, which Marc Gravell said [Buffer.BlockCopy] is basically a wrapper over a raw mem-copy While insightful, it doesn't answer my question if Array.CopyTo calls Buffer.BlockCopy. I'm specifically interested in if I'm able to see how these two functions are implemented, and if I had future questions about the internals of C#, if it is possible for me to investigate it. Or am I out of luck?

    Read the article

  • Why enumerator structs are a really bad idea

    - by Simon Cooper
    If you've ever poked around the .NET class libraries in Reflector, I'm sure you would have noticed that the generic collection classes all have implementations of their IEnumerator as a struct rather than a class. As you will see, this design decision has some rather unfortunate side effects... As is generally known in the .NET world, mutable structs are a Very Bad Idea; and there are several other blogs around explaining this (Eric Lippert's blog post explains the problem quite well). In the BCL, the generic collection enumerators are all mutable structs, as they need to keep track of where they are in the collection. This bit me quite hard when I was coding a wrapper around a LinkedList<int>.Enumerator. It boils down to this code: sealed class EnumeratorWrapper : IEnumerator<int> { private readonly LinkedList<int>.Enumerator m_Enumerator; public EnumeratorWrapper(LinkedList<int> linkedList) { m_Enumerator = linkedList.GetEnumerator(); } public int Current { get { return m_Enumerator.Current; } } object System.Collections.IEnumerator.Current { get { return Current; } } public bool MoveNext() { return m_Enumerator.MoveNext(); } public void Reset() { ((System.Collections.IEnumerator)m_Enumerator).Reset(); } public void Dispose() { m_Enumerator.Dispose(); } } The key line here is the MoveNext method. When I initially coded this, I thought that the call to m_Enumerator.MoveNext() would alter the enumerator state in the m_Enumerator class variable and so the enumeration would proceed in an orderly fashion through the collection. However, when I ran this code it went into an infinite loop - the m_Enumerator.MoveNext() call wasn't actually changing the state in the m_Enumerator variable at all, and my code was looping forever on the first collection element. It was only after disassembling that method that I found out what was going on The MoveNext method above results in the following IL: .method public hidebysig newslot virtual final instance bool MoveNext() cil managed { .maxstack 1 .locals init ( [0] bool CS$1$0000, [1] valuetype [System]System.Collections.Generic.LinkedList`1/Enumerator CS$0$0001) L_0000: nop L_0001: ldarg.0 L_0002: ldfld valuetype [System]System.Collections.Generic.LinkedList`1/Enumerator EnumeratorWrapper::m_Enumerator L_0007: stloc.1 L_0008: ldloca.s CS$0$0001 L_000a: call instance bool [System]System.Collections.Generic.LinkedList`1/Enumerator::MoveNext() L_000f: stloc.0 L_0010: br.s L_0012 L_0012: ldloc.0 L_0013: ret } Here, the important line is 0002 - m_Enumerator is accessed using the ldfld operator, which does the following: Finds the value of a field in the object whose reference is currently on the evaluation stack. So, what the MoveNext method is doing is the following: public bool MoveNext() { LinkedList<int>.Enumerator CS$0$0001 = this.m_Enumerator; bool CS$1$0000 = CS$0$0001.MoveNext(); return CS$1$0000; } The enumerator instance being modified by the call to MoveNext is the one stored in the CS$0$0001 variable on the stack, and not the one in the EnumeratorWrapper class instance. Hence why the state of m_Enumerator wasn't getting updated. Hmm, ok. Well, why is it doing this? If you have a read of Eric Lippert's blog post about this issue, you'll notice he quotes a few sections of the C# spec. In particular, 7.5.4: ...if the field is readonly and the reference occurs outside an instance constructor of the class in which the field is declared, then the result is a value, namely the value of the field I in the object referenced by E. And my m_Enumerator field is readonly! Indeed, if I remove the readonly from the class variable then the problem goes away, and the code works as expected. The IL confirms this: .method public hidebysig newslot virtual final instance bool MoveNext() cil managed { .maxstack 1 .locals init ( [0] bool CS$1$0000) L_0000: nop L_0001: ldarg.0 L_0002: ldflda valuetype [System]System.Collections.Generic.LinkedList`1/Enumerator EnumeratorWrapper::m_Enumerator L_0007: call instance bool [System]System.Collections.Generic.LinkedList`1/Enumerator::MoveNext() L_000c: stloc.0 L_000d: br.s L_000f L_000f: ldloc.0 L_0010: ret } Notice on line 0002, instead of the ldfld we had before, we've got a ldflda, which does this: Finds the address of a field in the object whose reference is currently on the evaluation stack. Instead of loading the value, we're loading the address of the m_Enumerator field. So now the call to MoveNext modifies the enumerator stored in the class rather than on the stack, and everything works as expected. Previously, I had thought enumerator structs were an odd but interesting feature of the BCL that I had used in the past to do linked list slices. However, effects like this only underline how dangerous mutable structs are, and I'm at a loss to explain why the enumerators were implemented as structs in the first place. (interestingly, the SortedList<TKey, TValue> enumerator is a struct but is private, which makes it even more odd - the only way it can be accessed is as a boxed IEnumerator!). I would love to hear people's theories as to why the enumerators are implemented in such a fashion. And bonus points if you can explain why LinkedList<int>.Enumerator.Reset is an explicit implementation but Dispose is implicit... Note to self: never ever ever code a mutable struct.

    Read the article

  • JSIL - a Dot Net to JavaScript translator

    - by TATWORTH
    JSI is described at http://jsil.org/ as:"JSIL is a compiler that transforms .NET applications and libraries from their native executable format - CIL bytecode - into standards-compliant, cross-browser JavaScript. You can take this JavaScript and run it in a web browser or any other modern JavaScript runtime. Unlike other cross-compiler tools targeting JavaScript, JSIL produces readable, easy-to-debug JavaScript that resembles the code a developer might write by hand, while still maintaining the behavior and structure of the original .NET code. Because JSIL transforms bytecode, it can support most .NET-based languages - C# to JavaScript and VB.NET to JavaScript work right out of the box."

    Read the article

  • Unable to install Emerald theme manager in Ubuntu 12.04?

    - by kernel_panic
    I learnt how to install ETM from here But when i try to install i get `ubu@sanjay-pc:~$ sudo apt-get install git autoconf libtool libwnck1.0-cil-dev libwnck-dev intltool libdecoration0-dev gawk Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming.code The following information may help to resolve the situation: The following packages have unmet dependencies: libdecoration0-dev : Depends: libdecoration0 (= 1:0.9.7.6-0ubuntu1) but 1:0.9.7.8-0ubuntu1 is to be installed E: Unable to correct problems, you have held broken packages. ` Help Needed

    Read the article

  • What might cause this ExecutionEngineException?

    - by Qwertie
    I am trying to use Reflection.Emit to generate a wrapper class in a dynamic assembly. Automatic wrapper generation is part of a new open-source library I'm writing called "GoInterfaces". The wrapper class implements IEnumerable<string> and wraps List<string>. In C# terms, all it does is this: class List1_7931B0B4_79328AA0 : IEnumerable<string> { private readonly List<string> _obj; public List1_7931B0B4_79328AA0(List<string> obj) { this._obj = obj; } IEnumerator IEnumerable.GetEnumerator() { return this._obj.GetEnumerator(); } public sealed IEnumerator<string> GetEnumerator() { return this._obj.GetEnumerator(); } } However, when I try to call the GetEnumerator() method on my wrapper class, I get ExecutionEngineException. So I saved my dynamic assembly to a DLL and used ildasm on it. Is there anything wrong with the following code? .class public auto ansi sealed List`1_7931B0B4_79328AA0 extends [mscorlib]System.Object implements [mscorlib]System.Collections.Generic.IEnumerable`1<string>, [Loyc.Runtime]Loyc.Runtime.IGoInterfaceWrapper { .field private initonly class [mscorlib]System.Collections.Generic.List`1<string> _obj .method public hidebysig virtual final instance class [mscorlib]System.Collections.Generic.IEnumerator`1<string> GetEnumerator() cil managed { // Code size 12 (0xc) .maxstack 1 IL_0000: ldarg.0 IL_0001: ldfld class [mscorlib]System.Collections.Generic.List`1<string> List`1_7931B0B4_79328AA0::_obj IL_0006: call instance valuetype [mscorlib]System.Collections.Generic.List`1/Enumerator<!0> class [mscorlib]System.Collections.Generic.List`1<string>::GetEnumerator() IL_000b: ret } // end of method List`1_7931B0B4_79328AA0::GetEnumerator .method public hidebysig virtual final instance class [mscorlib]System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() cil managed { .override [mscorlib]System.Collections.IEnumerable::GetEnumerator // Code size 12 (0xc) .maxstack 1 IL_0000: ldarg.0 IL_0001: ldfld class [mscorlib]System.Collections.Generic.List`1<string> List`1_7931B0B4_79328AA0::_obj IL_0006: call instance valuetype [mscorlib]System.Collections.Generic.List`1/Enumerator<!0> class [mscorlib]System.Collections.Generic.List`1<string>::GetEnumerator() IL_000b: ret } // end of method List`1_7931B0B4_79328AA0::System.Collections.IEnumerable.GetEnumerator ... I have a test suite that wraps all sorts of different things, including interfaces derived from other interfaces, and multiple interface methods with identical signatures. It's only when I try to wrap IEnumerable<T> that this problem occurs. I'd be happy to send the source code (2 *.cs files, no dependencies) if anyone would like.

    Read the article

  • Using Reflection.Emit to match existing constructor

    - by yodaj007
    First, here is the C# code and the disassembled IL: public class Program<T> { private List<T> _items; public Program(T x, [Microsoft.Scripting.ParamDictionary] Microsoft.Scripting.IAttributesCollection col) { _items = new List<T>(); _items.Add(x); } } Here is the IL of that constructor: .method public hidebysig specialname rtspecialname instance void .ctor(!T x, class [Microsoft.Scripting]Microsoft.Scripting.IAttributesCollection col) cil managed { .param [2] .custom instance void [Microsoft.Scripting]Microsoft.Scripting.ParamDictionaryAttribute::.ctor() = ( 01 00 00 00 ) // Code size 34 (0x22) .maxstack 8 IL_0000: ldarg.0 IL_0001: call instance void [mscorlib]System.Object::.ctor() IL_0006: nop IL_0007: nop IL_0008: ldarg.0 IL_0009: newobj instance void class [mscorlib]System.Collections.Generic.List`1<!T>::.ctor() IL_000e: stfld class [mscorlib]System.Collections.Generic.List`1<!0> class Foo.Program`1<!T>::_items IL_0013: ldarg.0 IL_0014: ldfld class [mscorlib]System.Collections.Generic.List`1<!0> class Foo.Program`1<!T>::_items IL_0019: ldarg.1 IL_001a: callvirt instance void class [mscorlib]System.Collections.Generic.List`1<!T>::Add(!0) IL_001f: nop IL_0020: nop IL_0021: ret } // end of method Program`1::.ctor I am trying to understand the IL code by emitting it myself. This is what I have managed to emit: .method public hidebysig specialname rtspecialname instance void .ctor(!T A_1, class [Microsoft.Scripting]Microsoft.Scripting.IAttributesCollection A_2) cil managed { // Code size 34 (0x22) .maxstack 4 IL_0000: ldarg.0 IL_0001: call instance void [mscorlib]System.Object::.ctor() IL_0006: ldarg.0 IL_0007: newobj instance void class [mscorlib]System.Collections.Generic.List`1<!T>::.ctor() IL_000c: stfld class [mscorlib]System.Collections.Generic.List`1<!0> class MyType<!T>::_items IL_0011: ldarg.0 IL_0012: ldfld class [mscorlib]System.Collections.Generic.List`1<!0> class MyType<!T>::_items IL_0017: ldarg.s A_1 IL_0019: nop IL_001a: nop IL_001b: nop IL_001c: callvirt instance void class [mscorlib]System.Collections.Generic.List`1<!T>::Add(!0) IL_0021: ret } // end of method MyType::.ctor There are a few differences that I just can't figure out. I'm really close... How do I take care of the parameter attribute (ParamDictionaryAttribute)? I can't find a 'custom' opcode. Is the .param [2] important? How do I emit that? Why is the C# code stack size 8, while my emitted version is 4? Is this important?

    Read the article

  • Textbased issue-tracker/todo list for Git?

    - by anon
    I've been managing all of my todo-lists as ~/git-repo/todo which is kept under git. THen I add/delete files from the todo list, and have git autocommit all changes. However, I feel there should be more powerful tools. Besides "cil" and git-issues [neither of which I've tried], what tools are available? PS I want something that's entirely text/command line based. Thanks!

    Read the article

  • How does the CLR (.NET) internally allocate and pass around custom value types (structs)?

    - by stakx
    Question: Do all CLR value types, including user-defined structs, live on the evaluation stack exclusively, meaning that they will never need to be reclaimed by the garbage-collector, or are there cases where they are garbage-collected? Background: I have previously asked a question on SO about the impact that a fluent interface has on the runtime performance of a .NET application. I was particuarly worried that creating a large number of very short-lived temporary objects would negatively affect runtime performance through more frequent garbage-collection. Now it has occured to me that if I declared those temporary objects' types as struct (ie. as user-defined value types) instead of class, the garbage collector might not be involved at all if it turns out that all value types live exclusively on the evaluation stack. What I've found out so far: I did a brief experiment to see what the differences are in the CIL generated for user-defined value types and reference types. This is my C# code: struct SomeValueType { public int X; } class SomeReferenceType { public int X; } . . static void TryValueType(SomeValueType vt) { ... } static void TryReferenceType(SomeReferenceType rt) { ... } . . var vt = new SomeValueType { X = 1 }; var rt = new SomeReferenceType { X = 2 }; TryValueType(vt); TryReferenceType(rt); And this is the CIL generated for the last four lines of code: .locals init ( [0] valuetype SomeValueType vt, [1] class SomeReferenceType rt, [2] valuetype SomeValueType <>g__initLocal0, // [3] class SomeReferenceType <>g__initLocal1, // why are these generated? [4] valuetype SomeValueType CS$0$0000 // ) L_0000: ldloca.s CS$0$0000 L_0002: initobj SomeValueType // no newobj required, instance already allocated L_0008: ldloc.s CS$0$0000 L_000a: stloc.2 L_000b: ldloca.s <>g__initLocal0 L_000d: ldc.i4.1 L_000e: stfld int32 SomeValueType::X L_0013: ldloc.2 L_0014: stloc.0 L_0015: newobj instance void SomeReferenceType::.ctor() L_001a: stloc.3 L_001b: ldloc.3 L_001c: ldc.i4.2 L_001d: stfld int32 SomeReferenceType::X L_0022: ldloc.3 L_0023: stloc.1 L_0024: ldloc.0 L_0025: call void Program::TryValueType(valuetype SomeValueType) L_002a: ldloc.1 L_002b: call void Program::TryReferenceType(class SomeReferenceType) What I cannot figure out from this code is this: Where are all those local variables mentioned in the .locals block allocated? How are they allocated? How are they freed? Why are so many anonymous local variables needed and copied to-and-fro only to initialize my two local variables rt and vt?

    Read the article

  • Ubuntu error: no candidate ver

    - by codedude
    Ok...so for some reason by Ubuntu 10.04 partition won't startup anymore. I'm not exactly sure what I did. I have the feeling that I accidentally removed some important packages. However, when I startup in Recovery Mode and select "dpkg: repair broken packages" I get this output: rm: cannot remove /var/lib/apt/lists/partial/*': No such file or directory rm: cannot remove/var/cache/apt/archives/partial/*': No such file or directory Reading Cache Reading Package lists: Done Reading State Information: Done Reading State Information: Done Reading State Information: Done No candidate ver: libisc44 No candidate ver: readahead No candidate ver: libdirectfb-1.0-0 No candidate ver: upstart-logd No candidate ver: libparted1.8-10 No candidate ver: libflickrnet2.1.5-cil No candidate ver: libicu38 No candidate ver: fast-user-switch-applet No candidate ver: linux-restricted-modules-2.6.28-11-generic No candidate ver: libnm-util0 No candidate ver: libwebkit-1.0-1 No candidate ver: libopal3.6.1 No candidate ver: libbind9-40 No candidate ver: linux-restricted-modules-common No candidate ver: upstart-compat-sysv No candidate ver: linux-restricted-modules-2.6.28-13-generic No candidate ver: chromium-browser No candidate ver: libisc45 No candidate ver: belocs-locales-bin No candidate ver: libxcb-xlib0 No candidate ver: libpoppler4 No candidate ver: libpulsecore9 No candidate ver: libpulsecore5 No candidate ver: linux-image-2.6.28-15-generic No candidate ver: libntfs-3g49 No candidate ver: libisccfg40 No candidate ver: libavahi-core5 No candidate ver: linux-restricted-modules-2.6.27-7-generic No candidate ver: libparted1.8-9 No candidate ver: libmagickwand1 No candidate ver: libwvstreams4.4-base No candidate ver: linux-image-2.6.28-14-generic No candidate ver: libraw1394-8 No candidate ver: libdatrie0 No candidate ver: libboost-program-options1.35.0 No candidate ver: libgnomekbdui3 No candidate ver: libsgutils1 No candidate ver: libass1 No candidate ver: linux-restricted-modules-2.6.28-15-generic No candidate ver: libindicate1 No candidate ver: libgnomekbd3 No candidate ver: system-services No candidate ver: linux-image-2.6.28-13-generic No candidate ver: libmagick10 No candidate ver: libcolamd-3.2.0 No candidate ver: desktop-effects-kde No candidate ver: picasa No candidate ver: libgnome-desktop-2-7 No candidate ver: libntfs-3g28 No candidate ver: libxklavier12 No candidate ver: libgpod3 No candidate ver: libmagickcore1 No candidate ver: libffado0 No candidate ver: libzephyr3 No candidate ver: libuniconf4.4 No candidate ver: libmbca0 No candidate ver: liblwres40 No candidate ver: hotkey-setup No candidate ver: libkrb53 No candidate ver: ttf-bitstream-vera No candidate ver: libee12-2 No candidate ver: libopal-2.2 No candidate ver: songbird No candidate ver: plib1.8.4c2 No candidate ver: linux-image-2.6.27-7-generic No candidate ver: libpoppler3 No candidate ver: google-chrome-unstable No candidate ver: linux-image-2.6.28-11-generic No candidate ver: linux-restricted-modules-2.6.28-14-generic No candidate ver: simgear1.0.0 No candidate ver: libpoppler-glib3 No candidate ver: mono-common No candidate ver: libx264-65 No candidate ver: libwvstreams4.4-extras No candidate ver: libdns43 No candidate ver: libnm-glib0 No candidate ver: libpt2.6.1 No candidate ver: libisccc40 No candidate ver: libdns45 No candidate ver: libisc44 No candidate ver: readahead No candidate ver: libdirectfb-1.0-0 No candidate ver: upstart-logd No candidate ver: libparted1.8-10 No candidate ver: libflickrnet2.1.5-cil No candidate ver: libicu38 No candidate ver: fast-user-switch-applet No candidate ver: linux-restricted-modules-2.6.28-11-generic No candidate ver: libnm-util0 No candidate ver: libwebkit-1.0-1 No candidate ver: libopal3.6.1 No candidate ver: libbind9-40 No candidate ver: linux-restricted-modules-common No candidate ver: upstart-compat-sysv No candidate ver: linux-restricted-modules-2.6.28-13-generic No candidate ver: chromium-browser No candidate ver: libisc45 No candidate ver: belocs-locales-bin No candidate ver: libxcb-xlib0 No candidate ver: libpoppler4 No candidate ver: libpulsecore9 No candidate ver: lipulsecore5 No candidate ver: linux-image-2.6.28-15-generic No candidate ver: libntfs-3g49 No candidate ver: libisccfg40 No candidate ver: libavahi-core5 No candidate ver: linux-restricted-modules-2.6.27-7-generic No candidate ver: libparted1.8-9 No candidate ver: libmagickwand1 No candidate ver: linux-image-2.6.28-14-generic No candidate ver: libraw1394-8 No candidate ver: libdatrie0 No candidate ver: libboost-program-options1.35.0 No candidate ver: libgnomekbdui3 No candidate ver: libsgutils1 No candidate ver: libass1 No candidate ver: linux-restricted-modules-2.6.28-15-generic No candidate ver: libindicate1 No candidate ver: libgnomekbd3 No candidate ver: system-services No candidate ver: linux-image-2.6.28-13-generic No candidate ver: libmagick10 No candidate ver: libcolamd-3.2.0 No candidate ver: desktop-effects-kde No candidate ver: picasa No candidate ver: libgnome-desktop-2-7 No candidate ver: libntfs-3g28 No candidate ver: libxklavier12 No candidate ver: libgpod3 No candidate ver: libmagickcore1 No candidate ver: libffado0 No candidate ver: libzephyr3 No candidate ver: libuniconf4.4 No candidate ver: libmbca0 No candidate ver: liblwres40 No candidate ver: hotkey-setup No candidate ver: libkrb53 No candidate ver: ttf-bitstream-vera No candidate ver: libeel2-2 No candidate ver: libopal-2.2 No candidate ver: songbird No candidate ver: plib1.8.4c2 No candidate ver: linux-image-2.6.27-7-generic No candidate ver: libpoppler3 No candidate ver: google-chrome-unstable No candidate ver: linux-image-2.6.28-11-generic No candidate ver: linux-restricted-modules-2.6.28-14-generic No candidate ver: simgear1.0.0 No candidate ver: libpoppler-glib3 No candidate ver: mono-common No candidate ver: libx264-65 No candidate ver: libwvstreams4.4-extras No candidate ver: libdns43 No candidate ver: libnm-glib0 No candidate ver: libpt2.6.1 No candidate ver: libisccc40 No candidate ver: libdns45 Your system is up-to-date There are no upgrades available for your system. The upgrade will now be canceled. Do you want to start the upgrdae? Continue [yN] Details [d] (Sorry that is so long...) I'm assuming I'm missing each of those packages. However, when I try to install them, for example: sudo apt-get install libisc44 I get some response that this package is missing and/or it may be part of another package. I'm not exactly sure what I should do. I don't want to reinstall ubuntu, since I have it dual booted with Windows Vista and I don't want to risk anything on the Windows partition. What are your thoughts? EDIT: I've posted this on Ubuntu Forums and nobody ever responded so...yah

    Read the article

  • Ubuntu error: no candidate ver

    - by codedude
    Ok...so for some reason by Ubuntu 10.04 partition won't startup anymore. I'm not exactly sure what I did. I have the feeling that I accidentally removed some important packages. However, when I startup in Recovery Mode and select "dpkg: repair broken packages" I get this output: rm: cannot remove /var/lib/apt/lists/partial/*': No such file or directory rm: cannot remove/var/cache/apt/archives/partial/*': No such file or directory Reading Cache Reading Package lists: Done Reading State Information: Done Reading State Information: Done Reading State Information: Done No candidate ver: libisc44 No candidate ver: readahead No candidate ver: libdirectfb-1.0-0 No candidate ver: upstart-logd No candidate ver: libparted1.8-10 No candidate ver: libflickrnet2.1.5-cil No candidate ver: libicu38 No candidate ver: fast-user-switch-applet No candidate ver: linux-restricted-modules-2.6.28-11-generic No candidate ver: libnm-util0 No candidate ver: libwebkit-1.0-1 No candidate ver: libopal3.6.1 No candidate ver: libbind9-40 No candidate ver: linux-restricted-modules-common No candidate ver: upstart-compat-sysv No candidate ver: linux-restricted-modules-2.6.28-13-generic No candidate ver: chromium-browser No candidate ver: libisc45 No candidate ver: belocs-locales-bin No candidate ver: libxcb-xlib0 No candidate ver: libpoppler4 No candidate ver: libpulsecore9 No candidate ver: libpulsecore5 No candidate ver: linux-image-2.6.28-15-generic No candidate ver: libntfs-3g49 No candidate ver: libisccfg40 No candidate ver: libavahi-core5 No candidate ver: linux-restricted-modules-2.6.27-7-generic No candidate ver: libparted1.8-9 No candidate ver: libmagickwand1 No candidate ver: libwvstreams4.4-base No candidate ver: linux-image-2.6.28-14-generic No candidate ver: libraw1394-8 No candidate ver: libdatrie0 No candidate ver: libboost-program-options1.35.0 No candidate ver: libgnomekbdui3 No candidate ver: libsgutils1 No candidate ver: libass1 No candidate ver: linux-restricted-modules-2.6.28-15-generic No candidate ver: libindicate1 No candidate ver: libgnomekbd3 No candidate ver: system-services No candidate ver: linux-image-2.6.28-13-generic No candidate ver: libmagick10 No candidate ver: libcolamd-3.2.0 No candidate ver: desktop-effects-kde No candidate ver: picasa No candidate ver: libgnome-desktop-2-7 No candidate ver: libntfs-3g28 No candidate ver: libxklavier12 No candidate ver: libgpod3 No candidate ver: libmagickcore1 No candidate ver: libffado0 No candidate ver: libzephyr3 No candidate ver: libuniconf4.4 No candidate ver: libmbca0 No candidate ver: liblwres40 No candidate ver: hotkey-setup No candidate ver: libkrb53 No candidate ver: ttf-bitstream-vera No candidate ver: libee12-2 No candidate ver: libopal-2.2 No candidate ver: songbird No candidate ver: plib1.8.4c2 No candidate ver: linux-image-2.6.27-7-generic No candidate ver: libpoppler3 No candidate ver: google-chrome-unstable No candidate ver: linux-image-2.6.28-11-generic No candidate ver: linux-restricted-modules-2.6.28-14-generic No candidate ver: simgear1.0.0 No candidate ver: libpoppler-glib3 No candidate ver: mono-common No candidate ver: libx264-65 No candidate ver: libwvstreams4.4-extras No candidate ver: libdns43 No candidate ver: libnm-glib0 No candidate ver: libpt2.6.1 No candidate ver: libisccc40 No candidate ver: libdns45 No candidate ver: libisc44 No candidate ver: readahead No candidate ver: libdirectfb-1.0-0 No candidate ver: upstart-logd No candidate ver: libparted1.8-10 No candidate ver: libflickrnet2.1.5-cil No candidate ver: libicu38 No candidate ver: fast-user-switch-applet No candidate ver: linux-restricted-modules-2.6.28-11-generic No candidate ver: libnm-util0 No candidate ver: libwebkit-1.0-1 No candidate ver: libopal3.6.1 No candidate ver: libbind9-40 No candidate ver: linux-restricted-modules-common No candidate ver: upstart-compat-sysv No candidate ver: linux-restricted-modules-2.6.28-13-generic No candidate ver: chromium-browser No candidate ver: libisc45 No candidate ver: belocs-locales-bin No candidate ver: libxcb-xlib0 No candidate ver: libpoppler4 No candidate ver: libpulsecore9 No candidate ver: lipulsecore5 No candidate ver: linux-image-2.6.28-15-generic No candidate ver: libntfs-3g49 No candidate ver: libisccfg40 No candidate ver: libavahi-core5 No candidate ver: linux-restricted-modules-2.6.27-7-generic No candidate ver: libparted1.8-9 No candidate ver: libmagickwand1 No candidate ver: linux-image-2.6.28-14-generic No candidate ver: libraw1394-8 No candidate ver: libdatrie0 No candidate ver: libboost-program-options1.35.0 No candidate ver: libgnomekbdui3 No candidate ver: libsgutils1 No candidate ver: libass1 No candidate ver: linux-restricted-modules-2.6.28-15-generic No candidate ver: libindicate1 No candidate ver: libgnomekbd3 No candidate ver: system-services No candidate ver: linux-image-2.6.28-13-generic No candidate ver: libmagick10 No candidate ver: libcolamd-3.2.0 No candidate ver: desktop-effects-kde No candidate ver: picasa No candidate ver: libgnome-desktop-2-7 No candidate ver: libntfs-3g28 No candidate ver: libxklavier12 No candidate ver: libgpod3 No candidate ver: libmagickcore1 No candidate ver: libffado0 No candidate ver: libzephyr3 No candidate ver: libuniconf4.4 No candidate ver: libmbca0 No candidate ver: liblwres40 No candidate ver: hotkey-setup No candidate ver: libkrb53 No candidate ver: ttf-bitstream-vera No candidate ver: libeel2-2 No candidate ver: libopal-2.2 No candidate ver: songbird No candidate ver: plib1.8.4c2 No candidate ver: linux-image-2.6.27-7-generic No candidate ver: libpoppler3 No candidate ver: google-chrome-unstable No candidate ver: linux-image-2.6.28-11-generic No candidate ver: linux-restricted-modules-2.6.28-14-generic No candidate ver: simgear1.0.0 No candidate ver: libpoppler-glib3 No candidate ver: mono-common No candidate ver: libx264-65 No candidate ver: libwvstreams4.4-extras No candidate ver: libdns43 No candidate ver: libnm-glib0 No candidate ver: libpt2.6.1 No candidate ver: libisccc40 No candidate ver: libdns45 Your system is up-to-date There are no upgrades available for your system. The upgrade will now be canceled. Do you want to start the upgrdae? Continue [yN] Details [d] (Sorry that is so long...) I'm assuming I'm missing each of those packages. However, when I try to install them, for example: sudo apt-get install libisc44 I get some response that this package is missing and/or it may be part of another package. I'm not exactly sure what I should do. I don't want to reinstall ubuntu, since I have it dual booted with Windows Vista and I don't want to risk anything on the Windows partition. What are your thoughts? EDIT: I've posted this on Ubuntu Forums and nobody ever responded so...yah

    Read the article

  • Imperative vs. LINQ Performance on WP7

    - by Bil Simser
    Jesse Liberty had a nice post presenting the concepts around imperative, LINQ and fluent programming to populate a listbox. Check out the post as it’s a great example of some foundational things every .NET programmer should know. I was more interested in what the IL code that would be generated from imperative vs. LINQ was like and what the performance numbers are and how they differ. The code at the instruction level is interesting but not surprising. The imperative example with it’s creating lists and loops weighs in at about 60 instructions. .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } 1: .method private hidebysig instance void ImperativeMethod() cil managed 2: { 3: .maxstack 3 4: .locals init ( 5: [0] class [mscorlib]System.Collections.Generic.IEnumerable`1<int32> someData, 6: [1] class [mscorlib]System.Collections.Generic.List`1<int32> inLoop, 7: [2] int32 n, 8: [3] class [mscorlib]System.Collections.Generic.IEnumerator`1<int32> CS$5$0000, 9: [4] bool CS$4$0001) 10: L_0000: nop 11: L_0001: ldc.i4.1 12: L_0002: ldc.i4.s 50 13: L_0004: call class [mscorlib]System.Collections.Generic.IEnumerable`1<int32> [System.Core]System.Linq.Enumerable::Range(int32, int32) 14: L_0009: stloc.0 15: L_000a: newobj instance void [mscorlib]System.Collections.Generic.List`1<int32>::.ctor() 16: L_000f: stloc.1 17: L_0010: nop 18: L_0011: ldloc.0 19: L_0012: callvirt instance class [mscorlib]System.Collections.Generic.IEnumerator`1<!0> [mscorlib]System.Collections.Generic.IEnumerable`1<int32>::GetEnumerator() 20: L_0017: stloc.3 21: L_0018: br.s L_003a 22: L_001a: ldloc.3 23: L_001b: callvirt instance !0 [mscorlib]System.Collections.Generic.IEnumerator`1<int32>::get_Current() 24: L_0020: stloc.2 25: L_0021: nop 26: L_0022: ldloc.2 27: L_0023: ldc.i4.5 28: L_0024: cgt 29: L_0026: ldc.i4.0 30: L_0027: ceq 31: L_0029: stloc.s CS$4$0001 32: L_002b: ldloc.s CS$4$0001 33: L_002d: brtrue.s L_0039 34: L_002f: ldloc.1 35: L_0030: ldloc.2 36: L_0031: ldloc.2 37: L_0032: mul 38: L_0033: callvirt instance void [mscorlib]System.Collections.Generic.List`1<int32>::Add(!0) 39: L_0038: nop 40: L_0039: nop 41: L_003a: ldloc.3 42: L_003b: callvirt instance bool [mscorlib]System.Collections.IEnumerator::MoveNext() 43: L_0040: stloc.s CS$4$0001 44: L_0042: ldloc.s CS$4$0001 45: L_0044: brtrue.s L_001a 46: L_0046: leave.s L_005a 47: L_0048: ldloc.3 48: L_0049: ldnull 49: L_004a: ceq 50: L_004c: stloc.s CS$4$0001 51: L_004e: ldloc.s CS$4$0001 52: L_0050: brtrue.s L_0059 53: L_0052: ldloc.3 54: L_0053: callvirt instance void [mscorlib]System.IDisposable::Dispose() 55: L_0058: nop 56: L_0059: endfinally 57: L_005a: nop 58: L_005b: ldarg.0 59: L_005c: ldfld class [System.Windows]System.Windows.Controls.ListBox PerfTest.MainPage::LB1 60: L_0061: ldloc.1 61: L_0062: callvirt instance void [System.Windows]System.Windows.Controls.ItemsControl::set_ItemsSource(class [mscorlib]System.Collections.IEnumerable) 62: L_0067: nop 63: L_0068: ret 64: .try L_0018 to L_0048 finally handler L_0048 to L_005a 65: } 66:   67: Compare that to the IL generated for the LINQ version which has about half of the instructions and just gets the job done, no fluff. .csharpcode, .csharpcode pre { font-size: small; color: black; font-family: consolas, "Courier New", courier, monospace; background-color: #ffffff; /*white-space: pre;*/ } .csharpcode pre { margin: 0em; } .csharpcode .rem { color: #008000; } .csharpcode .kwrd { color: #0000ff; } .csharpcode .str { color: #006080; } .csharpcode .op { color: #0000c0; } .csharpcode .preproc { color: #cc6633; } .csharpcode .asp { background-color: #ffff00; } .csharpcode .html { color: #800000; } .csharpcode .attr { color: #ff0000; } .csharpcode .alt { background-color: #f4f4f4; width: 100%; margin: 0em; } .csharpcode .lnum { color: #606060; } 1: .method private hidebysig instance void LINQMethod() cil managed 2: { 3: .maxstack 4 4: .locals init ( 5: [0] class [mscorlib]System.Collections.Generic.IEnumerable`1<int32> someData, 6: [1] class [mscorlib]System.Collections.Generic.IEnumerable`1<int32> queryResult) 7: L_0000: nop 8: L_0001: ldc.i4.1 9: L_0002: ldc.i4.s 50 10: L_0004: call class [mscorlib]System.Collections.Generic.IEnumerable`1<int32> [System.Core]System.Linq.Enumerable::Range(int32, int32) 11: L_0009: stloc.0 12: L_000a: ldloc.0 13: L_000b: ldsfld class [System.Core]System.Func`2<int32, bool> PerfTest.MainPage::CS$<>9__CachedAnonymousMethodDelegate6 14: L_0010: brtrue.s L_0025 15: L_0012: ldnull 16: L_0013: ldftn bool PerfTest.MainPage::<LINQProgramming>b__4(int32) 17: L_0019: newobj instance void [System.Core]System.Func`2<int32, bool>::.ctor(object, native int) 18: L_001e: stsfld class [System.Core]System.Func`2<int32, bool> PerfTest.MainPage::CS$<>9__CachedAnonymousMethodDelegate6 19: L_0023: br.s L_0025 20: L_0025: ldsfld class [System.Core]System.Func`2<int32, bool> PerfTest.MainPage::CS$<>9__CachedAnonymousMethodDelegate6 21: L_002a: call class [mscorlib]System.Collections.Generic.IEnumerable`1<!!0> [System.Core]System.Linq.Enumerable::Where<int32>(class [mscorlib]System.Collections.Generic.IEnumerable`1<!!0>, class [System.Core]System.Func`2<!!0, bool>) 22: L_002f: ldsfld class [System.Core]System.Func`2<int32, int32> PerfTest.MainPage::CS$<>9__CachedAnonymousMethodDelegate7 23: L_0034: brtrue.s L_0049 24: L_0036: ldnull 25: L_0037: ldftn int32 PerfTest.MainPage::<LINQProgramming>b__5(int32) 26: L_003d: newobj instance void [System.Core]System.Func`2<int32, int32>::.ctor(object, native int) 27: L_0042: stsfld class [System.Core]System.Func`2<int32, int32> PerfTest.MainPage::CS$<>9__CachedAnonymousMethodDelegate7 28: L_0047: br.s L_0049 29: L_0049: ldsfld class [System.Core]System.Func`2<int32, int32> PerfTest.MainPage::CS$<>9__CachedAnonymousMethodDelegate7 30: L_004e: call class [mscorlib]System.Collections.Generic.IEnumerable`1<!!1> [System.Core]System.Linq.Enumerable::Select<int32, int32>(class [mscorlib]System.Collections.Generic.IEnumerable`1<!!0>, class [System.Core]System.Func`2<!!0, !!1>) 31: L_0053: stloc.1 32: L_0054: ldarg.0 33: L_0055: ldfld class [System.Windows]System.Windows.Controls.ListBox PerfTest.MainPage::LB2 34: L_005a: ldloc.1 35: L_005b: callvirt instance void [System.Windows]System.Windows.Controls.ItemsControl::set_ItemsSource(class [mscorlib]System.Collections.IEnumerable) 36: L_0060: nop 37: L_0061: ret 38: } Again, not surprising here but a good indicator that you should consider using LINQ where possible. In fact if you have ReSharper installed you’ll see a squiggly (technical term) in the imperative code that says “Hey Dude, I can convert this to LINQ if you want to be c00L!” (or something like that, it’s the 2010 geek version of Clippy). What about the fluent version? As Jon correctly pointed out in the comments, when you compare the IL for the LINQ code and the IL for the fluent code it’s the same. LINQ and the fluent interface are just syntactical sugar so you decide what you’re most comfortable with. At the end of the day they’re both the same. Now onto the numbers. Again I expected the imperative version to be better performing than the LINQ version (before I saw the IL that was generated). Call it womanly instinct. A gut feel. Whatever. Some of the numbers are interesting though. For Jesse’s example of 50 items, the numbers were interesting. The imperative sample clocked in at 7ms while the LINQ version completed in 4. As the number of items went up, the elapsed time didn’t necessarily climb exponentially. At 500 items they were pretty much the same and the results were similar up to about 50,000 items. After that I tried 500,000 items where the gap widened but not by much (2.2 seconds for imperative, 2.3 for LINQ). It wasn’t until I tried 5,000,000 items where things were noticeable. Imperative filled the list in 20 seconds while LINQ took 8 seconds longer (although personally I wouldn’t suggest you put 5 million items in a list unless you want your users showing up at your door with torches and pitchforks). Here’s the table with the full results. Method/Items 50 500 5,000 50,000 500,000 5,000,000 Imperative 7ms 7ms 38ms 223ms 2230ms 20974ms LINQ/Fluent 4ms 6ms 41ms 240ms 2310ms 28731ms Like I said, at the end of the day it’s not a huge difference and you really don’t want your users waiting around for 30 seconds on a mobile device filling lists. In fact if Windows Phone 7 detects you’re taking more than 10 seconds to do any one thing, it considers the app hung and shuts it down. The results here are for Windows Phone 7 but frankly they're the same for desktop and web apps so feel free to apply it generally. From a programming perspective, choose what you like. Some LINQ statements can get pretty hairy so I usually fall back with my simple mind and write it imperatively. If you really want to impress your friends, write it old school then let ReSharper do the hard work for! Happy programming!

    Read the article

  • I want to build a Virtual Machine, are there any good references?

    - by Michael Stum
    I'm looking to build a Virtual Machine as a platform independent way to run some game code (essentially scripting). The Virtual Machines that I'm aware of in games are rather old: Infocom's Z-Machine, LucasArts' SCUMM, id Software's Quake 3. As a .net Developer, I'm familiar with the CLR and looked into the CIL Instructions to get an overview of what you actually implement on a VM Level (vs. the language level). I've also dabbled a bit in 6502 Assembler during the last year. The thing is, now that I want¹ to implement one, I need to dig a bit deeper. I know that there are stack based and register based VMs, but I don't really know which one is better at what and if there are more or hybrid approaches. I need to deal with memory management, decide which low level types are part of the VM and need to understand why stuff like ldstr works the way it does. My only reference book (apart from the Z-Machine stuff) is the CLI Annotated Standard, but I wonder if there is a better, more general/fundamental lecture for VMs? Basically something like the Dragon Book, but for VMs? I'm aware of Donald Knuth's Art of Computer Programming which uses a register-based VM, but I'm not sure how applicable that series still is, especially since it's still unfinished? Clarification: The goal is to build a specialized VM. For example, Infocom's Z-Machine contains OpCodes for setting the Background Color or playing a sound. So I need to figure out how much goes into the VM as OpCodes vs. the compiler that takes a script (language TBD) and generates the bytecode from it, but for that I need to understand what I'm really doing. ¹ I know, modern technology would allow me to just interpret a high level scripting language on the fly. But where is the fun in that? :) It's also a bit hard to google because Virtual Machines is nowadays often associated with VMWare-type OS Virtualization...

    Read the article

  • Problem running apt-get DPKG broken?

    - by nekochan7
    Problem when runing apt-get debian av # sudo dpkg --configure -a Setting up libgdata2.1-cil (2.2.0.0-2) ... mono: ../nptl/pthread_mutex_lock.c:80: __pthread_mutex_cond_lock: Assertion `mutex->__data.__owner == 0' failed. Native stacktrace: /usr/bin/mono() [0x4ac5a1] /lib/x86_64-linux-gnu/libpthread.so.0(+0xf8f0) [0x7fee2c0e88f0] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x37) [0x7fee2bd65407] /lib/x86_64-linux-gnu/libc.so.6(abort+0x148) [0x7fee2bd68508] /lib/x86_64-linux-gnu/libc.so.6(+0x2e516) [0x7fee2bd5e516] /lib/x86_64-linux-gnu/libc.so.6(+0x2e5c2) [0x7fee2bd5e5c2] /lib/x86_64-linux-gnu/libpthread.so.0(+0x113f6) [0x7fee2c0ea3f6] /lib/x86_64-linux-gnu/libpthread.so.0(pthread_cond_wait+0x150) [0x7fee2c0e5140] /usr/bin/mono() [0x6058b3] /usr/bin/mono() [0x5fdd25] /usr/bin/mono() [0x604077] /lib/x86_64-linux-gnu/libpthread.so.0(+0x80ca) [0x7fee2c0e10ca] /lib/x86_64-linux-gnu/libc.so.6(clone+0x6d) [0x7fee2be1605d] Debug info from gdb: ================================================================= Got a SIGABRT while executing native code. This usually indicates a fatal error in the mono runtime or one of the native libraries used by your application. ================================================================= Aborted mono: ../nptl/pthread_mutex_lock.c:80: __pthread_mutex_cond_lock: Assertion `mutex->__data.__owner == 0' failed. Native stacktrace: /usr/bin/mono() [0x4ac5a1] /lib/x86_64-linux-gnu/libpthread.so.0(+0xf8f0) [0x7fcec8eef8f0] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x37) [0x7fcec8b6c407] /lib/x86_64-linux-gnu/libc.so.6(abort+0x148) [0x7fcec8b6f508] /lib/x86_64-linux-gnu/libc.so.6(+0x2e516) [0x7fcec8b65516] /lib/x86_64-linux-gnu/libc.so.6(+0x2e5c2) [0x7fcec8b655c2] /lib/x86_64-linux-gnu/libpthread.so.0(+0x113f6) [0x7fcec8ef13f6] /lib/x86_64-linux-gnu/libpthread.so.0(pthread_cond_wait+0x150) [0x7fcec8eec140] /usr/bin/mono() [0x6058b3] /usr/bin/mono() [0x5fdd25] /usr/bin/mono() [0x604077] /lib/x86_64-linux-gnu/libpthread.so.0(+0x80ca) [0x7fcec8ee80ca] /lib/x86_64-linux-gnu/libc.so.6(clone+0x6d) [0x7fcec8c1d05d] Debug info from gdb:

    Read the article

  • IL short-form instructions aren't short?

    - by Alix
    Hi. I was looking at the IL code of a valid method with Reflector and I've run into this: L_00a5: leave.s L_0103 Instructions with the suffix .s are supposed to take an int8 operand, and sure enough this is should be the case with Leave_S as well. However, 0x0103 is 259, which exceeds the capacity of an int8. The method somehow works, but when I read the instructions with method Mono.Reflection.Disassembler.GetInstructions it retrieves L_00a5: leave.s L_0003 that is, 3 instead of 259, because it's supposed to be an int8. So, my question: how is the original instruction (leave.s L_0103) possible? I have looked at the ECMA documentation for that (Partition III: CIL Instruction Set) and I can't find anything that explains it. Any ideas? Thanks.

    Read the article

  • Is Lightweight Code Generation (LCG) dead?

    - by Greg Beech
    In the .NET 2.0-3.5 frameworks, LCG (aka the DynamicMethod class) was a decent way to emit lightweight methods at runtime when no class structure was needed to support them. In .NET 4.0, expression trees now support statements and blocks, and as such appear to provide sufficient functionality to build just about any functionality you could require from such a method, and can be constructed in a much easier and safer way than directly emitting CIL op-codes. (This statement is borne from today's experimentation of converting some of our most complex LCG code to use expression tree building and compilation instead.) So is there any reason why one would use LCG in any new code? Is there anything it can do that expression trees cannot? Or is it now a 'dead' piece of functionality?

    Read the article

< Previous Page | 1 2 3  | Next Page >