Search Results

Search found 1557 results on 63 pages for 'daniel gollas'.

Page 37/63 | < Previous Page | 33 34 35 36 37 38 39 40 41 42 43 44  | Next Page >

  • Receiving an object in a unmanaged callback function

    - by Daniel Baulig
    Eg. I have following delegate method I want to use as a callback function with unmanaged code: public delegate void Callback(IntPtr myObject); Callback callback; I register it in the following way: [DllImport("a.dll")] public static void registerCallback(IntPtr callbackFunction, IntPtr anObject); // ... this.myObject = new MyClass(); this.objectPin = GCHandle.Alloc(this.myObject, GCHandleType.Pinned); registerCallback(Marshal.GetFunctionPointerForDelegate(callback), objectPin.AddrOfPinnedObject()); Now whenever the callback function is called it will have a Pointer/Handle of an object of the MyClass class. I could use Marshal.PtrToStructure to convert this to an object of MyClass. However, what I would like to have is that the delegate definition already contains the class MyClass. eg.: public delegate void Callback(MyClass myObject); I tried this, but it will not work. I also tried the following, which did not work: public delegate void Callback([MarshalAs(UnmanagedType.IUnknown)]MyClass myObject); I suppose I would need something like "UnmarshalAs" at this point, but sadly this is not available. Any suggestions how I could get lost of that IntPtr in my callback function and get a it packed up as a regular, managed MyClass object?

    Read the article

  • VB.NET LINQ to SQL Delete All Records

    - by Daniel
    I am having problems with deleting all records in a table with VB.NET. I am using this code to delete all records in the Contacts table For Each contact In database.Contacts database.Contacts.DeleteOnSubmit(contact) Next But I get this error Can't perform Create, Update or Delete operations on 'Table(Contact)' because it has no primary key. Anyone have any suggestions? Thanks

    Read the article

  • Drupal VS Zikula

    - by DaNieL
    Hi guys! Im new to drupal (just finished my first web site with it), i found it very simple and powerfull to use. Recently, i've been asked to build a community with Zikula. They prefer to use zikula becose it is the 'evolution' of phpnuke, that is the cms that they currently use (i have 'restayling and rebuild' it). Moreover, I want learn and use just 1 cms. So, what are the main differences between drupal and zikula? What are the advantages and disadvantages of one and other? Why should I choose Drupal or Zikula? p.s: i know that the most of the times the answer is 'its all about your needs', but this is supposed to be a general question

    Read the article

  • Handling User Authentication in .NET?

    - by Daniel
    I am new to .NET, and don't have much experience in programming. What is the standard way of handling user authentication in .NET in the following situation? In Process A, User inputs ID/Password Process A sends the ID/Password to Process B over a nonsecure public channel. Process B authenticates the user with the recieved ID/Password what are some of the standard cryptographic algorithms I can use in above model?

    Read the article

  • Why does my call to Activator.CreateInstance intermittently fail?

    - by Daniel Stutzbach
    I'm using the following code to access the Windows Explorer Shell's band site service: Guid GUID_TrayBandSiteService = new Guid(0xF60AD0A0, 0xE5E1, 0x45cb, 0xB5, 0x1A, 0xE1, 0x5B, 0x9F, 0x8B, 0x29, 0x34); Type shellTrayBandSiteService = Type.GetTypeFromCLSID(GUID_TrayBandSiteService, true); site = Activator.CreateInstance(shellTrayBandSiteService) as IBandSite; Mostly, it works great. A very small percentage of the time (less than 1%), the call to Activator.CreateInstance throws the following exception: System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {F60AD0A0-E5E1-45CB-B51A-E15B9F8B2934} failed due to the following error: 80040154. at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck) at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache) at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache) at System.Activator.CreateInstance(Type type, Boolean nonPublic) I've looked up the error code, and it appears to indicate that the service isn't registered. That's nonsense in my case, since I'm trying to access a service provided by the operating system (explorer.exe, to be specific). I'm stumped. What might cause Activator.CreateInstance fail, but only rarely?

    Read the article

  • How to output two ddl files at the same time with using maven hbm2ddl plugin

    - by daniel-cai
    Our application needs to use two different kinds of databases.One is oracle, the other is mysql and we want to use maven plugin hbm2ddl to generate the ddl file, and want to output the two ddl files at the same time, I don't know how to set the configuration in pom.xml. I tried to use this plugin twice, but it always generated one ddl file. Any one encountered such case before ? could u please give some advice.

    Read the article

  • How do I reconnect to Memcache when forking in rails?

    - by Daniel Huckstep
    I have a rails 3 application, and a script called by rails runner. This script forks and does some stuff in other processes. I do the proper thing with ActiveRecord before forking, where I disconnect-fork-reconnect and all that jazz. My question is I also use memcache for the Rails.cache but should I be disconnecting-reconnecting that too for my forks? If so, how would I go about that in the rails way.

    Read the article

  • Javascript performance issue

    - by Daniel
    Hello, I've built a top menu based on superfish, but the amount of displayed items in the menu is huge. And there is also alot of jquery on the top menu. Now to the problem, everytime I load any page that has the menu, the browser(ie7) feels like it looks it locks it self for about 1-2 seconds while the page is being loaded. I'm sure that the top menu is the issue, and I would like to improve the performance of the page.(besides removing the menu and removing the menu items) I've used firebug to see which calls take most of the times, and I the calls are standard jquery or superfish. The top menu is a ascx control. Are they any good ways to let the page load first and the menu later or any other goods ideas to improve the performance?

    Read the article

  • If/Then in SQL Embedded in VBA

    - by Daniel
    I've got a string like this in my Excel VBA: strSQL = "SELECT * FROM Total WHERE (SimulationID = (" & TextBox1.Text & ") And Test1 = (" & Example & "))" However, sometimes Test will be 'is null', which makes the query And Example = is NULL How can I change it to add an if/then statement or something to make it say And Example is null when Example has a value of "is null"?

    Read the article

  • How much network overhead does TLS add compared to a non-encrypted connection?

    - by Daniel Sterling
    (Approximately) how many more bits of data must be transferred over the network during an encrypted connection compared to an unencrypted connection? IIUC, once the TLS handshake has completed, the number of bits transferred is equal to those transferred during an unencrypted connection. Is this accurate? As a follow up, is transferring a large file over https significantly slower than transferring that file over http, given fast processors and the same (ideal) network conditions?

    Read the article

  • Is there a library that can decompile a method into an Expression tree, with support for CLR 4.0?

    - by Daniel Earwicker
    Previous questions have asked if it is possible to turn compiled delegates into expression trees, for example: http://stackoverflow.com/questions/767733/converting-a-net-funct-to-a-net-expressionfunct The sane answers at the time were: It's possible, but very hard and there's no standard library solution. Use Reflector! But fortunately there are some greatly-insane/insanely-great people out there who like reverse engineering things, and they make difficult things easy for the rest of us. Clearly it is possible to decompile IL to C#, as Reflector does it, and so you could in principle instead target CLR 4.0 expression trees with support for all statement types. This is interesting because it wouldn't matter if the compiler's built-in special support for Expression<> lambdas is never extended to support building statement expression trees in the compiler. A library solution could fill the gap. We would then have a high-level starting point for writing aspect-like manipulations of code without having to mess with raw IL. As noted in the answers to the above linked question, there are some promising signs but I haven't succeeded in finding if there's been much progress since by searching. So has anyone finished this job, or got very far with it? Note: CLR 4.0 is now released. Time for another look-see.

    Read the article

  • C function changes behaviour depending on whether it has a call to printf in it

    - by Daniel
    I have a function that processes some data and finds the threshold that classifies the data with the lowest error. It looks like this: void find_threshold(FeatureVal* fvals, sampledata* data, unsigned int num_samples, double* thresh, double* err, int* pol) { //code to calculate minThresh, minErr, minPol omitted printf("minThresh: %f, minErr: %f, minPol: %d\n", minThresh, minErr, minPol); *thresh = minThresh; *err = minErr; *pol = minPol; } Then in my test file I have this: void test_find_threshold() { //code to set up test data omitted find_threshold(fvals, sdata, 6, &thresh, &err, &pol); printf("Expected 5 got %f\n", thresh); assert(eq(thresh, 5.0)); printf("Expected 1 got %d\n", pol); assert(pol == 1); printf("Expected 0 got %f\n", err); assert(eq(err, 0.0)); } This runs and the test passes with the following output: minThresh: 5.000000, minErr: 0.000000, minPol: 1 Expected 5 got 5.000000 Expected 1 got 1 Expected 0 got 0.000000 However if I remove the call to printf() from find_threshold, suddenly the test fails! Commenting out the asserts so that I can see what gets returned, the output is: Expected 5 got -15.000000 Expected 1 got -1 Expected 0 got 0.333333 I cannot make any sense of this whatsoever.

    Read the article

  • Installing a rails plugin from a Git repository

    - by Daniel Beardsley
    I've been trying to install Shoulda script/plugin install git://github.com/thoughtbot/shoulda.git but all I get is: removing: C:/Documents and Settings/Danny/My Documents/Projects/Ruby On Rails/_ProjectName_/vendor/plugins/shoulda/.git > And the vender/plugins directory is empty. I have Rails 2.1.1 installed as a gem and have verified that 2.1.1 is loaded (using a puts inserted into config/boot.rb). Any ideas about what's going on? (this is on a windows box)

    Read the article

  • SVN Import Force for importing existing file

    - by Daniel A. White
    I am creating a text file and a zip file for a tag automatically with MSBuild. My msbuild project is called by cruisecontrol.net. The text file is always going to be latest.txt and the zip file will be (version).zip (so it will be different every time). I do not want to commit these files back to my trunk, so I discovered svn import. On the first time, it works for both. On successive runs, it fails since latest.txt already exists in the repository. Do I need to use svn import --force or something else to get these two files pushed up to my repository?

    Read the article

  • Make a div fall off the page

    - by Daniel Hertz
    Hey, So I have been playing with jQuery for a good time now and I'm trying to get an effect to work properly. I have a main square div in the middle of the page and when someone clicks a link I want the box to look like its falling off the page and disappear, revealing a new page behind it. I'v been playing with the easing plugin but I can seem to get what I want to work. Basically I have the div's top margin or just top distance increased to a large number. However, this just makes the div fall but it also expands my page and its just much lower on the page. I basically want the div to fall out of site and not change the dimensions of the site. Anyone know how to do that? Thanks! Danny

    Read the article

  • What is the equivalent of <composite-element> in Castle ActiveRecord?

    - by Daniel T.
    I have a TrackLog that has a collection of TrackPoints: public class TrackLog { public string Name { get; set; } public ISet<TrackPoint> TrackPoints { get; set; } } public class TrackPoint { public DateTime Timestamp { get; set; } public double Latitude { get; set; } public double Longitude { get; set; } } I'd like to map the track points as a collection of components, as this makes the most sense. According to the book NHibernate in Action, on page 187: Collections of components are mapped similarily to other collections of value type instances. The only difference is the use of <composite-element> in place of the familiar <element> tag. How would I do this using Castle ActiveRecord attributes?

    Read the article

  • In OpenRasta, how do I configure a URI where I get "the remainder of the path" as a single string?

    - by Daniel Earwicker
    Normally in OpenRasta there is some configuration like this: ResourceSpace.Has.ResourcesOfType<Customers>() .AtUri("/customers/region/{region}") ... // and so on ... where the {region} part of the path is automatically mapped to a string parameter in the handling method. So if the user hits: http://server/customers/region/emea Then the handler method is passed the string "emea". As well as doing this, I'd like to register a handler with something like this: ResourceSpace.Has.ResourcesOfType<Customers>() .AtUri("/someotherthing/*") ... // and so on In this imaginary syntax, the asterisk would mean "take the rest of the path, including slashes, to be a single string parameter to pass to the handling method". And so if the user hits: http://server/someotherthing/how/about/this?that=other Then my handler method receives a string parameter: how/about/this?that=other Is such a thing possible in OpenRasta? In Sinatra (Ruby) I'd use a regular expression to do exactly this.

    Read the article

  • What bugs apply to the different FindBugs reportLevels?

    - by Daniel H
    According to the Ant task, the report level is a low/medium/high setting that would look for bugs of different criticallity levels. However, there isn't anything I could find that explains which of the bugs apply to these different reporting levels. Is there somewhere that provides this, even if it is something I need to look at within the source?

    Read the article

  • Visual Basic .NET Help

    - by Daniel
    How can I get this code into a loop? contact.first_name = list.Item(0) contact.middle_name = list.Item(1) contact.last_name = list.Item(2) contact.age = list.Item(3) contact.mobile_phone = list.Item(4) contact.home_phone = list.Item(5) contact.work_phone = list.Item(6) contact.home_street = list.Item(7) contact.home_city = list.Item(8) contact.home_state = list.Item(9) contact.home_zip = list.Item(10) contact.work_street = list.Item(11) contact.work_city = list.Item(12) contact.work_state = list.Item(13) contact.work_zip = list.Item(14)

    Read the article

  • How to implement a countdown clock on a product launch web page?

    - by Daniel Earwicker
    I'm asking this on behalf of a certain corporation: http://www.microsoft.com/visualstudio/en-us/watch-it-live Things to bear in mind: It's 8:30 AM at different times depending on where you are in the world. For example, where I am, it is already 10 AM, whereas in Redmond it's still only 2 AM. That's probably the main thing, I guess. Can any SO users recommend ways to improve the existing countdown page so that it works correctly for users in any timezone? (Serious question - clearly this is a pit that is easy to fall into!)

    Read the article

  • Programmer tendency to preach [closed]

    - by Daniel
    I've run across several SO posts that come across as preachy or condescending. Do pedagogical programmers feel plagued by thoughtless questions? Or, do programmers count self-sufficiency such a virtue that any perceived lack of ambition merits scolding? These are some theories, admittedly negative ones. Can anyone offer some insight?

    Read the article

  • Cannot run texi2dvi on R Ubuntu

    - by João Daniel
    I'm trying to generate a pdf file from a tex file from R, but I'm getting the following error: > tools::texi2dvi("teste.tex",) Error in tools::texi2dvi("teste.tex", ) : Running 'texi2dvi' on 'teste.tex' failed. Messages: sed: can't read ./teste.tex: Permission denied mkdir: cannot create directory `teste.t2d': Permission denied /usr/bin/texi2dvi: cannot create directory: teste.t2d The user owns the file teste.tex and also the folder it's located. I'm running it into Ubuntu 12.04 and R 2.15.0 Does anyone knows what's going on?

    Read the article

  • Open Office Impress

    - by Daniel Ray
    Hi I have seen that in some question around presentation you suggest using OO Impress for this. I am trying to show multiple presentation in a non fullscreen window, but havent been very successful so far. Ideally I want to be able to move this presentation windows around the screen. I have searched the Open Office forum but the is almost nothing concerning this topic and noone seems to know the answer to my question. Im trying to do this in C#. I would be very thankfull if you can give me some directions, how to do this. Thank you

    Read the article

< Previous Page | 33 34 35 36 37 38 39 40 41 42 43 44  | Next Page >