Search Results

Search found 1105 results on 45 pages for 'thx'.

Page 41/45 | < Previous Page | 37 38 39 40 41 42 43 44 45  | Next Page >

  • ZendX Jquery Decorator

    - by iJD
    How use partial decorator in Jquery Element I use this code for Form Element: $title = new Zend_Form_Element_Text('title'); $title->setRequired(true) ->setAttrib('class', 'inputbox') ->setLabel('Title'); $title->viewScript = 'RegElement.phtml'; $title->setDecorators( array( array('ViewScript', array('class' => 'RegElement')) ) ); But when i use Jquery Element i dont know how implement it: $datePicker = new ZendX_JQuery_Form_Element_DatePicker( "datePicker1", array("label" => "Date:") ); $datePicker->viewScript = 'RegElement.phtml'; $datePicker->setDecorators( array( array('ViewScript', array('class' => 'RegElement')) ) ); //views/scripts/RegElement.phtml <li class="row <?php echo $this->class ?>"> <div class="cont-error"> <?php echo $this->formErrors($this->element->getMessages()); ?> </div> <div class="rowfields"> <?php echo $this->formLabel($this->element->getName(), $this->element->getLabel()) ?> <?php echo $this->{$this->element->helper}( $this->element->getName(), $this->element->getValue(), $this->element->getAttribs() ) ?> </div> <div class="hint"><?php echo $this->element->getDescription() ?></div> </li> And display this error: Warning: Exception caught by form: Cannot render jQuery form element without at least one decorator implementing the 'ZendX_JQuery_Form_Decorator_UiWidgetElementMarker' interface. I need display datePicker with same format. but idk how implement this interface. thx for your help.

    Read the article

  • How to set gravity (or margins) of ImageView using code?

    - by mastojun
    Hi. I want to add ImageView to FrameLayout with Gravity or margins. but FramLayout and ImageView has no method about that(Actually, I can't found that). Reason that selects Framelayout is to put ImageView on ImageView. Help me plz. It is emergency for me to find solution. thx. Bellow is my code which help understanding my question. FrameLayout imageFrame = new FrameLayout(mContext); imageFrame.setLayoutParams(new GridView.LayoutParams(158, 158)); ImageView frame = new ImageView(mContext); frame = new ImageView(mContext); frame.setLayoutParams(new LayoutParams(158, 158)); frame.setScaleType(ImageView.ScaleType.CENTER_CROP); frame.setImageResource(R.drawable.image_frame_n); ImageView image = new ImageView(mContext); image.setLayoutParams(new LayoutParams(148, 148)); image.setScaleType(ImageView.ScaleType.CENTER_CROP); image.setImageResource(mThumbIds[position]); // image is needed to have a margin or gravity to be positioned at center imageFrame.addView(image); imageFrame.addView(frame);

    Read the article

  • Check if date is allowed weekday in php?

    - by moogeek
    Hello! I'm stuck with a problem how to check if a specific date is within allowed weekdays array in php. For example, function dateIsAllowedWeekday($_date,$_allowed) { if ((isDate($_date)) && (($_allowed!="null") && ($_allowed!=null))){ $allowed_weekdays=json_decode($_allowed); $weekdays=array(); foreach($allowed_weekdays as $wd){ $weekday=date("l",date("w",strtotime($wd))); array_push($weekdays,$weekday); } if(in_array(date("l",strtotime($_date)),$weekdays)){return TRUE;} else {return FALSE;} } else {return FALSE;} } ///////////////////////////// $date="21.05.2010"; $wd="[0,1,2]"; if(dateIsAllowedWeekday($date,$wd)){echo "$date is within $wd weekday values!";} else{echo "$date isn't within $wd weekday values!"} I have input dates formatted as "d.m.Y" and an array returned from database with weekday numbers (formatted as 'Numeric representation of the day of the week') like [0,1,2] - (Sunday,Monday,Tuesday). The returned string from database can be "null", so i check it too. Them, the isDate function checks whether date is a date and it is ok. I want to check if my date, for example 21.05.2010 is an allowed weekday in this array. My function always returns TRUE and somehow weekday is always 'Thursday' and i don't know why... Is there any other ways to check this or what can be my error in the code above? thx

    Read the article

  • jQuery load() problem with html that contain jQuery plugin

    - by Victorgalaxy
    FYI, here is my code: [index.html] <script type="text/javascript" src="js/script.js"></script> [script.js] $(document).ready(function() { $('#buttonEphone').click(function() { $('#apDiv2').load("ePhone.html, #content"); }); }); "ePhone.html" contain some lightbox effect. (making use of code below) [ePhone.html] <script type="text/javascript" src="js/prototype.lite.js"></script> <script type="text/javascript" src="js/moo.fx.js"></script> <script type="text/javascript" src="js/litebox-1.0.js"></script> The Litebox plugin also required to add onload="initLightbox()" within the BODY tag of ePhone.html. From the above code, I can load ePhone.html's content(#content div) to my (apDiv2) of my index.html. However, the lightbox effect is no longer work. I've also try loading the whole html instead of only #content: $('#apDiv2').load('ePhone.html'); but it still doesn't work. Please help, thx

    Read the article

  • Google Analytics, Install Tracking android

    - by vvieux
    Hi, I want track install referer for my application using google analytics. I don't want use the Tracking Pageviews and Events feature, only install. So I added the sdk jar in my app, add these lines to the manifest : <receiver android:name="com.google.android.apps.analytics.AnalyticsReceiver" android:exported="true"> <intent-filter> <action android:name="com.android.vending.INSTALL_REFERRER" /> </intent-filter> </receiver> And publish the app. But how can see the stats ? I never entered my UA-xxxxxxx id. For the Pageviews and Events tracking it's here : tracker.start("UA-YOUR-ACCOUNT-HERE", this); But as thew readme says : (NOTE: do not start the GoogleAnalyticsTracker in your Application onCreate() method if using referral tracking). But with referer where do I put my id ? And what is the url to watch in the google analytics console ? Thx

    Read the article

  • C++ destructor called on array index - why

    - by tge
    The following code (from Apache Tuscany SDO C++) occasionally (actually very rarely) causes subsequent crashes and I don't understand what's going on. The following statement is in DataObjectImpl.cpp (see stack below): PropertyImpl* DataObjectImpl::getPropertyImpl(unsigned int index) { ... 904 PropertyList props = getType().getProperties(); 905 if (index < props.size()) 906 { 907 return (PropertyImpl*)&props[index]; ... causes the following stack (all omitted frames above and below look plausible): Note: #11 libtuscany_sdo.dll!std::vector<>::~vector<> [c:\program files\microsoft visual studio 9.0\vc\include\vector:559] Note: #12 libtuscany_sdo.dll!commonj::sdo::PropertyList::~PropertyList [y:\external\tuscany\src\runtime\core\src\commonj\sdo\propertylist.cpp:60] Note: #13 libtuscany_sdo.dll!commonj::sdo::DataObjectImpl::getPropertyImpl [y:\external\tuscany\src\runtime\core\src\commonj\sdo\dataobjectimpl.cpp:907] Note: #14 libtuscany_sdo.dll!commonj::sdo::DataObjectImpl::getSDOValue [y:\external\tuscany\src\runtime\core\src\commonj\sdo\dataobjectimpl.cpp:3845] The actual question is - why is the destructor of PropertyList called?? As stated, the stack looks OK otherwise, also the vector destructor, as PropertyList has a member std::vector<PropertyImplPtr plist; and the array index operator of PropertyList just calls the array index of the plist member. And, even more puzzling (to me), why this happens only occasionally ... Many thx!!

    Read the article

  • Using custom FaultContract object causes 'Add Service Reference' to fail

    - by SpoBo
    Hey, I just noticed something particular. I have an internal stock service which is published through basicHttpBinding, and a customBinding (http+binary) for which metadata is enabled. I also included a mex endpoint for http. We use Visual Studio 2008 & VB.NET Just recently we noticed that we were unable to succesfully add a service reference to this service in our other projects. All that it would generate was the first custom exception we included through a FaultContract (actually, there was only 1 type). if I'd add a simple web reference it would work correctly as well. Also, the WcfClient.exe had no problems either in loading the services. Just VS.NET add service reference wouldn't work. In the service this exception inherits from Exception and is marked as serializable. That's all you're supposed to do, no? Anyway, this had me baffled. If I remove the FaultContract for this custom exception everything works fine. I can add a service reference, no problem. But is there a way I can still have my custom exceptions? Is this a known problem? Thx!

    Read the article

  • jQuery slideToggle jump on close

    - by spankmaster79
    Hi, I'm trying to slideToggle a in a table with jQuery and it works in FF, OP, CHrome. Only IE (6,7,8) is giving me problems. It slides down perfectly down and up, but after the slide up animation is finished. The hidden pops up in full height and then closes. So I guess it must be somwhere inbetween when it switches from a minimal height to "display:none" that it appears for a short second. The code is built dynamically but I'll try to give an example: <table> <tr> <td> <script type="text/javascript"> function toggleTr_{$dynamicID}() { $('#content_{$dynamicID}').slideToggle('slow'); /* DO SOME OTHER STOFF LIKE COLOR CHANGES CSS CLASS CHANGES */ } </script> </td> </tr> <tr id="list_{$dynamicID}" onclick="toggleTr_{$dynamicID}();" style="cursor:pointer;"> <td> <!-- INFO HEADER --> </td> </tr> <tr> <td> <div id="content_{$dynamicID}" style="display:none;"> <!-- INFO BODY HIDDEN --> </div </td> </tr> Other problems here with slideToggle only descibed problems with padding, margin, or problems with the animation, but that all works. Help is appreciated. Thx, Spanky

    Read the article

  • QTCreator 3.1 design tab not working

    - by user3112140
    I’m currently using QtCreator 3.1 and qt-everywhere-opensource-src-5.2.1 on Ubuntu 12.04 My project is correctly working, i.e., i can build it and run without any trouble. But i’ve got some problems with the design tab inside Qtcreator. First, on all qml file (even with example projects), i have an error message “Using Qt Quick code model instead of Qt Quick2 (M324) (4:1)” and i can’t use the design editor. Second, on qml files with other import than QtQuick 2.2 (for me QtQml.Models 2.1 and QtQuick.Controls 1.1), the import is underlined in red with the error message “QML module not found”. I’ve tried to edit the .pro file by adding QML2_IMPORT_PATH=/home/user/qt-everywhere-opensource-src-5.2.1/qtquickcontrols/qml/QtQuick/Controls/ (also tried with QML_IMPORT_PATH), it doesn’t work. Then, I tried to add it to my path in a terminal using “export QML_IMPORT_PATH=/home/user/qt-everywhere-opensource-src-5.2.1/qtquickcontrols/qml/QtQuick/Controls/” and this time, in the error message, i can see the added path in the error message, but it still doesn’t work. Anyone has an idea to help me ? Thx !

    Read the article

  • Improve a regex statement in order to be as efficient as it can be

    - by user551625
    I have a PHP program that, at some point, needs to analyze a big amount of HTML+javascript text to parse info. All I want to parse needs to be in two parts. Seperate all "HTML goups" to parse Parse each HTML group to get the needed information. In the 1st parse it needs to find: <div id="myHome" And start capturing after that tag. Then stop capturing before <span id="nReaders" And capture the number that comes after this tag and stop. In the 2nd parse use the capture nº 1 (0 has the whole thing and 2 has the number) from the parse made before and then find . I already have code to do that and it works. Is there a way to improve this, make it easier for the machine to parse? preg_match_all('%<div id="myHome"[^>]>(.*?)<span id="nReaders[^>]>([0-9]+)<"%msi', $data, $results, PREG_SET_ORDER); foreach($results AS $result){ preg_match_all('%<div class="myplacement".*?[.]php[?]((?:next|before))=([0-9]+).*?<tbody.*?<td[^>]>.*?[0-9]+"%msi', $result[1], $mydata, PREG_SET_ORDER); //takes care of the data and finish the program Note: I need this for a freeware program so it must be as general as possible and, if possible, not use php extensions ADD: I ommitted some parts here because I didn't expect for answers like those. There is also a need to parse text inside one of the tags that is in the document. It may be the 6th 7th or 8th tag but I know it is after a certain tag. The parser I've checked (thx profitphp) does work to find the script tag. What now? There are more than 1 tag with the same class. I want them all. But I want only with also one of a list of classes..... Where can I find instructions and demos and limitations of DOM parsers (like the one in http://simplehtmldom.sourceforge.net/)? I need something that will work on, at least, a big amount of free servers.

    Read the article

  • Which way to store this data is effective?

    - by Tattat
    I am writing a game, which need a map, and I want to store the map. The first thing I can think of, is using a 2D-array. But the problem is what data should I store in the 2D-array. The player can tap different place to have different reaction. So, I am thinking store a 2D-array with objects, when player click some position, and I find it in the array, and use the object in that array to execute a cmd. But I have a concern that storing lots of object may use lots of memory. So, I am think storing char/int only. But it seems that not enough for me. I want to store the data like that: { Type:1 Color:Green } No matter what color is, if they are all type 1, the have same reactions in logic, but the visual effect is based on the color. So, it is not easy to store using a prue char/int data, unless I make something like this: 1-5 --> all type 1. 1=color green , 2=color red, 3 = color yellow.... ... 6-10 --> all type 2. 2 = color green, 2 = color red ... ... So, do you have any ideas on how to minimize the ram use, but also easy for me to read... ...thx

    Read the article

  • Map Literals to Object Properties/Values

    - by vijay
    For eg, my input XML is look like this. <root> <myelemt> <input type="variable"> <variable>STARTDATE</variable> <variable>CUSTOMERNAME</variable> </input> </myelemt> </root> it is deserialized and loaded into the object MyXmlElemtObj in my code i have written like this, if(MyXmlElemtObj.input.variable.ToUpper() == "STARTDATE") ProcessObjectB(ObjectA.OrderDate); if(MyXmlElemtObj.input.variable.ToUpper() == "CUSTOMERNAME") ProcessObjectB(ObjectC.UserName); Here I am mapping those input literals to some objects value. The one thing that scares me is seeing some ** hard-coded literals** all over my code. Instead i would like to write something like ProcessObjectB(Common.GetMappedvalue(MyXmlElemtObj.input.variable)); Is there a way to isolate this mapping thing to common class, where i will predefine which literal is mapped to which values. The problem is the values are of objects created at the run time. If my question is making sense then So how do i achieve this? I think i have given all the necessary details. if anything is missing please metnion. Thx Much.

    Read the article

  • Javascript, IE, Strings, and Performance problems

    - by Infinity
    Hey guys, So we have this product, and it's really slow in IE. We've already applied a lot of the practices advised by the IE guys themselves (like this, and this), and try to sacrifice clean code for performance in the critical parts like DOM manipulation. However, as you can see in this IE profiler screenshot.. Just "String" is the biggest offender. Almost 750ms of exclusive time. Does this mean IE is spending 750ms just instantiating Strings? I also read this stuff on the Opera dev blog: A build script can remove whitespace, comments, replace strings with Array lookups (to avoid MSIE creating a string object for every single instance of a string — even in conditions) But no more info regarding this. Anyone can clarify? It seems like IE has to create a full String instance every time you have " " in your code, which could explain this, but I don't know what the array lookup optimization would look like. BTW- we don't really do much of string concatenation anywhere in the code. The library we use is MooTools 1.2.4 Any suggestions will be appreciated! Thx

    Read the article

  • What goes into main function?

    - by Woltan
    I am looking for a best practice tip of what goes into the main function of a program using c++. Currently I think two approaches are possible. (Although the "margins" of those approaches can be arbitrarily close to each other) 1: Write a "Master"-class that receives the parameters passed to the main function and handle the complete program in that "Master"-class (Of course you also make use of other classes). Therefore the main function would be reduced to a minimum of lines. #include "MasterClass.h" int main(int args, char* argv[]) { MasterClass MC(args, argv); } 2: Write the "complete" program in the main function making use of user defined objects of course! However there are also global functions involved and the main function can get somewhat large. I am looking for some general guidelines of how to write the main function of a program in c++. I came across this issue by trying to write some unit test for the first approach, which is a little difficult since most of the methods are private. Thx in advance for any help, suggestion, link, ...

    Read the article

  • My app crash with MFMailComposeViewController and MFMessageComposeViewController when I re-launch it.

    - by Dolwen
    Hello all, I encounter a crash with MFMailComposeViewController, MFMessageComposeViewController and multitasking on IOS 4.2 (both simulator and IPHone 4). Code i use : Class emailClass = (NSClassFromString(@"MFMailComposeViewController")); if( emailClass != nil ) { MFMailComposeViewController * controller = [[emailClass alloc] init]; if([emailClass canSendMail]) { // delegate controller.mailComposeDelegate = self; // subject [controller setSubject:@"Hello All."]; // main message [controller setMessageBody:@"I love Stackoverflow.com !" isHTML:NO]; // adding image attachment // getting path for the image we have in the tutorial project NSString *path = [[NSBundle mainBundle] pathForResource:@"image" ofType:@"png"]; // loading content of the image into NSData NSData *imageData = [NSData dataWithContentsOfFile:path]; // adding the attachment to he message [controller addAttachmentData:imageData mimeType:@"image/png" fileName:@"My Byook image"]; // setting different than the default transition for the modal view controller [controller setModalTransitionStyle:UIModalTransitionStyleCoverVertical]; // show [[CGameStateManager getCurrentGameState] presentModalViewController:controller animated:YES]; } [controller release]; } To close MFMailComposeViewController i use : [[CGameStateManager getCurrentGameState] dismissModalViewControllerAnimated:NO]; Then the app crash on the "dismissModalViewControllerAnimated:" and we can read in the debugger with NSZombieEnabled : * -[UIImage isKindOfClass:]: message sent to deallocated instance 0xb0b9f80 Anyone have an answer to solve my problem ? :) Thx

    Read the article

  • PHP post programmatically

    - by Tural Teyyuboglu
    After user registration, website send activation code to email. something like that. www.domain.com/?activate=<code> I'm creating 2 variants of activation: 1.manual 2.auto Lets say we have index.php. 1.Manual method. When someone wants to activate user manually all things are obvious: User opens page www.domain.com/?activate Index.php checks with following script and includes div file (which contains activation form) if (isset($_GET['activate'])) { $page='activate'; $divfile = 'path to div.php'; } include $divfile; Then page sends form data via ajax to activation.php file. 2.Auto method. Lets say user clicked directly to www.domain.com/?activate=<code>. What I wanna do is, to check if(!empty($_GET['activate'])), if all right ... I can't figure out how to act?! Programmatically send something like POST to activation.php or what? Please help. Thx in advance

    Read the article

  • Shaping EF LINQ Query Results Using Multi-Table Includes

    - by sisdog
    I have a simple LINQ EF query below using the method syntax. I'm using my Include statement to join four tables: Event and Doc are the two main tables, EventDoc is a many-to-many link table, and DocUsage is a lookup table. My challenge is that I'd like to shape my results by only selecting specific columns from each of the four tables. But, the compiler is giving a compiler is giving me the following error: 'System.Data.Objects.DataClasses.EntityCollection does not contain a definition for "Doc' and no extension method 'Doc' accepting a first argument of type 'System.Data.Objects.DataClasses.EntityCollection' could be found. I'm sure this is something easy but I'm not figuring it out. I haven't been able to find an example of someone using the multi-table include but also shaping the projection. Thx,Mark var qry= context.Event .Include("EventDoc.Doc.DocUsage") .Select(n => new { n.EventDate, n.EventDoc.Doc.Filename, //<=COMPILER ERROR HERE n.EventDoc.Doc.DocUsage.Usage }) .ToList(); EventDoc ed; Doc d = ed.Doc; //<=NO COMPILER ERROR SO I KNOW MY MODEL'S CORRECT DocUsage du = d.DocUsage;

    Read the article

  • UIImageView and UIScrollView load lot of pictures

    - by Allan.Chen
    In my app, i use UIImageView and UIScrollView to show lot of pictures(Every time there are about 20 pictures and every pictures about 600px*500px and size is about 600KB ), i use for this code to do this function. Here is code: //Here is pictures Data; self.klpArry = self.pictureData; CGSize size = self.klpScrollView1.frame.size; for (int i=0; i < [klpArr count]; i++) { UIImageView *iv = [[UIImageView alloc] initWithFrame:CGRectMake((size.width * i)+300, 20, 546, 546)]; NSString *filePath = [[NSBundle mainBundle] pathForResource:[klpArr objectAtIndex:i] ofType:@"jpg"]; UIImage *imageData = [[UIImage alloc]initWithData:[NSData dataWithContentsOfFile:filePath]]; [iv setImage:imageData]; iv.backgroundColor = [UIColor grayColor]; [self.klpScrollView1 addSubview:iv]; imageData = nil; iv = nil; iv.image = nil; filePath = nil; [imageData release]; [filePath release]; [iv release]; } // show the picture in scrollview; [self.klpScrollView1 setContentSize:CGSizeMake(size.width * numImage, size.height)]; self.klpScrollView1.pagingEnabled = YES; self.klpScrollView1.showsHorizontalScrollIndicator = NO; self.klpScrollView1.backgroundColor = [UIColor grayColor]; But everytime i init this function, the memory will increase about 5MB, Actually i release UIImageView, UIimage and UIScrollView (vi.image=nil,[vi release]) but i doesn't work, it can't release the memory. BTW, i use my friend code first vi.image=nil then vi=nil; but the pictures not to show on scrollview. any one can help me ?? Thx ~~

    Read the article

  • Java doest run prepare statements with parameter

    - by Zaiman Noris
    If using PreparedStatement to query my table. Unfortunately, I have not been able to do so. My code is as simple as this :- PreparedStatement preparedStatement = connection.prepareStatement( "Select favoritefood from favoritefoods where catname = ?"); preparedStatement.setString(1, "Cappuccino"); ResultSet resultSet = preparedStatement.executeQuery(); Error thrown is java.sql.SQLException: ORA-00911: invalid character. As if it never run through the parameter given. Thanks for your time. I've spend a day to debug this yet still unsuccessful. As mention by Piyush, if I omit the semicolon at the end of statement, new error is thrown. java.sql.SQLException: ORA-00942: table or view does not exist. But I can assure you this table is indeed exist. UPDATE shoot. i edited the wrong sql. now it is successful. thx for your time.

    Read the article

  • using replace to produce javascript code, django

    - by durdenk
    I want to use highcharts with my django site but it requires a comlex javascript code such as below. So I wanted to get this script in my python code and replace apropriate portions then write it in my template, first question is, is this a dump way to do that for a person not knowing javascript. I can read it tough. Second question is, Why I cant replace this string. Lets say this string is a variable like this. lineChartsTemplate = """ ... ... """ if I try and do lineChartsTemplate .replace('dataCategory', dataCategory) it basically suppossed to change dataCategory text with my dataCategory variable, but no such luck. I need guidance here. thx. $(function () { var chart = new Highcharts.Chart({ chart: { renderTo: 'container', type: 'bar' }, xAxis: { categories: dataCategory }, yAxis: { }, legend: { layout: 'vertical', floating: true, backgroundColor: '#FFFFFF', align: 'right', verticalAlign: 'top', y: 60, x: -60 }, tooltip: { formatter: function() { return '<b>'+ this.series.name +'</b><br/>'+ this.x +': '+ this.y; } }, plotOptions: { }, series: [{ data: dataList , name : 'Satislar'}] }); });

    Read the article

  • How to use Many to Many in Rails?

    - by Newbie
    Hello! In my project, I have users and quests. One User can join multiple quests and one quest can have multiple users. So I created a table called questing, containing the user_id and the quest_id. In my user.rb I did following: require 'digest/sha1' class User < ActiveRecord::Base has_many :questings has_many :quests ,:through =>:questings ... My Quest.rb: class Quest < ActiveRecord::Base has_many :questings has_many :users ,:through =>:questings ... My Questing.rb: class Questing < ActiveRecord::Base belongs_to :quest belongs_to :user end Now I want to create a link or button on my /quests/show.html.erb, calling an action in my controller, which will create the relationship between user and quest. So, in my quest_controller I did: def join_quest @quest = Quest.find(params[:id]) puts '************************' puts 'join quest:' + @quest.id puts '************************' respond_to do |format| format.html { redirect_to(@quest) } format.xml { head :ok } end end and in my show.html.erb I did: <%= link_to 'join this quest!!!', :action => :join_quest %> Now, clicking on this link will cause an error like: Couldn't find Quest with ID=join_quest and the url points to */quests/join_quest* instead of */quests/1/join_quest* Now my questions: Is my quests_controller the right place for my join_quest action, or should I move it to my users_controller? Why do I get this error? How to solve it? What do I have to write in my join_quest action for saving the relationship? On my /users/show.html.erb I want to output all quests the user joined. How to do this? I have to get all this quests from my relationship table, right? How? I hope you can help me! THX!

    Read the article

  • Spring MVC Table selected row

    - by ich-bin-drin
    Hi, in a Spring MVC 2.5 application i'm using a spring <form:form> component and in this form a table with c:forEach is rendered. In each row a submit button is placed in. If i start a submit by clicking a button i would like to knwo, which button has processed the submit. <form:form commandName="formObject"> <table class="data-table" cellpadding="1" cellspacing="1" border="0"> <thead> <tr> </tr> </thead> <c:forEach items="${list}" var="document" varStatus="row"> <tr> <td> <input type="submit" value="${document.title}"/> <td> </tr> </c:forEach> </table> </form:form> THX.

    Read the article

  • Passing C++ object to C++ code through Python?

    - by cornail
    Hi all, I have written some physics simulation code in C++ and parsing the input text files is a bottleneck of it. As one of the input parameters, the user has to specify a math function which will be evaluated many times at run-time. The C++ code has some pre-defined function classes for this (they are actually quite complex on the math side) and some limited parsing capability but I am not satisfied with this construction at all. What I need is that both the algorithm and the function evaluation remain speedy, so it is advantageous to keep them both as compiled code (and preferrably, the math functions as C++ function objects). However I thought of glueing the whole simulation together with Python: the user could specify the input parameters in a Python script, while also implementing storage, visualization of the results (matplotlib) and GUI, too, in Python. I know that most of the time, exposing C++ classes can be done, e.g. with SWIG but I still have a question concerning the parsing of the user defined math function in Python: Is it possible to somehow to construct a C++ function object in Python and pass it to the C++ algorithm? E.g. when I call f = WrappedCPPGaussianFunctionClass(sigma=0.5) WrappedCPPAlgorithm(f) in Python, it would return a pointer to a C++ object which would then be passed to a C++ routine requiring such a pointer, or something similar... (don't ask me about memory management in this case, though :S) The point is that no callback should be made to Python code in the algorithm. Later I would like to extend this example to also do some simple expression parsing on the Python side, such as sum or product of functions, and return some compound, parse-tree like C++ object but let's stay at the basics for now. Sorry for the long post and thx for the suggestions in advance.

    Read the article

  • UIsearch bar not returning data to table

    - by Insane_Poyo
    Edited code - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell==nil) cell=[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; if (isFiltered) { int rowCount=indexPath.row; Aves *filtrada=[filteredTableData objectAtIndex:rowCount]; cell.textLabel.text=filtrada.name; NSLog(@"mostrando: "); }else { int rowCounter=indexPath.row; Aves *author=[theauthors objectAtIndex:rowCounter]; cell.textLabel.text=author.name; } NSLog(@"mostrando: "); return cell; } -(void)searchBar:(UISearchBar*)searchBar textDidChange:(NSString*)text { if(text.length == 0) { isFiltered = FALSE; } else { isFiltered = true; int i; [filteredTableData removeAllObjects]; for(i=0;[theauthors count]>i;i++) { Aves *name=[theauthors objectAtIndex:i]; //NSLog(name.name); NSRange nameRange = [[name.name lowercaseString] rangeOfString:[text lowercaseString]]; if(nameRange.length>0) { [filteredTableData addObject:name]; NSLog(name.name); } } [self.tableView performSelectorOnMainThread:@selector(reloadData) withObject:nil waitUntilDone:NO]; } } Edit: After working on it a while I solved some problems.Just updated my code, the problem is the repaint of the tableView, every thing else go ok. Check it and give any ideas you have plz ^^ Thx again for your time.

    Read the article

  • Cannot make a static reference to the non-static type MyRunnable

    - by kaiwii ho
    Here is the whole code : import java.util.ArrayList; public class Test{ ThreadLocal<ArrayList<E>>arraylist=new ThreadLocal<ArrayList<E>>(){ @Override protected ArrayList<E> initialValue() { // TODO Auto-generated method stub //return super.initialValue(); ArrayList<E>arraylist=new ArrayList<E>(); for(int i=0;i<=20;i++) arraylist.add((E) new Integer(i)); return arraylist; } }; class MyRunnable implements Runnable{ private Test mytest; public MyRunnable(Test test){ mytest=test; // TODO Auto-generated constructor stub } @Override public void run() { System.out.println("before"+mytest.arraylist.toString()); ArrayList<E>myarraylist=(ArrayList<E>) mytest.arraylist.get(); myarraylist.add((E) new Double(Math.random())); mytest.arraylist.set(myarraylist); System.out.println("after"+mytest.arraylist.toString()); } // TODO Auto-generated method stub } public static void main(String[] args){ Test test=new Test<Double>(); System.out.println(test.arraylist.toString()); new Thread(new MyRunnable(test)).start(); new Thread(new MyRunnable(test)).start(); System.out.println(arraylist.toString()); } } my questions are: 1\ why the new Thread(new MyRunnable(test)).start(); cause the error: Cannot make a static reference to the non-static type MyRunnable ? 2\ what is the static reference refer to right here? thx in advanced

    Read the article

< Previous Page | 37 38 39 40 41 42 43 44 45  | Next Page >