Is knowledge of HTML beyond the basics a prerequisite for learning CSS?
I am making a learning plan so this will help me evaluate the time required better.
My new job needs me to migrate from C# to C++. I am comfortable with C# and have an exposure to C++ at college (basics). What would be the best way to go forward. Please suggest some materials or books to go forward.
Hello guys ,
I am fairly new to transition and animation methods in Iphone. Can somebody pl. guide me the basics of transition and Animation in Iphone. This is needed frequently in my Apps. Can anybody tell me any link where i can Understand ABC of animation ?
I have an array which looks something along the lines of
resourceData[0][0] = "pic1.jpg";
resourceData[0][1] = 5;
resourceData[1][0] = "pic2.jpg";
resourceData[1][1] = 2;
resourceData[2][0] = "pic3.jpg";
resourceData[2][1] = 900;
resourceData[3][0] = "pic4.jpg";
resourceData[3][1] = 1;
The numeric represents the z-index of the image. Minimum z-index value is 1. Maximum (not really important) is 2000.
I have all the rendering and setting z-indexes done fine. My question is, I want to have four functions:
// Brings image to z front
function bringToFront(resourceIndex) {
// Set z-index to max + 1
resourceData[resourceIndex][1] = getBiggestZindex() + 1;
// Change CSS property of image to bring to front
$('#imgD' + resourceIndex).css("z-index", resourceData[resourceIndex][1]);
}
function bringUpOne(resourceIndex) {
}
function bringDownOne(resourceIndex) {
}
// Send toback z
function sendToBack(resourceIndex) {
}
So given then index [3] (900 z):
If we send it to the back, it will take the value 1, and [3] will have to go to 2, but that conflicts with [1] who has a 2 z-index so they need to go to three etc.
Is there an easy programatical way of doing this because as soon as I start doing this it's going to get messy.
It's important that the indexes of the array don't change. We can't sort the array unfortunately due to design.
Update
Thanks for answers, I'll post the functions here once they are written incase anyone comes across this in the future (note this code has zindex listed in [6])
// Send toback z
function sendToBack(resourceIndex) {
resourceData[resourceIndex][6] = 1;
$('#imgD' + resourceIndex).css("z-index", 1);
for (i = 0; i < resourceData.length; i++) {
if (i != resourceIndex) {
resourceData[i][6]++;
$('#imgD' + i).css("z-index", resourceData[i][6]);
}
}
}
am making a canon to fire objects. back of the canon the plunger is attached. plunger acts for set speed and angle. canon rotates 0-90 degree and plunger moves front and back for adjust speed. when am rotates the canon by touches moved its working fine. when plunger is pull back by touches moved and it rotates means the plunger is bounds outside of the canon.
how to control this:-
my code for plunger and canon rotation on touches moved. ( para3 is the canon , para6 is my plunger):-
CGPoint touchLocation = [self convertTouchToNodeSpace:touch];
CGPoint oldTouchLocation = [touch previousLocationInView:touch.view];
oldTouchLocation = [[CCDirector sharedDirector] convertToGL:oldTouchLocation];
oldTouchLocation = [self convertToNodeSpace:oldTouchLocation];
if (CGRectContainsPoint(CGRectMake(para6.position.x-para6.contentSize.width/2, para6.position.y-para6.contentSize.height/2, para6.contentSize.width, para6.contentSize.height), touchLocation) && (touchLocation.y-oldTouchLocation.y == 0))
{
CGPoint diff = ccpSub(touchLocation, oldTouchLocation);
CGPoint currentpos = [para6 position];
NSLog(@"%d",currentpos);
CGPoint destination = ccpAdd(currentpos, diff);
if (destination.x < 90 && destination.x >70)
{
[para6 setPosition:destination];
speed = (70 + (90-destination.x))*3.5 ;
}
}
if(CGRectIntersectsRect((CGRectMake(para6.position.x-para6.contentSize.width/8, (para6.position.y+30)-para6.contentSize.height/10, para6.contentSize.width, para6.contentSize.height/10)),(CGRectMake(para3.position.x-para3.contentSize.width/2, para3.position.y-para3.contentSize.height/2, para3.contentSize.width, para3.contentSize.height))))
{
[para3 runAction:[CCSequence actions:
[CCRotateTo actionWithDuration:rotateDuration angle:rotateDiff],
nil]];
CGFloat plungrot = (rotateDiff);
CCRotateTo *rot = [CCRotateTo actionWithDuration:rotateDuration angle:plungrot];
[para6 runAction:rot];
}
}
I have made a login page. When the user logs in a request to an API is send. This API is PHP and checks the username and password. When both are correct an unique key is send back (this is placed in the database for further use: userid and other stuff needed in the website).
After that key is sent back it is placed in a cookie:
$.cookie("session", JSON.stringify(result));
After the cookie is set I send the user to a new page:
location.href = 'dashboard.htm';
In this page jQuery checks if the cookie "session" is present. If not, the user is send backto the login page.
sessionId = ($.cookie("session") ? JSON.parse($.cookie("session")).SessionId : 0);
return sessionId;
This works fine in Chrome, but IE (8/9) has some problems with this. I figured out that when you get to dashboard.htm the session is present. As soon as I hit F5 the session is gone. And sometimes the cookie isn't set at all!
I can't seem to figure out why this is happening in IE. Has someone any idea? Other options/ideas to save that unique key are also welcome.
Thanks in advance.
I am a Java developer but up to now have not had any hands on experience using the Spring framework.
Does anyone know of anyone good online tutorials that explain the basics and offer good examples and sample code.
Does somebody know, why this compiles??
template< typename TBufferTypeFront, typename TBufferTypeBack = TBufferTypeFront>
class FrontBackBuffer{
public:
FrontBackBuffer(
const TBufferTypeFront front,
const TBufferTypeBack back): ////const reference assigned to reference???
m_Front(front),
m_Back(back)
{
};
~FrontBackBuffer()
{};
TBufferTypeFront m_Front; ///< The front buffer
TBufferTypeBack m_Back; ///< The back buffer
};
int main(){
int b;
int a;
FrontBackBuffer<int&,int&> buffer(a,b); //
buffer.m_Back = 33;
buffer.m_Front = 55;
}
I compile with GCC 4.4. Why does it even let me compile this? Shouldn't there be an error that I cannot assign a const reference to a non-const reference?
Hi, As the title states... I am deleting a 'subject' from a 'classroom' I view classrooms, then can click on a classroom to view the subject for that classroom. So the link where I am viewing subjects looks like:
viewsubjects.php?classroom=23
When the user selects the delete button (in a row) to remove a subject from a class, I simply want the user to be redirected backto the list of subjects for the classroom (exactly where they were before!!)
So I though this is simply a case of calling up the classroom ID within my delete script. Here is what I have:
EDIT: corrected spelling mistake in code (this was not the problem)
$subject_id = $_GET['subject_id'];
$classroom_id = $_GET['classroom_id'];
$sql = "DELETE FROM subjects WHERE subject_id=".$subject_id;
$result = mysql_query($sql, $connection)
or die("MySQL Error: ".mysql_error());
header("Location: viewsubjects.php?classroom_id=".$classroom_id);
exit();
The subject is being removed from the DB, but when I am redirected back the URI is displaying with an empty classroom ID like:
viewsubjects.php?classroom_id=
Is there a way to carry the classroom ID through successfully through the delete script so it can be displayed after, allowing the user to be redirected backto the page? Thanks for any help!
I am in the planning phases of a project for myself, it is to be a single and multi-player card game. I would like to track statistics for each person such as world rankings etc...
My problem is I do not know the best approach for the client - server architecture and programming. My original goal was to program everything in C# as I want to get proficient in that language. My original idea was to have a back-end database and a back end server run on some sort of hosting on the internet, however that seems costly for such a small project that may or may not make any money.
I have tried looking into cloud services however I am unfamiliar with the technology, and I am not sure I can make them suit my needs, especially since most like Google's cloud wants you to use their coding architecture from what I understand.
Finally my last problem is that I would like an architecture that can be used for different languages so that I can port it from PC to IPhone, Xbox etc...
So does anyone have any advice on the best architecture and language to do this in?
Am I worrying about architecture and back-end costs to much and should just concentrate on getting the game running any which way?
I have a web site and when my users login it takes them to
verify.php
(where it connects to the DataBase and matches email and password to the user input and if OK puts client data into sessions and take the client to /memberarea/index.php ELSE backto login page with message "Invalid Email or password!")
<?php
ob_start();
session_start();
$email=$_POST['email'];
$pass=md5($_POST['pass']);
include("conn.php"); // connects to Database
$sql="SELECT * FROM `user` WHERE email='$email' AND pass='$pass'";
$result=mysql_query($sql);
$new=mysql_fetch_array($result);
$_SESSION['fname']=$new['fname'];
$_SESSION['lname']=$new['lname'];
$_SESSION['email1']=$new['email1'];
$_SESSION['passwrd']=$new['passwrd'];
$no=mysql_num_rows($result);
if ($no==1){
header('Location:memberarea/index.php');
}else {
header("Location:login.php?m=$msg"); //msg="Invalid Login"
}
?>
then after email id and password is verified it takes them to `
/memberarea/index.php
(This is where the problem happens.)
where in index.php it checks if a session has been created in-order to block hackers to enter member area and sends them backto the login page.
<?
session_start();
isset($_SESSION['email'])` && `isset($_SESSION['passwrd'])`
The problem is the client gets verified in verify.php (the code is above)
In varify.php only after I put
ob_start(); ontop of session_start();
It moves on to /memberarea/index.php ,
If I remove ob_start()
It keeps the client on the verify.php page and displays error header is alredy SENT.
after I put ob_start() it goes in to /memberarea/index.php but the session is blank,
so it goes backto the login page and displays the error ($msg) "Invalid Login" which I programed to display.
Can anyone tell me why the session cant pass values from verify.php to /memberarea/index.php
The problem is that when I load page 2 for example the URL becomes:
http://domain.com/index.php?restaurant-id=45¤tpage=2
And that's fine but when I get to page 3 it becomes:
http://domain.com/index.php?restaurant-id=45¤tpage=2¤tpage=3
And so on, it adds one more currentpage parameter everytime a new page is loaded from the pagination links!
I wonder how this problem can be fixed?
Here's some of the pagination function's code
/****** build the pagination links ******/
// Getting current page URL with its parameters
$current_page_url = ($_SERVER["PHP_SELF"].(isset($_SERVER["QUERY_STRING"])?"?".htmlentities($_SERVER["QUERY_STRING"]):""));
// Determine which sign to use (? or &) before the (currentpage=xx) parameter
$sign = preg_match('/\?/', $current_page_url) ? '&' : '?';
$pagination_links = '';
// if not on page 1, don't show back links
if ($currentpage > 1) {
// show << link to go backto page 1
$pagination_links .= " <a href='{$current_page_url}{$sign}currentpage=1'>First page</a> ";
// get previous page num
$prevpage = $currentpage - 1;
// show < link to go back 1 page
$pagination_links .= " <a href='{$current_page_url}{$sign}currentpage=$prevpage'>previous</a> ";
}
else
{
$pagination_links .= "? ?";
}// end if
I used Atlassian JIRA for bug and issue tracking at my last job. I absolutely loved it and it was particularly easy on the eyes.
My present company is using Trac instead, and while it does do all the basics, I am finding it really lacking, particularly with the inability to easily setup multiple projects and link issues.
Oh, and the fact that it uses SQLLite is a bit of an issue for me to.
Does anyone have any other good reasons to switch?
I have a model which contains view models for each view. This model is held in session and is initialised when application starts. I need to be able to populate a field from one view model with the value from another so have used a lambda function. Below is my model. I am using a lambda so that when I get Test2.MyProperty it will use the FunctionTestProperty to retrieve the value from Test1.TestProperty.
public class Model
{
public Model()
{
Test1 = new Test1()
Test2 = new Test2(FunctionTestProperty () => Test1.TestProperty)
}
}
public class Test1
{
public string TestProperty { get; set; }
}
public class Test2
{
public Test2() : this (() => string.Empty)
{}
public Test2(Func<string> functionTestProperty)
{
FunctionTestProperty = functionTestProperty;
}
public Func<string> FunctionTestProperty { get; set; }
public string MyProperty
{
get{ return FunctionTestProperty() ?? string.Empty; }
}
}
This works perfectly when I first run the application and navigate from Test1 to Test2; I can see that when I get the value for MyProperty it calls backto Model constructor and retrieves the Test1.TestProperty value. However when I then submit the form (Test2) it calls the default constructor which sets it to string.Empty. So if I go backto Test1 and backto Test2 again it always then calls the Test2 default constructor. Does anyone know why this works when first running the application but not after the view is submitted, or if I have made an obvious mistake?
Hey guys.
Circles are one of the basics geometric entities. Yet there is no primitives defined in openGl for this like lines or polygons. Why so? Its a little annoying to include custom headers for this all the time!
Any specific reason to omit it?
I have a technical interview on Monday and they were kind enough to give me a heads-up to brush up on my basic algorithms. It's been years since I looked at that kind of stuff and I'm pretty weak on it to begin with so I generally have a bad feeling about this. What's the best way to review the basics and get some practice in before Monday?
hello all,
i m using Jquery ajax post method to edit a form on same page, but if there is some mistake then how do i send user back on that page where data were loaded.
now i describe u what i do?
i have a page manageMovies.php there are list of movie name, now when i click on a name of any movie,
then i load editMovie.php on same page
now when i do some mistakes( i.e when validations fails) then i want to go back on same page
manageMovies.php loaded with editunit.php regarding that movie on the page.
here is my page structure
manageMovies.php
<div id="display"></div>
<div id="movieList">
<table >
<tr><td id="mov_10">Apharan</td></tr>
<tr><td id="mov_11">Gangaajal</td></tr>
<tr><td id="mov_12">Rajniti</td></tr>
</table>
</div>
<script type="text/javascript">
jQuery('td').click(function () {
jQuery('#movieList').hide(); // hide the div 'movielist'
jQuery.post('editMovie.php', {
idForEdit: jQuery(this).attr('id')
}, function (data) {
jQuery("#display").html(data); //display the editMovie.php page on 'display' div
});
});
</script>
now when i do some mistakes on editunit.php and go further for post, then i need to go back on same page (manageMovies.php) where
editMovie.php is shown on display div and movielist div should be hidden
The idea was simple:
change li background color on hover to one color
ul#menu li a:hover {...}
change it on mouse press to the other color
ul#menu li a:active {...}
return the color to the original (normal) if the link is neither hover nor pressed
The problem appeared to be that, if user rejected his intention and lets the mouse up away from the link, the back color stays as if it was pressed.
Then I tried to research and came up with this:
ul#menu li a:hover:active {...}
It became better, and the link is not marked with special back color in a normal state after user presses the link and rejects. But the "on-hover" back color became equal to the active one.
So it looks like the link gets "active" state and stays in it even after user releases mouse button.
Hate to write this, but I am very new to html and css. So I may be missing something very basic here.
Could you, please, suggest any way, how to achieve my goal?
EDIT
I've read this source CSS Styling links (thought there could be some other state to use instead of active), but found nothing suitable there...
I know Java and C++ but am looking to get in to XML. I don't want to waste time reading over the basics of programming in a book, so has anyone any recommendations for resources for learning XML that assume a knowledge of programming already, or even better highlight how to switch from Java/C++ to XML ie. main differences etcs.
Are Swing applications really used nowadays? I don't find a place where they are used. Is it okay to skip the AWT and Swing package (I learned a bit of the basics though)?
Does anyone know of an http client that is scripting friendly (ie: the basics, gets, posts) and is capable of executing javascript (all, not just location redirect) ? And one which isn't just launching another browser.
I think I understand the basic concepts of MVC - the Model contains the data and behaviour of the application, the View is responsible for displaying it to the user and the Controller deals with user input. What I'm uncertain about is exactly what goes in the Controller.
Lets say for example I have a fairly simple application (I'm specifically thinking Java, but I suppose the same principles apply elsewhere). I organise my code into 3 packages called app.model, app.view and app.controller.
Within the app.model package, I have a few classes that reflect the actual behaviour of the application. These extends Observable and use setChanged() and notifyObservers() to trigger the views to update when appropriate.
The app.view package has a class (or several classes for different types of display) that uses javax.swing components to handle the display. Some of these components need to feed back into the Model. If I understand correctly, the View shouldn't have anything to do with the feedback - that should be dealt with by the Controller.
So what do I actually put in the Controller? Do I put the public void actionPerformed(ActionEvent e) in the View with just a call to a method in the Controller? If so, should any validation etc be done in the Controller? If so, how do I feedback error messages backto the View - should that go through the Model again, or should the Controller just send it straight backto View?
If the validation is done in the View, what do I put in the Controller?
Sorry for the long question, I just wanted to document my understanding of the process and hopefully someone can clarify this issue for me!
This is deals_controller.rb. And it works like this, except two things.
Not sure how to call Deal.count to add in my flash[:notice] . I get the hunch that its not calling something global.
I need that contional statement back, as I'm pretty sure its responsible for actually adding the new @deal . So I assume my syntax is off. Do note, I added an extra 'end' when I uncomment this block.
def create
-# This will use the disclaimer_ids submitted from the check boxes in the view
-# to add/delete deal.disclaimers entries to matched the list of checked boxes.
@deal = Deal.new(params[:deal])
-# <------I Need this commented out IF statement back -------
-#if @deal.valid? && @organization.deals << @deal
flash[:notice] = 'Your promotion is published! You may find it in the number 1 position of our #{deal.count} previously posted promotions. To see your promotion, click here."'
respond_to do |format|
format.html { redirect_to organization_deals_path(@organization) }
format.js
-# I Need this IF Statement Back!
-#else
-#@disclaimers = Disclaimer.all
-#render :action = 'new'
end
end
Thanks!
Hey everybody,
I'm looking for a more robust and fully featured GUI SVN manager for Mac than what is built into XCode (which works, but only as long as you don't need anything beyond the bare basics and doesn't work for versioning scripts and such created in other editors).
I can use the terminal commands, but I'd really like the option of using a GUI.
On windows I use TortoiseSVN and Visual SVN, which do pretty much everything I need, but as far as I'm aware there's nothing even remotely resembling those on the Mac side.
Hi,
what the syntax is in Action Mailer Basics rails guide ?
class UserMailer < ActionMailer::Base
def welcome_email(user)
recipients user.email
from "My Awesome Site Notifications <[email protected]>"
subject "Welcome to My Awesome Site"
sent_on Time.now
body {:user => user, :url => "http://example.com/login"}
end
end
How should i understand the construction, like
from "Some text for this field"
Is it an assignment the value to a variable, called "from" ?