Daily Archives

Articles indexed Wednesday April 28 2010

Page 25/119 | < Previous Page | 21 22 23 24 25 26 27 28 29 30 31 32  | Next Page >

  • How do I split Chinese characters one by one?

    - by Nano HE
    If there is no special character(such as white space, : etc) between firstname and lastname. Then how to split the Chinese characters below. use strict; use warnings; use Data::Dumper; my $fh = \*DATA; my $fname; # ??; my $lname; # ? ; while(my $name = <$fh>) { $name =~ ??? ; print $fname"/n"; print $lname; } __DATA__ ??? Output ?? ?

    Read the article

  • Android how to get gps location

    - by Faisal khan
    I want to detect location from gps listener and also from network my code is as follows For network location listen locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, WLConstants.DELAY_HOUR, 500.0f, nsl); // where nsl is listener implements LocationListener and for the gps location listen locationManager.requestLocationUpdates( LocationManager.GPS_PROVIDER, WLConstants.DELAY_HOUR, gpsListener .getMinDistance(), gpsListener);// where gps listener implements LocationListener Can we have one listener to listen both rather then launching two different listeners to listen from network and gps???

    Read the article

  • Synonym for "Many-to-Many" relationship (relational databases)

    - by Byron
    What's a synonym for a "many-to-many" relationship? I've finished writing an object-relational mapper but I'm still stumped as to what to name the function that adds that relation. addParent() and addChild() seemed quite logical for the many-to-one/one-to-many and addSuperclass() for one-to-one inheritance, but addManyToMany() would sound quite unintuitive to an object-oriented programmer. addSibling() or addCousin() doesn't really make sense either. Any suggestions? And before you dismiss this as a non-programming question, please remember that consistent naming schemes and encapsulation are pretty integral to programming :)

    Read the article

  • How can I share dynamic data between Applications?

    - by Ehsan
    Hi, I use CreateFileMapping, but this method does not useful,because only static structure can be shared by this method. for example this method is good for following structure: struct MySharedData { unsigned char Flag; int Buff[10]; }; but it's not good for : struct MySharedData { unsigned char Flag; int *Buff; }; would be thankful if somebody guide me on this, Thanks in advance!

    Read the article

  • Regarding Sqlite Datbase connectivity in iphone

    - by Prash.......
    hi.. I am developing an application in iphone in which i have to do the database connectivity using sqlite. I have made a "clsDBManage" class which contains 4 functions open_database, close_database, is_database_open, getdatabase_connection, which are globally defined ,i have a screen called "user details" in which i am filling the user details such as name , mobileno , email-id , password, i want that when user feeds the info it should get connected with database and store the details entered and should authenticate the user the next time he logs in. (Just as we have yahoo login,gmail login screen) clsDBManage.h +(int) openDBConnection; +(int) closeDBConnection; +(BOOL) IsDatabaseOpen; +(sqlite3 *)getDBConnection; clsDBManage.m import "clsDBManage.h" import "Types.h" sqlite3 *DBConnection=nil; @implementation clsDBManage +(int) openDBConnection { NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *path = [documentsDirectory stringByAppendingPathComponent:@"iphone.sqlite"]; //Before if ([self IsDatabaseOpen] == YES) [self closeDBConnection]; // Open the database. The database was prepared outside the application. if (sqlite3_open([path UTF8String], &DBConnection ) == SQLITE_OK) { ifdef _DEBUG NSLog(@"Database Successfully Opened :)"); endif return CON_RET_SUCCESSFUL; } else { ifdef _DEBUG NSLog(@"Error in opening database :("); endif return CON_RET_ERROR; } } +(BOOL) IsDatabaseOpen { if(DBConnection != nil) { //add if condition to check database is in open state or close state return YES; } else { return NO; } } +(int) closeDBConnection { @try { if(DBConnection != nil) { sqlite3_close(DBConnection); DBConnection = nil; return CON_RET_SUCCESSFUL; } else { return CON_RET_ERROR; } } @catch (NSException * e) { NSLog([e reason]); } } +(sqlite3 *)getDBConnection { if ([self openDBConnection] == 1) return DBConnection; else return nil; } @end //classDBManage file is my handler class where i have written code to open database //my addprofile functions -(NSInteger)addProfile:(NSString *)mobileno:(NSString *)country:(NSString *)username:(NSString *)screenname:(NSString *)emailid:(NSString *)password:(NSString *)retypepassword { @try { sqlite3 *db =[clsDBManage getDBConnection]; if (db != nil) { sqlite3_stmt *statement =nil; const char *sql = "insert into SPCaccountdetails(MobileNo , Country , UserName , ScreenName, EmailId, Password, RetypePawssword) Values(?,?,?,?,?,?,?)"; if(sqlite3_prepare_v2(db, sql, -1, &statement, NULL) != SQLITE_OK) { //NSAssert1(0, @"Error while creating add statement. '%s'", sqlite3_errmsg(db)); } sqlite3_bind_text(statement, 1, [mobileno UTF8String], -1, SQLITE_TRANSIENT); sqlite3_bind_text(statement, 2, [country UTF8String], -1, SQLITE_TRANSIENT); sqlite3_bind_text(statement, 3, [username UTF8String], -1, SQLITE_TRANSIENT); sqlite3_bind_text(statement, 4, [screenname UTF8String], -1, SQLITE_TRANSIENT); sqlite3_bind_text(statement, 5, [emailid UTF8String], -1, SQLITE_TRANSIENT); sqlite3_bind_text(statement, 6, [password UTF8String], -1, SQLITE_TRANSIENT); sqlite3_bind_text(statement, 7, [retypepassword UTF8String], -1, SQLITE_TRANSIENT); if(SQLITE_DONE != sqlite3_step(statement)) { NSAssert1(0, @"Error while inserting data. '%s'", sqlite3_errmsg(db)); } sqlite3_finalize(statement); } } @catch(NSException *e) { //[clsMessageBox ShowMessageOK:@CON_MESSAGE_TITLE_MESSAGE_USER_PROFILE :[e reason]]; } return CON_RET_SUCCESSFUL; } //button click event where i am calling addprofile function;_ [self addProfile:txtMobile :txtCountry :txtName :txtScreenname :txtemailid :txtpassword :txtretypepassword];

    Read the article

  • Abstract Data Type: Any1 can help me this? thanks..

    - by Aga Hibaya
    Objectives: Implement the Abstract Data Type (ADT) List using dynamically allocated arrays and structures. Description A LIST is an ordered collection of items where items may be inserted anywhere in the list. Implement a LIST using an array as follows: struct list { int *items; // pointer to the array int size; // actual size of the array int count; // number of items in the array }; typedef struct list *List; // pointer to the structure Implement the following functions: a) List newList(int size); - will create a new List and return its pointer. Allocate space for the structure, allocate space for the array, then initialize size and count, return the pointer. b) void isEmpty(List list); c) void display(List list); d) int contains(List list, int item); e) void remove(List list, int i) ; f) void insertAfter(List list,int item, int i); g) void addEnd(List list,int item) - add item at the end of the list – simply store the data at position count, then increment count. If the array is full, allocate an array twice as big as the original. count = 5 size = 10 0 1 2 3 4 5 6 7 8 9 5 10 15 20 30 addEnd(list,40) will result to count = 6 size = 10 0 1 2 3 4 5 6 7 8 9 5 10 15 20 30 40 h) void addFront(List list,int item) - shift all elements to the right so that the item can be placed at position 0, then increment count. Bonus: if the array is full, allocate an array twice as big as the original. count = 5 size = 10 0 1 2 3 4 5 6 7 8 9 5 10 15 20 30 addFront(list,40) will result to count = 6 size = 10 0 1 2 3 4 5 6 7 8 9 40 5 10 15 20 30 i) void removeFront(List list) - shift all elements to the left and decrement count; count = 6 size = 10 0 1 2 3 4 5 6 7 8 9 40 5 10 15 20 30 removeFront(list) will result to count = 5 size = 10 0 1 2 3 4 5 6 7 8 9 5 10 15 20 30 j) void remove(List list,int item) - get the index of the item in the list and then shift all elements to the count = 6 size = 10 0 1 2 3 4 5 6 7 8 9 40 5 10 15 20 30 remove(list,10) will result to count = 5 size = 10 0 1 2 3 4 5 6 7 8 9 40 5 15 20 30 Remarks

    Read the article

  • Compute bounding quad of a sphere with vertex shader

    - by Ben Jones
    I'm trying to implement an algorithm from a graphics paper and part of the algorithm is rendering spheres of known radius to a buffer. They say that they render the spheres by computing the location and size in a vertex shader and then doing appropriate shading in a fragment shader. Any guesses as to how they actually did this? The position and radius are known in world coordinates and the projection is perspective. Does that mean that the sphere will be projected as a circle? Thanks!

    Read the article

  • How can specific the layout_width and layout_height of a Framelayout which fits an image

    - by michael
    Hi, I have an image which is 80px X 50 px, and I need to place that in one of the child of a FrameLayout, how can I specific the layout_width and layout_height of a Framelayout which fits an image without scaling it? I know there is a layout_height="wrap_content" layout_wight="wrap_content" for FrameLayout, but I can't use it, since that FrameLayout has other children. So I would like to hard code the FrameLayout width/height to match the dimension of the image? Should I use layout_width="80px" or layout_width="80dip"? Thank you.

    Read the article

  • Silverlight for windows embedded

    - by Abhi
    Dear All This is my xaml file. <UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Class="SilverlightApplication1.Page" Width="640" Height="480" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"> <UserControl.Resources> <Style x:Key="ButtonStyle1" TargetType="Button"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="Button"> <Grid> <vsm:VisualStateManager.VisualStateGroups> <vsm:VisualStateGroup x:Name="FocusStates"> <vsm:VisualState x:Name="Unfocused"/> <vsm:VisualState x:Name="Focused"/> </vsm:VisualStateGroup> <vsm:VisualStateGroup x:Name="CommonStates"> <vsm:VisualState x:Name="MouseOver"> <Storyboard> <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="image" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)"> <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1.207"/> </DoubleAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="image" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)"> <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1.207"/> </DoubleAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="image" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)"> <SplineDoubleKeyFrame KeyTime="00:00:00" Value="15.5"/> </DoubleAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="image" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)"> <SplineDoubleKeyFrame KeyTime="00:00:00" Value="17.877"/> </DoubleAnimationUsingKeyFrames> </Storyboard> </vsm:VisualState> <vsm:VisualState x:Name="Normal"/> <vsm:VisualState x:Name="Pressed"> <Storyboard> <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="image" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)"> <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.567"/> </DoubleAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="image" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)"> <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.567"/> </DoubleAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="image" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)"> <SplineDoubleKeyFrame KeyTime="00:00:00" Value="-32.5"/> </DoubleAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="image" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)"> <SplineDoubleKeyFrame KeyTime="00:00:00" Value="-37.483"/> </DoubleAnimationUsingKeyFrames> </Storyboard> </vsm:VisualState> <vsm:VisualState x:Name="Disabled"/> </vsm:VisualStateGroup> </vsm:VisualStateManager.VisualStateGroups> <Image Source="bounce_media.png" Stretch="Fill" RenderTransformOrigin="0.5,0.5" x:Name="image"> <Image.RenderTransform> <TransformGroup> <ScaleTransform/> <SkewTransform/> <RotateTransform/> <TranslateTransform/> </TransformGroup> </Image.RenderTransform> </Image> <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style> <Style x:Key="ButtonStyle2" TargetType="Button"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="Button"> <Grid> <vsm:VisualStateManager.VisualStateGroups> <vsm:VisualStateGroup x:Name="FocusStates"> <vsm:VisualState x:Name="Unfocused"/> <vsm:VisualState x:Name="Focused"/> </vsm:VisualStateGroup> <vsm:VisualStateGroup x:Name="CommonStates"> <vsm:VisualState x:Name="MouseOver"> <Storyboard> <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="image" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)"> <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1.243"/> </DoubleAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="image" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)"> <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1.243"/> </DoubleAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="image" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)"> <SplineDoubleKeyFrame KeyTime="00:00:00" Value="18.208"/> </DoubleAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="image" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)"> <SplineDoubleKeyFrame KeyTime="00:00:00" Value="21"/> </DoubleAnimationUsingKeyFrames> </Storyboard> </vsm:VisualState> <vsm:VisualState x:Name="Normal"/> <vsm:VisualState x:Name="Pressed"> <Storyboard> <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="image" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)"> <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.6"/> </DoubleAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="image" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)"> <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0.6"/> </DoubleAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="image" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)"> <SplineDoubleKeyFrame KeyTime="00:00:00" Value="-30"/> </DoubleAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="image" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)"> <SplineDoubleKeyFrame KeyTime="00:00:00" Value="-34.6"/> </DoubleAnimationUsingKeyFrames> </Storyboard> </vsm:VisualState> <vsm:VisualState x:Name="Disabled"/> </vsm:VisualStateGroup> </vsm:VisualStateManager.VisualStateGroups> <Image Source="bounce_photo.png" Stretch="Fill" RenderTransformOrigin="0.5,0.5" x:Name="image"> <Image.RenderTransform> <TransformGroup> <ScaleTransform/> <SkewTransform/> <RotateTransform/> <TranslateTransform/> </TransformGroup> </Image.RenderTransform> </Image> <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style> </UserControl.Resources> <Grid x:Name="LayoutRoot" Background="pink"> <Button Height="173" HorizontalAlignment="Left" Margin="8,0,0,18" Style="{StaticResource ButtonStyle1}" VerticalAlignment="Bottom" Width="150" Content=""/> <Button Height="173" HorizontalAlignment="Right" Margin="0,0,35,18" Style="{StaticResource ButtonStyle2}" VerticalAlignment="Bottom" Width="150" Content=""/> </Grid> The above mentioned is an xaml file built using Microsoft Expression Blend 2 I have to use this xaml file as resource in my sub project using visual studio(c++). For this i have to develop a c++ code. But i am very unfamiliar with this technology and i need some guidance to obtain the task. Please also tell me where can i learn to develop a c++ code for this xaml file. I have heard that silverlight has its own API's which is entirely different from the WIN32 API's. I am familiar using WIN32 API's but unfamiliar with this Silverlight Technology. Please guide me the step or the tutorial site where i can learn the following concepts: 1. c++ coding in visual studio for SWE where xaml file is added as resource in my sub project. for ex:- How to write a c++ code for windows embedded for an xaml file which will display images which acts as a button in the emulator ?

    Read the article

  • Silverlight file download for COM Interop

    - by rip
    Is the following possible in Silverlight when a button is clicked? An Excel template is downloaded from a remote server and saved to the local machine An instance of the template is then opened on the client A macro is then executed within the new Excel document I can do everything apart from saving the template to the local machine. I can save this in isolated storage but then I don’t know where this is when trying to open it from the Excel COM interop code. Has anyone any ideas or is this not possible?

    Read the article

  • Server 2003 and XP Client; Why are HTTP connections being silently dropped.

    - by Asa Yeamans
    On my network, my edge-router, a windows 2003 r2 server router with all the latest updates, will drop packets, but only under specific circumstances. I have troubleshot and isolated it down to the most simple configuration i can. There is NO NAT involved. Only fully-public IP addresses. No Firewalls are running either, all ahve been disabled. no packet filters on any interfaces anywhere either. I have a single Windows XP virtual machine and my edge-router(the windows 2003 r2 server, and also a virtual machine) running on a windows 2008 x64 r2 system (running virtual server 2005 as i dont have Intel-VT compatible chip yet). The edge router can access any external http site just fine, no issues. However the windows XP machine is only able to access certain sites. These work: www.google.com www.txstate.edu www.workintexas.com www.thedailywtf.com . These Dont: www.yahoo.com www.utexas.edu en.wikipedia.org slashdot.org www.bing.com. I have removed all possibility of DNS issues by connecting with net-cat from the XP box and sending GET /\r\nHost: \r\n\r\n and that connection replicates the issue as well. The network setup: My statically assigned IP block: x.x.x.168/29 DSL Modem -----PPPoE Connection---- x.x.x.169[EdgeRouter] [EdgeRouter]x.x.x.170 -----Virtual Ethernet----- x.x.x.174 [Test2] Test2's Default gateway is x.x.x.170 and test2 can ping any and every valid, accessible, public IP address with no packet loss what-so-ever. If i connect directly over PPPoE from test2 (the XP box) everything works just fine... Im at my wits end, i have NO IDEA whats causing this.

    Read the article

  • one email have multiple open id , unable to retrive specific open id password?

    - by superUser
    I have multiple OPENID accouts refrencing same email address, now i forget one of my accout's password. and when i tried to recover my password then only one openid accout link sent to my mail address whereas i need another openid password reset link what i have to do?? although i m able to login through gmail, but i want to login through openid. i have mailed already? but no satisfactory answer?? how do i collect all open ID password reset link referencing same email address??

    Read the article

  • Only some motherboards can support faster RAM?

    - by Wesley
    This is a question relating to one of my builds. Here are the specs: ECS P4VXASD2+ V5.0 motherboard Intel P4 Northwood 2.8 GHz (533 MHz FSB, 512 KB L2) 2x 1GB PC3200 DDR RAM Maxtor 300GB IDE HDD 16 MB NVIDIA TNT2 Pro AGP OKIA 300W ATX PSU Gigabyte 52x CD-ROM The issue right now is that I'm trying to install Windows XP from the CD drive but the computer randomly restarts partway through installation. My other build was BSODing due to RAM latency errors. This ECS board manual states that memory modules "up to 333 MHz" (i.e. PC2700) is supported. However, I am running PC3200 modules, which is clearly faster than PC2700. Would this be causing the computer from randomly restarting? EDIT 1: I also wanted to mention that my Emachines T2482 is actually running 2x 512MB PC3200 DDR RAM when it should only be supporting PC1600 and PC2100 DDR RAM. Yet there are no issues with it.

    Read the article

  • Can an ASP.NET page be a WebService also?

    - by halivingston
    I know it's a little odd, specifically because a Page inherits from the System.Web.Page (or something) and a WebService inherits from System.Web.Service (or something). But just thought I'd ask if there is any way to do this? Does anyone have suggestions to do this?

    Read the article

  • Cakephp beforeFind() - How do I add a JOIN condition AFTER the belongsTo association is added?

    - by michael
    I'm in Model-beforeFind($queryData), trying to add a JOIN condition to the queryData on a model which has belongsTo associations. Unfortunately, the new JOIN references a table in the belongsTo association, so it must appear AFTER the belongsTo in the query. Here is my Tagged-belongsTo association: app\plugins\tags\models\tagged.php (line 192) Array ( [Tag] => Array ( [className] => Tag [foreignKey] => tag_id [conditions] => [fields] => [order] => [counterCache] => ) [Group] => Array ( [className] => Group [foreignKey] => foreign_key [conditions] => Array ( [Tagged.model] => Group ) [fields] => [order] => [counterCache] => ) ) Here is the JOIN added in Tagged-beforeFind(), notice that the belongsTo joins have not yet been added: app\plugins\tags\models\tagged.php (line 194) Array ( [conditions] => Array ( [Tag.keyname] => europe ) [fields] => Array ( [0] => DISTINCT Group.* [1] => GroupPermission.* ) [joins] => Array ( [0] => Array ( [table] => permissions [alias] => GroupPermission [foreignKey] => [type] => INNER [conditions] => Array ( [GroupPermission.model] => Group [0] => GroupPermission.foreignId = Group.id [or] => Array ( ... ) ) ) ) [limit] => [offset] => [order] => Array ( [0] => ) [page] => 1 [group] => [callbacks] => 1 [by] => europe [model] => Group ) When I check the output, it fails with "1054: Unknown column 'Group.id' in 'on clause'" because the Permissions join appeared BEFORE the Groups join. SELECT DISTINCT `Group`.*, `GroupPermission`.* FROM `tagged` AS `Tagged` INNER JOIN permissions AS `GroupPermission` ON (`GroupPermission`.`model` = 'Group' AND `GroupPermission`.`foreignId` = `Group`.`id` AND (...)) LEFT JOIN `tags` AS `Tag` ON (`Tagged`.`tag_id` = `Tag`.`id`) LEFT JOIN `groups` AS `Group` ON (`Tagged`.`foreign_key` = `Group`.`id` AND `Tagged`.`model` = 'Group') WHERE `Tag`.`keyname` = 'europe' But this SQL (with Permissions joined moved to the end) works fine: SELECT DISTINCT `Group`.*, `GroupPermission`.* FROM `tagged` AS `Tagged` LEFT JOIN `tags` AS `Tag` ON (`Tagged`.`tag_id` = `Tag`.`id`) LEFT JOIN `groups` AS `Group` ON (`Tagged`.`foreign_key` = `Group`.`id` AND `Tagged`.`model` = 'Group') INNER JOIN permissions AS `GroupPermission` ON (`GroupPermission`.`model` = 'Group' AND `GroupPermission`.`foreignId` = `Group`.`id` AND (...)) WHERE `Tag`.`keyname` = 'europe' How do I add my join in beforeFind() after the belongsTo join?

    Read the article

  • Binding the property to a control defined inside a listboxitem template

    - by Malcolm
    I have a class called ledgerObject : public class LedgerObject { public ChargeLine ChargeLine{ get; set; } public DelegateCommand Click_hyperbnCommand{ get; private set; } public LedgerObject() { this.Click_hyperbnCommand = new DelegateCommand(click_btn); } private void click_btn(object args) { } } The chargeLine which is the property of this class is itself a class and has some properties in it. So I am binding the datacontext of a listbox to an array of LedgerObject, and I want to bind the textblock control defined inside a listboxitem template to the property of a ChargeLine. Any idea or suggestion will help. I have tried this but not working: <TextBlock Margin="4 0 4 0" Grid.Column="3" Text="{Binding Path=ChargeLine.SimCode}" TextDecorations="Underline" Foreground="Red" />

    Read the article

  • To pass the ID of DIV tag in JQuery

    - by kwokwai
    Hi all, I am learning JQuery. In a HTML file, I got this: <DIV ID="testing"> And I am trying to pass the ID of this DIV tag to a JQuery self-defined function: <script> $(function() { $("div").mouseover(function() { var ID = $(this).children().attr('id'); alert(ID); }); }); But it wont work.

    Read the article

  • NSStrings, C strings, pathnames and encodings in iPhone

    - by iter
    I am using libxml2 in my iPhone app. I have an NSString that holds the pathname to an XML file. The pathname may include non-ASCII characters. I want to get a C string representation of the NSString for to pass to xmlReadFile(). It appears that cStringUsingEncoding gives me the representation I seek. I am not clear on which encoding to use. I wonder if there is a "default" encoding in iPhone OS that I can use here and ensure that I can roundtrip non-ASCII pathnames.

    Read the article

  • An Object reference is required for the non-static field

    - by Muhammad Akhtar
    I have make my existing method to static method to get access in javascript, like.. [WebMethod(EnableSession = true), ScriptMethod()] public static void Build(String ID) { Control releaseControl = LoadControl("~/Controls/MyControl.ascx"); //An Object reference is required for the non-static field, mthod or property // 'System.Web.UI.TemplateControl.LoadControl(string)' plc.Controls.Add(releaseControl); // where plc is place holder control //object reference is required for the nonstatic field, method, or property '_Default.pl' } When I build I am getting error and I have posted these in comments below each line before converted it to static method, it working perfectly. Please suggest me the solution of my issue. Thanks

    Read the article

  • C# massive insertion into data structures

    - by Seabass
    In C#, you can do the following: List registers = new List { 1, 2, 3, 4 }; This will produce a list with 1, 2, 3, and 4 in the list. Suppose that I am given a list from some function and I want to insert a bunch of numbers like the following: List register = somewhere(); register.Add(1); register.Add(2); register.Add(3); register.Add(4); Is there a cleaner way of doing this like the snippet above?

    Read the article

< Previous Page | 21 22 23 24 25 26 27 28 29 30 31 32  | Next Page >