Search Results

Search found 4763 results on 191 pages for 'adams john'.

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

  • Regex and PHP for extracting contents between tags with several line breaks

    - by John
    How can I extract the content between tags with several line breaks? I'm a newbie to regex, who would like to know how to handle unknown numbers of line break to match my query. Task: Extract content between <div class="test"> and the first closing </div> tag. Original source: <div class="test">optional text<br/> content<br/> <br/> content<br/> ... content<br/><a href="/url/">Hyperlink</a></div></div></div> I've worked out the below regex, /<div class=\"test\">(.*?)<br\/>(.*?)<\/div>/ Just wonder how to match several line breaks using regex. There is DOM for us but I am not familiar with that.

    Read the article

  • Why is my app running

    - by John Smith
    I have compiled my iPhone app with setting (Device, Release). I install it on the test machine and it runs with no problem. Here's the problem. The app is linked to a C++ library. The compilation on the simulator has no errors. However the device compilation produces 568 errors, mostly about different visibilities w.r.t AppDelegate.o. They all look like: QL::Error::~Error()has different visibility (default) in /QL/build/Release-iphoneos/libQLLibrary.a(abcd.o) and (hidden) in /Programming/ObjC/Second/build/Second.build/Release-iphoneos/FG.build/Objects-normal/armv6/AppDelegate.o Why is this, and how can I stop the errors anyway?

    Read the article

  • Get text from UITextView

    - by John
    Is it possible to get the first line of text from a UITextView. I have looked through the UITextView and NSString Class References and can't find any methods that could accomplish this.

    Read the article

  • Opencart Dashboard show last months statistics

    - by John Magnolia
    How could I added the option to show the statistics for last month. PHP public function chart() { $this->load->language('common/home'); $data = array(); $data['order'] = array(); $data['customer'] = array(); $data['xaxis'] = array(); $data['order']['label'] = $this->language->get('text_order'); $data['customer']['label'] = $this->language->get('text_customer'); if (isset($this->request->get['range'])) { $range = $this->request->get['range']; } else { $range = 'month'; } switch ($range) { case 'day': for ($i = 0; $i < 24; $i++) { $query = $this->db->query("SELECT COUNT(*) AS total FROM `" . DB_PREFIX . "order` WHERE order_status_id > '0' AND (DATE(date_added) = DATE(NOW()) AND HOUR(date_added) = '" . (int)$i . "') GROUP BY HOUR(date_added) ORDER BY date_added ASC"); if ($query->num_rows) { $data['order']['data'][] = array($i, (int)$query->row['total']); } else { $data['order']['data'][] = array($i, 0); } $query = $this->db->query("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "customer WHERE DATE(date_added) = DATE(NOW()) AND HOUR(date_added) = '" . (int)$i . "' GROUP BY HOUR(date_added) ORDER BY date_added ASC"); if ($query->num_rows) { $data['customer']['data'][] = array($i, (int)$query->row['total']); } else { $data['customer']['data'][] = array($i, 0); } $data['xaxis'][] = array($i, date('H', mktime($i, 0, 0, date('n'), date('j'), date('Y')))); } break; case 'week': $date_start = strtotime('-' . date('w') . ' days'); for ($i = 0; $i < 7; $i++) { $date = date('Y-m-d', $date_start + ($i * 86400)); $query = $this->db->query("SELECT COUNT(*) AS total FROM `" . DB_PREFIX . "order` WHERE order_status_id > '0' AND DATE(date_added) = '" . $this->db->escape($date) . "' GROUP BY DATE(date_added)"); if ($query->num_rows) { $data['order']['data'][] = array($i, (int)$query->row['total']); } else { $data['order']['data'][] = array($i, 0); } $query = $this->db->query("SELECT COUNT(*) AS total FROM `" . DB_PREFIX . "customer` WHERE DATE(date_added) = '" . $this->db->escape($date) . "' GROUP BY DATE(date_added)"); if ($query->num_rows) { $data['customer']['data'][] = array($i, (int)$query->row['total']); } else { $data['customer']['data'][] = array($i, 0); } $data['xaxis'][] = array($i, date('D', strtotime($date))); } break; default: case 'month': for ($i = 1; $i <= date('t'); $i++) { $date = date('Y') . '-' . date('m') . '-' . $i; $query = $this->db->query("SELECT COUNT(*) AS total FROM `" . DB_PREFIX . "order` WHERE order_status_id > '0' AND (DATE(date_added) = '" . $this->db->escape($date) . "') GROUP BY DAY(date_added)"); if ($query->num_rows) { $data['order']['data'][] = array($i, (int)$query->row['total']); } else { $data['order']['data'][] = array($i, 0); } $query = $this->db->query("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "customer WHERE DATE(date_added) = '" . $this->db->escape($date) . "' GROUP BY DAY(date_added)"); if ($query->num_rows) { $data['customer']['data'][] = array($i, (int)$query->row['total']); } else { $data['customer']['data'][] = array($i, 0); } $data['xaxis'][] = array($i, date('j', strtotime($date))); } break; case 'year': for ($i = 1; $i <= 12; $i++) { $query = $this->db->query("SELECT COUNT(*) AS total FROM `" . DB_PREFIX . "order` WHERE order_status_id > '0' AND YEAR(date_added) = '" . date('Y') . "' AND MONTH(date_added) = '" . $i . "' GROUP BY MONTH(date_added)"); if ($query->num_rows) { $data['order']['data'][] = array($i, (int)$query->row['total']); } else { $data['order']['data'][] = array($i, 0); } $query = $this->db->query("SELECT COUNT(*) AS total FROM " . DB_PREFIX . "customer WHERE YEAR(date_added) = '" . date('Y') . "' AND MONTH(date_added) = '" . $i . "' GROUP BY MONTH(date_added)"); if ($query->num_rows) { $data['customer']['data'][] = array($i, (int)$query->row['total']); } else { $data['customer']['data'][] = array($i, 0); } $data['xaxis'][] = array($i, date('M', mktime(0, 0, 0, $i, 1, date('Y')))); } break; } $this->response->setOutput(json_encode($data)); } HTML <select name="range"> <option value="day">Today</option> <option value="week">This Week</option> <option value="month">This Month</option> <option value="year">This Year</option> </select>

    Read the article

  • richfaces progressBar polling

    - by John
    Hi, I've got a progressBar component defined as the following on my webpage: <rich:modalPanel id="pb1Panel"> <rich:progressBar id="pb1" oncomplete="javascript:#{myBean.handleProgressEvent()} closeProgressModalPanel()" value="#{pb1Listener.percentageComplete}" label="#{pb1Listener.percentageComplete} %" minValue="1" maxValue="100" limitToList="true" timeout="3200" interval="1400" enabled="false"/> </rich:modalPanel> and a button: <a4j:commandButton id="actButton" value="action" action="#{myBean.performAction}" immediate="true" ajaxSingle="true" onclick="javascript:Richfaces.showModalPanel('pb1Panel');" reRender="pb1Panel"> <a4j:support event="onClick" value="#{rich:component('pb1')}.enable()" reRender="pb1" /> </a4j:commandButton> which doesn't work. However if I take out the .... enabled="false"/> .... from the progress bar, and the element from the button, everything seems to work just fine. Any suggestion why it's not working? I'm setting enabled="false" initially because I do not want the polling to start unless the button was clicked (to reduce unnecessary polling). The system is building on richfaces/seam. Thanks!

    Read the article

  • Dynamic LINQ OrderBy

    - by John Sheehan
    I found an example in the VS2008 Examples for Dynamic LINQ that allows you to use a sql-like string (e.g. OrderBy("Name, Age DESC")) for ordering. Unfortunately, the method included only works on IQueryable<T>. Is there any way to get this functionality on IEnumerable<T>?

    Read the article

  • ASP.NET MVC Master Page

    - by john
    hi Guys How can one do this? I would like to save the master pages template in the database and then based on a query string pull the correct template. Is this possible?

    Read the article

  • How to route all subdomains to a single host using mDNS?

    - by John Mee
    I have a development webserver hosting as "myhost.local" which is found using Bonjour/mDNS. The server is running avahi-daemon. The webserver also wants to handle any subdomains of itself. Eg "cat.myhost.local" and "dog.myhost.local" and "guppy.myhost.local". Given that myhost.local is on a dynamic ip address from dhcp, is there still a way to route all requests for the subdomains to myhost.local? I'm starting to think it not currently possible... http://marc.info/?l=freedesktop-avahi&m=119561596630960&w=2 You can do this with the /etc/avahi/hosts file. Alternatively you can use avahi-publish-host-name. No, he cannot. Since he wants to define an alias, not a new hostname. I.e. he only wants to register an A RR, no reverse PTR RR. But if you stick something into /etc/avahi/hosts then it registers both, and detects a collision if the PTR RR is non-unique, which would be the case for an alias.

    Read the article

  • LINQ query checks for null

    - by user300992
    I have a userList, some users don't have a name (null). If I run the first LINQ query, I got an error saying "object reference not set to an instance of an object" error. var temp = (from a in userList where ((a.name == "john") && (a.name != null)) select a).ToList(); However, if I switch the order by putting the checking for null in front, then it works without throwing any error: var temp = (from a in userList where ((a.name != null) && (a.name == "john")) select a).ToList(); Why is that? If that's pure C# code (not LINQ), I think both would be the same. I don't have SQL profiler, I am just curious what will be the difference when they are being translated on SQL level.

    Read the article

  • Avoiding deployment when debugging an ASP.NET MVC application

    - by John Kaster
    Once an asp.net MVC project has a web deployment project associated with it, there doesn't seem to be a way to avoid deploying when you build the MVC project. I still want to be able to debug my MVC project locally and avoid deploying new versions of it. How do I configure the web deployment project to skip the deployment step when I'm trying to debug?

    Read the article

  • Receiving XML from Actionscript on Servlet - Invalid Stream Header

    - by John Doe
    I have an ActionScript File sending XML to my servlet. I am only getting empty arrays on output. In ActionScript I checked and I am in fact sending the correct XML. Anyone know what Exactly I'm doing wrong? Exception error is: java.io.StreamCorruptedException: invalid stream header package myDungeonAccessor; try { System.out.println("HEADERS: " + request.getHeaderNames()); ObjectInputStream in = new ObjectInputStream(request.getInputStream()); System.out.println(in); ObjectOutputStream out = new ObjectOutputStream(response.getOutputStream()); } catch(Exception e) { e.printStackTrace(); } Exception

    Read the article

  • Silverlight: how to use a scroll viewer to wrap a list view without specifying height?

    - by John Nicholas
    I have a control that has a list that varies in length greatly. This control appears in various places meaning that i cannot calculate its position and desired height easily. Moreover all I want is for the scrollviewer to simply size itself according to its parent. currently it insists on sizing itself according to the content. currently when i have a list that exceeds the height of the screen the whole control extends off the bottom and the scrollviewer shows no bar (because it has stretched to the heigth of the contents and so thinks it is not required). I've not included code as the object graph is fairly deep. What i am looking for is a set of conditions that would cause the scrollviewer to resize itself according to its content rather than its parent. I have it working in a similar situation involving grids and datagrids, the unique part of this control is that there is a list containing controls. Any ideas? I would prefer solutions that don't require use of code behind - but im really not in a position to be choosey.

    Read the article

  • How do I set the default selection for NSTreeController at startup?

    - by John Gallagher
    The Background I've built a source list (similar to iTunes et al.) in my Cocoa app. I've got an NSOutlineView, with Value column bound to arrangedObjects.name key path of an NSTreeController. The NSTreeController accesses JGSourceListNode entities in a Core Data store. I have three subclasses of JGSourceListNode - JGProjectNode, JGGroupNode and JGFolderNode. I have selectedIndexPaths on NSTreeController bound to an NSArray called selectedIndexPaths in my App Delegate. On startup, I search for group nodes and if they're not found in the core data store I create them: if ([allGroupNodes count] == 0) { JGGroupNode *rootTrainingNode = [JGGroupNode insertInManagedObjectContext:context]; [rootTrainingNode setNodeName:@"TRAIN"]; JGProjectNode *childUntrainedNode = [JGProjectNode insertInManagedObjectContext:context]; [childUntrainedNode setParent:rootTrainingNode]; [childUntrainedNode setNodeName:@"Untrained"]; JGGroupNode *rootBrowsingNode = [JGGroupNode insertInManagedObjectContext:context]; [rootBrowsingNode setNodeName:@"BROWSE"]; JGFolderNode *childFolder = [JGFolderNode insertInManagedObjectContext:context]; [childFolder setNodeName:@"Folder"]; [childFolder setParent:rootBrowsingNode]; [context save:nil]; } What I Want When I start the app, I want both top level groups to be expanded and "Untrained" to be highlighted as shown: The Problem I put the following code in the applicationDidFinishLaunching: method of the app delegate: [sourceListOutlineView expandItem:[sourceListOutlineView itemAtRow:0]]; [sourceListOutlineView expandItem:[sourceListOutlineView itemAtRow:2]]; NSIndexPath *rootIndexPath = [NSIndexPath indexPathWithIndex:0]; NSIndexPath *childIndexPath = [rootIndexPath indexPathByAddingIndex:0]; [self setSelectedIndexPaths:[NSArray arrayWithObject:childIndexPath]]; but the outline view seems to not have been prepared yet, so this code does nothing. Ideally, eventually I want to save the last selection the user had made and restore this on a restart. The Question I'm sure it's possible using some crazy KVO to observe when the NSTreeController or NSOutlineView gets populated then expand the items and change the selection, but that feels clumsy and too much like a work around. How would I do this elegantly?

    Read the article

  • Entity framework and many to many queries unusable?

    - by John Landheer
    I'm trying EF out and I do a lot of filtering based on many to many relationships. For instance I have persons, locations and a personlocation table to link the two. I also have a role and personrole table. EDIT: Tables: Person (personid, name) Personlocation (personid, locationid) Location (locationid, description) Personrole (personid, roleid) Role (roleid, description) EF will give me persons, roles and location entities. EDIT: Since EF will NOT generate the personlocation and personrole entity types, they cannot be used in the query. How do I create a query to give me all the persons of a given location with a given role? In SQL the query would be select p.* from persons as p join personlocations as pl on p.personid=pl.personid join locations as l on pl.locationid=l.locationid join personroles as pr on p.personid=pr.personid join roles as r on pr.roleid=r.roleid where r.description='Student' and l.description='Amsterdam' I've looked, but I can't seem to find a simple solution.

    Read the article

  • Django Forms - change the render multiple select widget

    - by John
    Hi, In my model I have a manytomany field mentors = models.ManyToManyField(MentorArea, verbose_name='Areas', blank=True) In my form I want to render this as: drop down box with list of all MentorArea objects which has not been associated with the object. Next to that an add button which will call a javascript function which will add it to the object. Then under that a ul list which has each selected MentorArea object with a x next to it which again calls a javascript function which will remove the MentorArea from the object. I know that to change how an field element is rendered you create a custom widget and override the render function and I have done that to create the add button. class AreaWidget(widgets.Select): def render(self, name, value, attrs=None, choices=()): jquery = u''' <input class="button def" type="button" value="Add" id="Add Area" />''' output = super(AreaWidget, self).render(name, value, attrs, choices) return output + mark_safe(jquery) However I don't know how to list the currently selected ones underneath as a list. Can anyone help me? Also what is the best way to filter down the list so that it only shows MentorArea objects which have not been added? I currently have the field as mentors = forms.ModelMultipleChoiceField(queryset=MentorArea.objects.all(), widget = AreaWidget, required=False) but this shows all mentors no matter if they have been added or not. Thanks

    Read the article

  • What is your favorite textmate plugin or bundle?

    - by John Duff
    Textmate is a great editor with lots of plugins and bundles, hoping to find a few more that will make Textmate even more useful. I personally can't live without Ack in Project (http://github.com/protocool/ack-tmbundle), the built in search for textmate is awful, ack in project does searches 100x faster. What's your favorite Textmate plugin or bundle and what makes it so great?

    Read the article

  • WCF RIA Services Silverlight 3.0

    - by John
    Hi, I have downloaded WCF RIA Services Beta from the following website: WCF RIA Services Beta for Visual Studio 2008 SP1 http://www.microsoft.com/downloads/details.aspx?FamilyID=76bb3a07-3846-4564-b0c3-27972bcaabce&displaylang=en#filelist But I am unable to add a reference to the following assembly : system.Windows.Ria.Data I searched at the downloaded location c:\Program files\Microsoft SDK's\RIA Services but i am unable to find this dll. Would appreciate if you could point me what I am missing here.

    Read the article

  • regex to get current page or directory name?

    - by John Isaacks
    I am trying to get the page or last directory name from a url for example if the url is: http://www.example.com/dir/ i want it to return dir or if the passed url is http://www.example.com/page.php I want it to return page Notice I do not want the trailing slash or file extension. I tried this: $regex = "/.*\.(com|gov|org|net|mil|edu)/([a-z_\-]+).*/i"; $name = strtolower(preg_replace($regex,"$2",$url)); I ran this regex in PHP and it returned nothing. (however I tested the same regex in ActionScript and it worked!) So what am I doing wrong here, how do I get what I want? Thanks!!!

    Read the article

  • Connecting to SQL Server in Php - Extension Err

    - by John Doe
    <html> <head> <title>Connecting </title> </head> <body> <?php $host = "*.*.*.*"; $username = "xxx"; $password = "xxx"; $db_name = "xxx"; $db = mssql_connect($host, $username,$password) or die("Couldnt Connect"); $selected = mssql_select_db($db_name, $db) or die("Couldnt open database"); ?> </body> </html> My error message is: Fatal error: Call to undefined function mssql_connect() in C:\wamp\www\php\dbase.php on line 12 I am using WampServer 2.0 on Php 5.3.0 When I check the extensions, php_mssql is Checked. I also checked the php.ini file to make sure it is not commented out. I have my file dbase.php saved in C:\wamp\www\php. I have tried stopping the service, closing everything, and running it again. I know the problem is that the extension file is not being included somehow. The below is copied from my php.ini file. Note I made all http = /http to avoid posting Links. ;;;;;;;;;;;;;;;;;;;;;;;;; ; Paths and Directories ; ;;;;;;;;;;;;;;;;;;;;;;;;; ; UNIX: "/path1:/path2" ;include_path = ".:/php/includes" ; Windows: "\path1;\path2" include_path = "C:\wamp\bin\php\php5.3.0\ext" ; ; PHP's default setting for include_path is ".;/path/to/php/pear" ; /http://php.net/include-path ; The root of the PHP pages, used only if nonempty. ; if PHP was not compiled with FORCE_REDIRECT, you SHOULD set doc_root ; if you are running php as a CGI under any web server (other than IIS) ; see documentation for security issues. The alternate is to use the ; cgi.force_redirect configuration below ; /http://php.net/doc-root doc_root = ; The directory under which PHP opens the script using /~username used only ; if nonempty. ; /http://php.net/user-dir user_dir = ; Directory in which the loadable extensions (modules) reside. ; /http://php.net/extension-dir ; extension_dir = "./" ; On windows: ; extension_dir = "ext" extension_dir = "c:/wamp/bin/php/php5.3.0/ext/" ; Whether or not to enable the dl() function. The dl() function does NOT work ; properly in multithreaded servers, such as IIS or Zeus, and is automatically ; disabled on them. ; /http://php.net/enable-dl enable_dl = Off ; cgi.force_redirect is necessary to provide security running PHP as a CGI under ; most web servers. Left undefined, PHP turns this on by default. You can ; turn it off here AT YOUR OWN RISK ; You CAN safely turn this off for IIS, in fact, you MUST. ; /http://php.net/cgi.force-redirect ;cgi.force_redirect = 1 ; if cgi.nph is enabled it will force cgi to always sent Status: 200 with ; every request. PHP's default behavior is to disable this feature. ;cgi.nph = 1 ; if cgi.force_redirect is turned on, and you are not running under Apache or Netscape ; (iPlanet) web servers, you MAY need to set an environment variable name that PHP ; will look for to know it is OK to continue execution. Setting this variable MAY ; cause security issues, KNOW WHAT YOU ARE DOING FIRST. ; /http://php.net/cgi.redirect-status-env ;cgi.redirect_status_env = ; ; cgi.fix_pathinfo provides real PATH_INFO/PATH_TRANSLATED support for CGI. PHP's ; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok ; what PATH_INFO is. For more information on PATH_INFO, see the cgi specs. Setting ; this to 1 will cause PHP CGI to fix its paths to conform to the spec. A setting ; of zero causes PHP to behave as before. Default is 1. You should fix your scripts ; to use SCRIPT_FILENAME rather than PATH_TRANSLATED. ; /http://php.net/cgi.fix-pathinfo ;cgi.fix_pathinfo=1 ; FastCGI under IIS (on WINNT based OS) supports the ability to impersonate ; security tokens of the calling client. This allows IIS to define the ; security context that the request runs under. mod_fastcgi under Apache ; does not currently support this feature (03/17/2002) ; Set to 1 if running under IIS. Default is zero. ; /http://php.net/fastcgi.impersonate ;fastcgi.impersonate = 1; ; Disable logging through FastCGI connection. PHP's default behavior is to enable ; this feature. ;fastcgi.logging = 0 ; cgi.rfc2616_headers configuration option tells PHP what type of headers to ; use when sending HTTP response code. If it's set 0 PHP sends Status: header that ; is supported by Apache. When this option is set to 1 PHP will send ; RFC2616 compliant header. ; Default is zero. ; /http://php.net/cgi.rfc2616-headers ;cgi.rfc2616_headers = 0 ;;;;;;;;;;;;;;;; ; File Uploads ; ;;;;;;;;;;;;;;;; ; Whether to allow HTTP file uploads. ; /http://php.net/file-uploads file_uploads = On ; Temporary directory for HTTP uploaded files (will use system default if not ; specified). ; /http://php.net/upload-tmp-dir upload_tmp_dir = "c:/wamp/tmp" ; Maximum allowed size for uploaded files. ; /http://php.net/upload-max-filesize upload_max_filesize = 2M Also, my php.ini file is saved in: C:\wamp\bin\apache\Apache2.2.11\bin

    Read the article

  • R: ggplot2, why does my legend show faded colors?

    - by John
    Why is my legend faded in these examples below? Notice how the colours in the legend are not as vivid as the colours in the plot: library(ggplot2) r <- ggplot(data = diamonds, aes(x = carat, y = price, color = cut, group = cut)) r + geom_smooth() #(left) r + geom_smooth(size = 2) #(right)

    Read the article

  • Looking for Recommendations on Version Control System with Intuitive (.NET) API?

    - by John L.
    I'm working on a project which generates (composite) Microsoft Word documents which are comprised of one or more child documents. There are tens of thousands of permutations of the composite documents. Far too many for users to easily manage. Users will need to view/edit the child documents through the app which hides all of the nasty implementation details. A requirement of the system is that the child documents must be version controlled. That is what has been tripping me up. I've been torn between using an off-the-shelf solution or rolling my own. At a minimum, the system needs to support get latest, get specific version, add new, rename and possibly delete. I’ve whiteboarded it enough to realize it won’t be a trivial task to create my own. As far as commercial systems I have VSS and TFS at my disposal. I've played with the TFS API some, but it isn’t as intuitive or well documented as I had hoped. I'm not averse to an open source solution (e.g. SVN), but I have less familiarity with them. Which approach or tool would you recommend? Why? Do you have any links to API documentation you would recommend? Environment: C#, VS2008, SQL Server 2005/2008, low volume (a few hundred operations per day)

    Read the article

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