Search Results

Search found 1941 results on 78 pages for 'james ferguson'.

Page 42/78 | < Previous Page | 38 39 40 41 42 43 44 45 46 47 48 49  | Next Page >

  • Wordpress Navigation

    - by James Pellerano
    I am working on a Wordpress Theme, I need to work on the navigation, I am having a little trouble creating it. The navigation I am looking for looks like this: www.neu.edu/humanities. I have gotten this far: if (is_front_page()) { wp_list_pages('title_li=&exclude=12&depth=1'); } else { // display the subpages of the current page while // display all of the main pages and all of the // and display the parent pages while on the subpages }

    Read the article

  • Select random row from MySQL (with probability)

    - by James Simpson
    I have a MySQL table that has a row called cur_odds which is a percent number with the percent probability that that row will get selected. How do I make a query that will actually select the rows in approximately that frequency when you run through 100 queries for example? I tried the following, but a row that has a probability of 0.35 ends up getting selected around 60-70% of the time. SELECT * FROM table ORDER BY RAND()*cur_odds DESC

    Read the article

  • moving audio over a local network using GStreamer

    - by James Turner
    I need to move realtime audio between two Linux machines, which are both running custom software (of mine) which builds on top of Gstreamer. (The software already has other communication between the machines, over a separate TCP-based protocol - I mention this in case having reliable out-of-band data makes a difference to the solution). The audio input will be a microphone / line-in on the sending machine, and normal audio output as the sink on the destination; alsasrc and alsasink are the most likely, though for testing I have been using the audiotestsrc instead of a real microphone. GStreamer offers a multitude of ways to move data round over networks - RTP, RTSP, GDP payloading, UDP and TCP servers, clients and sockets, and so on. There's also many examples on the web of streaming both audio and video - but none of them seem to work for me, in practice; either the destination pipeline fails to negotiate caps, or I hear a single packet and then the pipeline stalls, or the destination pipeline bails out immediately with no data available. In all cases, I'm testing on the command-line just gst-launch. No compression of the audio data is required - raw audio, or trivial WAV, uLaw or aLaw encoding is fine; what's more important is low-ish latency.

    Read the article

  • ASP.Net MVC - What replaces events to support loose coupling?

    - by James
    What feature(s) of ASP.Net MVC can replace the way events can be used in Webforms to support loosely coupled components. For example, take a simple pager control: A page number is clicked Pager fires off a "PageChange" event with the new page number This subscribing page/control received the event and handles initiating a call to fetch and bind new data. What tools are available in ASP.Net MVC to support Loose coupling Component re-usability Separation of logic for a single page/view (such a very complex "portal" type page).

    Read the article

  • storing/retrieving data for graph with long continuous stretches

    - by james
    i have a large 2-dimensional data set which i would like to graph. the graph is displayed in a browser and the data is retrieved via ajax. long stretches of this graph will be continuous - e.g., for x=0 through x=1000, y=9, then for x=1001 through x=1100, y=80, etc. the approach i'm considering is to send (from the server) and store (in the browser) only the points where the data changes. so for the example above, i would say data[0] = 9, then data[1001] = 80. then given x=999 for example, retrieving data[999] would actually look up data[0]. the problem that arises is finding a dictionary-like data structure which behaves like this. the approach i'm considering is to store the data in a traditional dictionary object, then also maintain a sorted array of key for that object. when given x=999, it would look at the mid-point of this array, determine whether the nearest lower key is left or right of that midpoint, then repeat with the correct subsection, etc.. does anyone have thoughts on this problem/approach?

    Read the article

  • C# - How do find a string within a string even if it spans across whitespace?

    - by James Heaney
    I want to be able to find and highlight a string within a string BUT I no not want to remove the space. So if my original string is : There are 12 monkeys I want to find '12 mon' and highlight those characters ending up with : There are < font color='red' 12 mon< /font keys BUT I also want the same result if I search for '12mon' (no space this time) This has really bent my mind! I'm sure it can be done with Regex.

    Read the article

  • What happens when you run out of ram with mlockall set?

    - by James Dean
    I am working on a C++ application that requires a large amounts of memory for a batch run. ( 20gb) Some of my customers are running into memory limits where sometimes the OS starts swapping and the total run time doubles or worse. I have read that I can use the mlockall to keep the process from being swapped out. What would happen when the process memory requirements approaches or exceeds the the available physical memory in this way? I guess the answer might be OS specific so please list the OS in your answer.

    Read the article

  • Getting XML data from a external page and parsing it with PHP

    - by James P
    I'm trying to create a database of World of Warcraft gems. If I go to this page: http://www.wowarmory.com/search.xml?fl[source]=all&fl[type]=gems&fl[subTp]=purple&searchType=items And go to View Source in Firefox, I see a tonne of XML data which is exactly what I want. I wrote up this quick script to try and parse some of it: <?php $gemUrls = array( 'Blue' => 'http://www.wowarmory.com/search.xml?fl[source]=all&fl[type]=gems&fl[subTp]=blue&searchType=items', 'Red' => 'http://www.wowarmory.com/search.xml?fl[source]=all&fl[type]=gems&fl[subTp]=red&searchType=items', 'Yellow' => 'http://www.wowarmory.com/search.xml?fl[source]=all&fl[type]=gems&fl[subTp]=yellow&searchType=items', 'Meta' => 'http://www.wowarmory.com/search.xml?fl[source]=all&fl[type]=gems&fl[subTp]=meta&searchType=items', 'Green' => 'http://www.wowarmory.com/search.xml?fl[source]=all&fl[type]=gems&fl[subTp]=green&searchType=items', 'Orange' => 'http://www.wowarmory.com/search.xml?fl[source]=all&fl[type]=gems&fl[subTp]=orange&searchType=items', 'Purple' => 'http://www.wowarmory.com/search.xml?fl[source]=all&fl[type]=gems&fl[subTp]=purple&searchType=items', 'Prismatic' => 'http://www.wowarmory.com/search.xml?fl[source]=all&fl[type]=gems&fl[subTp]=purple&searchType=items' ); // Get blue gems $blueGems = file_get_contents($gemUrls['Blue']); $xml = new SimpleXMLElement($blueGems); echo $xml->items[0]->item; ?> But I get a load of errors like this: Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: Entity: line 20: parser error : xmlParseEntityRef: no name in C:\xampp\htdocs\WoW\index.php on line 19 Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: if(Browser.iphone && Number(getcookie2("mobIntPageVisits")) < 3 && getcookie2( in C:\xampp\htdocs\WoW\index.php on line 19 I'm not sure what's wrong. I think file_get_contents() is bringing back data that isn't XML, maybe some Javascript files judging by the iPhone parts in the errors. Is there any way to just get back the XML from that page? Without any HTML or anything? Thanks :)

    Read the article

  • Extension Method for copying properties form object to another, with first attempt

    - by James
    Hi All, Im trying to write an extension method that I can use to copy values from one object property to another object of a different type, as long as the property names and types match exactly. This is what I have: public static T CopyFrom<T>(this T toObject, object fromObject) { var fromObjectType = fromObject.GetType(); var fromProperties = fromObjectType.GetProperties(); foreach (PropertyInfo toProperty in toObject.GetType().GetProperties()) { PropertyInfo fromProperty = fromObjectType.GetProperty(toProperty.Name); if (fromProperty != null) // match found { // check types var fromType = fromProperty.PropertyType.UnderlyingSystemType; var toType = toProperty.PropertyType.UnderlyingSystemType; if (toType.IsAssignableFrom(fromType)) { toProperty.SetValue(toObject, fromProperty.GetValue(fromObject, null), null); } } } return toObject; } This is working great for non boxed types, but Nullable<T> returns false when I call toType.IsAssignableFrom(fromType) because its type is Nullable<T> and is not the underlying type T. I read here that GetType() should unbox the Nullable<T> so it returns T but if I call that on PropertyInfo.PropertyType I get ReflectedMemberInfo and not the type T im looking for. I think im missing something obvious here, so I thought I would throw it open to SO to get some advice. Anyone have any ideas? Thanks, Jamee

    Read the article

  • Efficiently making web pages from multiple servers

    - by james.bcn
    I want to create a service that allows diverse web site owners to integrate material from my web servers into content served from their own servers. Ideally the resulting web page would only be delivered from the web site owners server, and the included content would be viewed as being part of the site by Google - which I think would rule out iframes or client-side Javascript to get the content from my server (although I may be wrong about that?). Also the data wouldn't actually be updated that often, say once a day, so it would be inefficient to get the data from my web servers with every request. Finally, the method needs to be as simple as possible so that it is easy for web site owners to integrate into their own sites. Are there any good methods for doing this sort of thing? If not then I guess the simple way is with iframes or Javascript.

    Read the article

  • Getting "value is not defined" while inheriting a type

    - by James Black
    I can't see what I am doing wrong, as the files are in the correct order. In this case it is: BaseDAO.fs CreateDatabase.fs They are in the same namespace, but even when I had them in different modules, and opened the module in CreateDatabase the same error. The error is: Error 1 The value or constructor 'execNonQuery' is not defined I am trying to inherit BaseDAO and use a member that will be common to several files, and I don't see why I get the error above. namespace RestaurantServiceDAO open MySql.Data.MySqlClient type BaseDAO() = let connString = @"Server=localhost;Database=mysql;Uid=root;Pwd=$$$$;" let conn = new MySqlConnection(connString) member self.execNonQuery(sqlStr) = conn.Open() let comm = new MySqlCommand(sqlStr, conn, CommandTimeout = 10) comm.ExecuteNonQuery |> ignore comm.Dispose |> ignore The type that does inherit is here, and execNonQuery is not defined. namespace RestaurantServiceDAO open MySql.Data.MySqlClient type CreateDatabase() = inherit BaseDAO() let createRestaurantTable conn = execNonQuery "CREATE TABLE restaurant(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, name VARCHAR(100), cur_timestamp TIMESTAMP(8))"

    Read the article

  • Signal processing or algorithmic programming for a PLC

    - by james singen smythe
    I have an application that takes voltages and temperatures as analog inputs and does some processing using an algorithm which involves signal processing such as low-pass filtering, exponential smoothing, and other steps which might typically be done in a high-level programming language such as C or C++. I'm curious how I could perform these same steps using a PLC, and in particular, the Allen-Bradley Control-Logix system? It seems to me that the instruction set with ladder logic is too limited for this. Could I perform this using structured text?

    Read the article

  • Why does output of fltk-config truncate arguments to gcc?

    - by James Morris
    I'm trying to build an application I've downloaded which uses the SCONS "make replacement" and the Fast Light Tool Kit Gui. The SConstruct code to detect the presence of fltk is: guienv = Environment(CPPFLAGS = '') guiconf = Configure(guienv) if not guiconf.CheckLibWithHeader('lo', 'lo/lo.h','c'): print 'Did not find liblo for OSC, exiting!' Exit(1) if not guiconf.CheckLibWithHeader('fltk', 'FL/Fl.H','c++'): print 'Did not find FLTK for the gui, exiting!' Exit(1) Unfortunately, on my (Gentoo Linux) system, and many others (Linux distributions) this can be quite troublesome if the package manager allows the simultaneous install of FLTK-1 and FLTK-2. I have attempted to modify the SConstruct file to use fltk-config --cflags and fltk-config --ldflags (or fltk-config --libs might be better than ldflags) by adding them like so: guienv.Append(CPPPATH = os.popen('fltk-config --cflags').read()) guienv.Append(LIBPATH = os.popen('fltk-config --ldflags').read()) But this causes the test for liblo to fail! Looking in config.log shows how it failed: scons: Configure: Checking for C library lo... gcc -o .sconf_temp/conftest_4.o -c "-I/usr/include/fltk-1.1 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_THREAD_SAFE -D_REENTRANT" gcc: no input files scons: Configure: no How should this really be done? And to complete my answer, how do I remove the quotes from the result of os.popen( 'command').read()? EDIT The real question here is why does appending the output of fltk-config cause gcc to not receive the filename argument it is supposed to compile?

    Read the article

  • Entity Framework connection metadata extraction

    - by James
    Hi, I am using the EntityFramework POCO adapter and since there are limitations to what microsoft gives access to with regards to the meta data, i am manually extracting the information i need out of the xml. The only problem is i want to get the ssdl, msl, csdl file names to load without having to directly check for the connection string node in app.config. In short where in the ObjectContext/EntityConnection can i get access to these file names? Worst case scenario i need to get the connection name from the EntityConnection object then load this from app.config and parse the string itself and extract the filenames myself. (But i obviously don't want to do that). Thanks

    Read the article

  • How do I check out Eclipse projects from CVS using the command line

    - by Jeff James
    Hi. I'm trying to check out the Mylyn project from Eclipse. However, I can't use Eclipse to check out the projects and am having to do it via the command line. I'm behind a firewall so am basing my attempt on http://wiki.eclipse.org/CVS_Howto#CVS_and_firewalls. I'm not very familiar with CVS. When I run my CVS command, it fails to connect: cvs -td :pserver:[email protected]:443/cvsroot/tools checkout mylyn -> main: Session ID is w4PO5KiMwQmaD6uu -> main loop with CVSROOT=/cvsroot/tools -> safe_location( where=(null) ) -> open_connection_to_server (:pserver:[email protected]:443/cvsroot/tools) -> Connecting to proxy.eclipse.org(206.191.52.48):443. cvs [checkout aborted]: unrecognized auth response from proxy.eclipse.org: SSH-1.99-OpenSSH_4.2 Can anyone tell me what I'm doing wrong? Thanks

    Read the article

  • Array of Objects

    - by James
    Complete and utter neophyte to Objective-C and the entire Mac platform so don't flame me please =). Basically I'm trying to create a simple game. The game has a board which I've created a class for and a board is comprised of squares which I also created a class for (board and square respectively). In my view controller I'm trying to instantiate a board and add boardSize^2 squares to said object. board contains an NSMutableArray *squares. I've also created a convenience method which sets an NSNumber *boardSize called initWithDimension. In my touchesBegan handler I have the following: board *game_board = [[board alloc] initWithDimension:10]; int size = [game_board.boardSize intValue]; for(int i = 0; i <= size; i++) { square *s = [[square alloc] init]; [game_board.squares addObject:s]; [s release]; } NSLog(@"%i", size); NSLog(@"%@", [game_board.squares objectAtIndex:0]); ...and I'm getting 10 (as expected) and then (null). This is probably glaringly obvious to an experienced developer, I've just struggled for an hour trying to solve it and have given up. I've tried it without the [s release] as well, same result. I've also imported square.h and board.h. Any ideas what's wrong here? Any other comments on what I'm brutalizing? Thanks.

    Read the article

  • Changing API level Android Studio

    - by James B
    I want to change the minimum SDK version in Android Studio from API 12 to API 14. I have tried changing it in the manifest file, i.e., <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="18" /> and rebuilding the project, but I still get the Android Studio IDE throwing up some errors. I presume I have to set the min SDK in 'project properties' or something similar so the IDE recognises the change, but I can't find where this is done in Android Studio. Pointers greatly appreciated. Thnx.

    Read the article

  • Reformat SQLGeography polygons to JSON

    - by James
    I am building a web service that serves geographic boundary data in JSON format. The geographic data is stored in an SQL Server 2008 R2 database using the geography type in a table. I use [ColumnName].ToString() method to return the polygon data as text. Example output: POLYGON ((-6.1646509904325884 56.435153006374627, ... -6.1606079906751 56.4338050060666)) MULTIPOLYGON (((-6.1646509904325884 56.435153006374627 0 0, ... -6.1606079906751 56.4338050060666 0 0))) Geographic definitions can take the form of either an array of lat/long pairs defining a polygon or in the case of multiple definitions, an array or polygons (multipolygon). I have the following regex that converts the output to JSON objects contained in multi-dimensional arrays depending on the output. Regex latlngMatch = new Regex(@"(-?[0-9]{1}\.\d*)\s(\d{2}.\d*)(?:\s0\s0,?)?", RegexOptions.Compiled); private string ConvertPolysToJson(string polysIn) { return this.latlngMatch.Replace(polysIn.Remove(0, polysIn.IndexOf("(")) // remove POLYGON or MULTIPOLYGON .Replace("(", "[") // convert to JSON array syntax .Replace(")", "]"), // same as above "{lng:$1,lat:$2},"); // reformat lat/lng pairs to JSON objects } This is actually working pretty well and converts the DB output to JSON on the fly in response to an operation call. However I am no regex master and the calls to String.Replace() also seem inefficient to me. Does anyone have any suggestions/comments about performance of this?

    Read the article

  • PHP preg_replace - Don't match within h1 tags

    - by James
    Hi there. I am using preg_replace to add a link to keywords if they are found within a long HTML string. I don't want to add a link if the keyword is found within h1 tags or strong tags. The below regex nearly works and basically says (I think): If the keyword is not immediately wrapped by either a h1 tag or a strong tag then replace with the keyword that was matched, as a bolded link to google. $result = preg_replace('%(?!<h1>)(?!<strong>)\b(bobs widgets)\b(?!<\/strong>)(?!<\/h1>)%i','<a href="http://www.google.com"><strong>$1</strong></a>', $result, -1); (the reason I don't want to match if in strong tags is because I am recursing through a lot of keywords so don't want to link an already linked keyword on subsequent passes) the above works fine and won't match: <h1>bobs widgets</h1> It will however match the keyword in the following text, because the h1 tag isn't immediately either side of the keyword: <h1>Here are bobs widgets for sale</h1> I need to make the spaces either side optional and have tried adding \s* but that doesn't get me anywhere. I'd be very grateful for a push in the right direction here.

    Read the article

  • How can I convert data encoded in WE8MSWIN1252 to utf8 for use in Python scripts?

    - by James Dean
    This data comes from an Oracle database and is extracted to flatfiles in encoding 'WE8MSWIN1252'. I want to parse the data and do some analysis. I want to see the text fields but do not need to publish the results to any other system so if some characters do not get converted perfectly I do not have a problem with that. I just do not want my parsing to fail with a decode error which is what I get if I use: inputFile = codecs.open( dataFileName, "r", "utf-8'")

    Read the article

  • Execute javascript on IIS server

    - by James Westgate
    I have the following situation. A customer uses JavaScript with jQuery to create a complex website. We would like to use JavaScript and jQuery on the server (IIS) for the following reasons: Skills transfer - we would like to use JavaScript and jQuery on the server and not have to use eg VB Script. / classic asp. .Net framework/Java etc is ruled out because of this. Improved options for search/accessibility. We would like to be able to use jQuery as a templating system, but this isn't viable for search engines and users with js turned off - unless we can selectively run this code on the server. There is significant investment in IIS and Windows Server, so changing that is not an option. I know you can run jScript on IIS using windows Script host, but am unsure of the scalability and the process surrounding this. I am also unsure whether this would have access to the DOM. Here is a diagram that hopefully explains the situation. I was wondering if anyone has done anything similar?

    Read the article

< Previous Page | 38 39 40 41 42 43 44 45 46 47 48 49  | Next Page >