Search Results

Search found 2126 results on 86 pages for 'wrapper'.

Page 53/86 | < Previous Page | 49 50 51 52 53 54 55 56 57 58 59 60  | Next Page >

  • How might one implement FileTimeToSystemTime?

    - by Billy ONeal
    Hello :) I'm writing a simple wrapper around the Win32 FILETIME structure. boost::datetime has most of what I want, except I need whatever date type I end up using to interpolate with Windows APIs without issues. To that end, I've decided to write my own things for doing this -- most of the operations aren't all that complicated. I'm implementing the TimeSpan - like type at this point, but I'm unsure how I'd implement FileTimeToSystemTime. I could just use the system's built-in FileTimeToSystemTime function, except FileTimeToSystemTime cannot handle negative dates -- I need to be able to represent something like "-12 seconds". How should something like this be implemented? Billy3

    Read the article

  • Adapting methods which return true/false

    - by James P.
    What's the best practise when adapting C-style functions which return a true/false to Java? Here's a simple method to illustrate where the problem lies. public static boolean fileNameEndsWithExtension( String filename, String fileExtension) { return filename.endsWith( fileExtension ); } Note that there's probably a more elegant way of filtering files (feel free to comment on this). Anyway, if filename is a null value, does one: Return a false if filename is null? If so, how does one go about distinguishing between the case where filename is null and the case where the String or file name doesn't end with a given file extension? Change the return type to the wrapper class Boolean which allows a null value. Throw an Exception and force the programmer to make sure that a null value is never passed to the method? Use another solution?

    Read the article

  • .NET/C# Drizzle database client

    - by FlappySocks
    I am planning to use Drizzle in my next C# Mono app. Since there is no C# client available for Drizzle, I thought I would have a stab at writing my own by converting the Java client, and then making it work with DBLinq. Having seen the Java client, I realise that it's a longer job that I had anticipated, and I don't have the time. Besides the Java client is not all that mature yet. Since there is an official Drizzle C client library (libdrizzle), writing a C# wrapper might be the best solution. Are there any tools available that can assist in generating the code for this?

    Read the article

  • How to intercept deallocate callbacks of Core Foundation objects in Objective-C.

    - by Matteo
    I'm writing an Eiffel wrapper for AppKit and Foundation and I need to hijack all -dealloc methods. Thanks to the dynamic nature of Objective-C it is pretty easy to do that. But the problem is it only works with some of the Foundation or AppKit objects. There are certain objects (e.g. NSString, NSArray, NSDate, ...) that are actually CF objects so the dealloc method doesn't get called. Instead the deallocate callbacks of the allocator that allocated the CF object is called. Is there a way to intercept that?

    Read the article

  • Exposing an ISO C++ class to C#

    - by Stick it to THE MAN
    I need to expose some C++ classes to C# (I am building on Linux, using mono, so COM is not an option) The evidence I have gathered so far suggests that the best way to approach this is: Write a wrapper C++.Net class around the ISO C++ class Consume the C++.Net classes from C# I have the following questions: First, is this the "best" way of achieving the goal of exposing ISO C++ classes to C# ? So far though, I have not seen any examples that actually show how to do this - can anyone suggest some links, or a code snippet to show how this is done for a dummy class? How may I send asynchronous message notifications from the C++ code to the C# code ?. Ideally, I would like to cause the C# class to raise an event, with the received data as an argument

    Read the article

  • I'm getting a ServerException when I try to send objects from a BlackBerry to a Server via a webserv

    - by DanG
    I'm trying to send an array of objects wrapped in an array object wrapper to a WS via JSR172 WS calls. Using the generated stub, I'm able to download objects from the server, but I'm not able to upload objects to the server. This currently happens on all simulators in house. This is all the information I can get out of the server exception: javax.xml.rpc.JAXRPCException: java.rmi.ServerException: Server cannot handle the message because of some temporary condition. Here are the server specs: Windows 7 IIS 7 or 7.5 .NET 3.5 for the WS code written in C#. If anyone knows how to solve this problem, or knows where to look, I'd love to know. Thanks!

    Read the article

  • How do I link a VS2008 C++ project as a DLL instead of a LIB?

    - by Clark Battle
    I have the C++ source code in a Visual Studio project from another developer that compiles into a static lib. I need to change it so that it builds a dll from that code so that I can call it from C#. I went into the project properties in Visual Studio and changed the configuration type to a DLL. However, it now gives lots of linker errors like: error LNK2001: unresolved external symbol __CAP_Enter_Function XXXFilter.obj XXXFramework What else do I need to do in Visual Studio and in the code to produce a dll from the code instead of a lib? The library is huge so writing a wrapper is not an option. I have the code so I should be able to make it build a dll. I am not a very experienced C++ dev but I am in C# and visual studio. Thanks

    Read the article

  • jQuery textbox required validation based on another text box having text

    - by doug
    Pretty basic question, however, I am very new to jQuery and javascript in general. I have a jQuery validation that is requiring a text box to have text in it, if a checkbox is checked. <script type="text/javascript"> $(document).ready(function () { $("form").validate( { rules: { Comments: { required: "#IsAbnormal:checked" } }, messages: { Comments: { required: "Comments are required" } }, onkeyup: false, wrapper: "", errorLabelContainer: "#ErrorMessageBox" }); }); Pretty straight forward, if you check the IsAbnormal checkbox, it will throw a validation if there are no comments. What I am trying to do is require a textbox based on if another text box has any text in it, for instance require the old password if a user enters a new password into a textbox. Is there an easy way to get the required: "#NewPassword:NotBlank" to work?

    Read the article

  • PHP FUNCTION TO AUTOMATICALLY REMOVE WHITESPACE AND TRIM DOWN IDENTIFIERS

    - by H8 MY H0ST
    I HAVE A WEBSITE WHICH GETS WAY TOO MUCH TRAFFIC. MY HOST IS MAKING ME UPGRADE AND I'M LIKE MAN MY SITE MAKES $0 CUZ I AINT NO SPAMMER YA DIGG? I WILL CUT DOWN ON THE BANDWITH AND THEY'RE LIKE OKAY. GONNA DO GZIP. BUT I NEED LIKE A FUNCTION TO STRIP ALL WHITESPACE AND EXTRA SHIT FROM OUTPUT TOO IF POSSIBLE. AND THEN STUFF THAT CAN TURN MY #WRAPPER INTO LIKE #A #B #C ?? USING ZEND FRAMEWORK AT THE MOMENT. THANK YOU ALL VERY MUCH FOR YOUR TIME.

    Read the article

  • Anonymous iterators blocks in Clojure?

    - by Checkers
    I am using clojure.contrib.sql to fetch some records from an SQLite database. (defn read-all-foo [] (let [sql "select * from foo"] (with-connection *db* (with-query-results res [sql] (into [] res))))) Now, I don't really want to realize the whole sequence before returning from the function (i.e. I want to keep it lazy), but if I return res directly or wrap it some kind of lazy wrapper (for example I want to make a certain map transformation on result sequence), SQL bindings will be gone after I return, so realizing the sequence will throw an error. How can I enclose the whole function in a closure and return a kind of anonymous iterator block (like yield in C# or Python)? Or is there another way to return a lazy sequence from this function?

    Read the article

  • Calling this[int index] via reflection

    - by tkutter
    I try to implement a reflection-based late-bound library to Microsoft Office. The properties and methods of the Offce COM objects are called the following way: Type type = Type.GetTypeFromProgID("Word.Application"); object comObject = Activator.CreateInstance(type); type.InvokeMember(<METHOD NAME>, <BINDING FLAGS>, null, comObject, new object[] { <PARAMS>}); InvokeMember is the only possible way because Type.GetMethod / GetProperty works improperly with the COM objects. Methods and properties can be called using InvokeMember but now I have to solve the following problem: Method in the office-interop wrapper: Excel.Workbooks wb = excel.Workbooks; Excel.Workbook firstWb = wb[0]; respectively foreach(Excel.Workbook w in excel.Workbooks) // doSmth. How can I call the this[int index] operator of Excel.Workbooks via reflection?

    Read the article

  • How to debug without Visual Studio?

    - by aF
    Hello, Python - c++ dll - c# dll I have a com interop c# dll that is loaded in a wrapper c++ dll throught the .tlb file generated in c# to be used in a python project. When I run in my computer it works fine but when I run in a computer that just got formated it gives: WindowsError: exception code 0xe0434f4d I have the redistribute c++ installed and the .net compact framework 3.5 on the formatted computer. How can I see what is the correct exception on a computer that does not have visual studio installed? How can I debug all of this? I can't debug the dll's itself can I? Note: in my computer all works well so maybe is some dll or file missing. I allready used Dependency Walker to see if there's some dll missing, and nop!

    Read the article

  • CSS Selector Issue

    - by YsoL8
    Hello html body .home blog logged-in div #wrapper div #page div .cats I have a problem with selecting unordered lists (i.e ul li.class-name class-name-number) at the above dom location in CSS. I am working with a wordpress theme. Basically could I have suggestions for the correct selector to use in order to influence this tag? I can provide a simplified html structure if it will help. I've tried a number of selectors along the lines of: (sometimes)#page (# or .)cats (sometimes)ul li(sometimes with class name) EDIT: I've tried the selectors suggested in the wordpress docs. Thanks!

    Read the article

  • Is there a Java 1.5 varargs API for slf4j yet?

    - by Josh
    I want to get rid of this lot... public void info(String msg); public void info(String format, Object arg); public void info(String format, Object arg1, Object arg2); public void info(String format, Object[] argArray); ...and replace it with this one... public void info(String format, Object ... args); ...so that my logging syntax doesn't have to change depending on the number of arguments I want to log. There seems to be lots of discussion and work around it, but where is it? Or should I wrap the wrapper that is slf4j?

    Read the article

  • Sqlite + Java: table not updating

    - by Ben L
    I'm using a Java wrapper for SQLite called SQLiteJDBC - this may have some bearing on any answers... I have a table which I've displayed in a GUI, within that UI I have a button for the fields for an individual row of that table. When I save my changes I do this... Statement stmt = connection.createStatement(); stmt.execute("update 'tableName' set 'fieldName'=1 where userid=1"); int updateCount = stmt.getUpdateCount(); My connection is valid, I get no exceptions thrown and getUpdateCount() returns '1' indicating that one row has been updated. However my table is not updated. I've spent the last few hours trying to work out what's going on but I'm not having any luck. Help!!

    Read the article

  • Best way to do TDD in express versions of visual studio(eg VB Express)

    - by Nathan W
    I have been looking in to doing some test driven development for one of the applications that I'm currently writing(OLE wrapper for an OLE object). The only problem is that I am using the express versions of Visual Studio(for now), at the moment I am using VB express but sometimes I use C# express. Is it possible to do TDD in the express versions? If so what are the bast was to go about it? Cheers. EDIT. By the looks of things I will have to buy the full visual studio so that I can do integrated TDD, hopefully there is money in the budget to buy a copy :). For now I think I will use Nunit like everyone is saying.

    Read the article

  • Sphinx: change column set for searching in runtime

    - by Fedyashev Nikita
    I use Ultrasphinx gem plugin as a wrapper for accessing Sphinx search daemon. My model declaration: class Foo < ActiveRecord::Base is_indexed :fields => ['content', 'private_notes', 'user_id'] Client code: filters = {} if type == "private" # search only in `content` column filters['user_id'] = current_user.id else # search in `content` and `private_notes` columns end results = Ultrasphinx::Search.new(:query => params[:query], :per_page => 20, :page => params[:page] || 1, :filters => filters) The problem I have now with Ultrasphinx gem(or Sphinx, in general?) is that it does not allow me to change set of fields where to look for matches IN RUNTIME How can I solve this problem?

    Read the article

  • How to align floated elements such that their bottoms match

    - by AJM
    I'm writing a web page where I show a title and a date over some text. My HTML: <div class="post"> <h2>Post 1</h2> <span class="date">February 28, 2011</span> <div class="post-content"> ... </div> </div> My css: .post h2 { float: left; } .date { float: right; } .post-content { clear: both; } What I want to do is vertically align the title and date such that their bottoms match. Right now they don't: I tried wrapping the two text elements in a div, setting the div's position to relative, and using absolute positioning on the two text elements (and taking out the float declarations). That didn't work because the top margin is not preserved due to the wrapper div collapsing, even though I gave it a clearfix class.

    Read the article

  • C# : Redirect console application output : How to flush the output?

    - by user93422
    I am spawning external console application and use async output redirect. as shown in this SO post My problem is it seems that the spawned process needs to produce certain amount of output before I get the OutputDataReceived event notification. I want to receive the OutputDataReceived event as soon as possible. I have a bare-bones redirecting application, and here are some observations: 1. When I call a simple 'while(true) print("X");' console application (C#) I receive output event immediately. 2. When I call a 3d party app I am trying to wrap from the command line I see the line-by-line output. 3. When I call that 3d party app from my bare-bone wrapper (see 1) - the output comes in chunks (about one page size). What happens inside that app? FYI: The app in question is a "USBee DX Data Exctarctor (Async bus) v1.0".

    Read the article

  • An easy way to replace fread()'s with reading from a byte array?

    - by Sam Washburn
    I have a piece of code that needs to be run from a restricted environment that doesn't allow stdio (Flash's Alchemy compiler). The code uses standard fopen/fread functions and I need to convert it to read from a char* array. Any ideas on how to best approach this? Does a wrapper exist or some library that would help? Thanks! EDIT: I should also mention that it's reading in structs. Like this: fread(&myStruct, 1, sizeof(myStruct), f);

    Read the article

  • Run Java Application as a Service

    - by Jason
    I would like to run a Java application as a service. Unfortunately, I am limited in that I can't use something like the Java Service Wrapper (which does appear to be an excellent tool). Is there any way of running an executable JAR, as a service, without relying on external applications? I currently have the service installed, but it fails to start. This is where I am getting stuck and I haven't been able to find anything on Google other than information about the JSW. Thanks.

    Read the article

  • FTP/SFTP module for .NET

    - by Angrius
    I am designing an auto downloader using .NET and C#. I was wondering if there is a decent/robust FTP/SFTP module out there that I can use, preferably free of charge. EDIT: I probably should've noted that I am looking for answer from somebody who tried several and found one that works very well. I currently use .NET wrapper for libcurl for FTP and it does not behave right. For example when I connect to FTP site with Filezilla and provide a path, it finds directory just fine. With libcurl, i get a header for 404 page saying path cannot be found. I am guessing that Filezilla gets 'home' directory correctly, and libcurl puts me to the root (i tried no path, and i had no permissions to access that directory). But anyways, I just don't know enough about FTP itself, so I would like something that just works. Thanks!

    Read the article

  • Placing error message for a checkbox array

    - by eddy
    Hello all. I am using the Validation Plugin for jQuery and it works wonders. Except when I have a group of checkboxes...the error messages will display right after the first checkbox...like so: <tbody> <c:forEach items="${list}" var="item"> <tr> <td align="center"> <input type="checkbox" name="selectItems" value="<c:out value="${item.numberPlate}"/>" /> </td> <!--some other columns--> </tr> </c:forEach> </tbody> I found that I can use a wrapper for these checkboxes ,then place the error message there, but I have no idea how to do it since I'm creating the rows dynamically. Hope you can help me out.

    Read the article

  • .NET platform independant sync framework

    - by Quandary
    Question: I need to synchronize a few ActionScript files from my computer to a network share (backup). I saw a quick fix would be using Microsoft Sync Framework for this, and write a windows service. My problem is I also use Linux, and before I start with MS vendor lockin, is there any sync framework/library/whatever I could use that works accross platform? Or does the MS sync framework work on Linux, too? It is my understanding that it is a wrapper around some com objects, thus it wouldn't work. All I need is synchronizing files. So never mind the database part, although it would be nice to have it, too.

    Read the article

  • Python Class inherit from all submodules

    - by Dhruv Govil
    I'm currently writing a wrapper in python for a lot of custom company tools. I'm basically going to break each tool into its own py file with a class containing the call to the tool as a method. These will all be contained in a package. Then there'll be a master class that will import all from the package, then inherit from each and every class, so as to appear as one cohesive class. masterClass.py pyPackage - __ init__.py - module1.py --class Module1 ---method tool1 - module2.py --class Module2 ---method tool2 etc Right now, I'm autogenerating the master class file to inherit from the packages modules, but I was wondering if there was a more elegant way to do it? ie from package import * class MasterClass(package.all): pass

    Read the article

< Previous Page | 49 50 51 52 53 54 55 56 57 58 59 60  | Next Page >