Search Results

Search found 8301 results on 333 pages for 'types'.

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

  • Is .NET support for Win32 Code Interop?

    - by Usman
    Hello, I need to InterOp Win32 code (unmanaged Win32 DLL's and Exe) completely with .NET. I need to call Win32 unmanaged code(DLL exported functions) at runtime i.e (knowing the types of data types in Win32 signatures and need to pass data according to that type at runtime). This is 100% possible in case of COM. You can convert COM unmanaged code to managed assemblies using tlbimp.exe and use now reflection API to work with those managed types(actual were unmanaged types now converted managed using tlbimp). But same functionality I need to get in terms of Win32(i.e) in .NET framework. How?? I know MS provided Export table reading API ..but I couldn't find exact API for InterOp of Win32 unmanaged code Regards

    Read the article

  • Automatic type conversion in Java?

    - by davr
    Is there a way to do automatic implicit type conversion in Java? For example, say I have two types, 'FooSet' and 'BarSet' which both are representations of a Set. It is easy to convert between the types, such that I have written two utility methods: /** Given a BarSet, returns a FooSet */ public FooSet barTOfoo(BarSet input) { /* ... */ } /** Given a FooSet, returns a BarSet */ public BarSet fooTObar(FooSet input) { /* ... */ } Now say there's a method like this that I want to call: public void doSomething(FooSet data) { /* .. */ } But all I have is a BarSet myBarSet...it means extra typing, like: doSomething(barTOfoo(myBarSet)); Is there a way to tell the compiler that certain types can automatically be cast to other types? I know this is possible in C++ with overloading, but I can't find a way in Java. I want to just be able to type: doSomething(myBarSet); And the compiler knows to automatically call barTOfoo()

    Read the article

  • Drupal: Create custom search

    - by Dr. Hfuhruhurr
    I'm trying to create a custom search but getting stuck. What I want is to have a dropdownbox so the user can choose where to search in. These options can mean 1 or more content types. So if he chooses options A, then the search will look in node-type P,Q,R. But he may not give those results, but only the uid's which will be then themed to gather specific data for that user. To make it a little bit clearer, Suppose I want to llok for people. The what I'm searching in is 2 content profile types. But ofcourse you dont want to display those as a result, but a nice picture of the user and some data. I started with creating a form with a textfield and the dropdown box. Then, in the submit handler, i created the keys and redirected to another pages with those keys as a tail. This page has been defined in the menu hook, just like how search does it. After that I want to call hook_view to do the actual search by calling node_search, and give back the results. Unfortunately, it goes wrong. When i click the Search button, it gives me a 404. But am I on the right track? Is this the way to create a custom search? Thx for your help. Here's the code for some clarity: <?php // $Id$ /* * @file * Searches on Project, Person, Portfolio or Group. */ /** * returns an array of menu items * @return array of menu items */ function vm_search_menu() { $subjects = _vm_search_get_subjects(); foreach ($subjects as $name => $description) { $items['zoek/'. $name .'/%menu_tail'] = array( 'page callback' => 'vm_search_view', 'page arguments' => array($name), 'type' => MENU_LOCAL_TASK, ); } return $items; } /** * create a block to put the form into. * @param $op * @param $delta * @param $edit * @return mixed */ function vm_search_block($op = 'list', $delta = 0, $edit = array()) { switch ($op) { case 'list': $blocks[0]['info'] = t('Algemene zoek'); return $blocks; case 'view': if (0 == $delta) { $block['subject'] = t(''); $block['content'] = drupal_get_form('vm_search_general_form'); } return $block; } } /** * Define the form. */ function vm_search_general_form() { $subjects = _vm_search_get_subjects(); foreach ($subjects as $key => $subject) { $options[$key] = $subject['desc']; } $form['subjects'] = array( '#type' => 'select', '#options' => $options, '#required' => TRUE, ); $form['keys'] = array( '#type' => 'textfield', '#required' => TRUE, ); $form['submit'] = array( '#type' => 'submit', '#value' => t('Zoek'), ); return $form; } function vm_search_general_form_submit($form, &$form_state) { $subjects = _vm_search_get_subjects(); $keys = $form_state['values']['keys']; //the search keys //the content types to search in $keys .= ' type:' . implode(',', $subjects[$form_state['values']['subjects']]['types']); //redirect to the page, where vm_search_view will handle the actual search $form_state['redirect'] = 'zoek/'. $form_state['values']['subjects'] .'/'. $keys; } /** * Menu callback; presents the search results. */ function vm_search_view($type = 'node') { // Search form submits with POST but redirects to GET. This way we can keep // the search query URL clean as a whistle: // search/type/keyword+keyword if (!isset($_POST['form_id'])) { if ($type == '') { // Note: search/node can not be a default tab because it would take on the // path of its parent (search). It would prevent remembering keywords when // switching tabs. This is why we drupal_goto to it from the parent instead. drupal_goto($front_page); } $keys = search_get_keys(); // Only perform search if there is non-whitespace search term: $results = ''; if (trim($keys)) { // Log the search keys: watchdog('vm_search', '%keys (@type).', array('%keys' => $keys, '@type' => $type)); // Collect the search results: $results = node_search('search', $type); if ($results) { $results = theme('box', t('Zoek resultaten'), $results); } else { $results = theme('box', t('Je zoek heeft geen resultaten opgeleverd.')); } } } return $results; } /** * returns array where to look for * @return array */ function _vm_search_get_subjects() { $subjects['opdracht'] = array('desc' => t('Opdracht'), 'types' => array('project') ); $subjects['persoon'] = array('desc' => t('Persoon'), 'types' => array('types_specialisatie', 'smaak_en_interesses') ); $subjects['groep'] = array('desc' => t('Groep'), 'types' => array('Villamedia_groep') ); $subjects['portfolio'] = array('desc' => t('Portfolio'), 'types' => array('artikel') ); return $subjects; }

    Read the article

  • From VB6 to .net via COM and Remoting...What a mess!

    - by Robert
    I have some legacy vb6 applications that need to talk to my .Net engine application. The engine provides an interface that can be connected to via .net Remoting. Now I have a stub class library that wraps all of the types that the interface exposes. The purpose of this stub is to translate my .net types into COM-friendly types. When I run this class library as a console application, it is able to connect to the engine, call various methods, and successfully return the wrapped types. The next step in the chain is to allow my VB6 application to call this COM enabled stub. This works fine for my main engine-entry type (IModelFetcher which is wrapped as COM_ModelFetcher). However, when I try and get any of the model fetcher's model types (IClientModel, wrapped as COM_IClientModel, IUserModel, wrapped as COM_IUserModel, e.t.c.), I get the following exception: [Exception - type: System.InvalidCastException 'Return argument has an invalid type.'] in mscorlib at System.Runtime.Remoting.Proxies.RealProxy.ValidateReturnArg(Object arg, Type paramType) at System.Runtime.Remoting.Proxies.RealProxy.PropagateOutParameters(IMessage msg, Object[] outArgs, Object returnValue) at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at AWT.Common.AWTEngineInterface.IModelFetcher.get_ClientModel() at AWT.Common.AWTEngineCOMInterface.COM_ModelFetcher.GetClientModel() The first thing I did when I saw this was to handle the 'AppDomain.CurrentDomain.AssemblyResolve' event, and this allowed me to load the required assemblies. However, I'm still getting this exception now. My AssemblyResolve event handler is loading three assemblies correctly, and I can confirm that it does not get called prior to this exception. Can someone help me untie myself from this mess of interprocess communication?!

    Read the article

  • How to do REST securely and with sensitive data?

    - by Earlz
    Hello, we are implementing a new web service. The web service will be a store of sensitive data and there are multiple users types with different permissions. So some user types can't access(and some can't change, and so on) certain types of data. How would this work in REST? I'm very new to REST, so sorry if this sounds noobish.

    Read the article

  • Transform OpenCV image data type to Devil image format and vice-verca

    - by D.K
    I want to use a CUDA-enabled SIFT library but I am using the OpenCV driver to get images from the webcam? The Cuda library is using the Devil Library for image data types. Should I transofrm the images from OpenCV data types to Devil? Or Should I use another method for getting images from the webcam[devil compatible data types]? Thanks for your attention

    Read the article

  • Which collection interface should I use in .NET for COM-interop?

    - by jhominal
    That is a followup from my previous question, but you don't need to read it to understand that one. I'm designing an interface in .NET that would be consumed from COM applications (mainly VB6, but Visual C++ 6 is also a possibility) and I would like to use Collection types as argument and return types for the methods in the interface. Questions: What happens to the VB6 built-in collection types (arrays, collections, dictionaries) when they go through interop? My current guess is that: arrays - System.Array collections - Microsoft.VisualBasic.Collection dictionaries - System.Collections.Hashtable Is that correct? Which interfaces should I use as return types? IEnumerable, ICollection, IList, IDictionary? Would I be able to do a For Each in VB6 to iterate over these interfaces? Should I use the generic or non-generic variants of the interfaces?

    Read the article

  • Using implicit conversion as a substitute for multiple inheritance in .NET

    - by Daniel Plaisted
    I have a situation where I would like to have objects of a certain type be able to be used as two different types. If one of the "base" types was an interface this wouldn't be an issue, but in my case it is preferable that they both be concrete types. I am considering adding copies of the methods and properties of one of the base types to the derived type, and adding an implicit conversion from the derived type to that base type. Then users will be able treat the derived type as the base type by using the duplicated methods directly, by assigning it to a variable of the base type, or by passing it to a method that takes the base type. It seems like this solution will fit my needs well, but am I missing anything? Is there a situation where this won't work, or where it is likely to add confusion instead of simplicity when using the API?

    Read the article

  • Nested joins hide table names

    - by Sergio
    Hi: I have three tables: Suppliers, Parts and Types. I need to join all of them while discriminating columns with the same name (say, "id") in the three tables. I would like to successfully run this query: CREATE VIEW Everything AS SELECT Suppliers.name as supplier, Parts.id, Parts.description, Types.typedesc as type FROM Suppliers JOIN (Parts JOIN Types ON Parts.type_id = Types.id) ON Suppliers.id = Parts.supplier_id; My DBMS (sqlite) complains that "there is not such a column (Parts.id)". I guess it forgets table names once the JOIN is done but then how can I refer to the column id that belongs to the table Parts?

    Read the article

  • Are we using IoC effectively?

    - by Juliet
    So my company uses Castle Windsor IoC container, but in a way that feels "off": All the data types are registered in code, not the config file. All data types are hard-coded to use one interface implementation. In fact, for nearly all given interfaces, there is and will only ever be one implementation. All registered data types have a default constructor, so Windsor doesn't instantiate an object graph for any registered types. The people who designed the system insist the IoC container makes the system better. We have 1200+ public classes, so its a big system, the kind where you'd expect to find a framework like Windsor. But I'm still skeptical. Is my company using IoC effectively? Is there an advantage to new'ing objects with Windsor than new'ing objects with the new keyword?

    Read the article

  • What is the merit of the "function" type (not "pointer to function")

    - by anatolyg
    Reading the C++ Standard, i see that there are "function" types and "pointer to function" types: typedef int func(int); // function typedef int (*pfunc)(int); // pointer to function typedef func* pfunc; // same as above I have never seen the function types used outside of examples (or maybe i didn't recognize their usage?). Some examples: func increase, decrease; // declares two functions int increase(int), decrease(int); // same as above int increase(int x) {return x + 1;} // cannot use the typedef when defining functions int decrease(int x) {return x - 1;} // cannot use the typedef when defining functions struct mystruct { func add, subtract, multiply; // declares three member functions int member; }; int mystruct::add(int x) {return x + member;} // cannot use the typedef int mystruct::subtract(int x) {return x - member;} int main() { func k; // the syntax is correct but the variable k is useless! mystruct myobject; myobject.member = 4; cout << increase(5) << ' ' << decrease(5) << '\n'; // outputs 6 and 4 cout << myobject.add(5) << ' ' << myobject.subtract(5) << '\n'; // 9 and 1 } Seeing that the function types support syntax that doesn't appear in C (declaring member functions), i guess they are not just a part of C baggage that C++ has to support for backward compatibility. So is there any use for function types, other than demonstrating some funky syntax?

    Read the article

  • Can a class Extend or Override himself?

    - by EBAGHAKI
    Suppose we have a class. We create an object from the class and when we do the class Extends himself base on the object initialization value.. For example: $objectType1 = new Types(1); $objectType1->Activate(); // It calls an activation function for type 1 $objectType2 = new Types(2); $objectType2->Activate(); // It calls an activation function for type 2 I don't want to use the standard procedure of class extending: class type1 extends types{}

    Read the article

  • How to store MySQL query results in another Table?

    - by Taz
    How to store results from following query into another table. Considering there is an appropriate table already created. SELECT labels.label,shortabstracts.ShortAbstract,images.LinkToImage,types.Type FROM ner.images,ner.labels,ner.shortabstracts,ner.types WHERE labels.Resource=images.Resource AND labels.Resource=shortabstracts.Resource AND labels.Resource=types.Resource;

    Read the article

  • In Emacs, how can I use imenu more sensibly with C#?

    - by Cheeso
    I've used emacs for a long time, but I haven't been keeping up with a bunch of features. One of these is speedbar, which I just briefly investigated now. Another is imenu. Both of these were mentioned in in-emacs-how-can-i-jump-between-functions-in-the-current-file? Using imenu, I can jump to particular methods in the module I'm working in. But there is a parse hierarchy that I have to negotiate before I get the option to choose (with autocomplete) the method name. It goes like this. I type M-x imenu and then I get to choose Using or Types. The Using choice allows me to jump to any of the using statements at the top level of the C# file (something like imports statements in a Java module, for those of you who don't know C#). Not super helpful. I choose Types. Then I have to choose a namespace and a class, even though there is just one of each in the source module. At that point I can choose between variables, types, and methods. If I choose methods I finally get the list of methods to choose from. The hierarchy I traverse looks like this; Using Types Namespace Class Types Variables Methods method names Only after I get to the 5th level do I get to select the thing I really want to jump to: a particular method. Imenu seems intelligent about the source module, but kind of hard to use. Am I doing it wrong?

    Read the article

  • Is this a good way to identify the type of a javascript object?

    - by FK82
    Apparently neither instanceof nor typeof deliver in terms of correctly identifying the type of every javascript object. I have come up with this function and I'm looking for some feedback: function getType() { var input = arguments[0] ; var types = ["String","Array","Object","Function","HTML"] ; //!! of the top of my head for(var n=0; n < types.length; n++) { if( input.constructor.toString().indexOf( types[n] ) != -1) { document.write( types[n] ) ; } } } Thanks for reading!

    Read the article

  • Merging .NET assemblies on Windows Store / Phone 8 / Portable Class Library

    - by Gabriel S.
    Is there a way to embed multiple dependent assemblies into a single one for projects written on the following platform types: Windows Store Apps, Windows Phone 8, Portable Class Library? I know that for regular .Net projects there is ILMerge, but on the aforementioned project types it doesn't work. Embedding assemblies as resources and then manually resolving the references using AppDomain.CurrentDomain.AssemblyResolve is not possible either, since AppDomain is not available in these types of project.

    Read the article

  • C# - Ensuring an assembly is called via a specified assembly

    - by Adam Driscoll
    Is there any built in functionality to determine if an assembly is being called from a particular assembly? I have assembly A which references assembly B. Assembly A exposes PowerShell cmdlets and outputs types that are found within B. Certain methods and properties with in types of exposed by B are of interest to types in assembly A but not of interest to consumers of PowerShell or anyone attempting to load types in B directly and call methods within it. I have looked into InternalsVisibleToAttribute but it would require extensive rework because of the use of interfaces. I was devising a shared key system that would later be obfuscated but that seemed clunky. Is there any way to ensure B is called only by A?

    Read the article

  • Money vs. Decimal vs. Float Performance issues (SQL data types for Currency value)?

    - by urz shah
    What data type should be selected in case of Currency value column in SQL server. I have read some where on web Working on customer implementations, we found some interesting performance numbers concerning the money data type. For example, when Analysis Services was set to the currency data type (from double) to match the SQL Server money data type, there was a 13% improvement in processing speed (rows/sec). Is it true??

    Read the article

  • Foreign keys and NULL in mySQL

    - by Industrial
    Hi everyone, Can I have a column in my values table (value) referenced as a foreign key to knownValues table, and let it be NULL whenever needed, like in the example: Table: values product type value freevalue 0 1 NULL 100 1 2 NULL 25 3 3 1 NULL Table: types id name prefix 0 length cm 1 weight kg 2 fruit NULL Table: knownValues id Type name 0 2 banana Note: The types in the table values & knownValues are of course referenced into the types table. Thanks!

    Read the article

  • Cast problem with LINQ

    - by yigit
    I'm tring to get my product's types to a list with Linq. var types = (from t in NHibernateSession.Linq<Product>() select t.Type).Distinct().ToList<Type>(); return types; But its giving an Unable to cast object of type error '...Domain.Product' to type '...Domain.Type'. Please tell where am I going wrong.

    Read the article

  • Why do we need Web-Api? [closed]

    - by user437973
    I was just wondering what the deal is with Asp.net Web-Api. Why did we need a separate type of controller in order to facilitate varying content types for action results? Why wasn't this capability just baked into the ASP.Net MVC base controller? Anyway, I was just wondering if there was a compelling reason to use both types of controllers within the same project, assuming that the project was being freshly created, or if this project structure was due to an inherent technical limitation. Would it be possible to have ApiControllers fulfill the purpose of an MVC Controller in all cases by just serving HTML when that is the specified accept type? It just seems to me like a lot of unnecessary repetition to have to re-implement the same types of actions using both types of controllers if you want those actions to be available to your web application through the API and through the web interface.

    Read the article

  • Why can't your switch statement data type be long Java?

    - by Fostah
    Here's an excerpt from Sun's Java tutorials: A switch works with the byte, short, char, and int primitive data types. It also works with enumerated types (discussed in Classes and Inheritance) and a few special classes that "wrap" certain primitive types: Character, Byte, Short, and Integer (discussed in Simple Data Objects ). There must be a good reason why the long primitive data type is not allowed. Anyone know what it is?

    Read the article

  • Not All “Viruses” Are Viruses: 10 Malware Terms Explained

    - by Chris Hoffman
    Most people seem to call every type of malware a “virus”, but that isn’t technically accurate. You’ve probably heard of many more terms beyond virus: malware, worm, Trojan, rootkit, keylogger, spyware, and more. But what do all these terms mean? These terms aren’t just used by geeks. They make their way into even mainstream news stories about the latest web security problems and tech scares. Understanding them will help you understand the dangers your\ hear about. Malware The word “malware” is short for “malicious software.” Many people use the word “virus” to indicate any type of harmful software, but a virus is actually just a specific type of malware. The word “malware” encompasses all harmful software, including all the ones listed below. Virus Let’s start with viruses. A virus is a type of malware that copies itself by infecting other files,  just as viruses in the real world infect biological cells and use those biological cells to reproduce copies of themselves. A virus can do many different things — watch in the background and steal your passwords, display advertisements, or just crash your computer — but the key thing that makes it a virus is how it spreads. When you run a virus, it will infect programs on your computer. When you run the program on another computer, the virus will infect programs on that computer, and so on. For example, a virus might infect program files on a USB stick. When the programs on that USB stick are run on another computer, the virus runs on the other computer and infects more program files. The virus will continue to spread in this way. Worm A worm is similar to a virus, but it spreads a different way. Rather than infecting files and relying on human activity to move those files around and run them on different systems, a worm spreads over computer networks on its own accord. For example, the Blaster and Sasser worms spread very quickly in the days of Windows XP because Windows XP did not come properly secured and exposed system services to the Internet. The worm accessed these system services over the Internet, exploited a vulnerability, and infected the computer. The worm then used the new infected computer to continue replicating itself. Such worms are less common now that Windows is properly firewalled by default, but worms can also spread in other ways — for example, by mass-emailing themselves to every email address in an effected user’s address book. Like a virus, a worm can do any number of other harmful things once it infects a computer. The key thing that makes it a worm is simply how it spreads copies of itself. Trojan (or Trojan Horse) A Trojan horse, or Trojan, is a type of malware that disguises itself as a legitimate file. When you download and run the program, the Trojan horse will run in the background, allowing third-parties to access your computer. Trojans can do this for any number of reasons — to monitor activity on your computer, to join your computer to a botnet. Trojans may also be used to open the floodgates and download many other types of malware onto your computer. The key thing that makes this type of malware a Trojan is how it arrives. It pretends to be a useful program and, when run, it hides in the background and gives malicious people access to your computer. It isn’t obsessed with copying itself into other files or spreading over the network, as viruses and worms are. For example, a piece of pirated software on an unscrupulous website may actually contain a Trojan. Spyware Spyware is a type of malicious software that spies on you without your knowledge. It collects a variety of different types of data, depending on the piece of spyware. Different types of malware can function as spyware — there may be malicious spyware included in Trojans that spies on your keystrokes to steal financial data, for example. More “legitimate” spyware may be bundled along with free software and simply monitor your web browsing habits, uploading this data to advertising servers so the software’s creator can make money from selling their knowledge of your activities. Adware Adware often comes along with spyware. It’s any type of software that displays advertising on your computer. Programs that display advertisements inside the program itself aren’t generally classified as malware. The kind of “adware” that’s particularly malicious is the kind that abuses its access to your system to display ads when it shouldn’t. For example, a piece of harmful adware may cause pop-up advertisements to appear on your computer when you’re not doing anything else. Or, adware may inject additional advertising into other web pages as you browse the web. Adware is often combined with spyware — a piece of malware may monitor your browsing habits and use them to serve you more targeted ads. Adware is more “socially acceptable” than other types of malware on Windows and you may see adware bundled with legitimate programs. For example, some people consider the Ask Toolbar included with Oracle’s Java software adware. Keylogger A keylogger is a type of malware that runs in the background, recording every key stroke you make. These keystrokes can include usernames, passwords, credit card numbers, and other sensitive data. The keylogger then, most likely, uploads these keystrokes to a malicious server, where it can be analyzed and people can pick out the useful passwords and credit card numbers. Other types of malware can act as keyloggers. A virus, worm, or Trojan may function as a keylogger, for example. Keyloggers may also be installed for monitoring purposes by businesses or even jealous spouses. Botnet, Bot A botnet is a large network of computers that are under the botnet creator’s control. Each computer functions as a “bot” because it’s infected with a specific piece of malware. Once the bot software infects the computer, ir will connect to some sort of control server and wait for instructions from the botnet’s creator. For example, a botnet may be used to initiate a DDoS (distributed denial of service) attack. Every computer in the botnet will be told to bombard a specific website or server with requests at once, and such millions or requests can cause a server to become unresponsive or crash. Botnet creators may sell access to their botnets, allowing other malicious individuals to use large botnets to do their dirty work. Rootkit A rootkit is a type of malware designed to burrow deep into your computer, avoiding detection by security programs and users. For example, a rootkit might load before most of Windows, burying itself deep into the system and modifying system functions so that security programs can’t detect it. A rootkit might hide itself completely, preventing itself from showing up in the Windows task manager. The key thing that makes a type of malware a rootkit is that it’s stealthy and focused on hiding itself once it arrives. Ransomware Ransomware is a fairly new type of malware. It holds your computer or files hostage and demands a ransom payment. Some ransomware may simply pop up a box asking for money before you can continue using your computer. Such prompts are easily defeated with antivirus software. More harmful malware like CryptoLocker literally encrypts your files and demands a payment before you can access them. Such types of malware are dangerous, especially if you don’t have backups. Most malware these days is produced for profit, and ransomware is a good example of that. Ransomware doesn’t want to crash your computer and delete your files just to cause you trouble. It wants to take something hostage and get a quick payment from you. So why is it called “antivirus software,” anyway? Well, most people continue to consider the word “virus” synonymous with malware as a whole. Antivirus software doesn’t just protect against viruses, but against all types of malware. It may be more accurately referred to as “antimalware” or “security” software. Image Credit: Marcelo Alves on Flickr, Tama Leaver on Flickr, Szilard Mihaly on Flickr     

    Read the article

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