Sunday, 1 September 2013

animating UIView transitions like expand dot to circle

animating UIView transitions like expand dot to circle

In my iPhone app i need to implement a different type of transition.
that was
next view open from the current view,
it stats like a dot, and the dot expands slowly like a circle with in the
circle next view is to be displayed partially with in the part of the
circle , finally the circle expands totally the next view appears
completely.
I search lots of transitions like CATransitions, and some animations on
cocoa controller, but i didn't find this type of transition, can any one
help me please.

Mysterious behavior of ajax jquery request inside jquery tabs

Mysterious behavior of ajax jquery request inside jquery tabs

I have jquery tabs created and inside of a tab there is a form where at
the bottom of it, there is this button.
<button id="submitForm" onclick="formSubmition();">Submit</button>
Here are the headers
<script
src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script
src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>
<script src="js/lib.js"></script>
<link rel="stylesheet"
href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<link rel="stylesheet" href="css/style.css" />
formSubmition() exists in lib.js file and here is its code
function formSubmition(){
$recId = $("#recId").val();
$collectionDate = $("#collectionDate").val();
$collectorsName = $("#collectorsName").val();
$donorsName = $("#donorsName").val();
$sciName = $("#sciName").val();
$family = $("#family").val();
$comName = $("#comName").val();
$variety = $("#variety").val();
$area = $("#area").val();
$location = $("#location").val();
$altitude = $("#altitude").val();
$geoOrientation = $("#geoOrientation").val();
$geoCoordinates = $("#geoCoordinates").val();
$soilDescription = $("#soilDescription").val();
$habitatDescription = $("#habitatDescription").val();
$plantPopulation = $("#plantPopulation").val();
$photoDate = $("#photoDate").val();
$photoId = $("#photoId").val();
$photoComments = $("#photoComments").val();
$soilTaken = 0;
$seedQuantity = $("#seedQuantity").val();
$plantQuantity = $("#plantQuantity").val();
$graftQuantity = $("#graftQuantity").val();
$moreInfo = $("#moreInfo").val();
if($('#soilTaken').is(':checked')) // Checking if Checkbox
was checked.
$soilTaken = 1;
jQuery.ajax({
type: 'POST',
async: true,
url: 'classes/classController.php',
data: {method: "recNewPlant", recId: $recId, collectionDate:
$collectionDate, collectorsName: $collectorsName, donorsName:
$donorsName, sciName: $sciName, family: $family, comName:
$comName, variety: $variety, area: $area, location: $location,
altitude: $altitude, geoOrientation: $geoOrientation,
geoCoordinates: $geoCoordinates, soilDescription:
$soilDescription, habitatDescription: $habitatDescription,
plantPopulation: $plantPopulation, photoDate: $photoDate, photoId:
$photoId, photoComments: $photoComments, soilTaken: $soilTaken,
seedQuantity: $seedQuantity, plantQuantity: $plantQuantity,
graftQuantity: $graftQuantity, moreInfo: $moreInfo},
contentType: ('application/x-www-form-urlencoded'),
dataType: "json",
success : function(json){
if(json.status == '1'){
alert("Added!");
}else{
alert("Problema!");
}
}
});
}
The problem is that i have use this method so many times but this is the
first time that it behaves like this. What i mean. If i press the button ,
nothing happens at most of the time and some times (rare) in chromium only
(not in firefox) it sends a request to the server and it returns
"Problema" messagage.
I ve erased the cache of two browsers but nothing changed. Also i'm using
OWASP ZAP to see the traffic and indeed , doesn't send any POST request. I
thought that maybe the tabs cause that problem but i cannot find the why.
Here is the way i setup tabs:
$("#mainTabs").tabs();

Pass QueryOver query as parameter to then execute (nhibernate)

Pass QueryOver query as parameter to then execute (nhibernate)

I have sort of a DOA class where I have my insert, update delete's etc
centralized and I also want to have the QueryOver method there. The method
will create the session etc and All I want to give it from a higher class
is the query.
Logically I would be something like this I guess...
public object QueryOver<T>(IQueryOver query)
{
using (ISession session = SessionManager.OpenSession())
{
return session.QueryOver<T>(???
}
}
Any Ideas? Or this having this 'Ópen session' centralized a bad practice?

Saturday, 31 August 2013

Mention 2 modifications that can be done to a linked list data structure so that it is converted into a binary tree data structure?

Mention 2 modifications that can be done to a linked list data structure
so that it is converted into a binary tree data structure?

It's an A level question. I looked it out on google but only programs are
found. I need theory explanation.

How to remove a directory from git index but not working tree directory?

How to remove a directory from git index but not working tree directory?

In case I messed up my definitions, I want git to stop tracking a folder,
but I want that folder to remain on my local machine.
I tried the following:
[ubuntu@ip-172-31-10-215:~/bitstarter]$cat .gitignore
# Heroku environmental variables, including API keys.
# https://devcenter.heroku.com/articles/config-vars
.env
# npm packages
node_modules
# Mac
.DS_Store
# Emacs
*~
[ubuntu@ip-172-31-10-215:~/bitstarter]$git status
# On branch temp
nothing to commit (working directory clean)
[ubuntu@ip-172-31-10-215:~/bitstarter]$git rm -r --cached node_modules
fatal: pathspec 'node_modules' did not match any files
Note worthy that I modified node_modules, committed changes, added
node_modules to .gitignore, committed THAT change, and now I have a
"clean" working directory.

Image div + text on hover

Image div + text on hover

Hey guys Im just wondering how to do a hover on image and fade the image a
colour with opacity 0.5. also with centered text. I know a bit how to do
it I'm just not sure if its purely css possible or jquery is required?
Thanks guys for help on this.

dispatch_async NSURLConnection - download don't start

dispatch_async NSURLConnection - download don't start

I'm trying to download information in background from a url. I've read
about GCD, Runloops and threads and decided that dispatc_async is my way
to go. After receiving data I aalso want to update the gui. But... the
NSUrlConnection don't seem to start at all. The delegate don't receive any
calls. I'v used this NSUrlRequest and NSUrlConnection in a synchronous way
and the delegate got the data excpected.
Here is my code, a method in a viewcontroller;
- (void)dispatch: (NSURLRequest *) pRequest respondTo: (VivaQuery *)
pQuery {
dispatch_queue_t downloadQueue =
dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
dispatch_async(downloadQueue, ^{
NSURLConnection *tConnectionResponse =[[NSURLConnection alloc]
initWithRequest: pRequest delegate: pQuery];
dispatch_async(dispatch_get_main_queue(), ^{
NSLog(@"Got to main thread.");
[pQuery requestEnd]; // Will update gui, i e aUIView
setNeedsDisplay
});
});
}
Anyone got an idea? Thanks in advance.
Kind regards, Jan Gifvars Stockholm