Search Results

Search found 6079 results on 244 pages for 'define'.

Page 18/244 | < Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >

  • Lua-Objective-C bridge on the iphone

    - by John Smith
    I have partially ported the LuaObjCBridge to the iPhone. Most things work but there are still some issues I have to deal with. There are sections where #defines are defined with-respect-to intel or ppc. Is the ARM chip closer to intel or ppc? Here is the most relevant section where most of the defines are: #if defined(__ppc__)||defined(__PPC__)||defined(__powerpc__) #define LUA_OBJC_METHODCALL_INT_IS_SHORTEST_INTEGRAL_TYPE #define LUA_OBJC_METHODCALL_PASS_FLOATS_IN_MARG_HEADER #define LUA_OBJC_POWER_ALIGNMENT #elif defined(__i386__)||defined(__arm__) #warning LuaObjCBridge is not fully tested for use on Intel chips. #define LUA_OBJC_METHODCALL_RETURN_STRUCTS_DIRECTLY // Use this or the code was crashing for me for structs LUA_OBJC_METHODCALL_RETURN_STRUCTS_DIRECTLY_LIMIT #define LUA_OBJC_METHODCALL_USE_OBJC_MSGSENDV_FPRET #define LUA_OBJC_METHODCALL_RETURN_STRUCTS_DIRECTLY_LIMIT 8 #define LUA_OBJC_INTEL_ALIGNMENT #endif For now I added arm with i386, but I could be wrong

    Read the article

  • About the MSDN NOTIFYICONDATA's cbSize member

    - by KenC
    Hi, I am reading the NOTIFYICONDATA documentation in MSDN. It says the NOTIFYICONDATA structure has a cbSize member should be set to the size of the structure, but NOTIFYICONDATA structure's size has different size in every Shell32.dll, so you should get the Shell32.dll version before setting cbSize. The following quotes from MSDN: If it is version 5.0 or later, initialize the cbSize member as follows. nid.cbSize = sizeof(NOTIFYICONDATA); Setting cbSize to this value enables all the version 5.0 and 6.0 enhancements. For earlier versions, the size of the pre-6.0 structure is given by the NOTIFYICONDATA_V2_SIZE constant and the pre-5.0 structure is given by the NOTIFYICONDATA_V1_SIZE constant. Initialize the cbSize member as follows. nid.cbSize = NOTIFYICONDATA_V2_SIZE; Using this value for cbSize will allow your application to use NOTIFYICONDATA with earlier Shell32.dll versions, although without the version 6.0 enhancements. I found it a bit of vague, because 'sizeof(NOTIFYICONDATA)' has different value in Win98 (using Shell32.dll version 4.x), Win2K (version 5.0) and WinXP (version 6.0). How could it 'enable all version 5.0 and 6.0 enhancements'? So I looked for the definition of NOTIFYICONDATA_V1_SIZE (source code as below), I see: NOTIFYICONDATA_V1_SIZE is for Win 2K (doesn't include 2K) NOTIFYICONDATA_V2_SIZE is for Win XP NOTIFYICONDATA_V3_SIZE is for Vista (not sure if I am right) It's completely different from what MSDN says? and none for Win2K? So, I am totaly confused right now. How should I set the cbSize member according to Shell32.dll version? Could anybody help me... Thanks in advance. //= = = = = = = = ShellAPI.h = = = = = = = = typedef struct _NOTIFYICONDATAA { DWORD cbSize; HWND hWnd; UINT uID; UINT uFlags; UINT uCallbackMessage; HICON hIcon; #if (NTDDI_VERSION < NTDDI_WIN2K) CHAR szTip[64]; #endif #if (NTDDI_VERSION >= NTDDI_WIN2K) CHAR szTip[128]; DWORD dwState; DWORD dwStateMask; CHAR szInfo[256]; union { UINT uTimeout; UINT uVersion; // used with NIM_SETVERSION, values 0, 3 and 4 } DUMMYUNIONNAME; CHAR szInfoTitle[64]; DWORD dwInfoFlags; #endif #if (NTDDI_VERSION >= NTDDI_WINXP) GUID guidItem; #endif #if (NTDDI_VERSION >= NTDDI_VISTA) HICON hBalloonIcon; #endif } NOTIFYICONDATAA, *PNOTIFYICONDATAA; typedef struct _NOTIFYICONDATAW { DWORD cbSize; HWND hWnd; UINT uID; UINT uFlags; UINT uCallbackMessage; HICON hIcon; #if (NTDDI_VERSION < NTDDI_WIN2K) WCHAR szTip[64]; #endif #if (NTDDI_VERSION >= NTDDI_WIN2K) WCHAR szTip[128]; DWORD dwState; DWORD dwStateMask; WCHAR szInfo[256]; union { UINT uTimeout; UINT uVersion; // used with NIM_SETVERSION, values 0, 3 and 4 } DUMMYUNIONNAME; WCHAR szInfoTitle[64]; DWORD dwInfoFlags; #endif #if (NTDDI_VERSION >= NTDDI_WINXP) GUID guidItem; #endif #if (NTDDI_VERSION >= NTDDI_VISTA) HICON hBalloonIcon; #endif } NOTIFYICONDATAW, *PNOTIFYICONDATAW; #define NOTIFYICONDATAA_V1_SIZE FIELD_OFFSET(NOTIFYICONDATAA, szTip[64]) #define NOTIFYICONDATAW_V1_SIZE FIELD_OFFSET(NOTIFYICONDATAW, szTip[64]) #ifdef UNICODE #define NOTIFYICONDATA_V1_SIZE NOTIFYICONDATAW_V1_SIZE #else #define NOTIFYICONDATA_V1_SIZE NOTIFYICONDATAA_V1_SIZE #endif #define NOTIFYICONDATAA_V2_SIZE FIELD_OFFSET(NOTIFYICONDATAA, guidItem) #define NOTIFYICONDATAW_V2_SIZE FIELD_OFFSET(NOTIFYICONDATAW, guidItem) #ifdef UNICODE #define NOTIFYICONDATA_V2_SIZE NOTIFYICONDATAW_V2_SIZE #else #define NOTIFYICONDATA_V2_SIZE NOTIFYICONDATAA_V2_SIZE #endif #define NOTIFYICONDATAA_V3_SIZE FIELD_OFFSET(NOTIFYICONDATAA, hBalloonIcon) #define NOTIFYICONDATAW_V3_SIZE FIELD_OFFSET(NOTIFYICONDATAW, hBalloonIcon) #ifdef UNICODE #define NOTIFYICONDATA_V3_SIZE NOTIFYICONDATAW_V3_SIZE #else #define NOTIFYICONDATA_V3_SIZE NOTIFYICONDATAA_V3_SIZE #endif (Seems like the code doesn't look good on the web site, but it from ShellAPI.h, all the same)

    Read the article

  • Combining two operators in Evil-mode Emacs

    - by Dyslexic Tangent
    In vim I've remapped > and < when in visual mode to >gv and <gv respectively, like so: vnoremap > >gv vnoremap < <gv Since my target for this question are folks experienced with emacs and not vim, what > and < do is indent/dedent visually selected text. What gv does is reselect the previously selected text. These maps cause > and < to indent/dedent and then reselect the previously selected text. I'm trying out emacs with evil-mode and I'd like to do the same, but I'm having some difficulty figuring out how, exactly, to accomplish the automatic reselection. It looks like I need to somehow call evil-shift-right and evil-visual-restore sequentially, but I don't know how to create a map that will do both, so I tried creating my own function which would call both sequentially and map that instead, but it didn't work, possibly due to the fact that both of them are defined, not as functions with defun but instead as operators with evil-define-operator. I tried creating my own operators: (evil-define-operator shift-left-reselect (beg end) (evil-shift-left beg end) (evil-visual-restore)) (evil-define-operator shift-right-reselect (beg end) (evil-shift-right beg end) (evil-visual-restore)) but that doesn't restore visual as expected. A stab in the dark gave me this: (evil-define-operator shift-left-reselect (beg end) (evil-shift-left beg end) ('evil-visual-restore)) (evil-define-operator shift-right-reselect (beg end) (evil-shift-right beg end) ('evil-visual-restore)) but that selects one additional line whenever it is supposed to reselect. For now I've been using the following, which only has the problem where it reselects an additional line in the < operator. (evil-define-operator shift-right-reselect (beg end) (evil-shift-right beg end) (evil-visual-make-selection beg end)) (evil-define-operator shift-left-reselect (beg end) (evil-shift-left beg end) (evil-visual-make-selection beg end)) and I've mapped them: (define-key evil-visual-state-map ">" 'shift-right-reselect) (define-key evil-visual-state-map "<" 'shift-left-reselect) any help / pointers / tips would be greatly appreciated. Thanks in advance.

    Read the article

  • How to get rid of messages addressed to not existing subdomains?

    - by user71061
    Hi! I have small problem with my sendmail server and need your little help :-) My situation is as follow: User mailboxes are placed on MS exchanege server and all mail to and from outside world are relayed trough my sendmail box. Exchange server ----- sendmail server ------ Internet My servers accept messages for one main domain (say, my.domain.com) and for few other domains (let we narrow it too just one, say my_other.domain.com). After configuring sendmail with showed bellow abbreviated sendmail.mc file, essentially everything works ok, but there is small problem. I want to reject messages addressed to not existing recipients as soon as possible (to avoid sending non delivery reports), so my sendmail server make LDAP queries to exchange server, validating every recipient address. This works well both domains but not for subdomains. Such subdomains do not exist, but someone (I'm mean those heated spamers :-) could try addresses like this: user@any_host.my.domain.com or user@any_host.my_other.domain.com and for those addresses results are as follows: Messages to user@sendmail_hostname.my.domain.com are rejected with error "Unknown user" (due to additional LDAPROUTE_DOMAIN line in my sendmail.mc file, and this is expected behaviour) Messages to user@any_other_hostname.my.domain.com are rejected with error "Relaying denied". Little strange to me, why this time the error is different, but still ok. After all message was rejected and I don't care very much what error code will be returned to sender (spamer). Messages to user@sendmail_hostname.my_other.domain.com and user@any_other_hostname.my_other.domain.com are rejected with error "Unknown user" but only when, there is no user@my_other.domain.com mailbox (on exchange server). If such mailbox exist, then all three addresses (i.e. user@my_other.domain.com, user@sendmail_hostname.my_other.domain.com and user@any_other_hostname.my_other.domain.com) will be accepted. (adding additional line LDAPROUTE_DOMAIN(my_sendmail_host.my_other.domain.com) to my sendmail.mc file don't change anything) My abbreviated sendmail.mc file is as follows (sendmail 8.14.3-5). Both domains are listed in /etc/mail/local-host-names file (FEATURE(use_cw_file) ): define(`_USE_ETC_MAIL_')dnl include(`/usr/share/sendmail/cf/m4/cf.m4')dnl OSTYPE(`debian')dnl DOMAIN(`debian-mta')dnl undefine(`confHOST_STATUS_DIRECTORY')dnl define(`confRUN_AS_USER',`smmta:smmsp')dnl FEATURE(`no_default_msa')dnl define(`confPRIVACY_FLAGS',`needmailhelo,needexpnhelo,needvrfyhelo,restrictqrun,restrictexpand,nobodyreturn,authwarnings')dnl FEATURE(`use_cw_file')dnl FEATURE(`access_db', , `skip')dnl FEATURE(`always_add_domain')dnl MASQUERADE_AS(`my.domain.com')dnl FEATURE(`allmasquerade')dnl FEATURE(`masquerade_envelope')dnl dnl define(`confLDAP_DEFAULT_SPEC',`-p 389 -h my_exchange_server.my.domain.com -b dc=my,dc=domain,dc=com')dnl dnl define(`ALIAS_FILE',`/etc/aliases,ldap:-k (&(|(objectclass=user)(objectclass=group))(proxyAddresses=smtp:%0)) -v mail')dnl FEATURE(`ldap_routing',, `ldap -1 -T<TMPF> -v mail -k proxyAddresses=SMTP:%0', `bounce')dnl LDAPROUTE_DOMAIN(`my.domain.com')dnl LDAPROUTE_DOMAIN(`my_other.domain.com ')dnl LDAPROUTE_DOMAIN(`my_sendmail_host.my.domain.com')dnl define(`confLDAP_DEFAULT_SPEC', `-p 389 -h "my_exchange_server.my.domain.com" -d "CN=sendmail,CN=Users,DC=my,DC=domain,DC=com" -M simple -P /etc/mail/ldap-secret -b "DC=my,DC=domain,DC=com"')dnl FEATURE(`nouucp',`reject')dnl undefine(`UUCP_RELAY')dnl undefine(`BITNET_RELAY')dnl define(`confTRY_NULL_MX_LIST',true)dnl define(`confDONT_PROBE_INTERFACES',true)dnl define(`MAIL_HUB',` my_exchange_server.my.domain.com.')dnl FEATURE(`stickyhost')dnl MAILER_DEFINITIONS MAILER(smtp)dnl Could someone more experienced with sendmail advice my how to reject messages to those unwanted subdomains? P.S. Mailboxes @my_other.domain.com are used only for receiving messages and never for sending.

    Read the article

  • About the MSDN Documentation on NOTIFYICONDATA's cbSize member

    - by KenC
    I am reading the NOTIFYICONDATA documentation in MSDN. It says the NOTIFYICONDATA structure has a cbSize member should be set to the size of the structure, but NOTIFYICONDATA structure's size has different size in every Shell32.dll, so you should get the Shell32.dll version before setting cbSize. The following quotes from MSDN: If it is version 5.0 or later, initialize the cbSize member as follows. nid.cbSize = sizeof(NOTIFYICONDATA); Setting cbSize to this value enables all the version 5.0 and 6.0 enhancements. For earlier versions, the size of the pre-6.0 structure is given by the NOTIFYICONDATA_V2_SIZE constant and the pre-5.0 structure is given by the NOTIFYICONDATA_V1_SIZE constant. Initialize the cbSize member as follows. nid.cbSize = NOTIFYICONDATA_V2_SIZE; Using this value for cbSize will allow your application to use NOTIFYICONDATA with earlier Shell32.dll versions, although without the version 6.0 enhancements. I found it a bit of vague, because 'sizeof(NOTIFYICONDATA)' has different value in Win98 (using Shell32.dll version 4.x), Win2K (version 5.0) and WinXP (version 6.0). How could it 'enable all version 5.0 and 6.0 enhancements'? So I looked for the definition of NOTIFYICONDATA_V1_SIZE (source code as below), I see: NOTIFYICONDATA_V1_SIZE is for Win 2K (doesn't include 2K) NOTIFYICONDATA_V2_SIZE is for Win XP NOTIFYICONDATA_V3_SIZE is for Vista (not sure if I am right) It's completely different from what MSDN says? and none for Win2K? So, I am totally confused right now. How should I set the cbSize member according to Shell32.dll version? //= = = = = = = = ShellAPI.h = = = = = = = = typedef struct _NOTIFYICONDATAA { DWORD cbSize; HWND hWnd; UINT uID; UINT uFlags; UINT uCallbackMessage; HICON hIcon; #if (NTDDI_VERSION < NTDDI_WIN2K) CHAR szTip[64]; #endif #if (NTDDI_VERSION >= NTDDI_WIN2K) CHAR szTip[128]; DWORD dwState; DWORD dwStateMask; CHAR szInfo[256]; union { UINT uTimeout; UINT uVersion; // used with NIM_SETVERSION, values 0, 3 and 4 } DUMMYUNIONNAME; CHAR szInfoTitle[64]; DWORD dwInfoFlags; #endif #if (NTDDI_VERSION >= NTDDI_WINXP) GUID guidItem; #endif #if (NTDDI_VERSION >= NTDDI_VISTA) HICON hBalloonIcon; #endif } NOTIFYICONDATAA, *PNOTIFYICONDATAA; typedef struct _NOTIFYICONDATAW { DWORD cbSize; HWND hWnd; UINT uID; UINT uFlags; UINT uCallbackMessage; HICON hIcon; #if (NTDDI_VERSION < NTDDI_WIN2K) WCHAR szTip[64]; #endif #if (NTDDI_VERSION >= NTDDI_WIN2K) WCHAR szTip[128]; DWORD dwState; DWORD dwStateMask; WCHAR szInfo[256]; union { UINT uTimeout; UINT uVersion; // used with NIM_SETVERSION, values 0, 3 and 4 } DUMMYUNIONNAME; WCHAR szInfoTitle[64]; DWORD dwInfoFlags; #endif #if (NTDDI_VERSION >= NTDDI_WINXP) GUID guidItem; #endif #if (NTDDI_VERSION >= NTDDI_VISTA) HICON hBalloonIcon; #endif } NOTIFYICONDATAW, *PNOTIFYICONDATAW; #define NOTIFYICONDATAA_V1_SIZE FIELD_OFFSET(NOTIFYICONDATAA, szTip[64]) #define NOTIFYICONDATAW_V1_SIZE FIELD_OFFSET(NOTIFYICONDATAW, szTip[64]) #ifdef UNICODE #define NOTIFYICONDATA_V1_SIZE NOTIFYICONDATAW_V1_SIZE #else #define NOTIFYICONDATA_V1_SIZE NOTIFYICONDATAA_V1_SIZE #endif #define NOTIFYICONDATAA_V2_SIZE FIELD_OFFSET(NOTIFYICONDATAA, guidItem) #define NOTIFYICONDATAW_V2_SIZE FIELD_OFFSET(NOTIFYICONDATAW, guidItem) #ifdef UNICODE #define NOTIFYICONDATA_V2_SIZE NOTIFYICONDATAW_V2_SIZE #else #define NOTIFYICONDATA_V2_SIZE NOTIFYICONDATAA_V2_SIZE #endif #define NOTIFYICONDATAA_V3_SIZE FIELD_OFFSET(NOTIFYICONDATAA, hBalloonIcon) #define NOTIFYICONDATAW_V3_SIZE FIELD_OFFSET(NOTIFYICONDATAW, hBalloonIcon) #ifdef UNICODE #define NOTIFYICONDATA_V3_SIZE NOTIFYICONDATAW_V3_SIZE #else #define NOTIFYICONDATA_V3_SIZE NOTIFYICONDATAA_V3_SIZE #endif (Seems like the code doesn't look good on the web site, but it from ShellAPI.h, all the same)

    Read the article

  • Wordpress network admin pointing to root as opposed to subdirectory

    - by Ian
    I've installed Wordpress on my nginx server in /blogs and new networks will be in /blogs/blogname. All my main site links point to example.com/blogs, but when I go to network admin the links point to http://www.example.com/wp-admin/network/ instead of http://www.example.com/blogs/wp-admin/network/ Here's the multisite section in my config: define('MULTISITE', true); define('SUBDOMAIN_INSTALL', false); $base = '/blogs'; define('DOMAIN_CURRENT_SITE', 'www.example.com'); define('PATH_CURRENT_SITE', '/'); define('SITE_ID_CURRENT_SITE', 1); define('BLOG_ID_CURRENT_SITE', 1); If I try changing PATH_CURRENT_SITE to /blogs, I get a db connection error. Thanks.

    Read the article

  • In WPF how to define a Data template in case of enum?

    - by Ashish Ashu
    I have a Enum defined as Type public Enum Type { OneType, TwoType, ThreeType }; Now I bind Type to a drop down Ribbon Control Drop Down Menu in a Ribbon Control that displays each menu with a MenuName with corresponding Image. ( I am using Syncfusion Ribbon Control ). I want that each enum type like ( OneType ) has data template defined that has Name of the menu and corrospending image. How can I define the data template of enum ? Please suggest me the solution, if this is possible !! Please also tell me if its not possible or I am thinking in the wrong direction !!

    Read the article

  • Can i use a SELECT statement to define a CHECK constraint?

    - by Neel
    In MS SQL server, can i use a SELECT statement to define a CHECK constraint? Say i have to work with two tables "Customer Master" and "Indian Customer" in ideal situation both tables are compleatly different, and are not interrelated in anyways. however they share the same database Content of "Customer Master": CustomerName (colomn): a, b, c, d, e Branchlocation (colomn): IN, AU, IN, IN, UK Content of "Indian Customer": customerID (colomn): 1, 2, 3 CustomerName (colomn): a, c, d customer details (colomn): details1, details, details . . . In Table "Indian Customer" i want to put a constraint so that the users entring data in this table should not be able to enter customers that dont exist in "Customer Master" or whose branch location is not IN. also the tables are in the same project but are not directly related.

    Read the article

  • WiX: Define made in included file not avaible from wxs-file.

    - by leiflundgren
    I have a defines.wxi-file which contains some good definitions used in all my wxs-files. When I attempt to reference the defined value I get Undefined preprocessor variable '$(var.MAGE_FOLDER)' back in my face. I guess there is something trivial I am missing here... Any ideas? defines.wxi <Include> <?define IMAGE_FOLDER="Images" ?> </Include> Product.wxs <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> <?Include defines.wxi ?> <Product ... > <Component Id='c.Images' Directory='$(var.IMAGE_FOLDER)' />

    Read the article

  • How to define cell width for 2 HTML tables with different column counts?

    - by DaveDev
    If I have 2 tables: <table id="Table1"> <tr> <td></td><td></td><td></td> </tr> </table> <table id="Table2"> <tr> <td></td><td></td><td></td><td></td> </tr> </table> The first has 3 columns, the second has 4 columns. How can I define a style to represent both tables when I want Table1's cell width to be 1/3 the width of the full table, and Table2's cells are 1/4 the width of the table?

    Read the article

  • How can I define pre/post-increment behavior in Perl objects?

    - by Zaid
    Date::Simple objects display this behavior. In the case of Date::Simple objects, $date++ returns the next day's date. Date::Simple objects are immutable. After assigning $date1 to $date2, no change to $date1 can affect $date2. This means, for example, that there is nothing like a set_year operation, and $date++ assigns a new object to $date. How can one custom define the pre/post-incremental behavior of an object, such that ++$object or $object-- performs a particular action? I've skimmed over perlboot, perltoot, perltooc and perlbot, but I don't see any examples showing how this can be done.

    Read the article

  • Is there a way to formerly define a time interval for configuring a process?

    - by gshauger
    Horrible worded question...I know. I'm working on an application that processes data for the previous day. The problem is that I know the customer is going to eventually ask to it for every hour or some other arbitrary time interval. I know that languages such as Java or SQL have masks for defining dates. Well what about a way to define a time interval? Let me ask it this way. If someone asked you to create a configurable piece of software how would you allow the user to specify the time intervals?

    Read the article

  • When defining a class as internal, do you define what would usually be public fields as internal?

    - by devoured elysium
    When defining a class as internal, do you define what would usually be public fields as internal? Or do you leave them as public? I have a set of classes with public/private methods that I have decided to set as internal. Now, should I change the class' modifier to internal and let the rest of the methods/properties as they are (public/private) or switch them to (internal/private)? I don't see a big point in changing it to internal, and if by some reason later I want to set them back to public it's going to give a lot of work to have to put them back to public again. Any other thoughts on this?

    Read the article

  • Is it possible to define a virtual directory in IIS and make the files relative to the physical dire

    - by Mikey John
    Is it possible to define a virtual directory in IIS and somehow make the files in that directory relative to the physical directory and not to the virtual directory ? For instance on my server I have the following folders: D:\WebSite\Css\myTheme.css, D:\WebSite\Images\image1.jpg I created a virtual directory on IIS resources.mysite: Inside my website I reference the sheet like this resources.mysite/myTheme.css But inside myTheme.css I reference pictures from ../Images/images1.jpg. So the problem is that image1.jpg is not found because it is relative to the physical folder and not the virtual folder on IIS. Can I solve this problem without modifying the style sheet ?

    Read the article

  • Where is the appropriate place to define inflector rules in CakePHP 1.3?

    - by Daniel Wright
    In CakePHP 1.2, custom inflector rules could be defined in a file app/config/inflections.php. This file was removed in CakePHP 1.3. Instead, the documentation prescribes using the Inflector::rules function to load custom inflections. There's adequate documentation of how to define the custom inflections themselves, but the documentation gives no context—where to use Inflector::rules. Should any custom inflections be defined in the bootstrap.php script? At the top of applicable corresponding controllers? Somewhere else? See also: Configuration: Inflections in the documentation Inflector::rules definition in the API documentation

    Read the article

  • typedef boost::shared_ptr<MyJob> Ptr; or #define Ptr boost::shared_ptr

    - by danio
    I've just started wrking on a new codebase where each class contains a shared_ptr typedef (similar to this) like: typedef boost::shared_ptr<MyClass> Ptr; Is the only purpose to save typing boost::shared_ptr? If that is the case why not do #define Ptr boost::shared_ptr in one common header? Then you can do: Ptr<MyClass> myClass(new MyClass); which is no more typing than MyClass::Ptr myClass(new MyClass); and saves the Ptr definition in each class.

    Read the article

  • Where is it appropriate to define inflector rules in CakePHP 1.3?

    - by Daniel Wright
    In CakePHP 1.2, custom inflector rules could be defined in a file app/config/inflections.php. This file was removed in CakePHP 1.3. Instead, the documentation prescribes using the Inflector::rules function to load custom inflections. There's adequate documentation of how to define the custom inflections themselves, but the documentation gives no context—where to use Inflector::rules. Should any custom inflections be defined in the bootstrap.php script? At the top of applicable corresponding controllers? Somewhere else? See also: Configuration: Inflections in the documentation Inflector::rules definition in the API documentation

    Read the article

  • How do I define an implicit typecast from my class to a scalar?

    - by Delan Azabani
    I have the following code, which uses a Unicode string class from a library that I'm writing: #include <cstdio> #include "ucpp" main() { ustring a = "test"; ustring b = "ing"; ustring c = "- -"; ustring d; d = "cafe\xcc\x81"; printf("%s\n", (a + b + c[1] + d).encode()); } The encode method of the ustring class instances converts the internal Unicode into a UTF-8 char *. However, because I don't have access to the char class definition, I am unsure on how I can define an implicit typecast (so that I don't have to manually call encode when using with printf, etc).

    Read the article

  • How to define supported BlackBerry OS versions and models for application?

    - by Lyubomyr Dutko
    After company wins a project it is usual to mention in contract what devices are supported and what OS versions are supported. But taking into account BlackBerry it appears sometimes to be tricky, as you can have the same device model, but two and(or) more different OS versions (or within same OS different package versions). And in this situation application may need to be updated. So the main question here is what is expected to be mentioned in contract? Could you please share some your experience of resolving such problems? So as a good example can be case of video playback issue on Storm: some issue exists on 5.0.0.XXX (network provider A) and doesn't exist on 5.0.0.YYY (network provider B), or could be following: 5.0.0.XXX1 (network provider A) - issue exist 5.0.0.XXX2 (network provider A) - issue doesn't exist The point here is to define some boundaries of development company responsibility

    Read the article

  • How to define a static array without a contant size in a constructor of a class? (C++)

    - by Keand64
    I have a class defined as: class Obj { public: int width, height; Obj(int w, int h); } and I need it to contain a static array like so: int presc[width][height]; however, I cannot define within the class, so it it possible to create a pointer to a 2D array (and, out of curiosity, 3, 4, and 5D arrays), have that as a member of the class, and intitalize it in the constructor like: int ar[5][6]; Obj o(5, 6, &ar); If that isn't possible, is there any way to get a static array without a contant size in a class, or am I going to have to use a dynamic array? (Something I don't want to do because I don't plan on ever changing the size of the array after it's created.)

    Read the article

  • How to define and use a local variable in aspx page?

    - by Bruskvilla
    Hello how can I define a local variable in aspx page. I just did the below code it gives errors. I'm new please help. Thanks. <% Devamsizlik.Models.DevamDurumu obj; % <% foreach (var item in Model){ %> .....blabla <% obj = item; %> <%} %>//end of foreach < p <%: Html.ActionLink("Create New", "DevamsizEkle", new { ogrId = obj.devamOgrenciID }, new { subeId = obj.devamsizlikSubeID })% < / p > ....< /p cause a compilation error Compiler Error Message: CS0165: Use of unassigned local variable 'obj'

    Read the article

  • Using static strings to define input field names in JSPs - good idea or not?

    - by Derek Clarkson
    Hi all, I've just be asked to work on a large portal project and have been looking through the established code. I keep finding this in the jsps: <input class="portlet-form-button" name="<%=ModifyUserProfile.FORM_FIRST_TIME_LOGIN_SUBMIT%>" type="submit" ... The authors are using static strings defined in classes to define the names of input fields and buttons in jsp forms. I've never seen this done before and was wondering if this is common practice. I'm inclined to think not, but I'm asking because, apart from centralising names which I would have thought are not likely to change, I can't see the reason why. Any thoughts on this?

    Read the article

  • Does TCP actually define 'TCP server' and 'TCP clients'? [closed]

    - by mjn
    In the Wikipedia article, TCP communication is explained using the terms 'client' and 'server'. It also uses the word 'peers'. But TCP actually does not define "TCP clients" and "TCP servers" - In the RFC 675 document (SPECIFICATION OF INTERNET TRANSMISSION CONTROL PROGRAM), the word "client" never appears. The RFC explains that TCP is used to connect processes over ports (sockets), and that 'A pair of sockets form a CONNECTION which can be used to carry data in either direction [i.e. full duplex]. Calling the originating party the "client" seems to be common practice. But this client/server communication model is not always applicable to TCP communication. For example take peer-to-peer networks. Calling all processes which open a socket (and wait for incoming connections from peers) "TCP servers", sounds wrong to me. I would not call my uncle's telephone device a "Telephony server" if I dial his phone number and he picks up.

    Read the article

  • What are the implications of using static const instead of #define?

    - by Simon Elliott
    gcc complains about this: #include <stdio.h> static const int YY = 1024; extern int main(int argc, char*argv[]) { static char x[YY]; } $ gcc -c test1.c test1.c: In function main': test1.c:5: error: storage size of x' isn't constant test1.c:5: error: size of variable `x' is too large Remove the “static” from the definition of x and all is well. I'm not exactly clear what's going on here: surely YY is constant? I had always assumed that the "static const" approach was preferable to "#define". Is there any way of using "static const" in this situation?

    Read the article

  • Is it possible to define XML schemata with node names specified via regular expressions?

    - by MartyIX
    Hello, I know it is probably a question against XML philosophy but still is it possible to define schemata for XML like this: <Root> <arbitrary-name-of-node> <Name></Name> <Position></Position> <!-- ... --> </arbitrary-name-of-node> <arbitrary-name-of-node> <Name></Name> <Position></Position> <!-- ... --> </arbitrary-name-of-node> </Root> where arbitrary-name-of-node matches regular expression [a-zA-Z0-9]? Thanks for an answer!

    Read the article

< Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >