add

How to Install Older iOS Simulators in XCode 4.2.1 (SDK5.0)

廉价感情. 提交于 2019-11-27 03:56:13
I have just bought a new iMac. I then downloaded the latest SDK 5.0 and installed XCode 4.2.1. Everything is working fine. Though I realized that there are only iPhone and iPad Simulators 5.0 available for debugging. So I went on clicking the More Simulators... I click Install for all items and a while passed, and when I came back, it indicated as "Installed". But when I go back to my XCode, there are still just Simulators 5.0 in the list. So, how do I go about installing the older simulators in XCode 4.2.1? Did I miss any steps? Or do I need to install older SDKs? Please help. Thanks. X-Code

How to add same view to parent multiple times by inflating it only once

怎甘沉沦 提交于 2019-11-27 03:43:39
问题 I have a LinearLayout with vertical orientation as parent, I want to add some view programmatically multiple times to this parent. Right now I am inflating the child every time getting new references to every UI element before adding to parent. This doesn't seem to be very efficient, is there any better way of doing this. Current code I am using is below, If I inflate only once before for loop I get runtime error "he specified child already has a parent. You must call removeView() on the

Adding two DateTime objects together

眉间皱痕 提交于 2019-11-27 03:21:24
问题 Is there any better way to add one DateTime object to another one, than this: DateTime first = new DateTime(2000, 1, 1); DateTime second = new DateTime(11, 2, 5, 10, 10, 11); DateTime result = first.AddYears(second.Year); DateTime result = first.AddMonths(second.Month); ... and so on... In this example I'd like to get DateTime(2011, 3, 6, 10, 10, 11) EDIT After a intensive brainstorm it seems to there's no different way, but to facilitate it can be boxed inside additional class and operator+

Add text to textarea - Jquery

心不动则不痛 提交于 2019-11-27 02:29:29
问题 How can I add text from a DIV to a textarea? I have this now: $('.oquote').click(function() { $('#replyBox').slideDown('slow', function() { var quote = $('.container').text(); $('#replyBox').val($('#replyBox').val()+quote); // Animation complete. }); }); 回答1: Just append() the text nodes: $('#replyBox').append(quote); http://jsfiddle.net/nQErc/ 回答2: That should work. Better if you pass a function to val : $('#replyBox').val(function(i, text) { return text + quote; }); This way you avoid

Replacing JPanel with JPanel in a JFrame

自闭症网瘾萝莉.ら 提交于 2019-11-27 02:15:04
I have a class that extends JFrame, and it has a BorderLayout. It has two private instance variables of type JPanel. They represent panels of buttons and are called flipButton and confidenceButtons. When you click on the button, the panel of buttons is replaced by the other panel of buttons. That is, if you click on a button in flipButton, flipButton is replaced by confidenceButtons. I tried to do it like this: private class FlipListener implements ActionListener{ public void actionPerformed(ActionEvent e){ remove(flipButton); add(confidenceButtons,BorderLayout.SOUTH); validate(); ... } }

How to add text to an existing div with jquery

时光总嘲笑我的痴心妄想 提交于 2019-11-27 00:25:54
问题 I want to add text to an existing div, when I click the Button with the id #add. But this is not working. Here my code: $(function () { $('#Add').click(function () { $('<p>Text</p>').appendTo('#Content'); }); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <div id="Content"> <button id="Add">Add</button> </div> I hope you can help me. 回答1: You need to define the button text and have valid HTML for the button. I would also suggest using .on for the

Add jQuery function to specific elements

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-27 00:13:26
问题 I know that you can add new jQuery functions by $.fn.someFunction = function() However, I want to add functions to specific elements only. I tried this syntax and it doesn't work $('.someElements').fn.someFunction = function() I want to do this so that I can call the function like this somewhere in the code $('someElements').someFunction(); 回答1: Use .bind() and .trigger() $('button').bind('someFunction',function() { alert('go away!') }); $('button').click(function(){ $(this).trigger(

Add a column to a table, if it does not already exist

安稳与你 提交于 2019-11-26 22:39:13
问题 I want to write a query for MS SQL Server that adds a column into a table. But I don't want any error display, when I run/execute the following query. I am using this sort of query to add a table ... IF EXISTS ( SELECT * FROM sys.objects WHERE OBJECT_ID = OBJECT_ID(N'[dbo].[Person]') AND TYPE IN (N'U') ) But I don't know how to write this query for a column. 回答1: You can use a similar construct by using the sys.columns table io sys.objects . IF NOT EXISTS ( SELECT * FROM sys.columns WHERE

git: How do you add an external directory to the repository?

人走茶凉 提交于 2019-11-26 22:37:18
问题 I want to add an external directory to an existing repository. External Dir: /home/some/directory Working Dir: /htdocs/.git If I attempt the following command from the /htdocs dir: git add /home/some/directory I get an error: fatal: '/home/some/directory' is outside repository 回答1: If I need to do something like that I would normally move that external file or directory into my git repo and symlink it's original location to the new one. mv /home/some/directory /htdocs/directory ln -s /htdocs

How to append text to '<textarea>'?

旧街凉风 提交于 2019-11-26 21:14:57
问题 I have <textarea> where user can type in his message to the world! Below, there are upload buttons... I would love to add link to uploaded file (don't worry, I have it); right next to the text that he was typing in. Like, he types in 'Hello, world!', then uploads the file (its done via AJAX), and the link to that file is added in next line to the content of <textarea> . Attention! Is it possible to keep cursor (place where he left to type) in the same place? All that may be done with jQuery..