Search Results

Search found 46790 results on 1872 pages for 'type systems'.

Page 12/1872 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • mysql data type confusion

    - by zen
    So this is more of a generalized question about MySQLs data types. I'd like to store a 5-digit US zip code (zip_code) properly in this example. A county has 10 different cities and 5 different zip codes. city | zip code -------+---------- city 0 | 33333 city 1 | 11111 city 2 | 22222 city 3 | 33333 city 4 | 44444 city 5 | 55555 city 6 | 33333 city 7 | 33333 city 8 | 44444 city 9 | 22222 I would typically structure a table like this as varchar(50), int(5) and not think twice about it. (1) If we wanted to ensure that this table had only one of 5 different zip codes we should use the enum data type, right? Now think of a similar scenario on a much larger scale. In a state, there are five-hundred cities with 418 different zip codes. (2) Should I store 418 zip codes as an enum data type OR as an int and create another table to reference?

    Read the article

  • Conditional type definitions

    - by pythonic metaphor
    I'm sure that boost has some functions for doing this, but I don't know the relevant libraries well enough. I have a template class, which is pretty basic, except for one twist where I need to define a conditional type. Here is the psuedo code for what I want struct PlaceHolder {}; template <typename T> class C{ typedef (T == PlaceHolder ? void : T) usefulType; }; How do I write that type conditional?

    Read the article

  • PHP Image content type problem

    - by Mirko
    Hi everybody, I have a specific problem, and cant get over it. For my latest project I need a simple PHP script that display an image according to its ID sent through URL. Here's the code: header("Content-type: image/jpeg"); $img = $_GET["img"]; echo file_get_contents("http://www.somesite.hr/images/$img"); The problem is that the image doesn't show although the browser recognizes it (i can see it in the page title), instead I get the image URL printed out. It doesn't work neither on a server with remote access allowed nor with one without. Also, nothing is printed or echoed before the header. I wonder if it is a content type error, or something else. Thanks in advance.

    Read the article

  • C#: Oracle Data Type Equivalence with OracleDbType

    - by Partial
    Situation: I am creating an app in C# that uses Oracle.DataAccess.Client (11g) to do certain operations on a Oracle database with stored procedures. I am aware that there is a certain enum (OracleDbType) that contains the Oracle data types, but I am not sure which one to use for certain types. Questions: What is the equivalent Oracle PL/SQL data type for each enumerated type in the OracleDbType enumeration? There are three types of integer (Int16, Int32, Int64) in the OracleDbType... how to know which one to use or are they all suppose to work?

    Read the article

  • Fallback to another existing MIME type when the required is missing in Rails

    - by fifigyuri
    I want to extend the existing supported HTML type of my site by support for iPhone. For this I registered a new MIME type. I created a layout for iphone and also converted some of the html views to iphone version. However, I did not convert all of the html.erb files. I do not see the reason to convert all views, some of them should not change, some partials simply just remain the same. I guess there should be a solution for this case. I tried to search for ways how to fallback to an existing format, but did not find any answer. Does a way to define fallback for MIME types in Rails exist? How does it work? If it doesn't exist and thus I wanted to solve the issue not the right way, what could simply solve the task of extending an existing site by another format? Thanks for your suggestions.

    Read the article

  • Fallback to another exiting MIME type when the required is missing in Rails

    - by fifigyuri
    I want to extend the exiting supported HTML type of my site by support for iPhone. For this I registered a new MIME type. I created a layout for iphone and also converted some of the html views to iphone version. However, I did not convert all of the html.erb-s. I do not see the reason to convert all views, some of them should not change, some partials simply just remain the same. I guess there should be a solution for this case. I tried to search for ways how to fallback to an existing format, but did not find any answer. Does a way to define fallback for MIME types in Rails exist? How does it work? If it doesn't exist and thus I wanted to solve the issue not the right way, what could simply solve the task of extending an existing site by another format? Thanks for your suggestions.

    Read the article

  • The *right* JSON content type?

    - by Oli
    Right I've been messing around with JSON for some time, just pushing it out as text and it hasn't hurt anybody (I know of), but I'd like to start doing things properly. I have seen so many purported "standards" for the JSON content type: application/json application/x-javascript text/javascript text/x-javascript text/x-json But which is right? Or best? I gather that there are security and browser support issues varying between them... (I know there's a similar question, What MIME type if JSON is being returned by a REST API?, but I'd like a slightly more targeted answer.)

    Read the article

  • Wordpress Custom Type permalink containing Taxonomy slug

    - by treznik
    I'm trying to create a permalink pattern for a Custom Type, that includes one of its taxonomies. The taxonomy name is known from the start (so I'm not trying to add or mix all of its taxonomies, just a specific one), but the value will by dynamic, of course. Normally, the Custom Type permalink is built using the rewrite arg with the slug param, but I don't see how I could add a dynamic variable in there. http://codex.wordpress.org/Function_Reference/register_post_type I'm guessing a custom solution is required, but I'm not sure what the best unintrusive approach would be. Is there a known practice for this or has anyone built something similar recently? I'm using WP 3.2.1 btw.

    Read the article

  • Odd behavior when recursively building a return type for variadic functions

    - by Dennis Zickefoose
    This is probably going to be a really simple explanation, but I'm going to give as much backstory as possible in case I'm wrong. Advanced apologies for being so verbose. I'm using gcc4.5, and I realize the c++0x support is still somewhat experimental, but I'm going to act on the assumption that there's a non-bug related reason for the behavior I'm seeing. I'm experimenting with variadic function templates. The end goal was to build a cons-list out of std::pair. It wasn't meant to be a custom type, just a string of pair objects. The function that constructs the list would have to be in some way recursive, with the ultimate return value being dependent on the result of the recursive calls. As an added twist, successive parameters are added together before being inserted into the list. So if I pass [1, 2, 3, 4, 5, 6] the end result should be {1+2, {3+4, 5+6}}. My initial attempt was fairly naive. A function, Build, with two overloads. One took two identical parameters and simply returned their sum. The other took two parameters and a parameter pack. The return value was a pair consisting of the sum of the two set parameters, and the recursive call. In retrospect, this was obviously a flawed strategy, because the function isn't declared when I try to figure out its return type, so it has no choice but to resolve to the non-recursive version. That I understand. Where I got confused was the second iteration. I decided to make those functions static members of a template class. The function calls themselves are not parameterized, but instead the entire class is. My assumption was that when the recursive function attempts to generate its return type, it would instantiate a whole new version of the structure with its own static function, and everything would work itself out. The result was: "error: no matching function for call to BuildStruct<double, double, char, char>::Go(const char&, const char&)" The offending code: static auto Go(const Type& t0, const Type& t1, const Types&... rest) -> std::pair<Type, decltype(BuildStruct<Types...>::Go(rest...))> My confusion comes from the fact that the parameters to BuildStruct should always be the same types as the arguments sent to BuildStruct::Go, but in the error code Go is missing the initial two double parameters. What am I missing here? If my initial assumption about how the static functions would be chosen was incorrect, why is it trying to call the wrong function rather than just not finding a function at all? It seems to just be mixing types willy-nilly, and I just can't come up with an explanation as to why. If I add additional parameters to the initial call, it always burrows down to that last step before failing, so presumably the recursion itself is at least partially working. This is in direct contrast to the initial attempt, which always failed to find a function call right away. Ultimately, I've gotten past the problem, with a fairly elegant solution that hardly resembles either of the first two attempts. So I know how to do what I want to do. I'm looking for an explanation for the failure I saw. Full code to follow since I'm sure my verbal description was insufficient. First some boilerplate, if you feel compelled to execute the code and see it for yourself. Then the initial attempt, which failed reasonably, then the second attempt, which did not. #include <iostream> using std::cout; using std::endl; #include <utility> template<typename T1, typename T2> std::ostream& operator <<(std::ostream& str, const std::pair<T1, T2>& p) { return str << "[" << p.first << ", " << p.second << "]"; } //Insert code here int main() { Execute(5, 6, 4.3, 2.2, 'c', 'd'); Execute(5, 6, 4.3, 2.2); Execute(5, 6); return 0; } Non-struct solution: template<typename Type> Type BuildFunction(const Type& t0, const Type& t1) { return t0 + t1; } template<typename Type, typename... Rest> auto BuildFunction(const Type& t0, const Type& t1, const Rest&... rest) -> std::pair<Type, decltype(BuildFunction(rest...))> { return std::pair<Type, decltype(BuildFunction(rest...))> (t0 + t1, BuildFunction(rest...)); } template<typename... Types> void Execute(const Types&... t) { cout << BuildFunction(t...) << endl; } Resulting errors: test.cpp: In function 'void Execute(const Types& ...) [with Types = {int, int, double, double, char, char}]': test.cpp:33:35: instantiated from here test.cpp:28:3: error: no matching function for call to 'BuildFunction(const int&, const int&, const double&, const double&, const char&, const char&)' Struct solution: template<typename... Types> struct BuildStruct; template<typename Type> struct BuildStruct<Type, Type> { static Type Go(const Type& t0, const Type& t1) { return t0 + t1; } }; template<typename Type, typename... Types> struct BuildStruct<Type, Type, Types...> { static auto Go(const Type& t0, const Type& t1, const Types&... rest) -> std::pair<Type, decltype(BuildStruct<Types...>::Go(rest...))> { return std::pair<Type, decltype(BuildStruct<Types...>::Go(rest...))> (t0 + t1, BuildStruct<Types...>::Go(rest...)); } }; template<typename... Types> void Execute(const Types&... t) { cout << BuildStruct<Types...>::Go(t...) << endl; } Resulting errors: test.cpp: In instantiation of 'BuildStruct<int, int, double, double, char, char>': test.cpp:33:3: instantiated from 'void Execute(const Types& ...) [with Types = {int, int, double, double, char, char}]' test.cpp:38:41: instantiated from here test.cpp:24:15: error: no matching function for call to 'BuildStruct<double, double, char, char>::Go(const char&, const char&)' test.cpp:24:15: note: candidate is: static std::pair<Type, decltype (BuildStruct<Types ...>::Go(BuildStruct<Type, Type, Types ...>::Go::rest ...))> BuildStruct<Type, Type, Types ...>::Go(const Type&, const Type&, const Types& ...) [with Type = double, Types = {char, char}, decltype (BuildStruct<Types ...>::Go(BuildStruct<Type, Type, Types ...>::Go::rest ...)) = char] test.cpp: In function 'void Execute(const Types& ...) [with Types = {int, int, double, double, char, char}]': test.cpp:38:41: instantiated from here test.cpp:33:3: error: 'Go' is not a member of 'BuildStruct<int, int, double, double, char, char>'

    Read the article

  • QotD: Alex Buckley announcing Java™ SE 8 Early Access Builds with Type Annotation Support

    - by $utils.escapeXML($entry.author)
    I am pleased to announce that binary builds of the JSR 308 Reference Implementation are available at http://jdk8.java.net/type-annotations/.Please see the Type Annotations project page for a link to the JSR 308 Specification. There is also a changelog, which is important to review as there have been significant spec changes in 2012.The builds were generated from the type-annotations/type-annotations forest on 9/9. This forest is regularly updated from jdk8/jdk8 and jdk8/tl.Alex Buckley in a post on the type-annotations-dev mailing list.If you want to play with repeating annotations, check out http://jdk8.java.net/type-annotations/ ... thanks to superior code wrangling by Joel Franck (repeating annotations) and Werner Dietl (type annotations), support for repeating annotations on declarations is included in the build.Alex Buckley in a post on the enhanced-metadata-spec-discuss mailing list.

    Read the article

  • unix systems programming jobs in India [closed]

    - by mnunna
    Hi, I am currently working on a HP-UX platform and my role as a prod support team member involves mostly to write shell scripts. But i want to branch out into core systems programming in unix. A quick search on the internet threw no "unix systems programming jobs" in india. I'm confused as what to do. I really would like to continue with unix as my core competency, but unix jobs in india are mostly of sys admin/ prod support type, of which i do not want a part of. Can anyone of you give me an informed advice on the career oppurtinities that await unix professionals in india?? Any advice would be appreciated.

    Read the article

  • Oracle's Thirteen Engineered Systems

    - by Luis Moreno Campos
    You already need a catalogue to keep up with the many new stuff coming out from Oracle Engineered from factory.In the Exadata portfolio you have 4 systems:- Quarter Rack X2-2 Database Machine- Half-Rack X2-2 Database Machine- Full-Rack X2-2 Database Machine- X2-8 Database MachineBut if Exadata presents a stunning portfolio, Exalogic doesn't fall behind on that by putting out 6 versions: 3 sizes (Quarter, Half and Full) with x86 processors and the same 3 sizes with SPARC based processors.Finally we have 3 new systems called SPARC Superclusters where Solaris 11 was re-engineered to take more out of the power of Infiniband: "Available in the next calendar year, the Oracle SPARC Supercluster will be available in T3-2, T3-4 and M5000-based configurations".I see Oracle delivering on it's promise to tightly integrate Hardware and Software to work closer together.

    Read the article

  • The History Of Operating Systems [Infographic]

    - by ETC
    Earlier this week we shared a history of operating system names with you. This infographic complements that with a timeline of quotes and facts from the annals of computer history. Hit up the link below to check out the full infographic. The History Of Operating Systems [MakeUseOf] Latest Features How-To Geek ETC Have You Ever Wondered How Your Operating System Got Its Name? Should You Delete Windows 7 Service Pack Backup Files to Save Space? What Can Super Mario Teach Us About Graphics Technology? Windows 7 Service Pack 1 is Released: But Should You Install It? How To Make Hundreds of Complex Photo Edits in Seconds With Photoshop Actions How to Enable User-Specific Wireless Networks in Windows 7 The History Of Operating Systems [Infographic] DriveSafe.ly Reads Your Text Messages Aloud The Likability of Angry Birds [Infographic] Dim an Overly Bright Alarm Clock with a Binder Divider Preliminary List of Keyboard Shortcuts for Unity Now Available Bring a Touch of the Wild West to Your Desktop with the Rango Theme for Windows 7

    Read the article

  • New Oracle E-Business Suite R12 OS and Tools Requirements on IBM AIX on Power Systems

    - by John Abraham
    IBM has announced May 1st, 2011 as the end of Support for Version 8 of the IBM XL C/C++ compiler currently used for Release 12 builds and patching. The target date of the switchover -- May 1st 2011 -- corresponds to when this older compiler will no longer be supported by IBM. Beginning on May 1st 2011, Oracle E-Business Suite patches for Release 12 (12.0, 12.1) on the IBM AIX on Power Systems platform will be built with Version 9 of the IBM XL C/C++ compiler.  Customers who plan to patch or upgrade their E-Business Suite R12 environments after May 1st, 2011 must meet all the new requirements prior to applying new patches or upgrades.Please review the documents below for all new requirements pertaining to the new runtime and utilities packages on IBM AIX on Power Systems.

    Read the article

  • Subterranean IL: The ThreadLocal type

    - by Simon Cooper
    I came across ThreadLocal<T> while I was researching ConcurrentBag. To look at it, it doesn't really make much sense. What's all those extra Cn classes doing in there? Why is there a GenericHolder<T,U,V,W> class? What's going on? However, digging deeper, it's a rather ingenious solution to a tricky problem. Thread statics Declaring that a variable is thread static, that is, values assigned and read from the field is specific to the thread doing the reading, is quite easy in .NET: [ThreadStatic] private static string s_ThreadStaticField; ThreadStaticAttribute is not a pseudo-custom attribute; it is compiled as a normal attribute, but the CLR has in-built magic, activated by that attribute, to redirect accesses to the field based on the executing thread's identity. TheadStaticAttribute provides a simple solution when you want to use a single field as thread-static. What if you want to create an arbitary number of thread static variables at runtime? Thread-static fields can only be declared, and are fixed, at compile time. Prior to .NET 4, you only had one solution - thread local data slots. This is a lesser-known function of Thread that has existed since .NET 1.1: LocalDataStoreSlot threadSlot = Thread.AllocateNamedDataSlot("slot1"); string value = "foo"; Thread.SetData(threadSlot, value); string gettedValue = (string)Thread.GetData(threadSlot); Each instance of LocalStoreDataSlot mediates access to a single slot, and each slot acts like a separate thread-static field. As you can see, using thread data slots is quite cumbersome. You need to keep track of LocalDataStoreSlot objects, it's not obvious how instances of LocalDataStoreSlot correspond to individual thread-static variables, and it's not type safe. It's also relatively slow and complicated; the internal implementation consists of a whole series of classes hanging off a single thread-static field in Thread itself, using various arrays, lists, and locks for synchronization. ThreadLocal<T> is far simpler and easier to use. ThreadLocal ThreadLocal provides an abstraction around thread-static fields that allows it to be used just like any other class; it can be used as a replacement for a thread-static field, it can be used in a List<ThreadLocal<T>>, you can create as many as you need at runtime. So what does it do? It can't just have an instance-specific thread-static field, because thread-static fields have to be declared as static, and so shared between all instances of the declaring type. There's something else going on here. The values stored in instances of ThreadLocal<T> are stored in instantiations of the GenericHolder<T,U,V,W> class, which contains a single ThreadStatic field (s_value) to store the actual value. This class is then instantiated with various combinations of the Cn types for generic arguments. In .NET, each separate instantiation of a generic type has its own static state. For example, GenericHolder<int,C0,C1,C2> has a completely separate s_value field to GenericHolder<int,C1,C14,C1>. This feature is (ab)used by ThreadLocal to emulate instance thread-static fields. Every time an instance of ThreadLocal is constructed, it is assigned a unique number from the static s_currentTypeId field using Interlocked.Increment, in the FindNextTypeIndex method. The hexadecimal representation of that number then defines the specific Cn types that instantiates the GenericHolder class. That instantiation is therefore 'owned' by that instance of ThreadLocal. This gives each instance of ThreadLocal its own ThreadStatic field through a specific unique instantiation of the GenericHolder class. Although GenericHolder has four type variables, the first one is always instantiated to the type stored in the ThreadLocal<T>. This gives three free type variables, each of which can be instantiated to one of 16 types (C0 to C15). This puts an upper limit of 4096 (163) on the number of ThreadLocal<T> instances that can be created for each value of T. That is, there can be a maximum of 4096 instances of ThreadLocal<string>, and separately a maximum of 4096 instances of ThreadLocal<object>, etc. However, there is an upper limit of 16384 enforced on the total number of ThreadLocal instances in the AppDomain. This is to stop too much memory being used by thousands of instantiations of GenericHolder<T,U,V,W>, as once a type is loaded into an AppDomain it cannot be unloaded, and will continue to sit there taking up memory until the AppDomain is unloaded. The total number of ThreadLocal instances created is tracked by the ThreadLocalGlobalCounter class. So what happens when either limit is reached? Firstly, to try and stop this limit being reached, it recycles GenericHolder type indexes of ThreadLocal instances that get disposed using the s_availableIndices concurrent stack. This allows GenericHolder instantiations of disposed ThreadLocal instances to be re-used. But if there aren't any available instantiations, then ThreadLocal falls back on a standard thread local slot using TLSHolder. This makes it very important to dispose of your ThreadLocal instances if you'll be using lots of them, so the type instantiations can be recycled. The previous way of creating arbitary thread-static variables, thread data slots, was slow, clunky, and hard to use. In comparison, ThreadLocal can be used just like any other type, and each instance appears from the outside to be a non-static thread-static variable. It does this by using the CLR type system to assign each instance of ThreadLocal its own instantiated type containing a thread-static field, and so delegating a lot of the bookkeeping that thread data slots had to do to the CLR type system itself! That's a very clever use of the CLR type system.

    Read the article

  • Management Software in Java for Networked Bus Systems

    - by Geertjan
    Telemotive AG develops complex networked bus systems such as Ethernet, MOST, CAN, FlexRay, LIN and Bluetooth as well as in-house product developments in infotainment, entertainment, and telematics related to driver assistance, connectivity, diagnosis, and e-mobility. Devices such as those developed by Telemotive typically come with management software, so that the device can be configured. (Just like an internet router comes with management software too.) The blue AdmiraL is a development and analysis device for the APIX (Automotive Pixel Link) technology. Here is its management tool: The blue PiraT is an optimised multi-data logger, developed by Telemotive specifically for the automotive industry. With the blue PiraT the communication of bus systems and control units are monitored and relevant data can be recorded very precisely. And here is how the tool is managed: Both applications are created in Java and, as clearly indicated in many ways in the screenshots above, are based on the NetBeans Platform. More details can be found on the Telemotive site.

    Read the article

  • Using allocators for different systems

    - by chadb
    I am going over the memory architecture for my game and even though I know my memory budgets may not be final, I at the point where I can start using them in a general sense. I know that I will need several allocators (for systems such as audio, rendering, etc) but I am unsure of how they will be accessed. I do not use singletons, so I can't just have something such as AudioManager::GetInstance().get_allocator(). Instead, I need to find a different method of usage but I am not sure of how. How can I store and call my allocators needed for several different systems over engine in an efficient manner?

    Read the article

  • Ubuntu 12.04 installation freezes at "Detecting File Systems"

    - by user67970
    I am installing Ubuntu 12.04 onto my system, which I am dual booting an already installed version of Windows 7 with. The installation goes fine until what I suppose is near the end of the entire thing, where it is at the page where it scrolls through the features of Ubuntu. At this point, it is saying: Detecting file systems... It will not go past this point, and it has been at this part for an hour and a half. What should I do to fix this? I am new to working with Linux operating systems, so please help!

    Read the article

  • The way to the future - Hybrid systems

    - by BuckWoody
    I've written before (as have others) about the dangers of an "either/or" mentality with various technologies, including the "cloud". Companies are starting to understand this message - I've been traveling a lot this year from Alaska to California, from the UK to Copenhagen, Denmark, talking with companies that are implementing Hybrid systems, and giving presentations on how to implement one. I'm doing another of these Monday of next week, in Boston here in the US. You can read about it and register here (it's a free event) and learn not only more about Hybrid systems using on-premises databases and Windows Azure, but more about SQL Server as well from other speakers.

    Read the article

  • Ivar definitions show 'long' type encoding as 'long long' type encoding

    - by Frank C.
    I've found what I think may be a bug with Ivar and Objective-C runtime. I'm using XCode 3.2.1 and associated libraries, developing a 64 bit app on X86_64 (MacBook Pro). Where I would expect the type encoding for the following "longVal" to be 'l', the Ivar encoding is showing a 'q' (which is a 'long long'). Anyone else seeing this? Simplified code and output follows: Code: #import <Foundation/Foundation.h> #import <objc/runtime.h> @interface Bug : NSObject { long longVal; long long longerVal; } @property (nonatomic,assign) long longVal; @property (nonatomic,assign) long long longerVal; @end @implementation Bug @synthesize longVal,longerVal; @end int main (int argc, const char * argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; unsigned int ivarCount=0; Ivar *ivars= class_copyIvarList([Bug class], &ivarCount); for(unsigned int x=0;x<ivarCount;x++) { NSLog(@"Name [%@] encoding [%@]", [NSString stringWithCString:ivar_getName(ivars[x]) encoding:NSUTF8StringEncoding], [NSString stringWithCString:ivar_getTypeEncoding(ivars[x]) encoding:NSUTF8StringEncoding]); } [pool drain]; return 0; } And here is output from debug console: This GDB was configured as "x86_64-apple-darwin".tty /dev/ttys000 Loading program into debugger… sharedlibrary apply-load-rules all Program loaded. run [Switching to process 6048] Running… 2010-03-17 22:16:29.138 ivarbug[6048:a0f] Name [longVal] encoding [q] 2010-03-17 22:16:29.146 ivarbug[6048:a0f] Name [longerVal] encoding [q] (gdb) continue Not a pretty picture! -- Frank

    Read the article

  • c++ passing unknown type to a function and any Class type definition

    - by user259789
    I am trying to create a generic class to write and read Objects to/from file. Called it ActiveRecord class only has one method, which saves the class itself: void ActiveRecord::saveRecord(){ string fileName = "data.dat"; ofstream stream(fileName.c_str(), ios::out); if (!stream) { cerr << "Error opening file: " << fileName << endl; exit(1); } stream.write(reinterpret_cast<const char *> (this), sizeof(ActiveRecord)); stream.close(); } now I'm extending this class with User class: class User : public ActiveRecord { public: User(void); ~User(void); string name; string lastName; }; to create and save the user I would like to do something like: User user = User(); user.name = "John"; user.lastName = "Smith" user.save(); how can I get this ActiveRecord::saveRecord() method to take any object, and class definition so it writes whatever i send it: to look like: void ActiveRecord::saveRecord(foo_instance, FooClass){ string fileName = "data.dat"; ofstream stream(fileName.c_str(), ios::out); if (!stream) { cerr << "Error opening file: " << fileName << endl; exit(1); } stream.write(reinterpret_cast<const char *> (foo_instance), sizeof(FooClass)); stream.close(); } and while we're at it, what is the default Object type in c++. eg. in objective-c it's id in java it's Object in AS3 it's Object what is it in C++??

    Read the article

  • Enforce strong type checking in C (type strictness for typedefs)

    - by quinmars
    Is there a way to enforce explicit cast for typedefs of the same type? I've to deal with utf8 and sometimes I get confused with the indices for the character count and the byte count. So it be nice to have some typedefs: typedef unsigned int char_idx_t; typedef unsigned int byte_idx_t; With the addition that you need an explicit cast between them: char_idx_t a = 0; byte_idx_t b; b = a; // compile warning b = (byte_idx_t) a; // ok I know that such a feature doesn't exist in C, but maybe you know a trick or a compiler extension (preferable gcc) that does that. EDIT: I still don't really like the Hungarian notation in general, I couldn't used it for this problem because of project coding conventions, but I used it now in another similar case, where also the types are the same and the meanings are very similar. And I have to admit: it helps. I never would go and declare every integer with a starting "i", but as in Joel's example for overlapping types, it can be life saving.

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >