Daily Archives

Articles indexed Sunday June 13 2010

Page 6/73 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • Is it possible to change UIBarButtonItem title and style in runtime?

    - by user262325
    Hello everyone In one project, I hope to change UIBarButtonItem and style in runtime editBarItemButton links to a UIBarButtonItem which original status are style:UIBarButtonItemStyleBordered title:Edit if I press the bar item button, it will execute the codes below: [editBarItemButton setStyle: UIBarButtonItemStyleDone]; [editTarBarItemButton setTitle:@"Done" ]; but neither the style nor title has changed. Welcome any comment Thanks interdev

    Read the article

  • Strange groovy behavior when dealing with threads

    - by Misha Koshelev
    Dear All: I have an interesting dilemma. If I define my class as: class Browser { def swtException protected Object evaluate(script) throws SWTException { swtException=null display.syncExec() { try { result=swtBrowser.evaluate(script) } catch (SWTException swtException) { Browser.swtException=swtException } } } I get this rather interesting error: Exception in thread "Thread-5" org.eclipse.swt.SWTException: Failed to execute runnable (groovy.lang.MissingPropertyException: No such property: swtException for class : com.mksoft.fbautomate.browser.Browser Possible solutions: swtException) Any ideas??? Thank you! Misha

    Read the article

  • what is the best way to analyze user raw query and detect what who want to search

    - by Sadegh
    hi, i am developing a very basic prototype of web search engine and now i want to know what is the best way to analyze user raw query and detect what who want to search. like Google, Bing, Yahoo etc... an example user query is something like this: Google+Maps+"South+Africa"+Brasil+OR+Italy+OR+Spain+-Argentina+Netherland and i want to splite this to a generic list of each term(single) like this: IEnumerable<KeyValuePair<TermType, string>> <TermType.All, "Google"> <TermType.All, "Maps"> <TermType.Exact, "South"> <TermType.Exact, "Africa"> <TermType.Any, "Brazil"> <TermType.Any, "Italy"> <TermType.Any, "Spain"> <TermType.None, "Argentina"> <TermType.None, "Netherland"> i don't want complete code, i want guidance, solution, tips or anything that's help me to write best for anylize user raw query. thanks in advance

    Read the article

  • Pear HTML BBcode Hyperlink

    - by rrrfusco
    Has anyone used the PEAR HTML BBcode Package? I don't really understand why hyperlink target _blank does not open a new tab in firefox. INSERT Snippet [url=http://site.com t=_blank]Link[/url] PHP Require PEAR require_once 'HTML/BBCodeParser.php'; $options = @parse_ini_file('BBCodeParser.ini'); $parser = new HTML_BBCodeParser($options); $parser->setText($text); $parser->parse(); echo $parser->getParsed(); BBCodeParser.ini [HTML_BBCodeParser] ; http://articles.sitepoint.com/article/bb-code-php-application/ ; possible values: single|double ; use single or double quotes for attributes quotestyle = double ; possible values: all|nothing|strings ; quote all attribute values, none, or only the strings quotewhat = all ; the opening tag character open = "[" ; the closing tag character close = "]" ; possible values: true|false ; use xml style closing tags for single html tags (<img> or <img />) xmlclose = true ; possible values: a comma seperated list of filters ; comma seperated list of filters to use filters = Basic,Extended,Links,Images,Lists ; filters = Basic,Extended,Links,Images,Lists,Email,MyBB

    Read the article

  • migrating moss 2007 to moss 2010

    - by Ali
    since we are having our MOSS 2007 on 32bit machine it is not possible to upgrade it to 2010 so i think to only way is to install fresh moss 2010 and then migrate the sites and webs from 2007 to 2010, what is the best way to do this?

    Read the article

  • Separating columnName and Value in C#

    - by KungfuPanda
    hi, I have a employee object as shown below class emp { public int EmpID { get; set; } public string EmpName { get; set; } public int deptID { get; set; } } I need to create a mapping either in this class or a different class to map the properties with column name of my SQL for eg. EmpdID="employeeID" EmpName="EmployeeName" deptID="DepartmentID" When from my asp.net page when I create the employee class and pass it to a function: for eg: emp e=new emp(); e.EmpID=1; e.EmpName="tommy"; e.deptID=10; When the emp object is populated and passed to the buildValues function it should return array of ComumnName(e.g.employeeID):Value(e.g.1),EmployeeName:tommy,DepartmentID:10) string[] values=buildValues(emp); public string[] buildValues(emp e) { string[] values=null; return values; } I have 2 questions: 1. Where do I specify the mappings 2. How do I use the mappings in my buildValues function shown above and build the values string array. I would really appreciate if you can help me with this

    Read the article

  • Implementing Skip List in C++

    - by trikker
    [SOLVED] So I decided to try and create a sorted doubly linked skip list... I'm pretty sure I have a good grasp of how it works. When you insert x the program searches the base list for the appropriate place to put x (since it is sorted), (conceptually) flips a coin, and if the "coin" lands on a then that element is added to the list above it(or a new list is created with element in it), linked to the element below it, and the coin is flipped again, etc. If the "coin" lands on b at anytime then the insertion is over. You must also have a -infinite stored in every list as the starting point so that it isn't possible to insert a value that is less than the starting point (meaning that it could never be found.) To search for x, you start at the "top-left" (highest list lowest value) and "move right" to the next element. If the value is less than x than you continue to the next element, etc. until you have "gone too far" and the value is greater than x. In this case you go back to the last element and move down a level, continuing this chain until you either find x or x is never found. To delete x you simply search x and delete it every time it comes up in the lists. For now, I'm simply going to make a skip list that stores numbers. I don't think there is anything in the STL that can assist me, so I will need to create a class List that holds an integer value and has member functions, search, delete, and insert. The problem I'm having is dealing with links. I'm pretty sure I could create a class to handle the "horizontal" links with a pointer to the previous element and the element in front, but I'm not sure how to deal with the "vertical" links (point to corresponding element in other list?) If any of my logic is flawed please tell me, but my main questions are: How to deal with vertical links and whether my link idea is correct Now that I read my class List idea I'm thinking that a List should hold a vector of integers rather than a single integer. In fact I'm pretty positive, but would just like some validation. I'm assuming the coin flip would simply call int function where rand()%2 returns a value of 0 or 1 and if it's 0 then a the value "levels up" and if it's 0 then the insert is over. Is this incorrect? How to store a value similar to -infinite? Edit: I've started writing some code and am considering how to handle the List constructor....I'm guessing that on its construction, the "-infinite" value should be stored in the vectorname[0] element and I can just call insert on it after its creation to put the x in the appropriate place.

    Read the article

  • Cycle backwards through NSArray

    - by dot
    Hello! I'm trying to cycle backwards through an array by clicking a button. My current code is close, but doesn't quite work. - (void)viewDidLoad { self.imageNames = [NSArray arrayWithObjects:@"MyFirstImage", @"AnotherImage", nil]; currentImageIndex = 0; [super viewDidLoad]; } ...what works: - (IBAction)change { UIImage* imageToShow = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:[imageNames objectAtIndex:currentImageIndex] ofType:@"png"]; currentImageIndex++; if (currentImageIndex >= imageNames.count) { currentImageIndex = 0; } } ...and what isn't working: - (IBAction)changeBack { UIImage* imageToShow = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:[imageNames objectAtIndex:currentImageIndex] ofType:@"png"]; currentImageIndex--; if (currentImageIndex >= imageNames.count) { currentImageIndex = 0; } } Any help is gladly appreciated! Thanks!

    Read the article

  • Haskell function composition (.) and function application ($) idioms: correct use.

    - by Robert Massaioli
    I have been reading Real World Haskell and I am nearing the end but a matter of style has been niggling at me to do with the (.) and ($) operators. When you write a function that is a composition of other functions you write it like: f = g . h But when you apply something to the end of those functions I write it like this: k = a $ b $ c $ value But the book would write it like this: k = a . b . c $ value Now to me they look functionally equivalent, they do the exact same thing in my eyes. However, the more I look, the more I see people writing their functions in the manner that the book does: compose with (.) first and then only at the end use ($) to append a value to evaluate the lot (nobody does it with many dollar compositions). Is there a reason for using the books way that is much better than using all ($) symbols? Or is there some best practice here that I am not getting? Or is it superfluous and I shouldn't be worrying about it at all? Thanks.

    Read the article

  • Skip Lists -- ever used them?

    - by Head Geek
    I'm wondering whether anyone here has ever used a skip list. It looks to have roughly the same advantages as a balanced binary tree, but is simpler to implement. If you have, did you write your own, or use a pre-written library (and if so, what was its name)?

    Read the article

  • Portion of Screen Broke

    - by Devoted
    Hi, A portion of my laptop screen broke. Is there any kind of software that will just ignore that part and resize everything accordingly? It's like 1/6 of the screen on the right that makes anything over there impossible to see. If not, what would be the best programming language to go about making my own program? It is a PC but I can also run Ubuntu if that would be easier to make a program for.

    Read the article

  • Soft keyboard "del" key fails in EditText on Gallery widget

    - by droidful
    Hi, I am developing an application in Eclipse build ID 20090920-1017 using android SDK 2.2 and testing on a Google Nexus One. For the purposes of the tests below I am using the IME "Android keyboard" on a non-rooted phone. I have an EditText widget which exhibits some very strange behavior. I can type text, and then press the "del" key to delete that text; but after I enter a 'space' character, the "del" key will no longer remove characters before that space character. An example speaks a thousand words, so consider the following two incredibly simple applications... Example 1: An EditText in a LinearLayout widget: package com.example.linear.edit; import android.app.Activity; import android.os.Bundle; import android.view.ViewGroup.LayoutParams; import android.widget.EditText; import android.widget.Gallery; import android.widget.LinearLayout; public class LinearEdit extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); LinearLayout layout = new LinearLayout(getApplicationContext()); layout.setLayoutParams(new Gallery.LayoutParams(Gallery.LayoutParams.MATCH_PARENT, Gallery.LayoutParams.MATCH_PARENT)); EditText edit = new EditText(getApplicationContext()); layout.addView(edit, new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT)); setContentView(layout); } } Run the above application, enter text "edit example", then press the "del" key several times until the entire sentence is deleted. Everything Works fine. Now consider example 2: An EditText in a Gallery widget: package com.example.gallery.edit; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.ViewGroup; import android.view.ViewGroup.LayoutParams; import android.widget.ArrayAdapter; import android.widget.EditText; import android.widget.Gallery; import android.widget.LinearLayout; public class GalleryEdit extends Activity { private final String[] galleryData = {"string1", "string2", "string3"}; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Gallery gallery = new Gallery(getApplicationContext()); gallery.setAdapter(new ArrayAdapter(getApplicationContext(), android.R.layout.simple_list_item_1, galleryData) { @Override public View getView(int position, View convertView, ViewGroup parent) { LinearLayout layout = new LinearLayout(getApplicationContext()); layout.setLayoutParams(new Gallery.LayoutParams(Gallery.LayoutParams.MATCH_PARENT, Gallery.LayoutParams.MATCH_PARENT)); EditText edit = new EditText(getApplicationContext()); layout.addView(edit, new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT)); return layout; } }); setContentView(gallery); } } Run the above application, enter text "edit example", then press the "del" key several times. If you are getting the same problem as me then you will find that you can't deleted past the 'space' character. All is not well. If anyone could shed some light on this issue I would be most appreciative. Regards

    Read the article

  • Convert string to variable in PHP?

    - by iamdadude
    Hey guys, How do I go about setting a string as a literal variable in PHP? Basically I have an array like $data['setting'] = "thevalue"; and I want to convert that 'setting' to $setting so that $setting becomes "thevalue". Thanks for any help!

    Read the article

  • Detecting the onload event of a window opened with window.open

    - by Chris T
    window.popup = window.open($(this).attr('href'), 'Ad', 'left=20,top=20,width=500,height=500,toolbar=1,resizable=0'); $(window.popup).onload = function() { alert("Popup has loaded a page"); }; This doesn't work in any browser I've tried it with (IE, Firefox, Chrome). How can I detect when a page is loaded in the window (like an iframe onload)?

    Read the article

  • jQuery.each for lists and non-lists

    - by Brian M. Hunt
    I've a jQuery.each(data, foo), where data is either a string or a list of strings. I'd like to know if there's an existing utility function to convert the string to a list, or otherwise perform foo on just the string. So instead of the easy route: if (!$.isArray(data)) { foo(0, data); // can't rely on `this` variable } else { $.each(data,foo); } I was just wondering if there was already a builtin function of jQuery or Javascript that would convert data to a list automatically, like this: function convert_to_list(data) { return $.isArray(data) ? data : [data]; } $.each(convert_to_list(data), foo); Just curious! Thanks for reading. Brian

    Read the article

  • Chaining animations and memory management

    - by bryan1967
    Hey Everyone, Got a question. I have a subclassed UIView that is acting as my background where I am scrolling the ground. The code is working really nice and according to the Instrumentation, I am not leaking nor is my created and still living Object allocation growing. I have discovered else where in my application that adding an animation to a UIImageView that is owned by my subclassed UIView seems to bump up my retain count and removing all animations when I am done drops it back down. My question is this, when you add an animation to a layer with a key, I am assuming that if there is already a used animation in that entry position in the backing dictionary that it is released and goes into the autorelease pool? For example: - (void)animationDidStop:(CAAnimation *)theAnimation finished:(BOOL)flag { NSString *keyValue = [theAnimation valueForKey:@"name"]; if ( [keyValue isEqual:@"step1"] && flag ) { groundImageView2.layer.position = endPos; CABasicAnimation *position = [CABasicAnimation animationWithKeyPath:@"position"]; position.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]; position.toValue = [NSValue valueWithCGPoint:midEndPos]; position.duration = (kGroundSpeed/3.8); position.fillMode = kCAFillModeForwards; [position setDelegate:self]; [position setRemovedOnCompletion:NO]; [position setValue:@"step2-1" forKey:@"name"]; [groundImageView2.layer addAnimation:position forKey:@"positionAnimation"]; groundImageView1.layer.position = startPos; position = [CABasicAnimation animationWithKeyPath:@"position"]; position.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]; position.toValue = [NSValue valueWithCGPoint:midStartPos]; position.duration = (kGroundSpeed/3.8); position.fillMode = kCAFillModeForwards; [position setDelegate:self]; [position setRemovedOnCompletion:NO]; [position setValue:@"step2-2" forKey:@"name"]; [groundImageView1.layer addAnimation:position forKey:@"positionAnimation"]; } else if ( [keyValue isEqual:@"step2-2"] && flag ) { groundImageView1.layer.position = midStartPos; CABasicAnimation *position = [CABasicAnimation animationWithKeyPath:@"position"]; position.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]; position.toValue = [NSValue valueWithCGPoint:endPos]; position.duration = 12; position.fillMode = kCAFillModeForwards; [position setDelegate:self]; [position setRemovedOnCompletion:NO]; [position setValue:@"step1" forKey:@"name"]; [groundImageView1.layer addAnimation:position forKey:@"positionAnimation"]; } } This chains animations infinitely, and as I said one it is running the created and living object allocation doesn't change. I am assuming everytime I add an animation the one that exists in that key position is released. Just wondering I am correct. Also, I am relatively new to Core Animation. I tried to play around with re-using the animations but got a little impatient. Is it possible to reuse animations? Thanks! Bryan

    Read the article

  • With NHibernate and Transaction do I rollback on commit failure or does it auto rollback on single c

    - by mattcodes
    I've built the following Dispose method for my Unit Of Work which essentially wraps the active NH session & transaction (transaction set as variable after opening session as to not be replaced if NH session gets new transaction after error) public void Dispose() { Func<ITransaction,bool> transactionStateOkayFunc = trans => trans != null && trans.IsActive && !trans.WasRolledBack; try { if(transactionStateOkayFunc(this.transaction)) { if (HasErrored) { transaction.Rollback(); } else { try { transaction.Commit(); } catch (Exception) { if(transactionStateOkayFunc(transaction)) transaction.Rollback(); throw; } } } } finally { if(transaction != null) transaction.Dispose(); if(session.IsOpen) session.Close(); } I can't help feeling that code is a little bloated, will a transaction automatically rollback is a discrete Commit fails in the case of non-nested transactions? Will Commit or Rollback automatically Dipose the transaction? If not will Session.Close() automatically dispose the associated transaction?

    Read the article

  • McAfee Virus Scan and Oracle RAC

    - by Lee Gathercole
    Hi, We're experiencing a strange problem with Oracle RAC and McAfee anti-virus. As part of the installation of the Oracle RAC we disable anti virus as directed. We have had our RAC running fine, but when we came to re-enable the AV and reboot we got the BSOD. Abnormal Program Termination (BugCheck, STOP: 0x00000035 (0x8E984678, 0x00000000, 0x00000000, 0x00000000 NO_MORE_IRP_STACK_LOCATIONS Following the standard process of raising this problem with Microsoft they identify the problem and also a fix. Microsoft talk about too many file filter drivers being present and pushing the DFS upper limit beyond the default size. Upping this value, as per msdn, has no impact. We're able to recover from this BSOD by disabling AV. We don't have the problem if we run the AV service manually whilst the system is up. However, if we make the service automatic we fail to boot. Tech Details 2 Node Oracle 10g Cluster 2 * Windows 2003 SP2, 16GB RAM, Quad Core 3ghz Processor SAN attached storage McAfee VirusScan Enterprise 8.5.0i, Scan Engine (5300.2777), DAT Version (5536.0000) Thanks Lee

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >