Search Results

Search found 4473 results on 179 pages for 'mark fish'.

Page 79/179 | < Previous Page | 75 76 77 78 79 80 81 82 83 84 85 86  | Next Page >

  • Get Const / Static Name from Function / Method Call.

    - by Mark Tomlin
    I want to find the token's name passed by augment into a function. class Norm { const STR_NORM = 0; const INT_NORM = 0; } function foo($Arg1, $Arg2 = NULL) { getConstName($Arg1); # Should Return STR_NORM; return $Arg1, $Arg2; } echo foo(Norm::STR_NORM); Is there any way to impalement getConstName via the PHP Reflection API?

    Read the article

  • Mysql - Rank field for a query

    - by Mark
    How can I add a field that contains a rows rank within the result set of a query? Initially I used php to rank my results as it was all on a single page. Now I have added multiple pages so now even though I am on the second page the first result on the page is still '1st'. Obviously I could multiply the page number by the number of results per page and add the result number but I imagine there is a better way within the query. Thanks,

    Read the article

  • DataGridView: how to focus the whole row instead of a single cell?

    - by Tomas Sedovic
    I'd like to use the DataGridView control as a list with columns. Sort of like ListView in Details mode but I want to keep the DataGridView flexibility. ListView (with Details view and FullRowSelect enabled) highlights the whole line and shows the focus mark around the whole line: DataGridView (with SelectionMode = FullRowSelect) displays focus mark only around a single cell: So, does anyone know of some (ideally) easy way to make the DataGridView row selection look like the ListView one? I'm not looking for a changed behaviour of the control - I only want it to look the same. Ideally, without messing up with the methods that do the actual painting.

    Read the article

  • jQuery: How to remove this code redundancy?

    - by Mark
    clone.find('[id]').each(function() { id = $(this).attr('id'); ind = id.search(/\d+$/); $(this).attr('id', id.substr(0,ind)+id_counter); }); clone.find('[for]').each(function() { id = $(this).attr('for'); ind = id.search(/\d+$/); $(this).attr('for', id.substr(0,ind)+id_counter); }); I know I can find elements that have either the id attribute or the for attribute, but then how do I know which one I need to set?

    Read the article

  • Running Services.msc as a different User C#

    - by Simon Mark Smith
    Hi, I have a requirement to create a simple windows forms application that allows an admin user to manage the Services on remote servers. We don't want to give the admins the usernames and passwords to the servers so these will be encrypted and stored in a database. My question is whether or not it is possible to spawn a Services.msc window when impersonating one of the users stored within the database? I have looked at the ProcessStartInfo class but because Services.msc is not an executable it does not seem to like executing this. Any ideas on a simple way of doing the actual impersonation and loading of Services.msc - say off a button click? Thanks

    Read the article

  • Using Python simplejson for transmitting JSON to another server results in unicode encoding problems

    - by Mark
    Hi there, I'm encoding a string with Python's simplejson library with special characters: hello testing spécißl characters plusses: +++++ special chars :œ?´®†¥¨ˆøp“ß?ƒ©??°¬O˜çv?˜µ== However, when I encode it and transmit it to the other machine (using POST), it turns out like this: {'message': ['{"body": "hello testing sp\\u00e9ci\\u00dfl characters\\n\\nplusses: \\n\\nspecial chars :\\u0153\\u2211\\u00b4\\u00ae\\u2020\\u00a5\\u00a8\\u02c6\\u00f8\\u03c0\\u201c\\u00df\\u2202\\u0192\\u00a9\\u02d9\\u2206\\u02da\\u00ac\\u03a9\\u2248\\u00e7\\u221a\\u222b\\u02dc\\u00b5\\u2264\\u2265"}']} The + signs are completely stripped and the rest are in this unicode(?) format. My code for this is: data = {'body': data_string} data_encoded = json.dumps(data) Any ideas? Thanks! Edit: I've tried using json.dumps(data, ensure_ascii=False) but it results in a UnicodeError ordinal not in range error.

    Read the article

  • How To Add Custom ModelValidatorProviders To Web API Project?

    - by Mark S.
    I'm moving some MVC code to Web API and I need to update my custom ModelValidatorProviders. It seems as though my validators can stay much the same only they should inherit the System.Web.Http.Validation namespace. What I can't figure out is how to add the provider to Web API. When using MVC I can just add the following to my global.asax: ModelValidatorProviders.Providers.Add(new CustomModelValidatorProvider()); How do I use the custom provider with Web API?

    Read the article

  • Drupal CCK Text field not saving.

    - by Mark Milbourne
    Hey Guys, I've been trying to write a CCK Field based on the Text field. But if I create a standard CCK Text field with only 1 value. Then edit a content item for this type, the values are never persisted. When I go back in and edit the same node, the value isn't there. I checked the database and its not in the table for the CCK node. If I use more than one value it works fine. I'm upto date on CCK (6.x-2.6) and CTools (6.x-1.5). Has anyone seen this? and a possible solution?

    Read the article

  • When marking an item (changing background color) in ListView it's repeating for other items.

    - by Adi
    If I want to mark the second item I'm doing the following code: This code is from my Adapter that extends ArrayAdapter : if (convertView == null) { LayoutInflater mInflater = (LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); convertView = mInflater.inflate(R.layout.channel_list, null); } MyContent o = items.get(position); if (o != null) { TextView tt = (TextView) convertView.findViewById(R.id.toptext); TextView bt = (TextView) convertView.findViewById(R.id.bottomtext); if (tt != null) { tt.setText(o.Top()); } if(bt != null){ bt.setText(o.Bottom()); } if(position == 2) { convertView.setBackgroundColor(R.color.selectem_color); } } return convertView; It will show the list view but mark every 9'th item after this item (the 11'th item 13'th and so on). Does anyone know what's the reason?

    Read the article

  • drupal module, check if node type

    - by Mark
    As a more specific take on this question: http://stackoverflow.com/questions/2985518/drupal-jquery-1-4-on-specific-pages How do I check, inside a module, whether or not a node is a certain type to be able to do certain things to the node. Thanks

    Read the article

  • What does the C# operator => mean?

    - by Mr. Mark
    Answers to a recent post (Any chances to imitate times() Ruby method in C#?) use the = operator in the usage examples. What does this operator do? I can't locate it in my C# book, and it is hard to search for symbols like this online. (I couldn't find it.)

    Read the article

  • MySQL managing catalogue views

    - by Mark Lawrence
    A friend of mine has a catalogue that currently holds about 500 rows or 500 items. We are looking at ways that we can provide reports on the catalogue inclduing the number of times an item was viewed, and dates for when its viewed. His site is averaging around 25,000 page impressions per month and if we assumed for a minute that half of these were catalogue items then we'd assume roughly 12,000 catalogue items viewed each month. My question is the best way to manage item views in the database. First option is to insert the catalogue ID into a table and then increment the number of times its viewed. The advantage of this is its compact nature. There will only ever be as many rows in the table as there are catalogue items. `catalogue_id`, `views` The disadvantage is that no date information is being held, short of maintaining the last time an item was viewed. The second option is to insert a new row each time an item is viewed. `catalogue_id`, `timestamp` If we continue with the assumed figure of 12,000 item views that means adding 12,000 rows to the table each month, or 144,000 rows each year. The advantage of this is we know the number of times the item is viewed, and also the dates for when its viewed. The disadvantage is the size of the table. Is a table with 144,000 rows becoming too large for MySQL? Interested to hear any thoughts or suggestions on how to achieve this. Thanks.

    Read the article

  • Checkboxes in ADF are initially null, where I want them to be 0

    - by Mark Tielemans
    I am using ADF in JDeveloper and don´t have any experience with either of the two. Now I´ve run into quite some trouble yet, but for this particular thing I decided to consult the wisom of stackoverflow. The thing is, I have an edit form for an object that contains 3 checkboxes. The checked values are set to 1, unchecked to 0. In my database, the values are NOT NULL, and I want to keep it that way. The thing is, in the edit form, if the user submits the form leaving any boxes unchecked, it will result in an error, because the unchecked box values apparently remain null. Only after checking and then unchecking the boxes again, their values will be '0' rather than null. I've tried some things, including making the attributes mandatory in the domain BCD, but that just gives a bit more neat error message.. Any help would be greatly appreciated!! EDIT I made a little progress thanks to the guide provided by Joe, but still run into problems. I changed the values that should be checkboxes in my model, making them BOOLEANs where the table columns are NUMBERs (All are also mandatory and have a default value of 0). This automatically changed the corresponding View Object too. In the Application module, this now works great. It shows checkboxes, a checked one will return 1, an untouched one will return 0. However, I deleted the old form, and inserted a new one using the corresponding Data Control. I gave these values the checkbox type. I still had to edit the bindings (which I think reflects the problem, as this is not the case with, say, a model-level defined LOV) and gave them 1 for checked and 0 for unchecked. However, now apart from the original problem still occurring, also the checkboxes cannot be unchecked after checking, and return 0 when checked (and null when left untouched). Even though this has created new problems, it works correctly in my AM. Does someone know what I'm doing wrong in my Swing form?

    Read the article

  • How do I clear a WebView's content before loading a page?

    - by Mark
    I have an embedded WebView in my Cocoa application in which I load an external web page. Each time the user clicks on a button, the view opens and shows the page. The problem is that the second time the user opens the WebView, the previous page is still visible. Instead I'd like to show a blank/empty page (together with a progress indicator). How can I clear a WebView before loading a new page? The closest solution I could find was to call this: [webView stringByEvaluatingJavaScriptFromString:@"document.open();document.close()"]; Is there a better way to do this? Thanks!

    Read the article

  • DispatcherOperations.Wait()

    - by Mark
    What happens if you call dispatcherOperation.Wait() on an operation that has already completed? Also, the docs say that it returns a DispatcherOperationStatus, but wouldn't that always be Completed since it (supposedly) doesn't return until it's done? I was trying to use it like this: private void Update() { while (ops.Count > 0) ops.Dequeue().Wait(); } public void Add(T item) { lock (sync) { if (dispatcher.CheckAccess()) { list.Add(item); OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, item)); } else { ops.Enqueue(dispatcher.BeginInvoke(new Action<T>(Add), item)); } } } I'm using this in WPF, so all the Add operations have to occur on the UI thread, but I figured I could basically just queue them up without having to wait for it to switch threads, and then just call Update() before any read operations to ensure that the list is up to date, but my program started hanging.

    Read the article

  • Large static arrays are slowing down class load, need a better/faster lookup method

    - by Visualize
    I have a class with a couple static arrays: an int[] with 17,720 elements a string[] with 17,720 elements I noticed when I first access this class it takes almost 2 seconds to initialize, which causes a pause in the GUI that's accessing it. Specifically, it's a lookup for Unicode character names. The first array is an index into the second array. static readonly int[] NAME_INDEX = { 0x0000, 0x0001, 0x0005, 0x002C, 0x003B, ... static readonly string[] NAMES = { "Exclamation Mark", "Digit Three", "Semicolon", "Question Mark", ... The following code is how the arrays are used (given a character code). [Note: This code isn't a performance problem] int nameIndex = Array.BinarySearch<int>(NAME_INDEX, code); if (nameIndex > 0) { return NAMES[nameIndex]; } I guess I'm looking at other options on how to structure the data so that 1) The class is quickly loaded, and 2) I can quickly get the "name" for a given character code. Should I not be storing all these thousands of elements in static arrays?

    Read the article

  • Forced naming of parameters in python

    - by Mark Mayo
    In python you may have a function definition: def info(object, spacing=10, collapse=1) which could be called in any of the following ways: info(odbchelper) info(odbchelper, 12) info(odbchelper, collapse=0) info(spacing=15, object=odbchelper) thanks to python's allowing of any-order arguments, so long as they're named. The problem we're having is as some of our larger functions grow, people might be adding parameters between spacing and collapse, meaning that the wrong values may be going to parameters that aren't named. In addition sometimes it's not always clear as to what needs to go in. We're after a way to force people to name certain parameters - not just a coding standard, but ideally a flag or pydev plugin? so that in the above 4 examples, only the last would pass the check as all the parameters are named. Odds are we'll only turn it on for certain functions, but any suggestions as to how to implement this - or if it's even possible would be appreciated.

    Read the article

  • jQuery Running a function in a context and adding to a variable

    - by Mark
    For this question I'm going to give a simplified example of what I want to do, and the function I want to learn to write. var collection = ''; <div id='container'> <span>1</span> <span>2</span> <span>3</span> </div> What I want to do this, for every span in the div, take its text, add it to the collection. So ideally it would look like: $('#container').addtoCollection(collection); The method would be something like: $(this).find('span').each(function () { collection = collection + $(this).text(); }). Where the first this would equal #container. So in the end you can do: console.log(collection); and get: 123 How do I write the function that does this? Thanks!

    Read the article

  • simple fbml fb:login-button is not rendering in ie6

    - by Mark
    The following codes works in FF and Chrome, but IE6 does not render the connect button. What am I missing here? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml"> <head> <title></title> </head> <body> <fb:login-button>Login button</fb:login-button> <script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" type="text/javascript"></script> <script type="text/javascript"> FB_RequireFeatures(["XFBML"], function(){ FB.Facebook.init("API_KEY", "/xd_receiver.htm"); }); </script> </body> </html>

    Read the article

< Previous Page | 75 76 77 78 79 80 81 82 83 84 85 86  | Next Page >