Search Results

Search found 5136 results on 206 pages for 'comment bot'.

Page 173/206 | < Previous Page | 169 170 171 172 173 174 175 176 177 178 179 180  | Next Page >

  • PHP Pass Dynamic Array name to function

    - by Brad
    How do I pass an array key to a function to pull up the right key's data? // The array <?php $var['TEST1'] = Array ( 'Description' => 'This is a Description', 'Version' => '1.11', 'fields' => Array( 'ID' => array( 'type' => 'int', 'length' =>'11', 'misc' =>'auto_increment' ), 'DATA' => array( 'type' => 'varchar', ' length' => '255' ) ); $var['TEST2'] = Array ( 'Description' =? 'This is the 2nd Description', 'Version' => '2.1', 'fields' => Array( 'ID' => array( 'type' => 'int', 'length' =>'11', 'misc' =>'auto_increment' ), 'DATA' => array( 'type' => 'varchar', ' length' => '255' ) ) // The function <?php $obj = 'TEST1'; print_r($schema[$obj]); // <-- Fives me output. But calling the function doesn't. echo buildStructure($obj); /** * @TODO to add auto_inc support */ function buildStructure($obj) { $output = ''; $primaryKey = $schema["{$obj}"]['primary key']; foreach ($schema["{$obj}"]['fields'] as $name => $tag) // #### ERROR #### Invalid argument supplied for foreach() { $type = $tag['type']; $length = $tag['length']; $default = $tag['default']; $description = $tag['description']; $length = (isset($length)) ? "({$length})" : ''; $default = ($default == NULL ) ? "NULL" : $default; $output .= "`{$name}` {$type}{$length} DEFAULT {$default} COMMENT `{$DESCRIPTION}`, "; } return $output; }

    Read the article

  • Why does my plist file exist even when I've uninstalled an app and wiped the simulator?

    - by just_another_coder
    I am trying to detect the existence of a plist file on application start. When my data class (descendant of NSObject) is initialized, it loads the plist file. Before it loads, it checks to see if the file exists, and if it doesn't, it sets the data = nil instead of trying to process the array of data in the plist file. However, every time it starts it indicates the file exists. Even when I uninstall the app in the organizer and when wiping the simulator directory (iPhone Simulator/3.0/Applications). I have the following static method in a library class named FileIO: +(BOOL) fileExists:(NSString *)fileName { NSString *path = [FileIO getPath:fileName]; // gets the path to the docs directory if ([[NSFileManager defaultManager] fileExistsAtPath:path]) return YES; else return NO; } In my data class: //if( [FileIO fileExists:kFavorites_Filename] ) [FileIO deleteFile:kFavorites_Filename]; if ([FileIO fileExists:kFavorites_Filename]) {NSLog(@"exists"); The "exists" is logged every time unless I un-comment the method to delete the file. How can the file exist if I've deleted the app? I've deleted the simulator directory and uninstalled on the device but both say it still exists. What gives???

    Read the article

  • Java File Handling, what did I do wrong?

    - by Urda
    Wrote up a basic file handler for a Java Homework assignment, and when I got the assignment back I had some notes about failing to catch a few instances: Buffer from file could have been null. File was not found File stream wasn't closed Here is the block of code that is used for opening a file: /** * Create a Filestream, Buffer, and a String to store the Buffer. */ FileInputStream fin = null; BufferedReader buffRead = null; String loadedString = null; /** Try to open the file from user input */ try { fin = new FileInputStream(programPath + fileToParse); buffRead = new BufferedReader(new InputStreamReader(fin)); loadedString = buffRead.readLine(); fin.close(); } /** Catch the error if we can't open the file */ catch(IOException e) { System.err.println("CRITICAL: Unable to open text file!"); System.err.println("Exiting!"); System.exit(-1); } The one comment I had from him was that fin.close(); needed to be in a finally block, which I did not have at all. But I thought that the way I have created the try/catch it would have prevented an issue with the file not opening. Let me be clear on a few things: This is not for a current assignment (not trying to get someone to do my own work), I have already created my project and have been graded on it. I did not fully understand my Professor's reasoning myself. Finally, I do not have a lot of Java experience, so I was a little confused why my catch wasn't good enough.

    Read the article

  • Codeigniter: how should I restructure db schema?

    - by Kevin Brown
    I don't even know if that's the right term. May it be known that I'm a major novice! I have three tables: users, profiles, and survey. Each one has user_id as it's first field, (auto-increment for users), and they're all tied by a foreign key constraint, CASCADE on DELETE. Currently, for each user, let's say user_id 1, they have a corresponding db entry in the other tables. For profiles it lists all their information, and the survey table holds all their survey information. Now I must change things...darn scope creep. Users need the ability to have multiple survey results. I imagine that this would be similar to a comment table for a blog... My entire app runs around the idea that a single user is linked to a constraining profile and survey. How should I structure my db? How should I design my app's db so that a user can have multiple tests/profiles for the test? Please assist! Any advice, information and personal-knowledge is appreciated! Right now the only way I know how to accompany my client is to create a pseudo-user for each test (so unnecessary) and list them in a view table (called "your tests")-- these are obtained from the db by saying: where user_id=manager_id

    Read the article

  • Modifying DOM of a webpage

    - by Prashant Singh
    The structure of a webpage is like this :- <div id='abc'> <div class='a'>Some contents here </div> <div class='b'>Some other contents< </div> </div> My aim is to add this after the class a in above structure. <div class='a'>Some other contents here </div> So that final structure looks like this :- <div id='abc'> <div class='a'>Some contents here </div> <div class='a'>Some other contents here </div> <div class='b'>Some other contents< </div> </div> Can there be a better way to do this using DOM properties. I was thinking of naive way of parsing the content and updating. Please comment if I am unclear in asking my doubt !

    Read the article

  • Why does this code leak? (simple codesnippet)

    - by Ela782
    Visual Studio shows me several leaks (a few hundred lines), in total more than a few MB. I traced it down to the following "helloWorld example". The leak disappears if I comment out the H5::DataSet.getSpace() line. #include "stdafx.h" #include <iostream> #include "cpp/H5Cpp.h" int main(int argc, char *argv[]) { _CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF ); // dump leaks at return H5::H5File myfile; try { myfile = H5::H5File("C:\\Users\\yyy\\myfile.h5", H5F_ACC_RDONLY); } catch (H5::Exception& e) { std::string msg( std::string( "Could not open HDF5 file.\n" ) + e.getCDetailMsg() ); throw msg; } H5::Group myGroup = myfile.openGroup("/so/me/group"); H5::DataSet myDS = myGroup.openDataSet("./myfloatvec"); hsize_t dims[1]; //myDS.getSpace().getSimpleExtentDims(dims, NULL); // <-- here's the leak H5::DataSpace dsp = myDS.getSpace(); // The H5::DataSpace seems to leak dsp.getSimpleExtentDims(dims, NULL); //dsp.close(); // <-- doesn't help either std::cout << "Dims: " << dims[0] << std::endl; // <-- Works as expected return 0; } Any help would be appreciated. I've been on this for hours, I hate unclean code...

    Read the article

  • facebook comments ajax

    - by Shunsho
    I have a function that load a jquery ui accordion (differents accordions based on different id) When I click on the tab titled "Facebook Comments" I do: $("#myaccordion").bind('accordionchange', function(event, ui) { id = $("#myaccordion").data('id'); switch (ui.newHeader.text()) { case "Facebook Comments": displayFb(id); break; } }); The "displayFB" function is: function displayFb(id){ $.get('/fbcomments/' + id, function(data) { $("#facecomm").append(data); }); } Where www.myweb.com/fbcomments/id is: <div id="fb-root"></div> <script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/es_ES/all.js#xfbml=1"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script> <div class="fb-comments" data-href="<?php echo '/fbcomments/'.$id ?>" data-num-posts="10" data-width="220"></div> When I load the homepage, then choose an accordion, then open a Facebook Comments, it works perfect. If I reload the page and choose another accordion, work perfect again. The problem is when I choose another accordion or the same again without reload the whole page. The accordions loads very well, all the data on them (some tabs of images, text, videos, etc), but the facebook comments don't appear. I tried: loading the #fb-root and facebook comment <script> on the main layout....doesn't work. adding FB.XFBML.parse(); into displayFB function....doesn't work adding FB.XFBML.parse(); into a $(document).ready(function(){} ...doesn't work. Thank you for reading and try to help!!

    Read the article

  • How can I make "month" columns in Sql?

    - by Beska
    I've got a set of data that looks something like this (VERY simplified): productId Qty dateOrdered --------- --- ----------- 1 2 10/10/2008 1 1 11/10/2008 1 2 10/10/2009 2 3 10/12/2009 1 1 10/15/2009 2 2 11/15/2009 Out of this, we're trying to create a query to get something like: productId Year Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec --------- ---- --- --- --- --- --- --- --- --- --- --- --- --- 1 2008 0 0 0 0 0 0 0 0 0 2 1 0 1 2009 0 0 0 0 0 0 0 0 0 3 0 0 2 2009 0 0 0 0 0 0 0 0 0 3 2 0 The way I'm doing this now, I'm doing 12 selects, one for each month, and putting those in temp tables. I then do a giant join. Everything works, but this guy is dog slow. I know this isn't much to go on, but knowing that I barely qualify as a tyro in the db world, I'm wondering if there is a better high level approach to this that I might try. (I'm guessing there is.) (I'm using MS Sql Server, so answers that are specific to that DB are fine.) (I'm just starting to look at "PIVOT" as a possible help, but I don't know anything about it yet, so if someone wants to comment about that, that might be helpful as well.)

    Read the article

  • CSS issue with multi-accordion

    - by Josh
    Alright, I got some help earlier with this, but it never truly got resolved. I'm pretty sure I'm having a CSS issue, but I just can't figure out how to correct it. Currently, I have these accordions working perfectly, they collapse, expand, expand again when told to etc. The problem I'm having is aligning the content within these accordion divs. Ideally, when everything is default (collapsed) all I want seen is the thumbnail image and the Headline. Then if the user wishes, they click on the headline and it expands and if they want to make a comment or view comments, they can click once again to expand that. Here's the thing, I have to make the height 62px so everything will fit in and just not float all over the place. This creates a problem with the "View Comments" to "Text Here" area, as you can tell it has outrageous space between the two. The other issue is, as I currently have it I'm forcefully indenting the article text so that it doesn't TEXT WRAP underneath the thumbnail image. Basically, I want it split into 2 columns so nothing ever goes beneath the image, but working with this accordion and divs inside the divs it's proving to be difficult for me. I've put up a demo here: http://www.notedls.com/demo

    Read the article

  • Make form redirect users after posting

    - by Liso22
    I need to change a form so that instead of reloading the page after submitting it, it redirects the user to another page, this is the form: <form class="questionform" name="questionform-0" id="questionform-0"> <textarea class="question-box" cols="12" rows="5" id="question-box-' . $questionformid . '" name="title" type="text" maxlength="200" size="28"></textarea> <input type="text" class="ubicacion" value="" name="question"> <input type="button" name="ask" value="Publicar" onclick="askquestion('questionform-0'); window.location.reload(true);"> I want to remove the window.location.reload and change it for a redirect that sends users to the page their comment will appear. Which is: www.chusmix.com/s?= (the content of the second field) The problem is that the content of the second field is part of the url I want to redirect, it's not simply always the same URL. So I have no idea how to do it. How do I do it? Anyway thanks for any info or whatever that points me on the right direction. Thanks

    Read the article

  • Right Language for the Job

    - by Manoj
    Using the right language for the job is the key - this is the comment I read in SO and I also belive thats the right thing to do. Because of this we ended up using different languages for different parts of the project - like perl, VBA(Excel Macros), C# etc. We have three to four languages currently in use inside the project. Using the right language for the job has made it immensly more easy to do automate a job, but of late people are complaining that any new person who has to take over the project will have to learn so many different languages to get started. Also it is difficult to find such kind of person. Please note that this is a one to two person working on the project maximum at a given point of time. I would like to know if the method we are following is right or should we converge to single language and try to use it across all the job even though another language might be better suited for it. Your experenece related to this would also help. Languages used and their purpose: Perl - Processing large text file(log files) C# with Silverlight for web based reporting. LabVIEW for automation Excel macros for processing data in excel sheets, generating graphs and exporting to powerpoint.

    Read the article

  • Emacs hide/show support for C++ triple-slash Doxygen markup?

    - by jsyjr
    I use Doxygen's triple-slash syntax to markup my C++ code. There are two important cases which arise: 1) block markup comments which are the sole element on the line and may or may not begin flush left; e.g. class foo /// A one sentence brief description of foo. The elaboration can /// continue on for many lines. { ... }; void foo::bar /// A one sentence brief description of bar. The elaboration can /// continue on for many lines. () const { ... } 2) trailing markup comments which always follow some number of C++ tokens earlier on the first line but may still spill over onto subsequent lines; e.g. class foo { int _var1; ///< A brief description of _var1. int _var2; ///< A brief description of _var2 ///< requiring additional lines. } void foo::bar ( int arg1 ///< A brief description of arg1. , int arg2 ///< A brief description of arg2 ///< requiring additional lines. ) const { ... } I wonder what hide/show support exists to deal with these conventions. The most important cases are the block markup comments. Ideally I would like to be able to eliminate these altogether, meaning that I would prefer not to waste a line simply to indicate presence of a folded block markup comment. Instead I would like a fringe marker, a la http://www.emacswiki.org/emacs/hideshowvis.el /john

    Read the article

  • MySql stored procedure not found in PHP

    - by kaupov
    Hello, I have a trouble with MySql stored procedure that calls itself recursively using PHP (CakePHP). Calling it I receive following error: SQL Error: 1305: FUNCTION dbname.GetAdvertCounts does not exist The procedure itself is following: delimiter // DROP PROCEDURE IF EXISTS GetAdvertCounts// CREATE PROCEDURE GetAdvertCounts(IN category_id INT) BEGIN DECLARE no_more_sub_categories, advert_count INT DEFAULT 0; DECLARE sub_cat_id INT; DECLARE curr_sub_category CURSOR FOR SELECT id FROM categories WHERE parent_id = category_id; DECLARE CONTINUE HANDLER FOR NOT FOUND SET no_more_sub_categories = 1; SELECT COUNT(*) INTO advert_count FROM adverts WHERE category_id = category_id; OPEN curr_sub_category; FETCH curr_sub_category INTO sub_cat_id; REPEAT SELECT advert_count + GetAdvertCounts(sub_cat_id) INTO advert_count; FETCH curr_sub_category INTO sub_cat_id; UNTIL no_more_sub_categories = 1 END REPEAT; CLOSE curr_sub_category; SELECT advert_count; END // delimiter ; If I remove or comment out the recursive call, the procedure is working. Any idea what I'm missing here? The categories are 2 level deep.

    Read the article

  • Is there a way to create subdatabases as a kind of subfolders in sql server?

    - by user193655
    I am creating an application where there is main DB and where other data is stored in secondary databases. The secondary databases follow a "plugin" approach. I use SQL Server. A simple installation of the application will just have the mainDB, while as an option one can activate more "plug-ins" and for every plug-in there will be a new database. Now why I made this choice is because I have to work with an exisiting legacy system and this is the smartest thing I could figure to implement the plugin system. MainDB and Plugins DB have exactly the same schema (basically Plugins DB have some "special content", some important data that one can use as a kind of template - think to a letter template for example - in the application). Plugin DBs are so used in readonly mode, they are "repository of content". The "smart" thing is that the main application can also be used by "plugin writers", they just write a DB inserting content, and by making a backup of the database they creaetd a potential plugin (this is why all DBs has the same schema). Those plugins DB are downloaded from internet as there is a content upgrade available, every time the full PlugIn DB is destroyed and a new one with the same name is creaetd. This is for simplicity and even because the size of this DBs is generally small. Now this works, anyway I would prefer to organize the DBs in a kind of Tree structure, so that I can force the PlugIn DBs to be "sub-DBs" of the main application DB. As a workaround I am thinking of using naming rules, like: ApplicationDB (for the main application DB) ApplicationDB_PlugIn_N (for the N-th plugin DB) When I search for plugin 1 I try to connect to ApplicationDB_PlugIn_1, if I don't find the DB i raise an error. This situation can happen for example if som DBA renamed ApplicationDB_Plugin_1. So since those Plugin DBs are really dependant on ApplicationDB only I was trying to "do the subfolder trick". Can anyone suggest a way to do this? Can you comment on this self-made plugin approach I decribed above?

    Read the article

  • How do I setup model associations in an RSpec test?

    - by Eric M.
    I've pastied the specs I've written for the posts/show.html.erb view in an application I'm writing as a means to learn RSpec. I am still learning about mocks and stubbing. This question is specific to the "should list all related comments" spec. What I want is to test that the show view displays a post's comments. But what I'm not sure about is how to setup this test and then have the test iterate through with should contain('xyz') statements. Any hints? Other suggestions are also appreciated! Thanks. ---Edit Some more information. I have a named_scope applied to comments in my view (I know, I did this a bit backwards in this case), so @post.comments.approved_is(true). The code pastied responds with the error "undefined method `approved_is' for #", which makes sense since I told it stub comments and return a comment. I'm still not sure, however, how to chain the stubs so that @post.comments.approved_is(true) will return an array of comments.

    Read the article

  • Logging in to Wordpress through CodeIgniter DX Authentication

    - by whobutsb
    Hello All, I'm about to start a very large project of rebuilding my companies intranet. The plan is to have most of the intranet live in a CI application. I chose to use CI because i'm very familiar with all the CI methods. Some sections of the intranet are going to be wordpress blogs. For example the Human Resources Dept. and the Marketing Dept will have their own wordpress blogs. Ideally my plan is to log on to the intranet, with a CI authentication library like DXAuth by querying the Active Directory of the company. When I return the AD information for the user I will by saving their group memberships into a session. It would be fantastic if I could have that session information of the user be used by wordpress to log the user as an editor if they are a member of the Marketing Group. And allow users who are not members of the group be able to comment on that blog, with out logging into wordpress. My question is if there are any CI classes or Wordpress Plugins, or tutorals out there, of this sort of integration with the two systems. Thank you for your help!

    Read the article

  • Detect that the onscreen keyboard has been displayed on Windows Phone 7

    - by David_001
    Simple question: How do I detect that the onscreen keyboard has been displayed on windows mobile 7? Is there an event I can add a listener to? It takes up about half the screen and I want to scroll the view up when it gets displayed... EDIT: A comment below indicates more clearly what I'm trying to do: I have a textbox input, and as the user types into it an autocomplete dropdown appears below it (like google suggest). By default, the active control (the textbox) scrolls into view when focussed, and the onscreen keyboard is directly below it. The onscreen keyboard appears in front of my autocomplete dropdown - what I want to do is make the screen scroll a little further up, so there's some room for my dropdown to be shown. The windows phone UI design guidelines say: "When the keyboard is deployed, the application should scroll to ensure the active edit control and the caret are in view". This happens fine, it's just the non-active dropdown gets hidden behind the onscreen keyboard. The guidelines also say that an application can choose to show the onscreen keyboard, and can also choose to close it. At the moment i'm stuck, and I don't think (based on my research and the replies to this question) that it's possible to detect that the onscreen keyboard has been displayed. I'm moving my investigation to see if it's possible to determine the "visible area" of the page (width & height in pixels for example), and combine this with an onfocus for the textbox... not sure if this will prove fruitful though.

    Read the article

  • how are association, aggregation and composition written?

    - by ajsie
    i have read some posts about the differences between these 3 relationships and i think i get the point. i just wonder, are all these written the same when coding? question 1: all 3 are just a value of the object type in a instance variable? class A { public $b = '' public function __construct($object) { $this->b = $object // <-- could be a association, aggregation or a composition relation? } } question 2: does it have to be an instance variable or can it be a static one? class A { public static $b = '' // <-- nothing changed? public function __construct($object) { $this->b = $object } } question 3: is there a difference in where the object is created? i tend to think that composition object is created inside the object: class A { public $b = '' public function __construct() { $this->b = new Object // is created inside the object } } and aggregation/association is passed through a constructor or another method: class A { public $b = '' public function __construct($object) { // passed through a method $this->b = $object } } question 4: why/when is this important to know. do i have to comment an object inside another what relation its about or do you do it in an UML diagram? could someone shed a light on these questions. thanks!

    Read the article

  • CodeIgniter: help with this query

    - by iamjonesy
    Hi, I have just started my first CI app. I have a view that displays some posts. Each post can have multiple comments and I want to display the total number of comments next to each post. So far all my db call are in my controller (will be changing this). function index(){ $data['query'] = $this->db->get('posts'); $this->load->view('blog_view', $data); } In my view: <?php foreach($query->result() as $row): <div class="post-box"> <p><?php echo $row->body; ?><small>&nbsp;added by <?php echo $row->username; ?> on <?php echo date ('d/m/Y',strtotime($row->created)); ?>&nbsp;<a href="<?php echo base_url(); ?>blog/comments/<?php echo $row->id; ?>"><img src="<?php echo base_url(); ?>images/comments_icon.png" />&nbsp;0</a></small></p> </div> <?php endforeach; ?> I want to get the total number of comments where comment.post_id = the current record's id. and display it next to the comments icon. Any help with this most appreciated, Billy

    Read the article

  • What is a good use case for static import of methods?

    - by Miserable Variable
    Just got a review comment that my static import of the method was not a good idea. The static import was of a method from a DA class, which has mostly static methods. So in middle of the business logic I had a da activity that apparently seemed to belong to the current class: import static some.package.DA.*; class BusinessObject { void someMethod() { .... save(this); } } The reviewer was not keen that I change the code and I didn't but I do kind of agree with him. One reason given for not static-importing was it was confusing where the method was defined, it wasn't in the current class and not in any superclass so it too some time to identify its definition (the web based review system does not have clickable links like IDE :-) I don't really think this matters, static-imports are still quite new and soon we will all get used to locating them. But the other reason, the one I agree with, is that an unqualified method call seems to belong to current object and should not jump contexts. But if it really did belong, it would make sense to extend that super class. So, when does it make sense to static import methods? When have you done it? Did/do you like the way the unqualified calls look? EDIT: The popular opinion seems to be that static-import methods if nobody is going to confuse them as methods of the current class. For example methods from java.lang.Math and java.awt.Color. But if abs and getAlpha are not ambiguous I don't see why readEmployee is. As in lot of programming choices, I think this too is a personal preference thing. Thanks for your response guys, I am closing the question.

    Read the article

  • C# XML Documentation Compiler Warning

    - by ImperialLion
    I am curious as to why I get a compiler warning in the following situation. /// <summary>This is class A /// </summary> public class A { /// <summary>This is the documentation for Method A /// </summary> public void MethodA() { //Do something } } /// <summary>This is class B /// </summary> public class B : A { /// <summary>This does something that I want to /// reference <see cref="MethodA"/> /// </summary> public void MethodB() { //Do something } } The warning states that "XML comment on 'B.MethodB()' has cref attribute 'MethodA' that could not be resolved." If B inherits from A shouldn't the compiler be able to see that method when generating the documentation without me specifying the parent class in the cref? If I change the cref to be cref="A.MethodA()" it works fine, but it seems like that's unnecessary and is a pain to do, especially if I have to go up more than one level. As a note to anyone testing this you have to be sure to "XML documentation file" checked in the Properties - Build in order to see the warning.

    Read the article

  • Most efficient way to make an activity log

    - by Nathan
    I am making a "recent activity" tab to profiles on my site and I also am going to have a log for moderators to see everything that happens on the site. This would require making an activity log of some sort. I just don't know what would be better. I have 2 options: Make a table called "activity" and then every time someone does something, add a record to it with the type of action, user id, timestamp, etc. Problem: table could get very long. Join all 3 tables (questions, answers, answer_comments) and then somehow show all these on the page in the order in which the action was taken. Problem: this would be extremely hard because I have no clue how I could make it say "John commented on an answer on Question Title Here" by just joining 3 tables. Does anyone know of a better way of making an activity log in this situation? I am using PHP and MySQL. If this is either too inefficient or hard I will probably just forget the Recent Activity tab on profiles but I still need an activity log for moderators. Here's some SQL that I started making for option 2, but this would not work because there is no way of detecting whether the action is a comment, question, or answer when I echo the info in a while loop: SELECT q.*, a.*, ac.* FROM questions q JOIN answers a ON a.questionid = q.qid JOIN answer_comments ac ON c.answerid = a.ans_id WHERE q.user = $userid AND a.userid = $userid AND ac.userid = $userid ORDER BY q.created DESC, a.created DESC, ac.created DESC Thanks in advance for any help!

    Read the article

  • problem with jQuery array being a newBie.

    - by user236106
    <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js" type="text/javascript"></script> <script type="text/jscript"> $('document').ready(function (){ var clickNo=0; $('div#pics>img').hide() $('div#pics>input').click(function(event){ $('div#pics>img')[0].show('slow'); }) }); </script> </head> <body> <div id="pics"> <input type="button" value="next" /> <--a bunch of img tags .I had to resort to this comment because the system won't let me include the img tag in the code--> </div> </body> </html> I can't understand why the line $('div#picsimg')[0].show('slow'); is not working ?

    Read the article

  • How to further improve error messages in Scala parser-combinator based parsers?

    - by rse
    I've coded a parser based on Scala parser combinators: class SxmlParser extends RegexParsers with ImplicitConversions with PackratParsers { [...] lazy val document: PackratParser[AstNodeDocument] = ((procinst | element | comment | cdata | whitespace | text)*) ^^ { AstNodeDocument(_) } [...] } object SxmlParser { def parse(text: String): AstNodeDocument = { var ast = AstNodeDocument() val parser = new SxmlParser() val result = parser.parseAll(parser.document, new CharArrayReader(text.toArray)) result match { case parser.Success(x, _) => ast = x case parser.NoSuccess(err, next) => { tool.die("failed to parse SXML input " + "(line " + next.pos.line + ", column " + next.pos.column + "):\n" + err + "\n" + next.pos.longString) } } ast } } Usually the resulting parsing error messages are rather nice. But sometimes it becomes just sxml: ERROR: failed to parse SXML input (line 32, column 1): `"' expected but `' found ^ This happens if a quote characters is not closed and the parser reaches the EOT. What I would like to see here is (1) what production the parser was in when it expected the '"' (I've multiple ones) and (2) where in the input this production started parsing (which is an indicator where the opening quote is in the input). Does anybody know how I can improve the error messages and include more information about the actual internal parsing state when the error happens (perhaps something like a production rule stacktrace or whatever can be given reasonably here to better identify the error location). BTW, the above "line 32, column 1" is actually the EOT position and hence of no use here, of course.

    Read the article

  • How to change the picture of CustomButtonField on click event?

    - by Ujjal boruah Vinod
    I have posted this question previously but the answer is not appropiate. The solution provided just change the picture when the custombutton has focus and unfocus. Suppose in my application I need to change the picture if the user clicks on the customButton, n i m doing this by calling the same screen (ie UiApplication.getUiApplication().pushScreen(new Screen2(b));) . Screen2 is the screen which holds the customButton. On the click evevt i m pushing the same screen by passing aint variable pic_status that determines which picture to be drawn in the CustomButton in the new screen. Is there any way to update the picture in the CustomButtonField on click event without pushing the same Screen again and again. //code in Screen2 public void fieldChanged(Field field, int context) { if(field == bf1) { if(pic_status == 0) { pic_status=1; } UiApplication.getUiApplication().pushScreen(new Screen2(pic_status)); } //code in CustomButtonField CustomButtonField(String label,int pic_status,long style) { super(style); this.label = label; this.labelHeight = getFont().getHeight(); this.labelWidth = getFont().getAdvance(label); this.notice = s; if(pic_status ==0) { currentPicture1 = onPicture; currentPicture2 = onPicture; } if(pic_status ==1) { currentPicture1 = clickPicture; currentPicture2 = onPicture; } if( pic_status==2 ) { currentPicture1 = onPicture; currentPicture2 = clickPicture; } } I need a way to update the customButtonField text and picture on the buttonClick event not on focus/unfocus event without pushing the same Screen again and again. If my above description of problem is not satisfactory, plz add a comment n i can give more details explanation of my problem?

    Read the article

< Previous Page | 169 170 171 172 173 174 175 176 177 178 179 180  | Next Page >