Search Results

Search found 8446 results on 338 pages for 'dynamic cast'.

Page 86/338 | < Previous Page | 82 83 84 85 86 87 88 89 90 91 92 93  | Next Page >

  • C++ Dynamic object construction

    - by Rajesh Subramanian
    I have a base class, class Msg { ParseMsg() { ParseMsgData(); ParseTrailer(); } virtual void ParseMsgData() = 0; ParseTrailer(); }; and derived classes, class InitiateMsg { void ParseMsgData() { ... } }; class ReadOperationMsg { void ParseMsgData() { ... } }; class WriteOperationMsg { void ParseMsgData() { ... } }; and the scenario is below, void UsageFunction(string data) { Msg* msg = ParseHeader(data); ParseMsg } Msg* ParseHeader(string data) { Msg *msg = NULL; .... switch() { case 1: msg = new InitiateMsg(); break; case 2: msg = new ReadOperationMsg{(); break; case 3: msg = new WriteOperationMsg{(); break; .... } return msg; } based on the data ParseHeader method will decide which object has to be created, So I have implemented ParseHeader function outside the class where I am using. How can I make the ParseHeader function inside the Msg class and then use it? In C# the same is achieved by defining ParseHeader method as static with in class and use it from outside,

    Read the article

  • CC.NET File merge task and dynamic values

    - by ccnet
    How can I use CCNetLabel in the file merge task? From what I have found I have to use dynamicValues. I have somethink like this and it is not working any help? <publishers> <merge> <dynamicValues> <replacementValue property="files"> <format>D:\Testoutput\{0}\*.xml</format> <parameters> <namedValue name="$CCNetLabel" value="Default" /> </parameters> </replacementValue> </dynamicValues> </merge> <xmllogger /> <modificationHistory onlyLogWhenChangesFound="true" /> <statistics /> </publishers>

    Read the article

  • Dynamic content in a Gridview

    - by mariki
    I have a gridview with couple of columns,I want to achieve the following: If user is NOT authorized display normal columns. If user IS authorized: set mouseover event for first column text and display some buttons (that are not available for NOT authorized users) in a second column when user hover over(using javascript) the first column. I am have 2 difficulties: The first one where and when should I create the buttons? I have 2 options, I can create those button on design time, in gridviews template and just set Visible value to false and then in codebehind set it to true if user is authorized. The second option would be creating this buttons dynamically in gridview_RowCreated event (or any other event) if user is authorized. The Second difficulty is setting the javascript event to show the buttons, the event should be added only if user is authorized! Note that event and buttons should have some kind of id match for Javascript function to know what should it hide/unhide when event is triggered. What should I do, what is the best practice? I know this is a long question, but please try to help :)

    Read the article

  • jQuery Validator - Dynamic Text

    - by James
    Adding a validator to my form: jQuery.validator.addMethod('whatever', function(val, el) { // whatever goes here }, 'A maximum of ' + $('#my_id_here').val() + ' categories can be selected.'); This doesn't fly. I always get undefined. Is this a good, simple way to do this? Thanks

    Read the article

  • Nested Dynamic PHP Class

    - by user338844
    Alright, I may just need a terminology update, but I have been playing in Magento and Joomla, and they do references like $mage = new Mage; $mage->block('blockname'); where class Mage through some process I am failing to figure out is calling: class blockname extends something{ } Don't quote me on that code, however I am looking to do something like that where I have a file that I can do $myscript-block('blockname'); and it will load and call the file with class blockname. I hope that is not too confusing, but any help is appreciated. Thanks in advance!

    Read the article

  • jQuery Scrollable Dynamic

    - by Coron3r
    Hi, I am doing a site where I need to change dynamically the amount of items in one slide depending on the resolution. I'm using the Jquery Tools scrollable For better understanding, here is the basic markup <div class="scrollable"> <!-- root element for the items --> <div class="items"> <!-- 1-5 --> <div> <img src="http://farm1.static.flickr.com/143/321464099_a7cfcb95cf_t.jpg" /> <img src="http://farm4.static.flickr.com/3089/2796719087_c3ee89a730_t.jpg" /> <img src="http://farm1.static.flickr.com/79/244441862_08ec9b6b49_t.jpg" /> <img src="http://farm1.static.flickr.com/28/66523124_b468cf4978_t.jpg" /> <img src="http://farm1.static.flickr.com/164/399223606_b875ddf797_t.jpg" /> </div> <!-- 5-10 --> <div> <img src="http://farm1.static.flickr.com/163/399223609_db47d35b7c_t.jpg" /> <img src="http://farm1.static.flickr.com/135/321464104_c010dbf34c_t.jpg" /> <img src="http://farm1.static.flickr.com/40/117346184_9760f3aabc_t.jpg" /> <img src="http://farm1.static.flickr.com/153/399232237_6928a527c1_t.jpg" /> <img src="http://farm1.static.flickr.com/50/117346182_1fded507fa_t.jpg" /> </div> <!-- 10-15 --> <div> <img src="http://farm4.static.flickr.com/3629/3323896446_3b87a8bf75_t.jpg" /> <img src="http://farm4.static.flickr.com/3023/3323897466_e61624f6de_t.jpg" /> <img src="http://farm4.static.flickr.com/3650/3323058611_d35c894fab_t.jpg" /> <img src="http://farm4.static.flickr.com/3635/3323893254_3183671257_t.jpg" /> <img src="http://farm4.static.flickr.com/3624/3323893148_8318838fbd_t.jpg" /> </div> </div> </div> Ok and now I would like to set, that if I have a resolution bellow 1440, I would show only e.g. 3 images <div class="scrollable"> <!-- root element for the items --> <div class="items"> <!-- 1-3 --> <div> <img src="http://farm1.static.flickr.com/143/321464099_a7cfcb95cf_t.jpg" /> <img src="http://farm4.static.flickr.com/3089/2796719087_c3ee89a730_t.jpg" /> <img src="http://farm1.static.flickr.com/79/244441862_08ec9b6b49_t.jpg" /> </div> <!-- 3-6 --> <div> <img src="http://farm1.static.flickr.com/163/399223609_db47d35b7c_t.jpg" /> <img src="http://farm1.static.flickr.com/135/321464104_c010dbf34c_t.jpg" /> <img src="http://farm1.static.flickr.com/40/117346184_9760f3aabc_t.jpg" /> </div> ..etc </div> </div> I know that I should use the screen.width(); function but how to slice and parse it depending on the resolution? Thanks for your comments!

    Read the article

  • Dynamic Column lookup with different pages in excel

    - by CinCity
    I have a multi page spread sheet in excel that needs to read information dynamically from columns on other pages and have these values show up on a main page. This is the formula I'm using: =IF(VLOOKUP($B:$B,'CP01'!$B:$BN,3,FALSE)="r","r", IF(VLOOKUP($B:$B,'CP01'!$B:$BN,3,FALSE)="a","a","")) CP01 is a sheet in the excel file and instead of look at the specific sheet I want it to look at all of the sheets in the file. Is there a way to do this as an excel formula or with excel-VBA? Edit: I also tried CP* (* being a wildcard character) and it didn't work. Edit2: Is there a way to match the value where the 'CP' is placed with its a other columns value?

    Read the article

  • Dynamic attached UILabel is not moving.

    - by coure06
    I have attached a UILabel to view. Now i want to move that label but its not working. here is my code UILabel *tick = (UILabel *)[self.view viewWithTag:tag]; CGRect frame = tick.frame; frame.origin.x = newVal; frame.origin.y = newVal; I can change text value of the UILabel tick but how can i move it here and there?

    Read the article

  • Linq-to-Entities Dynamic sorting

    - by verror
    This is my query, how can I use string as orderby parameter? string sortColumn="Title"; var items = (from ltem in ctxModel.Items where ltem.ItemID == vId orderby //something here select ltem).Skip(PageSize * PageIndex).Take(PageSize);

    Read the article

  • Dynamic Links in that auto navigates to the top of a div

    - by Dot Oyes
    I have a forum whereby links to a thread looks like http://www.website.com/comments.php?topic_id=1 How can I make it look like this http://www.website.com/1046302/some-link-desc#12154109 so that when such links are given out, the user is taken directly to that particular comment. I'm particular about the #12154109 . The other part of the URL /1046302/some-link-desc is achieved through .htaccess configuration.

    Read the article

  • Smarty dynamic error list

    - by Brainscrewer
    Im new to Smarty in combination with PHP and I really like it. Unfortunatly im running into a problem while validating fields after a $_POST has been done. I've made an array called $errors and use that to save error messages in, for example: $errors[] .= "Wrong email";. My problem is in sending the $errors array over to the template so I can use it to display the error messages. My question: How do you 'transfer' the $errors variable over to the template file so you can use it there with, for example {foreach}. I was planning on doing something like {if $hasErrors} {foreach from=errors item=error} <li>{$error}</li> {/foreach} {/if} Thanks in advance

    Read the article

  • What is the best way to handle dynamic content_type in Sinatra

    - by lusis
    I'm currently doing the following but it feels "kludgy": module Sinatra module DynFormat def dform(data,ct) if ct == 'xml';return data.to_xml;end if ct == 'json';return data.to_json;end end end helpers DynFormat end My goal is to plan ahead. Right now we're only working with XML for this particular web service but we want to move over to JSON as soon as all the components in our stack support it. Here's a sample route: get '/api/people/named/:name/:format' do format = params[:format] h = {'xml' => 'text/xml','json' => 'application/json'} content_type h[format], :charset => 'utf-8' person = params[:name] salesperson = Salespeople.find(:all, :conditions => ['name LIKE ?', "%#{person}%"]) "#{dform(salesperson,format)}" end It just feels like I'm not doing it the best way possible.

    Read the article

  • How to check volume is mounted or not using python with a dynamic volume name

    - by SR query
    import subprocess def volumeCheck(volume_name): """This function will check volume name is mounted or not. """ volume_name = raw_input('Enter volume name:') volumeCheck(volume_name) print 'volume_name=',volume_name p = subprocess.Popen(['df', '-h'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) p1, err = p.communicate() pattern = p1 if pattern.find(volume_name): print 'volume found' else: print 'volume not found' While running i always got wrong result "volume found". root@sr-query:/# df -h Filesystem Size Used Avail Use% Mounted on rootfs 938M 473M 418M 54% / /dev/md0 938M 473M 418M 54% / none 250M 4.9M 245M 2% /dev /dev/md2 9.7M 1.2M 8.0M 13% /usr/config /dev/md7 961M 18M 895M 2% /downloads tmpfs 250M 7.9M 242M 4% /var/volatile tmpfs 250M 0 250M 0% /dev/shm tmpfs 250M 0 250M 0% /media/ram **/dev/mapper/vg9-lv9 1016M 65M 901M 7% /VolumeData/sp /dev/mapper/vg10-lv10 1016M 65M 901M 7% /VolumeData/cp** root@sr-query:/# root@sr-query:/# root@sr-query:/# python volume_check.py Enter volume name:raid_10volume volume_name= raid_10volume **volume found** root@sr-query:/# I enterd raid_10volume its not listed here please check the df -h command out put(only 2 volume there sp and cp) , then how it reached else part. what is wrong in my code? Thanks in advance. is there any other way to do this work ! ?

    Read the article

  • CodeIgniter URI routing (dynamic, multilingual)

    - by koteko
    I'm trying to redirect all routs to one main controller. Here is my routes.php $route['default_controller'] = "main"; $route['scaffolding_trigger'] = ""; //$route['(\w{2})/(.*)'] = '$2'; //$route['(\w{2})'] = $route['default_controller']; $route['(en|ge)/(:any)'] = $route['default_controller']."/index/$1"; $route['(:any)'] = $route['default_controller']."/index/$1"; I need language id to be passed with every link (like: http://site.com/en/hello-world) Here is my main controller: class Main extends Controller { function __construct() { parent::Controller(); } function index($page_type=false, $param=false) { die($page_type.' | '.$param.'| Aaa!'); } } I want to check if predefined file type exists (like: http://site.com/en/archive/05-06-2010 - here predefined type would be archive) then do something. If not then search in the database for slug. If not found then go to 404. The problem is that I can't get index function parameters ($page_type, $param). Thanks for help.

    Read the article

  • flash video dynamic width and height change in Action Script 3.0

    - by coderex
    hi I have a video player and the video file came from one xml file, The videos are in different dimension so how can i set the video dimension dynamically? _vid = new Video(); _vid.attachNetStream(_vidStream); How can i give the new dimension of the video, the default i get is http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/media/Video.html Video(width:int = 320, height:int = 240) Creates a new Video instance. I need the height and width of the video, How

    Read the article

  • [CakePHP] Dynamic fields on insert/edit form

    - by user198003
    hi all, let's say that i have 3 tables: books properties book_properties of course, i would like that when i want to insert new book (or update existing), to fill the form. fields that exist on form have to be defined as records in table properties. when i fill up those fields, data has to be saved in table book_properties. can you help me by giving some advices and references, how to achieve that? thank you very much in advance!

    Read the article

  • iOS dynamic object creation

    - by Abdul Ahmad
    I've worked with Xcode and iOS on a few personal projects and have always used non-object-oriented designs for everything... just because I've been doing mostly learning/experimenting with things. Now I've been trying to implement some object oriented design into one game I've made previously. The idea is, I have a space ship that can shoot bullets. In the past I basically added the UIImageView to the storyboard and then connected it to the .h file and from there did things on it like move it around or whatever (using CGPointMake). The idea now is to make a method (and a whole other class soon) that will create a UIImageView programmatically, allocate it, add it to the superview etc... I've got this working so far, easy stuff, but the next part is a bit harder. Where do I store this local variable "bullet"? I've been saving it to an NSMutableArray and doing the following: (actually here are the methods that I have) -(void)movement { for (int i = 0; i < [array1 count]; i ++) { UIImageView *a = [array1 objectAtIndex:i]; a.center = CGPointMake(a.center.x + 2, a.center.y); if (a.center.x > 500) { [array1 removeObjectAtIndex:i]; [a removeFromSuperview]; } } } -(void)getBullet { UIImageView *bullet = [[UIImageView alloc] initWithFrame:CGRectMake(ship.center.x + 20, ship.center.y - 2, 15, 3)]; bullet.image = [UIImage imageNamed:@"bullet2.png"]; bullet.hidden = NO; [self.view addSubview:bullet]; [array1 addObject:bullet]; } (by the way, array1 is declared in the .h file) and theres a timer that controls the movement method timer = [NSTimer scheduledTimerWithTimeInterval:0.5 target:self selector:@selector(movement) userInfo:nil repeats:YES]; first question is: what is the correct way of doing this? Storing a bullet for example until it is removed from the superview, should I store it another way? and another question is, when I remove a UIImageView from the superview, does that remove it from memory so its not using up system resources? Thank you for the help! (will update if I Think of other questions

    Read the article

  • Best web technology for building dynamic charts

    - by Ryan
    I need to build a custom designed bar chart that displays some simple data. Below are my requirements. Can anyone suggest the best web technology for my requirements. high browser compatibility ability to draw shapes ability to fill shapes with gradients ability to have onclick and onmouseover events for the different shapes (bars in the chart). Thanks guys. I was thinking of using svg but looking for suggestions.

    Read the article

  • CodeMirror Dynamic Syntax Validation

    - by rawr
    Been trying to decide between using CodeMirror or Ace editor. I've been leaning towards CodeMirror, however there's one feature of Ace that I really like and that is how it does syntax validation. So as I'm typing there can appear a warning or error icon in the left gutter area beside the line number, and when I hover over it it gives me a little description. Is there any way to get this functionality in CodeMirror? Specifically, I'm using the css mode for CodeMirror. It'd also be nice to be able to add in my own custom validation. Thanks.

    Read the article

  • LINQ To SQL Dynamic Select

    - by mcass20
    Can someone show me how to indicate which columns I would like returned at run-time from a LINQ To SQL statement? I am allowing the user to select items in a checkboxlist representing the columns they would like displayed in a gridview that is bound to the results of a L2S query. I am able to dynamically generate the WHERE clause but am unable to do the same with the SELECT piece. Here is a sample: var query = from log in context.Logs select log; query = query.Where(Log => Log.Timestamp > CustomReport.ReportDateStart); query = query.Where(Log => Log.Timestamp < CustomReport.ReportDateEnd); query = query.Where(Log => Log.ProcessName == CustomReport.ProcessName); foreach (Pair filter in CustomReport.ExtColsToFilter) { sExtFilters = "<key>" + filter.First + "</key><value>" + filter.Second + "</value>"; query = query.Where(Log => Log.FormattedMessage.Contains(sExtFilters)); }

    Read the article

  • TSQL Writing into a Temporary Table from Dynamic SQL

    - by Jeff
    Consider the following code: SET @SQL1 = 'SELECT * INTO #temp WHERE ...' exec(@SQL1) SELECT * from #temp (this line throws an error that #temp doesn't exist) Apparently this is because the exec command spins off a separate session and #temp is local to that session. I can use a global temporary table ##temp, but then I have to come up with a naming scheme to avoid collisions. What do you all recommend?

    Read the article

  • lightbox dynamic image retrieval

    - by GSTAR
    I am constructing a lighbox gallery, currently experimenting with FancyBox (http://fancybox.net) and ColorBox (http://colorpowered.com/colorbox). By default you have to include a link to the large version of the image so that the Lightbox can display it. However, I am wanting to have the image link URLs pointing to a script rather than directly to the image file. So for example, instead of: <a href="mysite/images/myimage.jpg"> I want to do: <a href="mysite/photos/view/abc123"> The above URL points to a function: public function actionPhotos($view) { $photo=Photo::model()->find('name=:name', array(':name'=>$view)); if(!empty($photo)) { $user=$photo->user; $this->renderPartial('_photo', array('user'=>$user, 'photo'=>$photo, true)); } } At some point in the future the function will also update the view count of the image. Now this approach is working to an extent - most images load up but some do not load up (the lightbox gets displayed in a malformed state). I think the reason for this is because it is not processing the function quick enough. For example when I click the "next" button it needs to go to the URL, process the function and retreive/output the response. Does anybody know how I can get this working properly?

    Read the article

  • Find and Replace using Perl for a dynamic url based on wordpress post

    - by user1068544
    How do you find the following div using perl. The url and image location will consistently change based on the post url, so i need to use a wild card. I must use a regular expression because I am limited in what i can use due to the software i am using. http://community.autoblogged.com/entries/344640-common-search-and-replace-patterns <div class="tweetmeme_button" style="float: right; margin-left: 10px;"> <a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjumpinblack.com%2F2011%2F11%2F25%2Fdrake-and-rick-ross-you-only-live-once-ep-mixtape-2011-download%2F"><br /> <img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjumpinblack.com%2F2011%2F11%2F25%2Fdrake-and-rick-ross-you-only-live-once-ep-mixtape-2011-download%2F&amp;source=jumpinblack1&amp;style=compact&amp;b=2" height="61" width="50" /><br /> </a> </div> I tried using <div class="tweetmeme_button" style="float: right; margin-left: 10px;">.*<\/div>

    Read the article

< Previous Page | 82 83 84 85 86 87 88 89 90 91 92 93  | Next Page >