Search Results

Search found 2762 results on 111 pages for 'michael turner'.

Page 65/111 | < Previous Page | 61 62 63 64 65 66 67 68 69 70 71 72  | Next Page >

  • preg_match , regexp , php , ignore white spaces and new lines

    - by Michael
    I'm trying to extract richard123 using php preg_replace but there are a lot of white spaces and new lines and I think because of that my regexp doesn't work . The html can be seen here : http://pastebin.com/embed_iframe.php?i=vuD3z9ij My current preg_match is : $find = "/< tr bgcolor=\"F0F0F0\" valign=\"middle\">< td align=\"left\">< font size=\"-1\">(.*)<\/font><\/td>/"; preg_match_all($find, $res, $matches2); print_r($matches2); I also tried <\/td/s"; <\/td/m"; <\/td/x"; but doesn't work either .

    Read the article

  • Methods in super that will be subclassed anyway (Cocoa)

    - by Michael Matheus
    Sorry if this is a repost but I couldn't quite search for it because I can't explain it in a few words. I have a super class with lots of methods but they will always (not all of them) be subclassed. From the super I need to access (read only) those methods. I could either leave the methods in super empty or I could just not type them in super but call them anyway like so [self myMethod] and it will call my subclassed method even if it doesn't exist in super. This works but Xcode gives me an error though. 'superclass' may not respond to '-subclassmethod' What should I do?

    Read the article

  • Accessing resources in the package of an application created with xcode/cocoa

    - by Michael Minerva
    I am trying to make a simple that needs to create an NSImage and I want to put the .png file in the resources of my package contents. I added the .png file to my resources directory in Xcode and when I create the applicaiton the .png file shows up in my resources inside package contents but I am havhing trouble figuring out how to reference file here is what I tried: [image initWithContentsOfFile:@"resources/draw-button.png"]; I figured that my package contents would be my current directory so I thought this would work, but it does. How do I reference my resources directory?

    Read the article

  • shell function and environment

    - by Michael
    How in Makefile export variable first then make another variable's expansion? somevar := apple export somevar update = $(shell perl -e 'print "$$ENV{somevar}"') all: @echo $(update) For some reason the expansion takes place first, then export. As a result the output is empty.

    Read the article

  • mySql table returning JSON that needs formatting for a iPhone UITableview

    - by Michael Robinson
    I have a php query the returns the following JSON format from a table. [{"memberid":"18", "useridFK":"30", "loginName":"Johnson", "name":"Frank", "age":"23", "place":"School", }, It needs the following format: [{"memberid":"18" { "useridFK":"30", "loginName":"Johnson", "name":"Frank", "age":"23", "place":"School",} }, I can figure out where/how to convert this, Where would I create the formatting following: (1) In the php return? (2) the JSON instructions for deserialization? or (3) Some kinb of Obj-C coding instruction? My end use is a simple Drill Down table using the NSObject, so when I select "memberid" row, I'll get the child/detail list on the next UITableview. My Data.plist will look like the following: Root: Dictionary V Rows: Array V Item 0: Dictionary Title: String 18 V Children Array V Item 0 Dictionary Title String 30 etc. Thanks in advance, this site rocks.

    Read the article

  • CSS precedence order? My lecture slides are correct or not?

    - by Michael Mao
    Hi all: I've noticed that there are a couple of similar questions and answers at SO already, but let me clarify my specific question here first: I've got lecture slides which states like this: To be frank, I haven't heard of this rule of css precedence myself, and I googled to find something with similar topic but not quite like that : here To have a test myself, I've made a test page on my own server here After running it on FireFox 3.6.3, I am sure it does not show the way as it should be, according to the statement in lecture slides: imported stylesheet ? am I doing it wrong? I cannot see its effect using FireBug it says that embedded stylesheet has a higher precedence over linked/imported stylesheets, however, it doesn't work, if I put the linked/imported tag AFTER that. inline style vs html attributes ? I've got an image where I firstly set its inline style to control the width and height, then use direct html attributes width/height to try modifying that, but failed... Below is the source code : <html> <head> <style type="text/css"> #target { border : 2px solid green; color : green; } </style> <link rel="stylesheet" href="./linked.css" type="text/css" media="screen" /> </head> <body> <div id="target">A targeted div tag on page.</div> <img src="cat.jpg" alt="" style="width : 102px; height : 110px;" width="204px" height="220px" /> </body> </html> Can any experienced CSS guys help me figure out if the slide is correct or not? Frankly speaking, I am puzzled myself, as I can clearly see some other "incorrect" statements here and there amongst the slides, such as JavaScript is on client-side (how about server-side JavaScript?) and "Embedded styles are in the head section of a web page "(what the heck? I am not allowed to put it inside the body tag?) Sorry about this silly question, the exam is on TOMORROW, and I now see a lot of things to think about :)

    Read the article

  • AccessControlException: access denied - caller function failed to load properties file

    - by Michael Mao
    Hi all: I am having a jar archive environment which is gonna call my class in a folder like this: java -jar "emarket.jar" ../tournament 100 My compiled class is deployed into the ../tournament folder, this command runs well. After I changed my code to load a properties file, it gets the following exception message: Exception in thread "main" java.security.AccessControlException: access denied (java.io.FilePermission agent.properties read) at java.security.AccessControlContext.checkPermission(Unknown Source) at java.security.AccessController.checkPermission(Unknown Source) at java.lang.SecurityManager.checkPermission(Unknown Source) at java.lang.SecurityManager.checkRead(Unknown Source) at java.io.FileInputStream.<init>(Unknown Source) at java.io.FileInputStream.<init>(Unknown Source) at Agent10479475.getPropertiesFromConfigFile(Agent10479475.java:110) at Agent10479475.<init>(Agent10479475.java:100) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at java.lang.Class.newInstance0(Unknown Source) at java.lang.Class.newInstance(Unknown Source) at emarket.client.EmarketSandbox.instantiateClientObjects(EmarketSandbox.java:92) at emarket.client.EmarketSandbox.<init>(EmarketSandbox.java:27) at emarket.client.EmarketSandbox.main(EmarketSandbox.java:166) I am wondering why this security checking will fail. I issue the getPropertitiesFromConfigFile() function inside my class's default constructor, like this: public class Agent10479475 extends AbstractClientAgent { //default constructor public Agent10479475() { //set all properties to their default values in constructor FT_THRESHOLD = 400; FT_THRESHOLD_MARGIN = 50; printOut("Now loading properties from a config file...", ""); getPropertiesFromConfigFile(); printOut("Finished loading",""); } private void getPropertiesFromConfigFile() { Properties props = new Properties(); try { props.load(new FileInputStream("agent.properties")); FT_THRESHOLD = Long.parseLong(props.getProperty("FT_THRESHOLD")); FT_THRESHOLD_MARGIN = Long.parseLong(props.getProperty("FT_THRESHOLD_MARGIN ")); } catch(java.io.FileNotFoundException fnfex) { printOut("CANNOT FIND PROPERTIES FILE :", fnfex); } catch(java.io.IOException ioex) { printOut("IOEXCEPTION OCCURED :", ioex); } } } My class is loading its own .properties file under the same folder. why would the Java environment complains about such a denial of access? Must I config the emarket.client.EmarketSandbox class, which is not written by me and stored inside the emarket.jar, to access my agent.properties file? Any hints or suggestions is much appreciated. Many thanks in advance.

    Read the article

  • XMLHttpRequest fails in observer method

    - by Michael
    I'm developing a Firefox extension and this code belongs to javascript module. var ajax = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance(); ajax.open('GET', "http://www.google.com", true); ajax.onload = function () { Reader.log("Got News"); }; ajax.onerror = function () { Reader.log("Got Error"); }; ajax.send(null); This small code always fails (onerror) if calling from observe method invoked by preference "@mozilla.org/preferences-service;1" Anyone knows how to make this work in observe method?

    Read the article

  • Absolutely positioned div on right causing scrollbar when the left doesn't

    - by Michael Snyder
    I'm trying to "flank" a centered div with some design elements that are absolutely positioned outside the main div's width. I'm getting a scroll bar due to the element on the right, but not the element on the left (IE6/7/8, Chrome, Firefox). How can I get rid of that horizontal scrollbar? <html> <head> <style type="text/css"> html, body { height: 100%; width: 100%; margin: 0; } body { text-align: center; } .wrapper { margin: 0 auto; position: relative; width: 960px; z-index: 0; } .main { background: #900; height: 700px; } .right, .left { position: absolute; height: 100px; width: 100px; } .right { background: #090; top: 0px; left: 960px; z-index: 1; } .left { background: #009; top: 0px; left: -100px; z-index: 1; } </style> </head> <body> <div class="wrapper"> <div class="main"></div> <div class="left"></div> <div class="right"></div> </div> </body> </html>

    Read the article

  • Redefining PHP function?

    - by Michael
    If I have a function: function this($a){ return $a; } If I wanted to redefine the function, would it be as simple as rewriting it? function this($a, $b){ //New this function return $a * $b; }

    Read the article

  • Access: Reading deleted record buffer

    - by Michael Itzoe
    According to the Access (2003) documentation, when you delete a record, it's placed in a buffer, then the BeforeDeleteConfirm event is raised, then the AfterConfirmDelete ad Delete events. In my table if a record is deleted, I need to add one of its field values (a quantity value) to a field in another table. I tried setting the quantity to a private variable in the Current event, but as soon as I delete click delete, it looks like the Current event fires again and resets my variable. How can I access the value of a field in a deleted record?

    Read the article

  • razor websites not working and all dlls are present

    - by Michael Tot Korsgaard
    I've uploaded a .cshtml website to a surftown server, and I got some problems running the code. But I have a problem with it running the Razor code. This is how the page renders:(Default.cshtml) I've already checked for internal communication problems. And this is my result: But then why isn't it working, and how can I fix it? I've heard that it can be a problem with views but how whould I fix this if that's the case? My websites folder tree: (And some files too) App_Code App_Data packages Microsoft.AspNet.Razor.2.0.20710.0 Microsoft.Asp.Net.WebPages.2.0.20710.0 Microsoft.Asp.Net.WebPages.Administration.2.0.20710.0 Microsoft.Asp.Net.WebPages.Data.2.0.20710.0 Microsoft.Asp.Net.WebPages.WebData.2.0.20710.0 Microsoft.Web.Infrastructure.1.0.0.0 NuGet.Core.1.6.2 bin packages jQuery.2.0.3 Content Scripts Tools Microsoft.AspNet.Mvc.4.0.30506.0 lib net40 Microsoft.AspNet.Razor.2.0.30506.0 lib net40 Microsoft.AspNet.WebPages.2.0.30506.0 lib net40 Pages Chapters Read.cshtml Edit Move Chapter.cshtml Entry.cshtml Entries EnterEntry.cshtml EnterNote.cshtml Login Login.cshtml Search Result.cshtml Scripts Addons TinyMCE Styles CSS Views _Layout.cshtml Default.cshtml My web.config file looks like this: <?xml version="1.0"?> <configuration> <system.web> <compilation debug="true" targetFramework="4.0"> <buildProviders> <add extension=".cshtml" type="System.Web.WebPages.Razor.RazorBuildProvider, System.Web.WebPages.Razor"/> </buildProviders> <assemblies> <add assembly="System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> </assemblies> </compilation> </system.web> <connectionStrings> <add connectionString="database connection" providerName="System.Data.SqlClient"/> </connectionStrings> </configuration> EDIT: Is it a problem that all my files are .cshtml?

    Read the article

  • Display of colorblind images

    - by Michael
    Quick question: At this website here http://www.vischeck.com/examples/ there are a few pictures of numbers hidden within another color to test for color blindness. Is there any way that these images can be generated algorithmically?

    Read the article

  • How to use the correct Google OpenID url to login to my site?

    - by Michael Mao
    Hello everyone: I am trying to implement OpenID as one preferred option to my next web app here The code is taken from this tutorial and works if I use my openID from myopenid.com However, I believe most people would just love to use their everyday email address as their openID, as far as I know, Google, Yahoo, and some other big players have already done this in their systems. My question is: how could I find the correct "url" to enter in the form to login? I used my Google OpenID account for StackOverflow and it works just fine. I try to copy my openID like this: www.google.com/accounts/o8/id?id=aitoawllano10bzdzp3ht0diffry0qt6_j2ls-m And paste it directly into my form, but it doesn't work. I also tried to remove the url parameter, but that won't do, either. Thanks a lot in advance for any tips and suggestions.

    Read the article

  • Subsonic in a VS2008 Add-In woes

    - by Michael Smit
    Hi, I am writing a VS2008 add-in that connects to a remote database blah blah. I am having a problem with the app.config in this project. When I use SubSonic in my code, it moans that is cannot find the SubSonicServer section. This is because the .config file cannot be found. This appears to a problem with paths as the add-in is a DLL running in the context of VS2008 and the working directory is C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE. Is there a way to get the app.config to deploy properly with the application so my add-in (and SubSonic) can find what it needs in the .config file, or is there a way to get SubSonic to work without the need for the .config? I am very experienced in SubSonic projects now, but only winforms, web, web service, and WPF applications. This is the first time I have tried to use SubSonic in a VS2008 Add-In project. I also have AppSettings in the config file which the ConfigurationManager cannot read because it cannot see the .config file. 2AM now and brain is tired of trying to figure this one out. Hopefully there is an answer when I wake up :) TIA

    Read the article

  • How to associate static entity instances in a Session without database retrieval

    - by Michael Hedgpeth
    I have a simple Result class that used to be an Enum but has evolved into being its own class with its own table. public class Result { public static readonly Result Passed = new Result(StatusType.Passed) { Id = [Predefined] }; public static readonly Result NotRun = new Result(StatusType.NotRun) { Id = [Predefined] }; public static readonly Result Running = new Result(StatusType.Running) { Id = [Predefined] }; } Each of these predefined values has a row in the database at their predefined Guid Id. There is then a failed result that has an instance per failure: public class FailedResult : Result { public FailedResult(string description) : base(StatusType.Failed) { . . . } } I then have an entity that has a Result: public class Task { public Result Result { get; set; } } When I save a Task, if the Result is a predefined one, I want NHibernate to know that it doesn't need to save that to the database, nor does it need to fetch it from the database; I just want it to save by Id. The way I get around this is when I am setting up the session, I call a method to load the static entities: protected override void OnSessionOpened(ISession session) { LockStaticResults(session, Result.Passed, Result.NotRun, Result.Running); } private static void LockStaticResults(ISession session, params Result[] results) { foreach (var result in results) { session.Load(result, result.Id); } } The problem with the session.Load method call is it appears to be fetching to the database (something I don't want to do). How could I make this so it does not fetch the database, but trusts that my static (immutable) Result instances are both up to date and a part of the session?

    Read the article

  • Opinion on "loop invariants", and are these frequently used in the industry?

    - by Michael Aaron Safyan
    I was thinking back to my freshman year at college (five years ago) when I took an exam to place-out of intro-level computer science. There was a question about loop invariants, and I was wondering if loop invariants are really necessary in this case or if the question was simply a bad example... the question was to write an iterative definition for a factorial function, and then to prove that the function was correct. The code that I provided for the factorial function was as follows: public static int factorial(int x) { if ( x < 0 ){ throw new IllegalArgumentException("Parameter must be = 0"); }else if ( x == 0 ){ return 1; }else{ int result = 1; for ( int i = 1; i <= x; i++ ){ result*=i; } return result; } } My own proof of correctness was a proof by cases, and in each I asserted that it was correct by definition (x! is undefined for negative values, 0! is 1, and x! is 1*2*3...*x for a positive value of x). The professor wanted me to prove the loop using a loop invariant; however, my argument was that it was correct "by definition", because the definition of "x!" for a positive integer x is "the product of the integers from 1... x", and the for-loop in the else clause is simply a literal translation of this definition. Is a loop invariant really needed as a proof of correctness in this case? How complicated must a loop be before a loop invariant (and proper initialization and termination conditions) become necessary for a proof of correctness? Additionally, I was wondering... how often are such formal proofs used in the industry? I have found that about half of my courses are very theoretical and proof-heavy and about half are very implementation and coding-heavy, without any formal or theoretical material. How much do these overlap in practice? If you do use proofs in the industry, when do you apply them (always, only if it's complicated, rarely, never)?

    Read the article

  • navigateToURL with GET parameters in local SWF

    - by Michael Brewer-Davis
    I'm running a Flex application locally (local-with-filesystem or local-trusted), and I'm trying to call navigateToURL to a local page using GET parameters. Flash Player seems to be ignoring the parameters when opening the local page, though. I've been scouring the Flash security pages to find a documented prohibition for this, but haven't found anything. Pointers? How would you work around this issue? My Flex app: <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"> <mx:Script> <![CDATA[ private function onClick(event:MouseEvent):void { var request:URLRequest = new URLRequest("target.html"); request.data = new URLVariables(); request.data.text = "stackoverflow.com"; navigateToURL(request); } ]]> </mx:Script> <mx:Button label="Go" click="onClick(event)" /> </mx:Application> And my target.html: <html> <head> <script language="JavaScript"> <!-- function showURL() { alert(window.location.href); } //--> </script> </head> <body onload="showURL()" /> </html>

    Read the article

  • Simulating a button press without performClick: (cocoa osx/cocotron)

    - by Michael Minerva
    I need to be able to display popup menu when I press an openGL object. I was able to accomplish this by triggering the performClick: of an inviible NSPopupButton and also by triggering the performClickWithFrame:inView: of an NSPopupButtonCell. Both of these methods were successful on OSX but I also need to target the PC and unfortunately performClickWithFrame:inView: is unimplemented in cocotron and performClick does not cause the menu to be displayed when executed on an NSPopupButton (on cocotron). Now there must be someway for this to work because the NSPopupButton does sucesfully display the NSPopupButtonCell when it is clicked but I know it does not accomplish by calling performClick:. Can I access these lower levels methods used by the NSPopupButton to display my menu or force the invisible NSPopupButton to display its menu? If so can anyone link me to some info about this?

    Read the article

  • APC values randomly disappear

    - by Michael
    I'm using APC for storing a map of class names to class file paths. I build the map like this in my autoload function: $class_paths = apc_fetch('class_paths'); // If the class path is stored in application cache - search finished. if (isset($class_paths[$class])) { return require_once $class_paths[$class]; // Otherwise search in known places } else { // List of places to look for class $paths = array( '/src/', '/modules/', '/libs/', ); // Search directories and store path in cache if found. foreach ($paths as $path) { $file = DOC_ROOT . $path . $class . '.php'; if (file_exists($file)) { echo 'File was found in => ' . $file . '<br />'; $class_paths[$class] = $file; apc_store('class_paths', $class_paths); return require_once $file; } } } I can see as more and more classes are loaded, they are added to the map, but at some point the apc_fetch returns NULL in the middle of a page request, instead of returning the map. Getting => class_paths Array ( [MCS\CMS\Helper\LayoutHelper] => /Users/mbl/Documents/Projects/mcs_ibob/core/trunk/src/MCS/CMS/Helper/LayoutHelper.php [MCS\CMS\Model\Spot] => /Users/mbl/Documents/Projects/mcs_ibob/core/trunk/src/MCS/CMS/Model/Spot.php ) Getting => class_paths {null} Many times the cached value will also be gone between page requests. What could be the reason for this? I'm using APC as an extension (PECL) running PHP 5.3.

    Read the article

  • Shortcut for rake db:migrate:down for ruby-on-rails

    - by Michaël
    Hi, I want to know if there is a short way to do the migrations down equivalent to rake db:migrate (for the migrations up). Instead of doing : rake db:migrate:up VERSION=1, rake db:migrate:up VERSION=2, ... we can do : rake db:migrate! But for : rake db:migrate:down VERSION=10, rake db:migrate:down VERSION=..., rake db:migrate:down VERSION=1, is there a shortcut? Tank you for your help!

    Read the article

  • JDO difficulties in retrieving persistent vector

    - by Michael Omer
    I know there are already some posts regarding this subject, but although I tried using them as a reference, I am still stuck. I have a persistent class as follows: @PersistenceCapable(identityType = IdentityType.APPLICATION) public class GameObject implements IMySerializable{ @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) protected Key m_databaseKey; @NotPersistent private final static int END_GAME_VAR = -1000; @Persistent(defaultFetchGroup = "true") protected GameObjectSet m_set; @Persistent protected int m_databaseType = IDatabaseAccess.TYPE_NONE; where GameObjectSet is: @PersistenceCapable(identityType = IdentityType.APPLICATION) @FetchGroup(name = "mySet", members = {@Persistent(name = "m_set")}) public class GameObjectSet { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Key id; @Persistent private Vector<GameObjectSetPair> m_set; and GameObjectSetPair is: @PersistenceCapable(identityType = IdentityType.APPLICATION) public class GameObjectSetPair { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Key id; @Persistent private String key; @Persistent(defaultFetchGroup = "true") private GameObjectVar value; When I try to fetch the entire structure by fetching the GameObject, the set doesn't have any elements (they are all null) I tried adding the fetching group to the PM, but to no avail. This is my fetching code Vector<GameObject> ret = new Vector<GameObject>(); PersistenceManager pm = PMF.get().getPersistenceManager(); pm.getFetchPlan().setMaxFetchDepth(-1); pm.getFetchPlan().addGroup("mySet"); Query myQuery = pm.newQuery(GameObject.class); myQuery.setFilter("m_databaseType == objectType"); myQuery.declareParameters("int objectType"); try { List<GameObject> res = (List<GameObject>)myQuery.execute(objectType); ret = new Vector<GameObject>(res); for (int i = 0; i < ret.size(); i++) { ret.elementAt(i).getSet(); ret.elementAt(i).getSet().touchSet(); } } catch (Exception e) { } finally { pm.close(); } Does anyone have any idea? Thanks Mike

    Read the article

< Previous Page | 61 62 63 64 65 66 67 68 69 70 71 72  | Next Page >