Daily Archives

Articles indexed Friday April 6 2012

Page 4/18 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Lightning whip particle effects

    - by Fibericon
    I'm currently using Mercury Particle Engine for the particle effects in my game, and I'm trying to create a sort of lightning whip - basically a lightning effect bound to a line that curves when the player moves. I know how to use the editor, and I have particle effects working in game. However, I'm completely lost as to where I should start for this specific particle effect. Perhaps if I could find the code for it in a different particle engine, I could convert it, but I can't seem to find that either. What I did find was a lot of tutorials for creating the lines associated with lightning programmatically, which doesn't help in this case because I don't want it to be rigid. Perhaps it would be more like some sort of laser beam with crackling effects around it? I'm running into a wall as far as even beginning to implement this goes.

    Read the article

  • How to chain actions/animations together and delay their execution?

    - by codinghands
    I'm trying to build a simple game with a number of screens - 'TitleScreen', 'LoadingScreen', 'PlayScreen', 'HighScoreScreen' - each of which has it's own draw & update logic methods, sprites, other useful fields, etc. This works well for me as a game dev beginner, and it runs. However, on my 'PlayScreen' I want to run some animations before the player gets control - dropping in some artwork, playing some sound effects, generally prettifying things a little. However, I'm not sure what the best way to chain animations / sound effects / other timed general events is. I could make an intermediary screen, 'PrePlayScreen', which simply has all of this hardcoded like so: Update(){ Animation anim1 = new Animation(.....); Animation anim2 = new Animation(.....); anim1.Run(); if(anim1.State == AnimationState.Complete) anim2.Run(); if(anim2.State == AnimationState.Complete) // Load 'PlayScreen' screen } But this doesn't seem so great - surely their must be a better way? I then thought, 'Hey - an AnimationManager! That'd be awesome!'. But then that creeping OOP panic set in as I thought about it some more. If I create the Animation in my Screen, then add it to the AnimationManager (which may or may not be a GameComponent hooked up to Update/Draw), how can I get 'back' to it? To signal commands like start / end / repeat? I'd still need to keep a reference to the object in my Screen so that I could still communicate with it once it's buried in the bosom of a List in my AnimationManager. This seems bad. I've also tried using events - call 'Update' on all the animations in the PlayScreen update loop, but crucially all of the animations have a bool flag ('Active') which determines whether they should begin. The first animation has this set to 'true', all others 'false'. On completion the first animation raises an event, which sets animation 2's bool flag to true (and so it then runs). Once animation 2 is complete another 'anim complete' event is raised, and the screen state changes. Considering the game I'm making is basically as simple as it gets I know I'm overthinking this... it's just the paradigm shift from web - game development is making me break out in a serious case of the stupids.

    Read the article

  • Numbers not adding up? (What am I not understanding here?) [closed]

    - by Milo
    I have the following output: Short version: The last numbers on the S= lines increase by H and SHOULD theoretically be linearly decreasing, ex: -285,-290,-295...but the fourth one jumps to -252. Yet, every other number is linearly increasing. Why is that and how could I fix that? To explain the numbers, it comes from slider value changed. I have a slider whose value is used to generate the float on the next line. Everything should be growing linearly here. This value is used to determine the size of a flow layout and it is also used in conjunction with a scrollbar. But basically I have a background for the flow layout and that number is the start location for rendering it. The numbers should linearly change to create a smooth transition but when that one jumps, it looks weird on screen and I dont understand why the numbers are jumping every X slider value changes. Mathematically what could be causing this? Here is the code for rendering the background and the function that is called when value changes: void LobbyTableManager::renderBG( GraphicsContext* g, agui::Rectangle& absRect, agui::Rectangle& childRect ) { float scale = 0.35f; int w = m_bgSprite->getWidth() * getTableScale() * scale; int h = m_bgSprite->getHeight() * getTableScale() * scale; int numX = ceil(absRect.getWidth() / (float)w) + 2; int numY = ceil(absRect.getHeight() / (float)h) + 2; int startY = childRect.getY(); int numAttempts = 0; while(startY + h < absRect.getY() && numAttempts < 1000) { startY += h; if(moo) { std::cout << startY << ","; } numAttempts++; } g->holdDrawing(); for(int i = 0; i < numX; ++i) { for(int j = 0; j < numY; ++j) { g->drawScaledSprite(m_bgSprite,0,0,m_bgSprite->getWidth(),m_bgSprite->getHeight(), absRect.getX() + (i * w) + (offsetX),absRect.getY() + (j * h) + startY,w,h,0); } } g->unholdDrawing(); g->setClippingRect(cx,cy,cw,ch); } void LobbyTableManager::setTableScale( float scale ) { scale += 0.3f; scale *= 2.0f; float scrollRel = m_vScroll->getRelativeValue(); setScale(scale); rescaleTables(); resizeFlow(); updateScrollBars(); float newVal = scrollRel * m_vScroll->getMaxValue(); m_vScroll->setValue(newVal); } void LobbyTableManager::valueChanged( agui::VScrollBar* source,int val ) { m_flow->setLocation(0,-val); } Any insight on mathematically why the anomaly might happen every Nth time would be helpful. I just dont understand why if every number linearly increates it jumps from -295 to -252! Thanks

    Read the article

  • getting nullpointer exception when click on button

    - by user1315187
    I am use a button and when u click this button a text field is automatic created and button status is automatic disable but if u click on disable button text field is automatic delete and button status is changed to enable.i going through this process. public class ConfigurationScreen extends MainScreen implements FieldChangeListener{ TextField tf_text; tf_text = new TextField(TextField.TYPE_PLAIN,img_text[1],img_text[0],TextField.FIELD_HCENTER); tf_text.setWidth(Display.getWidth()/2+20); ImageButton btn_en; btn_en = new ImageButton(imgs_tmintrvl1,"enable",ImageButton.FIELD_HCENTER); ImageButton btn_dis; btn_dis=new ImageButton(imgs_tmintrvl1,"Disable",ImageButton.FIELD_HCENTER); add(btn_en); btn_en.setChangeListener(this); public void fieldChanged(Field field, int context) { if( field==btn_en) { delete(btn_en); insert(btn_dis, 4); insert(tf_text, 5); System.out.println(ex); }else if (field == btn_dis){ delete(btn_dis); delete(tf_text); insert(btn_en, 4); System.out.println("Disable Button="+ex); } } But when i run this code i am getting null pointerr exception please help me where i am making mistake. Thanks in Advance

    Read the article

  • How to display Currency in Indian Numbering Format in PHP

    - by Somnath Muluk
    I have a question about formatting the Rupee currency (Indian Rupee - INR). For example, numbers here are represented as: 1 10 100 1,000 10,000 1,00,000 10,00,000 1,00,00,000 10,00,00,000 Refer Indian Numbering System I have to do with it PHP. I have saw this question Displaying Currency in Indian Numbering Format. But couldn't able to get it for PHP my problem. Update: How to use money_format() in indian currency format?

    Read the article

  • Pass Types as arguments to a function in Haskell?

    - by Charles Peng
    The following two functions are extremely similar. They read from a [String] n elements, either [Int] or [Float]. How can I factor the common code out? I don't know of any mechanism in Haskell that supports passing types as arguments. readInts n stream = foldl next ([], stream) [1..n] where next (lst, x:xs) _ = (lst ++ [v], xs) where v = read x :: Int readFloats n stream = foldl next ([], stream) [1..n] where next (lst, x:xs) _ = (lst ++ [v], xs) where v = read x :: Float I am at a beginner level of Haskell, so any comments on my code are welcome.

    Read the article

  • How to store Hierarchical K-Means tree for a large number of images, using Opencv?

    - by AquaAsh
    I am trying to make a program that will find similar images from a dataset of images. The steps are 1)extract SURF descriptors for all images 2)store the descriptors 3)Apply knn on the stored descriptors 4)Match the stored descriptors to the query image descriptor using KNN Now each images SURF descriptor will be stored as Hierarchical k means tree, now do I store each tree as a separate file or is it possible to build some sort of single tree with all the images descriptors and updated as images are added to dataset. This is the paper I am basing the program on www.ijest.info/docs/IJEST10-02-03-13.pdf.

    Read the article

  • Ruby module_function, invoking module's private method, invoked in class method style on module shows error

    - by Jignesh
    test_module.rb module MyModule def module_func_a puts "module_func_a invoked" private_b end module_function :module_func_a private def private_b puts "private_b invoked" end end class MyClass include MyModule def test_module module_func_a end end Invoking module function from class c = MyClass.new c.test_module Output 1: $ ruby test_module.rb module_func_a invoked private_b invoked Invoking module function on module in class method style ma = MyModule.module_func_a Output 2: module_func_a invoked test_module.rb:5:in `module_func_a': undefined local variable or method `private_b' for MyModule:Module (NameError) from test_module.rb:31 As can be seen from the Output 1 and Output 2 when including the module in a class, no issue occurs when a module's private method gets invoked from a module function while in case when directly invoking the module function on the module in class method style the module's private method, invoked from module function, is not found. Can anybody make me understand the reason behind above behavior and whether invoking module function (which in turn invokes module's private method) on module in class method style is possible or not? If possible, then what rectifications are required in my code to do the same? Thanks, Jignesh

    Read the article

  • JSON documents and SQL database tables

    - by Sharmi
    Do JSON documents in RavenDB cost more than the SQL Server tables in terms of the storage and query costs. And also for centralized access, which one is better? What are the disadvantages of NON-SQL databases like RavenDB,CouchDB,MongoDB, etc... ? I can get that some of these are open source and support more datatypes like enums,objects,etc. but otherwise i don't see any big advantage? Currently there is a problem of storing huge amount of logs from various locations. I am planning to suggest these to my manager so just need a clear idea.

    Read the article

  • Python: (sampling with replacement): efficient algorithm to extract the set of UNIQUE N-tuples from a set

    - by Homunculus Reticulli
    I have a set of items, from which I want to select DISSIMILAR tuples (more on the definition of dissimilar touples later). The set could contain potentially several thousand items, although typically, it would contain only a few hundreds. I am trying to write a generic algorithm that will allow me to select N items to form an N-tuple, from the original set. The new set of selected N-tuples should be DISSIMILAR. A N-tuple A is said to be DISSIMILAR to another N-tuple B if and only if: Every pair (2-tuple) that occurs in A DOES NOT appear in B Note: For this algorithm, A 2-tuple (pair) is considered SIMILAR/IDENTICAL if it contains the same elements, i.e. (x,y) is considered the same as (y,x). This is a (possible variation on the) classic Urn Problem. A trivial (pseudocode) implementation of this algorithm would be something along the lines of def fetch_unique_tuples(original_set, tuple_size): while True: # randomly select [tuple_size] items from the set to create first set # create a key or hash from the N elements and store in a set # store selected N-tuple in a container if end_condition_met: break I don't think this is the most efficient way of doing this - and though I am no algorithm theorist, I suspect that the time for this algorithm to run is NOT O(n) - in fact, its probably more likely to be O(n!). I am wondering if there is a more efficient way of implementing such an algo, and preferably, reducing the time to O(n). Actually, as Mark Byers pointed out there is a second variable m, which is the size of the number of elements being selected. This (i.e. m) will typically be between 2 and 5. Regarding examples, here would be a typical (albeit shortened) example: original_list = ['CAGG', 'CTTC', 'ACCT', 'TGCA', 'CCTG', 'CAAA', 'TGCC', 'ACTT', 'TAAT', 'CTTG', 'CGGC', 'GGCC', 'TCCT', 'ATCC', 'ACAG', 'TGAA', 'TTTG', 'ACAA', 'TGTC', 'TGGA', 'CTGC', 'GCTC', 'AGGA', 'TGCT', 'GCGC', 'GCGG', 'AAAG', 'GCTG', 'GCCG', 'ACCA', 'CTCC', 'CACG', 'CATA', 'GGGA', 'CGAG', 'CCCC', 'GGTG', 'AAGT', 'CCAC', 'AACA', 'AATA', 'CGAC', 'GGAA', 'TACC', 'AGTT', 'GTGG', 'CGCA', 'GGGG', 'GAGA', 'AGCC', 'ACCG', 'CCAT', 'AGAC', 'GGGT', 'CAGC', 'GATG', 'TTCG'] Select 3-tuples from the original list should produce a list (or set) similar to: [('CAGG', 'CTTC', 'ACCT') ('CAGG', 'TGCA', 'CCTG') ('CAGG', 'CAAA', 'TGCC') ('CAGG', 'ACTT', 'ACCT') ('CAGG', 'CTTG', 'CGGC') .... ('CTTC', 'TGCA', 'CAAA') ] [[Edit]] Actually, in constructing the example output, I have realized that the earlier definition I gave for UNIQUENESS was incorrect. I have updated my definition and have introduced a new metric of DISSIMILARITY instead, as a result of this finding.

    Read the article

  • UIImagePNGRepresentation issues?

    - by disorderdev
    I want to load images from UIImagePickerController, then save the selected photo to my app's document directory. UIImage *image = [info objectForKey:UIImagePickerControllerOriginalImage]; NSData *data1 = UIImagePNGRepresentation(image); NSString *fileName = "1.png"; NSString *path = //get Document path, then add fileName BOOL succ = [data1 writeToFile:path atomically:YES]; but after I save the image to my document, I found that, the image was rotated 90 degree, then I change the method UIImagePNGRepresentation to UIImageJPEGRepresentation, this time it's fine, anyone know what's the problem?

    Read the article

  • Class works without declaring variables?

    - by Maxim Droy
    I'm learned php as functional and procedure language. Right now try to start learn objective-oriented and got an important question. I have code: class car { function set_car($model) { $this->model = $model; } function check_model() { if($this->model == "Mercedes") echo "Good car"; } } $mycar = new car; $mycar->set_car("Mercedes"); echo $mycar->check_model(); Why it does work without declaration of $model? var $model; in the begin? Because in php works "auto-declaration" for any variables? I'm stuck

    Read the article

  • Application shows low memory warning and crashes while loading images?

    - by Bhoomi
    I am using following code for loading images from server using following code.When i scroll UITableView application crashes. AsynchrohousImageView class .m file - (void)dealloc { [connection cancel]; //in case the URL is still downloading [connection release]; [data release]; [_imageView release]; [_activityIndicator release]; [super dealloc]; } - (void)loadImageFromURL:(NSURL*)url defaultImageName:(NSString *)defaultImageName showDefaultImage:(BOOL)defaultImageIsShown showActivityIndicator:(BOOL)activityIndicatorIsShown activityIndicatorRect:(CGRect)activityIndicatorRect activityIndicatorStyle:(UIActivityIndicatorViewStyle)activityIndicatorStyle { if (connection!=nil) { [connection release]; } if (data!=nil) { [data release]; } if ([[self subviews] count]>0) { [[[self subviews] objectAtIndex:0] removeFromSuperview]; // } if (defaultImageIsShown) { self.imageView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:defaultImageName]] autorelease]; } else { self.imageView = [[[UIImageView alloc] init] autorelease]; } [self addSubview:_imageView]; _imageView.frame = self.bounds; [_imageView setNeedsLayout]; [self setNeedsLayout]; if (activityIndicatorIsShown) { self.activityIndicator = [[[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:activityIndicatorStyle] autorelease]; [self addSubview:_activityIndicator]; _activityIndicator.frame = activityIndicatorRect; _activityIndicator.center = CGPointMake(_imageView.frame.size.width/2, _imageView.frame.size.height/2); [_activityIndicator setHidesWhenStopped:YES]; [_activityIndicator startAnimating]; } NSURLRequest* request = [NSURLRequest requestWithURL:url cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:60.0]; connection = [[NSURLConnection alloc] initWithRequest:request delegate:self]; } - (void)connection:(NSURLConnection *)theConnection didReceiveData:(NSData *)incrementalData { if (data==nil) { data = [[NSMutableData alloc] initWithCapacity:2048]; } [data appendData:incrementalData]; } - (void)connectionDidFinishLoading:(NSURLConnection*)theConnection { [connection release]; connection=nil; _imageView.image = [UIImage imageWithData:data]; if (_activityIndicator) { [_activityIndicator stopAnimating]; } [data release]; data=nil; } - (UIImage*) image { UIImageView* iv = [[self subviews] objectAtIndex:0]; return [iv image]; } In ViewController Class Which loads image - (UITableViewCell *)tableView:(UITableView *)tV cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *reuseIdentifier =@"CellIdentifier"; ListCell *cell = (ListCell *)[tableView dequeueReusableCellWithIdentifier:reuseIdentifier]; if (cell==nil) { cell = [[ListCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier]; NSMutableDictionary *dicResult = [arrResults objectAtIndex:indexPath.row]; NSURL *url=[NSURL URLWithString:[dicResult objectForKey:@"Image"]]; AsynchronousImageView *asyncImageView = [[AsynchronousImageView alloc] initWithFrame:CGRectMake(5, 10,80,80)]; [asyncImageView loadImageFromURL:url defaultImageName:@"DefaultImage.png" showDefaultImage:NO showActivityIndicator:YES activityIndicatorRect:CGRectMake(5, 10,30,30) activityIndicatorStyle:UIActivityIndicatorViewStyleGray]; // load our image with URL asynchronously [cell.contentView addSubview:asyncImageView]; // cell.imgLocationView.image = [UIImage imageNamed:[dicResult valueForKey:@"Image"]]; [asyncImageView release]; } if([arrResults count]==1) { UITableViewCell *cell1=[tableView dequeueReusableCellWithIdentifier:reuseIdentifier]; if(cell1==nil) cell1=[[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier] autorelease]; NSMutableDictionary *dicResult = [arrResults objectAtIndex:0]; cell1.textLabel.text=[dicResult valueForKey:@"NoResults"]; return cell1; } else { NSMutableDictionary *dicResult = [arrResults objectAtIndex:indexPath.row]; NSString *title = [NSString stringWithFormat:@"%@ Bedrooms-%@", [dicResult valueForKey:KEY_NUMBER_OF_BEDROOMS],[dicResult valueForKey:KEY_PROPERTY_TYPE]]; NSString *strAddress = [dicResult valueForKey:KEY_DISPLAY_NAME]; NSString *address = [strAddress stringByReplacingOccurrencesOfString:@", " withString:@"\n"]; NSString *price = [dicResult valueForKey:KEY_PRICE]; NSString *distance = [dicResult valueForKey:KEY_DISTANCE]; cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; cell.lblTitle.text = title; cell.lblAddress.text = address; if ([price length]>0) { cell.lblPrice.text = [NSString stringWithFormat:@"£%@",price]; }else{ cell.lblPrice.text = @""; } if ([distance length]>0) { cell.lblmiles.text = [NSString stringWithFormat:@"%.2f miles",[distance floatValue]]; }else{ cell.lblmiles.text = @""; } } return cell; } How can i resolve this? I have attached heapshot analysis screen shot of it.Here non Object consumes so much of memory what is that?

    Read the article

  • How to check when Shell32.Folder.CopyHere() is finished

    - by Jelle Capenberghs
    I need to unzip en zip some files in my application using Shell32. Right now, I use srcFolder.CopyHere(destFolder.Items()) to achieve this. However, my next line of code requires the newly made ZIP-file. But since the CopyHere method is Async, how can I check when it in finished? Right now I use a Thread.Sleep for around 500 ms which is enough for my computer to finish creating the ZIP file, but it's not good code imo. Any ideas? More info/code can be provided if necessary.

    Read the article

  • php multidimensional array as name value pair

    - by Ayad Mfs
    For ecommerce, that expected name value pair I have the following approved code: function create_example_purchase() { set_credentials(); $purchase = array( 'name' => 'Digital Good Purchase Example', 'description' => 'Example Digital Good Purchase', 'amount' => '12.00', // sum of all item_amount 'items' => array( array( // First item 'item_name' => 'First item name', 'item_description' => 'a description of the 1st item', 'item_amount' => '6.00', 'item_tax' => '0.00', 'item_quantity' => 1, 'item_number' => 'XF100', ), array( // Second item 'item_name' => 'Second Item', 'item_description' => 'a description of the 2nd item', 'item_amount' => '3.00', 'item_tax' => '0.00', 'item_quantity' => 2, 'item_number' => 'XJ100', ), ) ); return new Purchase( $purchase); } I would like to get $items Array inside associative $purchase array dynamically from shipping cart. Is there a way to generate exactly the same output above? My dirty solution, to write $purchase array as string inclusive the generated $items array in a file and include it later in the called script. Help appreciated.

    Read the article

  • Create instance of generic type in Java?

    - by David Citron
    Is it possible to create an instance of a generic type in Java? I'm thinking based on what I've seen that the answer is "no" (due to type erasure), but I'd be interested if anyone can see something I'm missing: class SomeContainer<E> { E createContents() { return what??? } } EDIT: It turns out that Super Type Tokens could be used to resolve my issue, but it requires a lot of reflection-based code, as some of the answers below have indicated. I'll leave this open for a little while to see if anyone comes up with anything dramatically different than Ian Robertson's Artima Article.

    Read the article

  • How do display checked value in checkbox on Google plus style popup box?

    - by user946742
    After reading this post on Stackoverflow Google plus popup box when hovering over thumbnail? I was inspirted to add it on my site. I managed to do so and the script adds the contacts to my database. So far awesome! However, my problem (and also appears in the example) is it does not display the "checked" value... so the user will never know if they already added them to their list or not. Is the correct way to display checked values with PHP? Here is my html code: <ul style="list-style: none;padding:2px;"> <li style="padding:5px 2px;"> <input type="checkbox" id="Friends" name="circles" value="Friends" '.$checked1.'/> Friends </li> <li style="padding:5px 2px;"> <input type="checkbox" id="Following" name="circles" value="Following" '.$checked2.'/>Following </li> <li style="padding:5px 2px;"> <input type="checkbox" id="Family" name="circles" value="Family" '.$checked3.'/> Family </li> <li style="padding:5px 2px;"> <input type="checkbox" id="Acquaintances" name="circles" value="Acquaintances" '.$checked4.'/> Acquaintances </li> </ul> And my PHP code is: if($circle_check_friends>0) { $ckecked1='checked=""'; } else if ($circle_check_following>0) { $ckecked2='checked=""'; } else if ($circle_check_family>0) { $ckecked3='checked=""'; } else if ($circle_check_acquaintances>0) { $ckecked4='checked=""'; } else if ($circle_check_friends=0) { $ckecked1=''; } else if ($circle_check_following=0) { $ckecked2=''; } else if ($circle_check_family=0) { $ckecked3=''; } else if ($circle_check_acquaintances=0) { $ckecked4=''; } Im lost because this is not giving me the result I want... i.e. for the checked values to be displayed according to the users choice. Your help is highly appreciated Thank you all in advance George

    Read the article

  • C# compile finalize method's on runtime?

    - by Royi Namir
    As im reading through 3 books about GC , ive notice some strange fact : C# via CLR CriticalFinalizerObject : the CLR treats this class and classes derived from it in a very special manner what ??? "not find enough memory to COMPILE a method? " IMHO - the code should be already compiled... no ? when Im writing c# code - the whole code is compiled to IL before its running... no? but according to the text - at RUNTIME - he MAY find insufficient memory for compile... Help ?

    Read the article

  • AsyncPostBackTrigger Just flashing/flicking the UpdatePanel but not updating it

    - by Pankaj
    I am trying UpdatePanel & AsyncPostBackTrigger on master pages through find control method but problem is when I click on button (UpdateButton) It just flash/flick (No Postback) the UpdatePanle but still it don't update or refresh the gridview (images) inside the updatePanel. I have placed script Manger on the master page & an AJAX Update panel in a ContentPlaceHolder in the child page. Also, in another ContentPlaceholder there is an asp button (outside of the UpdatePanel). I want to refresh/reload the AJAX UpdatePanel with this asp button. Thanks for suggestions. Child Page Code :- protected void Page_Load(object sender, EventArgs e) { ScriptManager ScriptManager1 = (ScriptManager)Master.FindControl("ScriptManager1"); ContentPlaceHolder cph = (ContentPlaceHolder)Master.FindControl("cp_Button"); Button btnRefresh = (Button)cph.FindControl("btnRefresh"); ScriptManager1.RegisterAsyncPostBackControl(btnRefresh); } protected void btnRefresh_Click(object sender, EventArgs e) { UpdatePanel1.Update(); } <%@ Page Title="" Language="C#" MasterPageFile="~/InnerMaster.master" AutoEventWireup="true" CodeFile="A.aspx.cs" Inherits="A" Async="true" %> <asp:Content ID="Content3" ContentPlaceHolderID="MainContent" Runat="Server"> <asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Conditional" runat="server"> <ContentTemplate> <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="id" DataSourceID="SqlDataSource1"> <Columns> <asp:TemplateField> <ItemTemplate> <asp:Image ID="img12" runat="server" Width="650px" Height="600" ToolTip="A" ImageUrl='<%# Page.ResolveUrl(string.Format("~/Cli/{0}", Eval("image"))) %>' /> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView> </ContentTemplate> </asp:UpdatePanel> </asp:Content> <asp:Content ID="Content4" ContentPlaceHolderID="cp_Button" Runat="Server"> <asp:Button ID ="btnRefresh" runat="server" onclick="btnRefresh_Click" Height="34" Width="110" Text="More Images" /> </asp:Content> Hi updated code :- Now on click event whole pages is refreshed. using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; namespace EProxy { public class EventProxy : Control, IPostBackEventHandler { public EventProxy() { } public void RaisePostBackEvent(string eventArgument) { } public event EventHandler<EventArgs> EventProxied; protected virtual void OnEventProxy(EventArgs e) { if (this.EventProxied != null) { this.EventProxied(this, e); } } public void ProxyEvent(EventArgs e) { OnEventProxy(e); } } } On Master Page Code (btn click):- protected void btnRefresh_Click(object sender, EventArgs e) { ContentPlaceHolder cph = (ContentPlaceHolder)this.FindControl("MainContent"); EventProxy eventProxy = (EventProxy)cph.FindControl("ProxyControl") as EventProxy; eventProxy.ProxyEvent(e); } Web Config :- <pages maintainScrollPositionOnPostBack="true" enableViewStateMac="true"> <controls> <add tagPrefix="it" namespace="EProxy" assembly="App_Code"/> </controls> </pages>

    Read the article

  • Unable to launch Eclipse 4.1.2 after installing the Eclipse e4 tooling

    - by Kuldeep Jain
    After installing Eclipse e4 Tools in my Eclipse 4.1.2 from update site. I am getting error when launching the eclipse.exe "An error has occurred. See the log file <my_workspace_path>\.metadata\.log". And the content of .log file are: !SESSION 2012-04-06 16:00:01.609 ----------------------------------------------- eclipse.buildId=M20120223-0900 java.fullversion=J2RE 1.6.0 IBM J9 2.4 Windows XP x86-32 jvmwi3260sr5-20090519_35743 (JIT enabled, AOT enabled) J9VM - 20090519_035743_lHdSMr JIT - r9_20090518_2017 GC - 20090417_AA BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US Command-line arguments: -os win32 -ws win32 -arch x86 -clean -console !ENTRY org.eclipse.osgi 4 0 2012-04-06 16:00:17.343 !MESSAGE Application error !STACK 1 java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 1 at org.eclipse.emf.common.util.URI.segment(URI.java:1731) at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.getBundle(ReflectionContributionFactory.java:135) at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:61) at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:53) at org.eclipse.e4.ui.internal.workbench.E4Workbench.processHierarchy(E4Workbench.java:196) at org.eclipse.e4.ui.internal.workbench.E4Workbench.init(E4Workbench.java:122) at org.eclipse.e4.ui.internal.workbench.E4Workbench.<init>(E4Workbench.java:73) at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createE4Workbench(E4Application.java:293) at org.eclipse.ui.internal.Workbench$3.run(Workbench.java:534) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:520) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) at java.lang.reflect.Method.invoke(Method.java:599) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577) at org.eclipse.equinox.launcher.Main.run(Main.java:1410) I also tried the eclipse.exe -clean to launch it but getting same error.

    Read the article

  • TimeZone change to UTC while updating the Appointment

    - by Firoz Ansari
    I am using EWS 1.2 to send appointments. On creating new Appointments, TimeZone is showing properly on notification mail, but on updating the same appointment, it's TimeZone reset to UTC. Could anyone help me to fix this issue? Here is sample code to replicate the issue: ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010_SP1, TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time")); service.Credentials = new WebCredentials("ews_calendar", PASSWORD, "acme"); service.Url = new Uri("https://acme.com/EWS/Exchange.asmx"); Appointment newAppointment = new Appointment(service); newAppointment.Subject = "Test Subject"; newAppointment.Body = "Test Body"; newAppointment.Start = new DateTime(2012, 03, 27, 17, 00, 0); newAppointment.End = newAppointment.Start.AddMinutes(30); newAppointment.RequiredAttendees.Add("[email protected]"); //Attendees get notification mail for this appointment using (UTC-05:00) Eastern Time (US & Canada) timezone //Here is the notification content received by attendees: //When: Tuesday, March 27, 2012 5:00 PM-5:30 PM. (UTC-05:00) Eastern Time (US & Canada) newAppointment.Save(SendInvitationsMode.SendToAllAndSaveCopy); // Pull existing appointment string itemId = newAppointment.Id.ToString(); Appointment existingAppointment = Appointment.Bind(service, new ItemId(itemId)); //Attendees get notification mail for this appointment using UTC timezone //Here is the notification content received by attendees: //When: Tuesday, March 27, 2012 11:00 PM-11:30 PM. UTC existingAppointment.Update(ConflictResolutionMode.AlwaysOverwrite, SendInvitationsOrCancellationsMode.SendToAllAndSaveCopy);

    Read the article

  • Using an observer within an Engine

    - by Tim
    I've created an Engine which is basically used for all of our projects. Now what I want to do is add a before_create callback to all of the models in this Engine. After some searching I found out that an observer is the way to go. So, I've created this observer: class AuthObserver < ActiveRecord::Observer def before_create( record ) p record end end And now I need to add it to the application, but of course in my Engine there is no such file as application.rb. What I tried is adding it to an initializer located in /config/initializers/observers.rb Like so: Rails.application.config.active_record.observers = :auth_observer But this doesn't work, and it throws no errors. Anybody out here has experience using an observer inside an engine? Thanks a lot!

    Read the article

  • Cannot implicitly convert type 'char*' to 'bool'

    - by neeraj
    i was trying to passing pointer value in the function , i really got stuck here I am a beginner , not getting what value should be put this is programme from the reference of the book "Cracking the coding interview " By Gayle Laakmann McDowell, class Program { unsafe void reverse(char *str) { char* end = str; char tmp; if (str) //Cannot implicitly convert type 'char*' to 'bool' { while(*end) //Cannot implicitly convert type 'char*' to 'bool' { ++end; } --end; while(str<end) { tmp = *str; *str+= *end; *end-= tmp; } } } public static void Main(string[] args) { } }

    Read the article

  • Why null reference exception in SetMolePublicInstance?

    - by OldGrantonian
    I get a "null reference" exception in the following line: MoleRuntime.SetMolePublicInstance(stub, receiverType, objReceiver, name, null); The program builds and compiles correctly. There are no complaints about any of the parameters to the method. Here's the specification of SetMolePublicInstance, from the object browser: SetMolePublicInstance(System.Delegate _stub, System.Type receiverType, object _receiver, string name, params System.Type[] parameterTypes) Here are the parameter values for "Locals": + stub {Method = {System.String <StaticMethodUnitTestWithDeq>b__0()}} System.Func<string> + receiverType {Name = "OrigValue" FullName = "OrigValueP.OrigValue"} System.Type {System.RuntimeType} objReceiver {OrigValueP.OrigValue} object {OrigValueP.OrigValue} name "TestString" string parameterTypes null object[] I know that TestString() takes no parameters and returns string, so as a starter to try to get things working, I specified "null" for the final parameter to SetMolePublicInstance. As already mentioned, this compiles OK. Here's the stack trace: Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.ExtendedReflection.Collections.Indexable.ConvertAllToArray[TInput,TOutput](TInput[] array, Converter`2 converter) at Microsoft.Moles.Framework.Moles.MoleRuntime.SetMole(Delegate _stub, Type receiverType, Object _receiver, String name, MoleBindingFlags flags, Type[] parameterTypes) at Microsoft.Moles.Framework.Moles.MoleRuntime.SetMolePublicInstance(Delegate _stub, Type receiverType, Object _receiver, String name, Type[] parameterTypes) at DeqP.Deq.Replace[T](Func`1 stub, Type receiverType, Object objReceiver, String name) in C:\0VisProjects\DecP_04\DecP\DeqC.cs:line 38 at DeqPTest.DecCTest.StaticMethodUnitTestWithDeq() in C:\0VisProjects\DecP_04\DecPTest\DeqCTest.cs:line 28 at Starter.Start.Main(String[] args) in C:\0VisProjects\DecP_04\Starter\Starter.cs:line 14 Press any key to continue . . . To avoid the null parameter, I changed the final "null" to "parameterTypes" as in the following line: MoleRuntime.SetMolePublicInstance(stub, receiverType, objReceiver, name, parameterTypes); I then tried each of the following (before the line): int[] parameterTypes = null; // if this is null, I don't think the type will matter int[] parameterTypes = new int[0]; object[] parameterTypes = new object[0]; // this would allow for various parameter types All three attempts produce a red squiggly line under the entire line for SetMolePublicInstance Mouseover showed the following message: The best overloaded method match for 'Microsoft.Moles.Framework.Moles.MoleRuntime.SetMolePublicInstance(System.Delegate, System.Type, object, string, params System.Type[])' has some invalid arguments. I'm assuming that the first four arguments are OK, and that the problem is with the params array.

    Read the article

  • How to successfully implement og:image for the LinkedIn

    - by Sabo
    THE PROBLEM: I am trying, without much success, to implement open graph image on site: http://www.guarenty-group.com/cz/ The homepage is completeply bypassing the og:image tag, where internal pages are reading all images from the site and place og:image as the last option. Other social networks are working fine on both internal pages and homepage. THE CONFIGURATION: I have no share buttons or alike, all I want is to be able to share the link via my profile. The image is well over 300x300px: http://guarenty-group.com/img/gg_seal.png Here is how my head tag looks like: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Guarenty Group : Pojištení pro nájemce a pronajímatelé</title> <meta name="keywords" content="" /> <meta name="description" content="Guarenty Group pojištuje príjem z nájmu pronajímatelum, kauci nájemcum - aby nemuseli platit velkou cástku v hotovostí predem - a dále nájemcum pojištuje príjmy, aby meli na nájem pri nemoci, úrazu ci nezamestnání." /> <meta name="image_src" content="http://guarenty-group.com/img/gg_seal.png" /> <meta name="image_url" content="http://guarenty-group.com/img/gg_seal.png" /> <meta property="og:title" content="Pojištení pro nájemce a pronajímatelé" /> <meta property="og:url" content="http://guarenty-group.com/cz/" /> <meta property="og:image" content="http://guarenty-group.com/img/gg_seal.png" /> <meta property="og:description" content="Guarenty Group pojištuje príjem z nájmu pronajímatelum, kauci nájemcum - aby nemuseli platit velkou cástku v hotovostí predem - a dále nájemcum pojištuje príjmy, aby meli na nájem pri nemoci, úrazu ci nezamestnání [...]" /> ... </head> THE TESTING RESULTS: In order to trick the cache i have tested the site with http://www.guarenty-group.com/cz/?try=N, where I have changed the N every time. The strange thing is that images found for different value of N is different. Sometimes there is no image, sometimes there is 1, 2 or 3 images, but each time there is a different set of images. But, in any case I could not find the image specified in the og:graph! MY QUESTIONS: https://developer.linkedin.com/documents/setting-display-tags-shares is saying one thing, and the personnel on the support forum is saying "over 300" Does anyone know What is the official minimum dimension of the image (both w and h)? Can an image be too large? Should I use the xmlns, should I not use xmlns or it doesn't matter? What are the maximum (and minimum) lengths for og:title and og:description tags? Any other suggestion is of course welcomed :) Thanks in advance, cheers~

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >