Hi, I have a tableview on a nib file with the interaction setting turned off. I'm animating a section change like this:
[myTableView beginUpdates];
[myTableView deleteSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:YES];
[myTableView insertSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:YES];
[myTableView endUpdates];
The problem is that, when I do this, the rows become selectable. How do I keep the interaction disabled while keeping the animation?
I am trying to change views on rotation because my views have to be significantly different from portrait to landscape. Now the code I am using works once then the app freezes when trying to rotate back. Either direction does not make a difference. For example: If I am in Landscape and rotate to portrait everything works great until I rotate back to landscape then it freezes and does absolutely nothing.
Here is the code I am using to achieve this
In my "viewDidLoad" method
[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(didRotate:)
name:UIDeviceOrientationDidChangeNotification
object:nil];
Then I call this for the rotation:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return YES;
}
- (void)didRotate:(NSNotification *)notification
{
UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];
if ((orientation == UIDeviceOrientationLandscapeLeft) ||
(orientation == UIDeviceOrientationLandscapeLeft))
{
// present the other viewController, it's only viewable in landscape
[self.view addSubview:landScapeView];
}
if ((orientation == UIDeviceOrientationLandscapeRight) ||
(orientation == UIDeviceOrientationLandscapeRight))
{
// present the other viewController, it's only viewable in landscape
[self.view addSubview:landScapeView];
}
else if ((orientation == UIDeviceOrientationPortrait ||
(orientation == UIDeviceOrientationPortrait))
{
// get rid of the landscape controller
[self.view addSubview:portrait];
}
else if ((orientation == UIDeviceOrientationPortraitUpsideDown ||
(orientation == UIDeviceOrientationPortraitUpsideDown))
{
// get rid of the landscape controller
[self.view addSubview:portrait];
}
}
<script language="Javascript">
var deviceIphone = "iPhone";
var deviceIpod = "iPod";
//Initialize our user agent string to lower case.
var uagent = navigator.userAgent.toLowerCase();
//**************************
// Detects if the current device is an iPhone.
function DetectiPhone()
{
if (uagent.search(deviceIphone) > -1)
{document.write('<link rel="stylesheet" type="text/css" href="ui/mobile/css/site.css">');
}
etc...
Above is the start of my code. I am trying to change the CSS file depending on what platform the user is using. I currently use media="screen ... " but it doesn't work with the amount of platforms I'm trying to use. I need something a lot more detailed/complex that is why I'm turning to useragents.
Any ideas why the css file doesn't change on my iPhone using the above code?
Better yet, any ideas on another way to change style sheets depending on the users platform/screen resolution?
Hi, I'm new to wicket, can someone please tell me how to dynamically setRequired to false. Here is my code:
AjaxButton cancel=new AjaxButton("cancel"){
public void onSubmit(AjaxRequestTarget target, Form form){
passwrd.setRequired(false);
nameField.setRequired(false);
usernameField.setRequired(false);
LecturerPage lecturer=new LecturerPage();
setResponsePage(lecturer);
}
};
addstud.add(cancel);
Tomcat is telling me that my feedback panel is being left unrendered(my ok button makes use of a feedback panel).
Thank you!
On several of my usercontrols, I change the cursor by using
this.Cursor = Cursors.Wait;
when I click on something.
Now I want to do the same thing on a WPF page on a button click. When I hover over my button, the cursor changes to a hand, but when I click it, it doesn't change to the wait cursor. I wonder if this has something to do with the fact that it's a button, or because this is a page and not a usercontrol? This seems like weird behavior.
sorry for the (probably) noob question, but I', new at this stuff.
i have a table that has column 'position', and I want to, when inserting a new row, change positions of every row that has position lower than row that is inserted. for example, if I add row with position 4, if there is a duplicate, it should become 5, 5 should shift to 6 and so on...
also, is there a way to get highest value for column besides testing it in every row via php?
Hello all,
I want to change my current url to a modified one.
suppose my current url is
www.abc.com/xyz/location.htm
i want it to change to
www.abc.com/location.htm
please suggest a suitable way....
Thanks in advance
hi all,i have a desktop application that install and start a service,i know a process can get the explorer.exe token and lunch another process with the tkoen,it means the second process will run us logged on account, my question is this that can i start my service by explorer.exe token too ? is there is an example in delphi?
thx for ur time
I am working on a web app that will generate an NxN grid based on the user's selection of N. I want the total width of the grid to be relative (ie 100% of the available space) so that users can print on various paper sizes. I can easily calculate the width of the squares in the grid by % (ie: 100%/N), but I am having issues calculating the height. The height of a web page is always going to be infinite unless I artificially limit it which, like I said, I don't want to do. How can I make the squares in my grid be square versus rectangular when the height and width constraints of my grid are dynamic and not square?
Thanks in advance!
Hi, I am working for a project on disaster management sponsered by World Bank,
under this project i have assigned work on CMS. and my senior has asked me to make a ASP.NET webpage where those logged with administrator privilege will be able to edit the page.
like:-
<div id="mydiv"><pre>+++++++MY CONTENT+++++++++++++++++++</pre></div>
now if if the admin clicks on mydiv he should be able to edit the pre contents.
for this i got many options such as WYSIWYG editors (but they work on textboxs only and further more they cant save the data back to server replacing the previous content)
then I came to know about Webparts , but its editing capabilities was so low that my plan for implementing a WYSIWYG editor went in vain.
so I m seeking help from u all is their any way to achieve the motive, it would be better if u can suggest something like incorporating WYSIWYG into webpartmanager editor...
THANKS..
I'm trying to add a body class of 'day' if it's 6am-5pm and 'night' if "else" based on the user's local time.
I tried the following but it didn't work. Any ideas?
In the head:
<script>
function setTimesStyles() {
var currentTime = new Date().getHours();
if(currentTime > 5 && currentTime < 17) {
document.body.className = 'day';
}
else {
document.body.className = 'night';
}
}
</script>
In the body:
<body onload="setTimeStyles();">
Also, is there a more elegant way to achieve what I need?
Hey there,
I'm trying to change all http://www.mysite.com/filename.php files to show as http://www.mysite.com/filename/ using mod_rewrite, but I seem to be doing something wrong.
Can anyone help out? I'm guessing it's something pretty simple for those that know. Thanks.
Is there a Design Pattern for supporting different permutations object?
Version 1
public class myOjbect {
public string field1 { get; set; } /* requirements: max length 20 */
public int field2 { get; set; }
. . .
public decimal field200 { get; set; }
}
Version 2
public class myObject {
public string field1 { get; set; } /* requirements: max length 40 */
public int field2 { get; set; }
. . .
public double field200 { get; set; } /* changed data types */
. . ./* 10 new properties */
public double field210 { get; set; }
}
of course I could just have separate objects, but thought there might be a good pattern for this sort of thing.
In C# (console app) I want to hold a collection of objects. All objects are of same type.
I want to iterate through the collection calling a method on each object. And then repeat the process continuously.
However during iteration objects can be added or removed from the list. (The objects themselves will not be destroyed .. just removed from the list).
Not sure what would happen with a foreach loop .. or other similar method.
This has to have been done 1000 times before .. can you recommend a solid approach?
The company I work for has windows xp installed and under group policy, I am not able to change the desktop appearnce or themes. Because admin has disabled the appearance and themes tab via group policy registry. I am looking for an application or Vb.net form which is able to switch the appearance and themes under limited access xp account. Your help would be higly appreciated..
If I run:
FILE* pFile = fopen("c:\\08.bin", "r");
fpos_t pos;
char buf[5000];
int ret = fread(&buf, 1, 9, pFile);
fgetpos(pFile, &pos);
I get ret = 9 and pos = 9.
However if I run
FILE* pFile = fopen("c:\\08.bin", "r");
fpos_t pos;
char buf[5000];
int ret = fread(&buf, 1, 10, pFile);
fgetpos(pFile, &pos);
ret = 10 as expected, but pos = 11!
How can this be?
I'd like to make my local repo point to a different fork of the same project. Will this work?
Do a merge with the 'target origin'
Change the origin repo in my config file to the 'target origin'
Also, if my local repo is not entirely identical to the new origin (say, I've resolved some merge conflicts in my favor), will these changes be pushed to the new origin when I do a git push, or will only commits made after the change of origin get pushed?
Hi ,
I have created Dealer dimension in SSAS 2005 and it has 3 hierarchies. By default the hierarchy created first is the default hierarchy of the dimension.
Is there any way to change the default hierarchy to another hierarchy.
I am new to using Mock test in .Net.
I am testing out a financial transaction which is of the following nature:
int amt =20;
//sets all the props and func and returns a FinaceAccount.
//Note I did not SetUp the amt of the account.
var account =GetFinanceAccount()
//service layer to be tested
_financeService.tranx(account,amt);
//checks if the amt was added to the account.amt
//here the amt comes out same as that set in GetFinanceAccount.
Assert.AreEqual(account.amt ,amt)
I know that the function tranx works correctly but there is an issue with the test.
Are there any GOOD reference material on Mocking in .Net
At work we have a number of databases that we need to do the same operations on. I would like to write 1 SP that would loop over operations and set the database at the beginning of the loop (example to follow). I've tried sp_executesql('USE ' + @db_id) but that only sets the DB for the scope of that stored procedure. I don't really want to loop with hard coded database names because we need to do similar things in many different places and it's tough to remember where things need to change if we add another DB.
Any thoughts
Example:
DECLARE zdb_loop CURSOR FAST_FORWARD FOR
SELECT distinct db_id from DBS order by db_id
OPEN zdb_loop
FETCH NEXT FROM zdb_loop INTO @db_id
WHILE @@FETCH_STATUS = 0
BEGIN
USE @db_id
--Do stuff against 3 or 4 different DBs
FETCH NEXT FROM zdb_loop INTO @db_id
END
CLOSE zdb_loop
DEALLOCATE zdb_loop
I've got a simple login system using PHP sessions, but just recently it seems that if you visit pages not in a certain directory (/login/) you will always be flagged as not logged in, even when you are. It seems that my session data is being lost when I change directories (say, to /login/user/).
I don't think I've touched the code myself since the problem appeared, is there something my web host could have done to my PHP installation that would delete the session data, and is there a workaround?
I already this something
Here is the original code:
<script type='text/javascript'>
function delete_user( id ){
var answer = confirm('Are you sure?');
//if user clicked ok
if ( answer ){
//redirect to url with action as delete and id to the record to be deleted
window.location = 'delete.php?id=' + id;
}
}
</script>
How do I remove the old javascript confirm dialog box and replace it with bootstrap?
Huge thanks for the help in this thread - Click td, select radio button in jQuery
But now I'm having trouble that it won't change the class of the cell, even though I have binded the 'change' trigger in jQuery like so:
$("td input[type=radio]").bind('change click', function () {
$('td').removeClass('selected');
$(this).parent('td').addClass('selected');
});
$("td").click(function () {
$('input:radio', this).attr('checked', true);
});
Hope that makes sense. If you click the radio button, or move between them using the keyboard, the cell's class changes just fine. However if you trigger this by clicking the cell it doesn't change the class :(
Thanks