Search Results

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

Page 126/206 | < Previous Page | 122 123 124 125 126 127 128 129 130 131 132 133  | Next Page >

  • WordPress + Facebook comments addition (php knowledge needed)

    - by user1356223
    I succeded to fetch Facebok comments number via this function: <?php function fb_comment_count() { global $post; $url = get_permalink($post->ID); $filecontent = file_get_contents('https://graph.facebook.com/?ids=' . $url); $json = json_decode($filecontent); $count = $json->$url->comments; if ($count == 0 || !isset($count)) { $count = 0; } echo $count; } ;?> And I call it with: <?php fb_comment_count();?> Now how do I add it to this code: <?php comments_number(__('No Comments'), __('1 Comment'), __('% Comments'), '', __('Comments Closed') ); ?> so that WordPress shows number of WP and FB comments together in one number. Thank you very much to everyone!

    Read the article

  • WCF service reference stopped generating code for one project

    - by Mike Pateras
    I have references to two different WCF services in a project. I updated the reference for one of the services, and now no code is generated for it. The references.cs file just has the "this is genrated code" comment at the top. Updating that same service in other projects and updating the other service both work fine. It's only that one service reference in this one project that's causing the problem, and I'm getting no information from Visual Studio (it just says it failed to generate code and I should look at the other errors, which provide no information). If I uncheck the "reuse types in referenced assemblies", code is generated, but I don't want to have this one project be different from the others. I'd like to solve the problem. Re-checking the reuse type option produces an empty references.cs file, again. The collection type doesn't seem to matter, either. How can I diagnose and solve this problem?

    Read the article

  • How to convert code to properly release memory

    - by BankStrong
    I've taken over a code base that has subtle flaws - audio player goes mute, unlogged crashes, odd behavior, etc. I found a way to provoke one instance of the problem and tracked it to this code snippet: NSURL *soundURL = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:[[soundsToPlay objectAtIndex:count] description] ofType:@"mp3"]]; self.audioPlayer = nil; self.audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:soundURL error:nil]; self.audioPlayer.delegate = self; AudioSessionSetActive(YES); [audioPlayer play]; When I comment out the 2nd line (nil) and add a release to the end, this problem stops. [self.audioPlayer release]; Where do I go from here? Nils are used in a similar fashion throughout the code (and may cause similar problems) - is there a safe way to remove them? I'm new to memory management - how can I discern proper nil usage from bad nil usage?

    Read the article

  • Is there an editor that shows WYSIWYG comments?

    - by Bráulio Bezerra
    Has anyone seen an editor/IDE that shows WYSIWYG comments inside the code? I have seen some that show the docs of an element in a separated tab/windows, but not together with code. For example, a JavaDoc comment would be much clearer and easier to edit if it had no tags and could be edited like a snippet from a normal text document. /** * Writes <code>Hello world!</code> to the <b>standard output</b>. * @seealso showGoodbye */ public static void showHello() { Could be something like this: /* Writes Hello world! to the standard output. See also: showGoodbye() */ public static void showHello() { but, editable, of course. And for anyone who happens to have some knowledge/experience with open IDEs like Eclipse, Netbeans, etc.: would it be too hard to implement this?

    Read the article

  • Hopefully simple topic to spark some good opinions, Question is MySQL or SQL Server???

    - by magellings
    I'm beginning development of a website and a high priority is for it to be extremely optimized, quick responses, etc. There will ultimately end up being large amounts of rows in the main tables (millions), so scalability is also important. It will need to use a database on the back-end for data storage and my web hosting service supports either MySQL or Sql Server. This website will be developed with .NET ASP.NET MVC with NHibernate (hopefully it can run in medium trust mode, as that is a requirement of my web hosting and reflection requirements of NHibernate may be problematic, maybe someone has a comment on this too). I'd also prefer to use the database that will require the least attention in regards to management. I don't want to have to be a DBA here. :) I wanted to through this topic out to the public to see what the community thinks? So MySQL or Sql Server, generally, which one would be better to use?

    Read the article

  • Java - Could not find the main class?

    - by asmo
    I'm having a hard-time with a Java error. I'm getting this when double-clicking on my compiled project Jar file in order to run it: Could not find the main class: testPackage.testFrame. Program will exit. However, my main class is cleary defined in the project properties. Furthermore, everything works fine when I run the project directly from NetBeans. I'm using the ip2c.jar third-party library to determine countries from IP addresses. If I comment the class that is using the ip2c.jar file, I don't get the error. How can a third-party library be preventing the JVM from finding my main class?

    Read the article

  • Feature categories for a social network

    - by mafutrct
    Not sure if this question belongs on SO. Anyway, please let me try to clarify the issue. I'm currently planning a social program. It's basically a chat server with the major additional ability to play games. I'd like to create categories of features that are offered to users. My question is, are there any useful standard feature categories? Does not have to be specific to my case, I'm interested in the general case as well. Just to give you an idea of what I'm thinking: functional e.g. play games social e.g. chatting operational e.g. 24/7 service availability I'm entirely unsure if this is the right place to ask, if you know of any better site to ask please don't hesitate to add a comment.

    Read the article

  • Relvance of 'public' contructor in abstract class.

    - by Amby
    Is there any relevance of a 'public' constructor in an abstract class? I can not think of any possible way to use it, in that case shouldn't it be treated as error by compiler (C#, not sure if other languages allow that). Sample Code: internal abstract class Vehicle { public Vehicle() { } } The C# compiler allows this code to compile, while there is no way i can call this contructor from the outside world. It can be called from derived classes only. So shouldn't it allow 'protected' and 'private' modifiers only. Please comment.

    Read the article

  • How do you enable block folding for Python comments in TextMate?

    - by Dave Gallagher
    In TextMate 1.5.10 r1623, you get little arrows that allow you to fold method blocks: Unfortunately, if you have a multi-lined Python comment, it doesn't recognize it, so you can't fold it: def foo(): """ How do I fold these comments? """ print "bar" TextMate has this on their site on how to customize folding: http://manual.macromates.com/en/navigation_overview#customizing_foldings ...but I'm not skilled in regex enough to do anything about it. TextMate uses the Oniguruma regex API, and I'm using the default Python.tmbundle updated to the newest version via GetBundles. Does anyone have an idea of how to do this? Thanks in advance for your help! :)

    Read the article

  • PHP: codecomments inside functions prevents it work

    - by Karem
    $query = $connect->prepare("SELECT firstname, lastname FROM users WHERE id = '$id'"); $query->execute(); $row = $query->fetch(); // $full_name = $row["firstname"] . " ".$row["lastname"]; $full_name = $row["firstname"] . " ".substr($row["lastname"], 0, 1)."."; return $full_name; If i remove the line that is a comment ( // ), it will return $full_name, if its there then it wont work. I also tried commenting with #, but it still wont work(wont return anything) as soon as there is a codecomment weird issue

    Read the article

  • Flex 4.5 - to long build process

    - by Idob
    We are developing an app using flex 4.5. The app runs just fine (no performance issues at all) but it takes us forever to compile and build it. A minor change, like just add a comment or press enter in an mxml file and rebuild takes about 3 minutes. You just cant work that way. It is a large project with about 1300 files. We also use Parsley as IOC container and a beat of cairngorm navigation. We also use Maven (Flex mojos) but I am talking about a normal eclipse build (Ctrl + B). We separated some of the code to a different SWC and all of our graphics are stored in a different resource SWF. Please, Do you have any suggestions? Regards, Ido

    Read the article

  • Delete text from copied text

    - by riddle
    Hello, I would to use JavaScript to clean up text that’s being copied from my site. I use snippets like this: body { vertical-align: middle; ? } Where ? indicates comment later on. I want readers to copy this snippet and use it – so I need to delete that Unicode marker. How can I access text that’s being copied and make changes to it? I considered deleting marker(s) from snippet when user clicks (mousedown) on it, so she could select the text, copy it and then I would restore markers but it seems a really long way to do it.

    Read the article

  • File Explorer using Java - how to go about it?

    - by user299988
    Hi, I am set to create a file explorer using Java. The aim is to emulate the behavior of the default explorer as closely as possible, whatever may be the underlying OS. I have done NO GUI programming in Java. I have looked-up Swing, SWT and JFace, and I am beginning my project with this tutorial: http://www.ibm.com/developerworks/opensource/library/os-ecgui1/ I would like to know your opinions about the best approach to tackle this problem. If you could comment on complexity of coding, portability and OS-independence, and efficiency, it would be great. Is there anything else I should know? Do some other ways exist? Thanks a lot!

    Read the article

  • GWT on Python App Engine

    - by Koran
    Hi, I have a python app engine code (matured backend) - and we are now planning to have a front end for that code. I was wondering whether it is possible to implement GWT as the front end. Even though Alex Martelli in this post [1] mentions it is not possible, a comment to that post suggests that it is indeed possible using rpc over json for GWT. I was unable to understand how this is possible. In app.yaml file, we have to specify the language to be python, right? In that case, how can it compile GWT based on JAVA? Are there any examples on anyone doing that? Can someone help me out? It would be extremely helpful. [1]: http://stackoverflow.com/questions/1085898/choosing-java-vs-python-on-google-app-engine/1087878#1087878 link

    Read the article

  • Is it possible to use SWT on a Mac with Mac Java 1.6

    - by ?????
    The official Eclipse site seems to indicate this is not possible: https://bugs.eclipse.org/bugs/show_bug.cgi?id=216051 which says: Apple is not supporting the 64-bit carbon API. SWT is written using carbon so it must be 32-bit. Apple won't support 32-bit JDK 1.6. Therefore SWT won't run on JDK 1.6 (along with any other Java program that had natives that made carbon calls). Nothing we can do here other than port to cocoa (which has been started but is still in the early stages). Is this still true? (This bug report comment is from over a year ago.) Is there no way to write an SWT app that I can distribute and will run on any Mac unless the user installs an old/Sun VM?

    Read the article

  • Echoing a pseudo column value after a COUNT

    - by rob - not a robber
    Hi Gang... Please don't beat me if this is elementary. I searched and found disjointed stuff relating to pseudo columns. Nothing spot on about what I need. Anyway... I have a table with some rows. Each record has a unique ID, an ID that relates to another entity and finally a comment that relates to that last entity. So, I want to COUNT these rows to basically find what entity has the most comments. Instead of me explaining the query, I'll print it SELECT entity_id, COUNT(*) AS amount FROM comments GROUP BY entity_id ORDER BY amount DESC The query does just what I want, but I want to echo the values from that pseudo column, 'amount' Can it be done, or should I use another method like mysql_num_rows? Thank you!!!

    Read the article

  • nHibernate Linq Projection

    - by Craig
    I am using the version 1.0 release of Linq for nHibernate. When I run the following linq statements I receive the error not a single-length projection: Surname I can find very few references to this on the web and looking into the source it says it should never occur! ClientID is a Int type and Surname is a string. When I comment out all the string fields in the projection and just leave ClientID it runs ok, but as soon as I add surname back it errors. var context = m_ClientRepository.Linq; var result = (from client in context from address in client.Addresses from contact in client.Contacts where client.Surname.StartsWith(surname) && client.GivenName.StartsWith(givenName) && contact.Value.StartsWith(phoneNumber) group client by new { client.ClientID, client.Surname, client.GivenName } into clientGroup select new ClientSearchDTO() { ClientID = clientGroup.Key.ClientID, Surname = clientGroup.Key.Surname, GivenName = clientGroup.Key.GivenName, Address = clientGroup.Max(x => x.Addresses.FirstOrDefault().Address), PhoneNumber = clientGroup.Max(x => x.Contacts.FirstOrDefault().Value) }) .Skip(Paging.FirstRecord(pageNumber)) .Take(5);

    Read the article

  • Alter a single attribute with XSLT

    - by Pete Montgomery
    Hello! <?xml version="1.0" encoding="utf-8" ?> <configuration> <system.web> <compilation debug="true" defaultLanguage="C#"> <!-- this is a comment --> </compilation> </system.web> </configuration> What's the simplest XSLT you can think of to transform the value of the first, in this case only, /configuration/system.web/compilation/@debug attribute from true to false?

    Read the article

  • Java library to partially export a database while respecting referential integrity constraints

    - by Mwanji Ezana
    My production database is several GB's uncompressed and it's getting to be a pain to download and run locally when trying to reproduce a bug or test a feature with real data. I would like to be able to select the specific records that interest me, then have the library figure out what other records are necessary to produce a dataset that respects the databases integrity constraints and finally print it out as a list of insert statements or dump that I can restore. For example: given Author, Blog and Comment tables when I select comments posted after a certain date I should get inserts for the Blog records the comments have foreign keys to and the Author records those Blogs have foreign keys to.

    Read the article

  • Something wrong with this gtk# class for a window?

    - by Isaiah
    Learning C#, I feel so guilty for loving it. I'm a microsoft hater. Anyways I'm trying out gtk# and just trying out some simple stuff. I've made a class for the main window and MonoDevelop is complaining about this code, which I swear was just fine a second ago. public class mwin{ protected Window win = new Window("test program--"); public mwin(){ //Configure the parts win.SetDefaultSize(300,500); } public void showWin(){ win.ShowAll(); } } win.SetDefaultSize(300,500); }--<(here it says "} expected") But obviously I have a closing brace! Am I missing something? [edit] here's whole code. The color stuff was some stuff I was playing around with to color the window, but I didn't finish because the error started. I'm sure it's not the color stuff because it still has an error when I comment them out. http://codepaste.net/b2mwys

    Read the article

  • Call to a member function query() on a non-object

    - by Randy Gonzalez
    Ok, this is so weird!!! I am running PHP Version 5.1.6 when I try and run the code below it gives a fatal error of an object that has not been instantiated. As soon as I un-comment this line of code //$cb_db = new cb_db(USER, PASSWORD, NAME, HOST); everything works. Even though I have declared the $cb_db object as global within in the method. Any help would be greatly appreciated. require_once ( ROOT_CB_CLASSES . 'db.php'); $cb_db = new cb_db(USER, PASSWORD, NAME, HOST); class cb_user { protected function find_by_sql( $sql ) { global $cb_db; //$cb_db = new cb_db(USER, PASSWORD, NAME, HOST); $result_set = $cb_db->query( $sql ); $object_array = array(); while( $row = $cb_db->fetch_array( $result_set ) ) { $object_array[] = self::instantiate( $row ); } return $object_array; } }

    Read the article

  • Drupal and Login Toboggan -- infinite redirect loop

    - by Ian Silber
    I'm getting a redirect loop when using Login Toboggan. It doesn't happen all of the time and I think I've narrowed it down to something with the session, specifically the active-tabs[last-active-href] value. Since it's intermittent, I was able to print out a session of a working copy and a non-working copy. Here are both: WORKS -- Array ( [active-tabs] = Array ( [last-active-href] = index ) ) toboggan/denied DOESN'T WORK -- Array ( [active-tabs] = Array ( [last-active-href] = user/register [user] = user/register ) [wantsEvents] = [wantsResources] = [wantsSupport] = ) toboggan/denied I've also noticed that if I comment out the following line the redirection loop stops (although no page loads): $return = menu_execute_active_handler('user/register'); Any ideas? I'm at my wits end.

    Read the article

  • Problem with compiler in Web.Config for generating xml doc

    - by asksuperuser
    I have several problems when putting code below in Web.Config to be able to generate xml doc with website (not webproject): <compiler language="c#;cs;csharp" extension=".cs" warningLevel="0" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" compilerOptions="/doc:c:\doc\WebDocs.xml"> How do I put a directory with spaces instead of /doc:c:\doc\WebDocs.xml? How do I put a directory that is a subdirectory of current project? Why my xml file output is nearly empty? Is it because some properties, methods, ... have no xml comment?

    Read the article

  • JScrollPane content to image

    - by Sebastian Ikaros Rizzo
    I'm trying to save the main viewport and headers of a JScrollPane (larger than screen) to PNG image files. I created 3 classes extending JPanel (MainTablePanel, MapsHeaderPanel and ItemsHeaderPanel) and set them to the viewports. Each of them has this method: public BufferedImage createImage() { BufferedImage bi = new BufferedImage(getSize().width, getSize().height, BufferedImage.TYPE_INT_ARGB); Graphics g = bi.createGraphics(); paint(g); g.dispose(); return bi; } Each class has also a paint method, which paints the background and then call the super.paint() to paint some label. For example: public void paint(Graphics g){ g.setColor(Color.BLACK); g.fillRect(0, 0, getWidth(), getHeight()); g.setColor(new Color(255, 255, 0, 50)); // for loop that paints some vertical yellow lines for(int i=0; i<getWidth(); i+=K.mW){ g.fillRect(i-1, 0, 2, getHeight()); if(i%(K.mW*5)==0){ g.fillRect(i-2, 0, 4, getHeight()); } } // called to pain some rotated JLabels super.paint(g); } From an external JFrame I then tried to save them to PNG file, using this code: BufferedImage tableImg = mainTableP.createImage(); BufferedImage topImg = mapsHeaderP.createImage(); BufferedImage leftImg = itemsHeaderP.createImage(); ImageIO.write(tableImg, "png", new File(s.homeDir+"/table.png")); ImageIO.write(topImg, "png", new File(s.homeDir+"/top.png")); ImageIO.write(leftImg, "png", new File(s.homeDir+"/left.png")); This is a screenshot of the application running: screenshot And this is the header exported: top If I comment the "super.paint(g)" instruction, I obtain a correct image (thus without all JLables, clearly). It seems like the second paint (super.paint(g)) is painted shifted into the BufferedImage and taking elements outside its JPanel. Somebody could explain me this behaviour? Thank you. ========== EDIT for SSCCE ==================================== This should compile. You can execute it as it is, and in c:\ you'll find two images (top.png and left.png) that should be the same as the two headers. Unfortunately, they are not. Background is not painted. Moreover (especially if you look at left.png) you can see that the labels are painted twice and shifted (note, for example, "Left test 21"). import java.awt.*; import java.awt.image.BufferedImage; import java.io.File; import javax.imageio.ImageIO; import javax.swing.*; public class Main { public static void main(String[] args) { JFrame frame = new JFrame(); frame.setLayout(null); frame.setSize(800, 600); JScrollPane scrollP = new JScrollPane(); scrollP.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); scrollP.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); MyPanel top = new MyPanel(); for(int i=0; i<30; i++){ JLabel label = new JLabel("Test "+i); label.setOpaque(false); label.setBounds(50*i, 40, 50, 20); label.setForeground(Color.GREEN); top.add(label); } top.setLayout(null); top.setOpaque(false); top.setPreferredSize(new Dimension(50*30, 200)); top.validate(); MyPanel left = new MyPanel(); for(int i=0; i<30; i++){ JLabel label = new JLabel("Left test "+i); label.setBounds(0, 50*i, 100, 20); label.setForeground(Color.RED); left.add(label); } left.setLayout(null); left.setOpaque(false); left.setPreferredSize(new Dimension(200, 50*30)); MyPanel center = new MyPanel(); center.setLayout(null); center.setOpaque(false); center.setPreferredSize(new Dimension(50*30, 50*30)); scrollP.setViewportView(center); scrollP.setColumnHeaderView(top); scrollP.setRowHeaderView(left); scrollP.setBounds(0, 50, 750, 500); frame.add(scrollP); frame.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); frame.setVisible(true); try{ BufferedImage topImg = top.createImage(); ImageIO.write(topImg, "png", new File("C:/top.png")); BufferedImage leftImg = left.createImage(); ImageIO.write(leftImg, "png", new File("C:/left.png")); }catch(Exception e){ e.printStackTrace(); } } } class MyPanel extends JPanel{ public void paint(Graphics g){ g.setColor(Color.BLACK); g.fillRect(0, 0, getWidth(), getHeight()); g.setColor(new Color(255, 255, 0, 50)); for(int i=0; i<getWidth(); i+=50){ g.fillRect(i-1, 0, 2, getHeight()); } super.paint(g); // COMMENT this line to obtain background images } public BufferedImage createImage() { BufferedImage bi = new BufferedImage(getSize().width, getSize().height, BufferedImage.TYPE_INT_ARGB); Graphics g = bi.createGraphics(); paint(g); g.dispose(); return bi; } }

    Read the article

  • #define vs enum in an embedded environment (How do they compile?)

    - by Alexander Kondratskiy
    This question has been done to death, and I would agree that enums are the way to go. However, I am curious as to how enums compile in the final code- #defines are just string replacements, but do enums add anything to the compiled binary? Or are they both equivalent at that stage. When writing firmware and memory is very limited, is there any advantage, no matter how small, to using #defines? Thanks! EDIT: As requested by the comment below, by embedded, I mean a digital camera. Thanks for the answers! I am all for enums!

    Read the article

< Previous Page | 122 123 124 125 126 127 128 129 130 131 132 133  | Next Page >