Daily Archives

Articles indexed Thursday March 17 2011

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

  • How to Install Linux on my PC

    - by Holic
    Hi i need some help to install the drivers from my pc, on Ubuntu 10.10 i just installed it, and i a newbie on Ubuntu, but i understand a bit of Windows...but i want to try ubuntu and then Maybe change to UBUNTU!!! My hardware: QuadCore Intel Core i7-870, 3266 MHz (24 x 136) Asus P7P55D-E (2 PCI, 3 PCI-E x1, 2 PCI-E x16, 4 DDR3 DIMM, Audio, Gigabit LAN, IEEE-1394) NVIDIA GeForce GTX 480 (1536 MB) nVIDIA HDMI @ nVIDIA GF100 - High Definition Audio Controller VIA VT1828S @ Intel Ibex Peak PCH - High Definition Audio Controller [B-3] DIMM1: G Skill F3-12800CL9-2GBRL 2 GB DDR3-1333 DDR3 SDRAM (8-8-8-22 @ 609 MHz) (7-7-7-20 @ 533 MHz) (6-6-6-17 @ 457 MHz) DIMM3: G Skill F3-12800CL9-2GBRL 2 GB DDR3-1333 DDR3 SDRAM (8-8-8-22 @ 609 MHz) (7-7-7-20 @ 533 MHz) (6-6-6-17 @ 457 MHz) my pc is not connected to the internet with a wire(RJ45) but with a wireless LAn Asus WL-167G-V3(wich i also whant to install if possible) Anything would've help me :) Cheers & Thank you!

    Read the article

  • Upstart: sense of "stop on..." stanza when job is a task

    - by Binarus
    Hi, an upstart question (I think I have read all relevant man pages but could not find the answer there): What is the sense of using a "stop on ..." stanza in the definition of a job which is a task? The manuals tell us that such a job, after being started, just waits until its script (or exec stanza) is executed completely, and then stops automatically. Given that, what is the point in using "stop on ..." stanzas in such job definitions? For example, this is the job definition for Upstart's (very important) rc job in Natty 11.04 (leaving out comments and empty lines): start on runlevel [0123456] stop on runlevel [!$RUNLEVEL] export RUNLEVEL export PREVLEVEL console output env INIT_VERBOSE task exec /etc/init.d/rc $RUNLEVEL IMHO, the job, after being started by a runlevel event, will be stopped automatically as soon as /etc/init.d/rc $RUNLEVEL has finished. Thank you very much for any explanation!

    Read the article

  • Wifi connection problems

    - by user12511
    I have Ubuntu 10.10 installed on a HP Pavilion DV2750ea. The wifi card is an Intel 4965AGN. When I first started using Ubuntu on this laptop it connected wirelessly to the network. Then it suddenly stopped. The Wifi card power light is off and all information says the card is disabled. When the laptop is powered on the wifi power light turns on and stays on until Ubuntu finishes loading. I have replaced the wifi card and the wifi switch module with no change. Please can you help.

    Read the article

  • Backup files with rsync: error 23

    - by maria
    Hi I'm trying to make a backup of my /home to transfer all data from one computer to another. I wanted to save the backup on the same computer and than transfere it to another one. For safety reasons, I'm trying to learn how does it work on the computer without a lot of data (the new one) to be sure I won't delete something instead of copying it. I've run in terminal: sudo rsync -avz /home/maria /home/guest/backup and I had as the result: sent 58797801 bytes received 23050 bytes 4705668.08 bytes/sec total size is 100202958 speedup is 1.70 rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1060) [sender=3.0.7] I've tried once again, with the same result. I have no idea, which files were not transferred, what makes the whole backup useless for me (I wanted to do it automatically in order not to forget about something and loose it). On both computers I have the same system (Ubuntu 10.04). Rsync version: 3.0.7-1ubuntu1. Thanks for any tips

    Read the article

  • Looking for VPS Hosting for a LAMP Web Application

    - by Ali
    Hi guys, Trying to find a Managed VPS Hosting Solution for a LAMP Web Application. The more CPU, RAM, and Disk space the better Don't need a huge amount of bandwidth for now Would like to be able to easily grow into a stronger server Have really responsive, dedicated, smart support staff -- our current hosting is just terrible My main problem is that I can't even find a non-biased website out there that does a proper comparison of VPS Hosting providers. Can anybody either suggest a reviews/ranking site or a hosting with proven record? How would you go about finding the best hosting service? Thanks a lot! Ali

    Read the article

  • Best stats tool for cross-domain traacking

    - by kidbrax
    We build a webapp that allows users to run the app under their own subdomain. So we run the app under search.domainX.com, search.domainY.com and so on. They each have their own Google Analytics to track individual stats. But we want to know what general traffic for all clients of our app. So we want to know stuff like "among all our clients we had x number of views." What is the best way tool to track that sort of thing.

    Read the article

  • Searching for a page with a Very Unique title, doesnt find that intended page... Why?

    - by Sam
    Dear folks, a question about appearing in search results in google: A page of mine has this extremely unique page title: Ein gutes Logo passt wie ein Handschuh auf Ihre Marke in die Hände Now, when I search the phrase: Ein gutes Logo passt wie ein Handschuh auf Ihre Marke in die Hände Then all kinds of other irrelevant pages show up having only 1 or at best two words from my unqie title appearing, although I have searched for the entire phrase! And when I search the phrase in between quotes: "Ein gutes Logo passt wie ein Handschuh auf Ihre Marke in die Hände" Then it finds 1 result, which is my page. What is going on? Why doesn't show the unique result without the quotes? Thanks: your ideas and suggestions are welcome and much appreciated

    Read the article

  • Moving objects colliding when using unalligned collision avoidance (steering)

    - by James Bedford
    I'm having trouble with unaligned collision avoidance for what I think is a rare case. I have set two objects to move towards each other but with a slight offset, so one of the objects is moving slightly upwards, and one of the objects is moving slightly downwards. In my unaligned collision avoidance steering algorithm I'm finding the points on the object's forward line and the other object's forward line where these two lines are the closest. If these closest points are within a collision avoidance distance, and if the distance between them is smaller than the two radii of the two object's bounding spheres, then the objects should steer away in the appropriate direction. The problem is that for my case, the closest points on the lines are calculated to be really far away from the actual collision point. This is because the two forward lines for each object are moving away from each other as the objects pass. The problem is that because of this, no steering takes place, and the two objects partially collide. Does anyone have any suggestions as to how I can correctly calculate the point of collision? Perhaps by somehow taking into account the size of the two objects?

    Read the article

  • Capitalizing on JavaScript's prototypal inheritance

    - by keithjgrant
    JavaScript has a class-free object system in which objects inherit properties directly from other objects. This is really powerful, but it is unfamiliar to classically trained programmers. If you attempt to apply classical design patterns directly to JavaScript, you will be frustrated. But if you learn to work with JavaScript's prototypal nature, your efforts will be rewarded. ... It is Lisp in C's clothing. -Douglas Crockford What does this mean for a game developer working with canvas and HTML5? I've been looking over this question on useful design patterns in gaming, but prototypal inheritance is very different than classical inheritance, and there are surely differences in the best way to apply some of these common patterns. For example, classical inheritance allows us to create a moveableEntity class, and extend that with any classes that move in our game world (player, monster, bullet, etc.). Sure, you can strongarm JavaScript to work that way, but in doing so, you are kind of fighting against its nature. Is there a better approach to this sort of problem when we have prototypal inheritance at our fingertips?

    Read the article

  • Units issue when exporting from 3DS Max to XNA

    - by miguelSantirso
    I am working on a XNA game where we have defined that 1 XNA unit equals to 1 meter. Then, I set meters as system unit in 3DS Max and set to meters the units in the FBX exporter. However, when I export my models, they are much bigger in the game. Am I missing something? What should I do to avoid problems with my units? Investigating the FBX file, I noticed that I it has two values called UnitScaleFactor and OriginalUnitScaleFactor. They both are 100 when I export the files... And if I manually change UnitScaleFactor to 1, it works fine :S

    Read the article

  • In Ruby on Rails Routing I Would Like to Use Dash `-` Instead of Underscore `_`

    - by pablitostar
    I would like all the URLs for my web applications to use dash - instead of underscore _ for word separators. I'm surprised about a couple of things really: Google et al. continue to distinguish them. That RoR doesn't have a simple global configuration parameter to map - to _ in the routing. Or does it? I found a few questions here and elsewhere, but the best solution I've seen is to use :as or a named route. That's quite annoying. So I'm thinking of modifying the Rails routing to check for that global config and change - to _ before dispatching to a controller action. But before I do that, I'm hoping someone can save me the trouble! Thanks in advance for any help, or even confirmation that my approach makes sense. I'd submit it back. BTW, I'm currently on 2.3.8, but hope to migrate to 3 soon.

    Read the article

  • Write to file depending on minSdkVersion - android

    - by Simon Rosenqvist
    Hi, I have written a filewriter for my android application. It is to function on a Galaxy Tab, so my minSdkVersion has to be at least 4, so it will fill the screen. I originally started out with SdkVersion = 2 and at that point my filewriter worked perfectly. Changing the SdkVersion to 4 introduced the problem. My filewriter doesn't work anymore! The application runs fine, but a file doesn't get created. My .java file looks like this: public class HelloAndroid extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); TextView tv = new TextView(this); tv.setText("Hello, Android"); setContentView(R.layout.main); //definerer en knap kaldet button1 og sætter en listener på denne. Button button1 = (Button)findViewById(R.id.btnClickMe); button1.setOnClickListener(btnListener); //definerer en knap kaldet button2 og sætter en listener på denne. Button button2 = (Button)findViewById(R.id.btnClickMe2); button2.setOnClickListener(btnListener2); } //en variabel af typen 'long' deklæres og kaldes tid1. public long time1; private OnClickListener btnListener = new OnClickListener() { public void onClick(View v) { //Når der klikkes på button1 gemmes et tal i variablen tid1. time1 = System.currentTimeMillis(); } }; //en variabel af typen 'long' deklæres og kaldes tid2. public long time2; // en variabel af typen 'string' deklæres og kaldes tid: public String string1 = "time:"; private OnClickListener btnListener2 = new OnClickListener() { public void onClick(View v) { //Når der klikkes på button2 gemmes et tal i variablen tid2. time2 = System.currentTimeMillis(); // Herefter oprettes en fil kaldet "file.txt". try{ File file = new File(Environment.getExternalStorageDirectory(), "file.txt"); file.createNewFile(); BufferedWriter writer = new BufferedWriter(new FileWriter(file,true)); //string1 og tid2-tid1 skrives til filen. tid2-tid1 giver den tid der går fra der er trykket på den ene knap til den anden i millisekunder. writer.write(string1 + "\t" + (time2-time1)); writer.newLine(); writer.flush(); writer.close(); } catch (IOException e) { e.printStackTrace(); } } }; } And my manifest.xml looks like this: <?xml version="1.0" encoding="utf-8"?> <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".HelloAndroid" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> Why does my filewriter not work with minSdkVersion 2? Do i have to make a new filewriter? or what to do? Sorry for the messy code, i'm quite new to programming :)

    Read the article

  • Selenium and Headless Environment

    - by sdmythos_gr
    I recently installed Python 2.7, Robot Framework and the Selenium Library (I still don't know if I succeded though...) on a Red Hat Server to run some test on a web application. So I tried a simple test case using the robot framework to see if Selenium Library is functional, just to Open a web page, nothing more... Selenium Server is up and running according to the result of ps, and firefox binaries are in the PATH... Running the test case from the Robot Framework (with the pybot testcasename.tsv) I get an exception: ERROR: Problem capturing a screenshot to string: java.awt.AWTException: headless environment So, what is the Headless Environment? Does anyone have an idea if there is something else that needs to be istalled or to be configured as well?

    Read the article

  • Whats wrong with the following code, its not compiling

    - by Ganesh Kundapur
    #include <iostream> #include <vector> using namespace std; class Base { public: void Display( void ) { cout<<"Base display"<<endl; } int Display( int a ) { cout<<"Base int display"<<endl; return 0; } }; class Derived : public Base { public: void Display( void ) { cout<<"Derived display"<<endl; } }; void main() { Derived obj; obj.Display(); obj.Display( 10 ); } $test1.cpp: In function ‘int main()’: test1.cpp:35: error: no matching function for call to ‘Derived::Display(int)’ test1.cpp:24: note: candidates are: void Derived::Display() On commenting obj.Display(10), it works.

    Read the article

  • Flip Vertices Array

    - by James
    Hi, I have an array of position vertices that make up a 2D polygon. Vector2[] _chassisConcaveVertices = { new Vector2(5.122f, 0.572f), new Vector2(3.518f, 0.572f), new Vector2(3.458f, 0.169f), new Vector2(2.553f, 0.169f), new Vector2(2.013f, 0.414f), new Vector2(0.992f, 0.769f), new Vector2(0.992f, 1.363f), new Vector2(5.122f, 1.363f), }; What algorithm can I use to modify the positions so the resultant polygon is flipped? I need to flip the polygon both horizontally and vertically.

    Read the article

  • A ResetBindings on a BindingSource of a Grid also resets ComboBox

    - by Tetsuo
    Hi there, I have a DataGridView with a BindingSource of products. This products have an enum (Producer). For the most text fields (to edit the product) below the DataGridView I have a method RefreshProduct which does a ResetBindings in the end to refresh the DataGridView. There is a ComboBox (cboProducer), too. If I run over the _orderBs.ResetBindings(false) it will reset my cboProducer outside the DataGridView, too. Could you please help me to avoid this? Here follows some code; maybe it is then better to understand. public partial class SelectProducts : UserControl { private AutoCompleteStringCollection _productCollection; private ProductBL _productBL; private OrderBL _orderBL; private SortableBindingList<ProductBE> _listProducts; private ProductBE _selectedProduct; private OrderBE _order; BindingSource _orderBs = new BindingSource(); public SelectProducts() { InitializeComponent(); if (_productBL == null) _productBL = new ProductBL(); if (_orderBL == null) _orderBL = new OrderBL(); if (_productCollection == null) _productCollection = new AutoCompleteStringCollection(); if (_order == null) _order = new OrderBE(); if (_listProducts == null) { _listProducts = _order.ProductList; _orderBs.DataSource = _order; grdOrder.DataSource = _orderBs; grdOrder.DataMember = "ProductList"; } } private void cmdGetProduct_Click(object sender, EventArgs e) { ProductBE product = _productBL.Load(txtProductNumber.Text); _listProducts.Add(product); _orderBs.ResetBindings(false); } private void grdOrder_SelectionChanged(object sender, EventArgs e) { if (grdOrder.SelectedRows.Count > 0) { _selectedProduct = (ProductBE)((DataGridView)(sender)).CurrentRow.DataBoundItem; if (_selectedProduct != null) { txtArticleNumber.Text = _selectedProduct.Article; txtPrice.Text = _selectedProduct.Price.ToString("C"); txtProducerNew.Text = _selectedProduct.ProducerText; cboProducer.DataSource = Enum.GetValues(typeof(Producer)); cboProducer.SelectedItem = _selectedProduct.Producer; } } } private void txtProducerNew_Leave(object sender, EventArgs e) { string property = CommonMethods.GetPropertyName(() => new ProductBE().ProducerText); RefreshProduct(((TextBoxBase)sender).Text, property); } private void RefreshProduct(object value, string property) { if (_selectedProduct != null) { double valueOfDouble; if (double.TryParse(value.ToString(), out valueOfDouble)) { value = valueOfDouble; } Type type = _selectedProduct.GetType(); PropertyInfo info = type.GetProperty(property); if (info.PropertyType.BaseType == typeof(Enum)) { value = Enum.Parse(info.PropertyType, value.ToString()); } try { Convert.ChangeType(value, info.PropertyType, new CultureInfo("de-DE")); info.SetValue(_selectedProduct, value, null); } catch (Exception ex) { throw new WrongFormatException("\"" + value.ToString() + "\" is not a valid value.", ex); } var produktFromList = _listProducts.Single(p => p.Position == _selectedProduct.Position); info.SetValue(produktFromList, value, null); _orderBs.ResetBindings(false); } } private void cboProducer_SelectedIndexChanged(object sender, EventArgs e) { var selectedIndex = ((ComboBox)(sender)).SelectedIndex; switch ((Producer)selectedIndex) { case Producer.ABC: txtProducerNew.Text = Constants.ABC; break; case Producer.DEF: txtProducerNew.Text = Constants.DEF; break; case Producer.GHI: txtProducerNew.Text = Constants.GHI; break; case Producer.Another: txtProducerNew.Text = String.Empty; break; default: break; } string property = CommonMethods.GetPropertyName(() => new ProductBE().Producer); RefreshProduct(selectedIndex, property); } }

    Read the article

  • php search and replace first element in div

    - by cnotethegr8
    i have a structure that looks like this <div class="table"> <div> <p> name1 </p> <p> title1 </p> </div> <div> <p> name2 </p> <p> title2 </p> </div> <div> <p> name3 </p> <p> title3 </p> </div> </div> and it continues a few hundred more times. what can i write in php that will search ( class="table" div ) and add a class to only the first 'p' in each 'div'?

    Read the article

  • How to open a file with chinese name in python.

    - by mahendraliya
    I am trying to open a file in "w" mode with "open()" function in python. The filename is : ?????.jpg. The open function fails with this filename but succeeds with normal files. How can I open a file with names which are not in English in python? My code is as follows: try: filename = urllib.quote(filename.encode('utf-8')) destination = open(filename, 'w') yield("<br>Obtained the file reference") except: yield("<br>Error while opening the file") I always get "Error while opening the file" for non-english filenames. Thanks in advance.

    Read the article

  • cufon problem background image

    - by andrewkthx
    Hi guys!! I'm developing a website and for the first time i found problems using cufon... if you think u know about cofon check this.. http://universite.jvsoftware.com If you open with firefox and IE, you will notice in the navigation bar, when you over the titles will appear a border (actually is an image) but if you open it with chrome or safari, that image doesnt appear.... the cufon script is easy to find in the source code, also the css. Let me know if you know how to fix that!! Kind Regards

    Read the article

  • iPhone NSCalendar - Incorrect Calendar Drawn for users outside US

    - by xoail
    After trying to work on someone else's code, and so many different iterations, I am unable to understand what am I doing wrong with dates on a calendar month view. I am trying to present a calendar in month view fashion like calendar.app but unfortunately some users in countries like Australia, UK are reporting incorrect alignment of Days to Dates. For instance in Australia it displays 17th March as Friday. Any help is highly appreciated! Here is the code sample I am using: -(void)setCalendar { NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; NSDateComponents *comps = [gregorian components:units fromDate:[NSDate date]]; self.currentDate = [gregorian dateFromComponents:comps]; NSInteger weekdayInteger=[comps weekday]; currentMonth=[comps month]; currentYear=[comps year]; NSString *dateString=[[NSString stringWithFormat:@"%@",currentDate] substringToIndex:10]; NSArray *array= [dateString componentsSeparatedByString:@"-"]; NSInteger currentDay=[[array objectAtIndex:2] intValue]; currentMonthConstant=currentMonth; currentYearConstant=currentYear; currentDayConstant=currentDay; currentConstantDate=[NSString stringWithFormat:@"%d/%d/%d",currentDayConstant,currentMonthConstant,currentYearConstant]; currentFirstDay=((8+weekdayInteger-(currentDay%7))%7); if(currentFirstDay==0) currentFirstDay=7; [gregorian release]; } And this is how im populating the calendar: -(void)fillCalender:(NSInteger)month weekStarts:(NSInteger)weekday year:(NSInteger)year { currentMonth=month; currentYear=year; currentFirstDay=weekday; UIButton *temp; NSInteger numberOfDays=[self getNumberofDays:month YearVlue:year]; currentLastDay=(currentFirstDay+numberOfDays-1)%7; if(currentLastDay==0) currentLastDay=7; NSString *monthName=[self getMonth:month]; NSInteger grid=(weekday-1); monthLabel.text=[NSString stringWithFormat:@"%@ %d",monthName,year]; for(int i=1;i<=numberOfDays;i++) { if([frontView isEqualToString:@"view1"]) temp=[arr_View2Buttons objectAtIndex:grid]; else temp= [arr_View1Buttons objectAtIndex:grid]; [temp setBackgroundImage:nil forState:UIControlStateNormal]; [temp setUserInteractionEnabled:TRUE]; UILabel *aLbl = (UILabel *)[temp viewWithTag:123]; [aLbl setText:[NSString stringWithFormat:@"%d",i]]; // check for today if(currentDayConstant == i && currentMonthConstant == currentMonth && currentYearConstant == currentYear) { [aLbl setTextColor:[UIColor blueColor]]; } else { [aLbl setTextColor:[UIColor colorWithRed:69/255.0 green:2/255.0 blue:71/255.0 alpha:1.0]]; } [temp setTag:i]; grid++; if(grid==35) grid=0; } } And finally viewdidload: - (void)viewDidLoad { [super viewDidLoad]; [self setCalendar]; // set views [self.view1 setFrame:CGRectMake(0,45,320,232)]; [self.view2 setFrame:CGRectMake(0,277,320,232)]; [self.view addSubview:self.view1]; [self.view addSubview:self.view2]; frontView = @"view2"; [self fillCalender:currentMonth weekStarts:currentFirstDay year:currentYear]; frontView = @"view1"; }

    Read the article

  • Entity Framework RC1 DbContext query issue

    - by Steve
    I'm trying to implement the repository pattern using entity framework code first rc 1. The problem I am running into is with creating the DbContext. I have an ioc container resolving the IRepository and it has a contextprovider which just news up a new DbContext with a connection string in a windsor.config file. With linq2sql this part was no problem but EF seems to be choking. I'll describe the problem below with an example. I've pulled out the code to simplify things a bit so that is why you don't see any repository pattern stuff here. just sorta what is happening without all the extra code and classes. using (var context = new PlssContext()) { var x = context.Set<User>(); var y = x.Where(u => u.UserName == LogOnModel.UserName).FirstOrDefault(); } using (var context2 = new DbContext(@"Data Source=.\SQLEXPRESS;Initial Catalog=PLSS.Models.PlssContext;Integrated Security=True;MultipleActiveResultSets=True")) { var x = context2.Set<User>(); var y = x.Where(u => u.UserName == LogOnModel.UserName).FirstOrDefault(); } PlssContext is where I am creating my DbContext class. The repository pattern doesn't know anything about PlssContext. The best I thought I could do was create a DbContext with the connection string to the sqlexpress database and query the data that way. The connection string in the var context2 was grabbed from the context after newing up the PlssContext object. So they are pointing at the same sqlexpress database. The first query works. The second query fails miserably with this error: The model backing the 'DbContext' context has changed since the database was created. Either manually delete/update the database, or call Database.SetInitializer with an IDatabaseInitializer instance. For example, the DropCreateDatabaseIfModelChanges strategy will automatically delete and recreate the database, and optionally seed it with new data. on this line var y = x.Where(u => u.UserName == LogOnModel.UserName).FirstOrDefault(); Here is my DbContext namespace PLSS.Models { public class PlssContext : DbContext { public DbSet<User> Users { get; set; } public DbSet<Corner> Corners { get; set; } public DbSet<Lookup_County> Lookup_County { get; set; } public DbSet<Lookup_Accuracy> Lookup_Accuracy { get; set; } public DbSet<Lookup_MonumentStatus> Lookup_MonumentStatus { get; set; } public DbSet<Lookup_CoordinateSystem> Lookup_CoordinateSystem { get; set; } public class Initializer : DropCreateDatabaseAlways<PlssContext> { protected override void Seed(PlssContext context) { I've tried all of the Initializer strategies with the same errors. I don't think the database is changing. If I remove the modelBuilder.Conventions.Remove<IncludeMetadataConvention>(); Then the error returns is The entity type User is not part of the model for the current context. Which sort of makes sense. But how do you bring this all together?

    Read the article

  • Presenting UINavigationController modally -- problem setting up tool and nav bar items in root view controller viewDidLoad

    - by Bogatyr
    In my iOS app I'm creating and presenting a UINavigationController modally like so: MyViewController *myvc = [[[MyViewController alloc] initWithNibName:@"MyViewController" bundle:nil] autorelease]; UINavigationController *navVC = [[[UINavigationController alloc] initWithRootViewController:myvc] autorelease]; [self presentModalViewController:navVC animated:YES]; In the MyViewController viewDidLoad I'm creating and setting toolbar items for the navigation controller's toolbar, like so: self.navigationController.toolbar.items = [NSArray arrayWithObjects:(items...), nil]; the problem I'm having is that the items don't show up. If instead I call a method from MyViewController's viewDidLoad method that adds the toolbar items via performSelector:withObject:afterDelay:0, then it works perfectly. So there's obviously some race condition going on here with the initial presentation of the UINavigationController, initialization of its toolbar/navbar, and the initialization of the nav bar's specified initial root view controller. I verified in the debugger that the root view controller's viewDidLoad is called after the UINavigationController's viewDidLoad method. In fact, the root view controller's viewDidLoad method is not called until presentModalViewController: is called, and the UINavigationController's viewDidLoad is called within initWithRootViewController, so doesn't that imply that the UINavigationController object should be "all ready to go", including its nav bar and toolbars? I thought at first that the navigation controller's toolbar object may not exist yet at MyViewController's viewDidLoad time, but it clearly does. At least, NSLog shows that it is not nil during MyViewController's viewDidLoad method. In fact, the UINavigationController's toolbar object is identical at both times: in the root view controller's viewDidLoad, and in the "setupToolbar" method that I called with performSelector:withObject:afterDelay, so it's not getting "re-initialized" somehow. So, what's going on here? Why aren't my toolbar modifications "sticking" in MyViewController's viewDidLoad, and why does performing them in the next iteration of the runloop (performSelector:withObject:afterDelay:0) make it work? What is the "right" way of setting up initial navbar / toolbar items in code from the rootViewController of the UINavigationController?

    Read the article

  • Unordered list navigation - hovered element moves 1px left

    - by rodrigo
    I have unordered list navigation like this. When anchor is hovered navigation list moves 1px left. How to fix that ? Here is my code <ul id="nav"> <li><a href="#">First</a></li> <li><a href="#">Second</a></li> <li><a href="#">Third</a></li> </li> Here is my css: ul#nav li { float: left; margin: 0; padding: 0; } ul#nav li a:hover { -moz-border-radius:3px; border: 1px solid #ccc; }

    Read the article

  • VHDL gate basics

    - by balina
    Hello. I'm learning VHDL and I've come to a halt. I'd like to create a simple gate out of smaller gates (a NAND gate here). Here's the code: library IEEE; use IEEE.STD_LOGIC_1164.all; entity ANDGATE2 is port( x,y : in STD_LOGIC; z : out STD_LOGIC ); end ANDGATE2; architecture ANDGATE2 of ANDGATE2 is begin z <= x AND y; end ANDGATE2; library IEEE; use IEEE.STD_LOGIC_1164.all; entity NOTGATE1 is port( x : in STD_LOGIC; z : out STD_LOGIC ); end NOTGATE1; architecture NOTGATE1 of NOTGATE1 is begin z <= NOT x; end NOTGATE1; library ieee; use ieee.std_logic_1164.all; entity NANDGATE2 is port( x : in STD_LOGIC; y : in STD_LOGIC; z : out STD_LOGIC ); end NANDGATE2; architecture NANDGATE2 of NANDGATE2 is signal c, d: std_logic; component NOTGATE1 port( n_in : in STD_LOGIC; n_out : out STD_LOGIC ); end component; component ANDGATE2 port( a_in1, a_in2 : in STD_LOGIC; a_out : out STD_LOGIC ); end component; begin N0: ANDGATE2 port map(x, y, c); N1: NOTGATE1 port map(c, d); z <= d; end NANDGATE2; Here's the code from some tutorial I've been using as a template; it compiles with no problems. library ieee; use ieee.std_logic_1164.all; -- definition of a full adder entity FULLADDER is port ( a, b, c: in std_logic; sum, carry: out std_logic ); end FULLADDER; architecture fulladder_behav of FULLADDER is begin sum <= (a xor b) xor c ; carry <= (a and b) or (c and (a xor b)); end fulladder_behav; -- 4-bit adder library ieee; use ieee.std_logic_1164.all; entity FOURBITADD is port ( a, b: in std_logic_vector(3 downto 0); Cin : in std_logic; sum: out std_logic_vector (3 downto 0); Cout, V: out std_logic ); end FOURBITADD; architecture fouradder_structure of FOURBITADD is signal c: std_logic_vector (4 downto 0); component FULLADDER port ( a, b, c: in std_logic; sum, carry: out std_logic ); end component; begin FA0: FULLADDER port map (a(0), b(0), Cin, sum(0), c(1)); FA1: FULLADDER port map (a(1), b(1), C(1), sum(1), c(2)); FA2: FULLADDER port map (a(2), b(2), C(2), sum(2), c(3)); FA3: FULLADDER port map (a(3), b(3), C(3), sum(3), c(4)); V <= c(3) xor c(4); Cout <= c(4); end fouradder_structure; My code compiles with no errors, but with two warnings: # Warning: ELAB1_0026: p2.vhd : (85, 0): There is no default binding for component "andgate2".(Port "a_in1" is not on the entity). # Warning: ELAB1_0026: p2.vhd : (87, 0): There is no default binding for component "notgate1".(Port "n_in" is not on the entity). What gives?

    Read the article

  • loading NSMutableArray into a Table View in Iphone

    - by sicKo
    I'm getting this error when I tried to put my array content into the table view. Btw, I'm new in this iphone development thingy.. 2011-03-17 15:54:13.142 FullApp[6851:207] -[NSCFString objectAtIndex:]: unrecognized selector sent to instance 0x5903860 2011-03-17 15:54:13.143 FullApp[6851:207] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSCFString objectAtIndex:]: unrecognized selector sent to instance 0x5903860' And here are my codes.. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; } // Configure the cell. FullAppAppDelegate *fullapp = (FullAppAppDelegate *)[[UIApplication sharedApplication]delegate]; NSString *cellValue = [[fullapp.soapResults objectAtIndex:0] objectAtIndex:indexPath.row]; cell.textLabel.text = cellValue; Here are my array content 2011-03-17 16:00:29.976 FullApp[6898:207] ( "Everyday.com.my", "Mydeals.com.my" )

    Read the article

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