Can I use GameKit to send data from an iPhone to an accessory, and if not is there some other way to connect without joining the Made for iPhone program
I've set up my .htaccess so far as follows:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?page=$1 [QSA]
My index.php loads the file from /pages, eg. index.php?page=home will load the page content from pages/home.php
However - if someone went to pages/home.php the page loads without the headers etc. which is undesirable. What can I add to redirect any URLs ending in .php to just take the user to the homepage?
Thanks
Hello,
I'm using a TreeViewer within a jface WizardPage and the initial input into the tree causes the WizardPage to grow vertically so that it can show all of the tree's values. When expanding one of the tree's values, then the vertical scrollbar works as expected. I'd like to be able to set the tree's size initially so that it is fixed and the scrollbar is already shown when the WizardPage is first drawn, but doing this isn't particularly obvious to me - the setSize method on the TreeViewer's Tree doesn't seem to do anything.
Any help would be appreciated!
Hi,
I have a DHTML layer that floats across a webpage. Everything is working with the DHTML layer, except when it goes pass the Windows Media Player toolbar. It goes behind the toolbar. Any idea how to fix this?
Thanks in advance for your help.
Is it possible to launch any arbitrary iPhone application from within another app? For example in my application if I want the user to push a button and launch right into the Phone app (close the current app, open the Phone app), would this be possible? I know this can be done for making phone calls with the tel URL link, but I want to instead just have the Phone app launch without dialing any specific number.
I have a two way foreign relation similar to the following
class Parent(models.Model):
name = models.CharField(max_length=255)
favoritechild = models.ForeignKey("Child", blank=True, null=True)
class Child(models.Model):
name = models.CharField(max_length=255)
myparent = models.ForeignKey(Parent)
How do I restrict the choices for Parent.favoritechild to only children whose parent is itself? I tried
class Parent(models.Model):
name = models.CharField(max_length=255)
favoritechild = models.ForeignKey("Child", blank=True, null=True, limit_choices_to = {"myparent": "self"})
but that causes the admin interface to not list any children.
I have 2 versions installed in my server. I used virtualenv to install Python 2.7.
I am using WSGI to deploy my project.
WSGIPythonPath /home/ENV/lib/python2.7/site-packages
WSGIScriptAlias / /var/www/html/my_project/wsgi.py
My http.conf is like that.
python -V gives
Python 2.7.3
But in my projects Debug window, it says Django is using 2.6.8. Where am I wrong?
UPDATE: Here is my wsgi file
import os
import sys
sys.path.append('/var/www/html')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "myproject.settings")
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
Python Version: 2.6.8
Python Path:
['/home/ENV/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg',
'/home/ENV/lib/python2.7/site-packages/pip-1.1-py2.7.egg',
'/home/ENV/lib/python2.7/site-packages/Django-1.4-py2.7.egg',
'/home/ENV/lib/python2.7/site-packages',
'/usr/lib/python2.6/site-packages/pip-1.1-py2.6.egg',
'/usr/lib/python2.6/site-packages/django_transmeta-0.6.7-py2.6.egg',
'/usr/lib/python2.6/site-packages/ipython-0.13-py2.6.egg',
'/usr/lib/python2.6/site-packages/virtualenv-1.7.2-py2.6.egg',
'/usr/lib64/python26.zip',
'/usr/lib64/python2.6',
'/usr/lib64/python2.6/plat-linux2',
'/usr/lib64/python2.6/lib-tk',
'/usr/lib64/python2.6/lib-old',
'/usr/lib64/python2.6/lib-dynload',
'/usr/lib64/python2.6/site-packages',
'/usr/lib64/python2.6/site-packages/gtk-2.0',
'/usr/lib/python2.6/site-packages',
'/usr/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg-info',
'/var/www/html']
In my error_log of httpd:
[Tue Jul 10 20:51:29 2012] [error] python_init: Python version mismatch, expected '2.6.7', found '2.6.8'.
[Tue Jul 10 20:51:29 2012] [error] python_init: Python executable found '/usr/bin/python'.
[Tue Jul 10 20:51:29 2012] [error] python_init: Python path being used '/usr/lib64/python26.zip:/usr/lib64/python2.6/:/usr/lib64/python2.6/plat-linux2:/usr/lib64/python2.6/lib-tk:/usr/lib64/python2.6/lib-old:/usr/lib64/python2.6/lib-dynload'.
Here's my stack trace. Where do I start to figure this out? I've tried a ton of NSLog()s and I can't track it down.
#0 0x94e9ced7 in objc_msgSend ()
#1 0x04936318 in ?? ()
#2 0x0259b252 in __CFRunLoopDoObservers ()
#3 0x0259a65f in CFRunLoopRunSpecific ()
#4 0x02599c48 in CFRunLoopRunInMode ()
#5 0x02ae7615 in GSEventRunModal ()
#6 0x02ae76da in GSEventRun ()
#7 0x0061dfaf in UIApplicationMain ()
#8 0x000051cc in main
Does anyone know if there is a library that exists to help test if an object graph is fully serializable? It would probably be as simple as writing it out and reading it back in, but I figured someone must have abstracted this already - I just can't find it.
* * * * * php /home/admin/public_html/domain.com/public/cron/route.php &>> /home/admin/public_html/domain.com/log/cron.log
I have that cron running every minute.
I want to store the errors that occur in route.php in cron.log
This works wonderfully when I run :
php /home/admin/public_html/domain.com/public/cron/route.php &>> /home/admin/public_html/domain.com/log/cron.log
through the command line manually. But when crontab runs it no errors gets stored in cron.log
the cron.log is owned by admin:admin and the permissions are set to 777 just to be sure.
anyone?
Our system complexity has risen to the point that we need to make permission names tied to the client from the database more specific. In the client, permissions are referenced from a static class since a lot of client functionality is dependent on the permissions each user has and the roles have a ton of variety. I've referenced this post as an example, but I'm looking for a more specific use case. Take for instance this reference, where PermissionAlpha would be a const string:
return HasPermission(PermissionNames.PermissionAlpha);
Which is great, except now that things are growing more complex the classes are being structured like this:
public static class PermissionNames
{
public static class PermissionAlpha
{
public const string SubPermission;
}
}
I'm trying to find an easy way to reference PermissionAlpha in this new setup that will act similar to the first declaration above. Would the only way to do this be to resort to pulling the value of the class name like in the example below? I'm trying to keep all the names in one place that can be reference anywhere in the application.
public static class PermissionAlpha
{
public static string Name { get { return typeof(PermissionAlpha).Name; } }
}
I'm using Netbeans to build a Grails app, while I have used this fine before on this new computer I can not get even the basic project to compile and run. I am getting errors around compiling the Tomcat plugin. If I uninstall the plugin it and use Jetty instead it will compile but the project isn't set up for Jetty and is missing files.
Below is the error I'm getting I'm thinking it is some issue with my classpath but I just don't know where to start any help would be much appreciated.
java.lang.NoClassDefFoundError: org/apache/catalina/startup/Tomcat$ExistingStandardWrapper
I have an NGINX server with fastcgi/PHP running on it. I need to add userdirs to it, but I can't get PHP to execute the files - it just asks me if I want to download it. It does work without the userdir (eg: it works on physibots.info/hugs.php, but not physibots.info/~kisses/hugs.php)
Any help is greatly appreciated.
Config:
server {
listen 80;
server_name physibots.info;
access_log /home/virtual/physibots.info/logs/access.log;
root /home/virtual/physibots.info/public_html;
location ~ ^/~(.+?)(/.*)?\.php$ {
fastcgi_param SCRIPT_FILENAME /home/$1/public_html$fastcgi_script_name;
fastcgi_pass unix:/tmp/php.socket;
}
location ~ ^/~(.+?)(/.*)?$ {
alias /home/$1/public_html$2;
autoindex on;
}
location ~ \.php$ {
try_files $uri /error.html/$uri?null;
fastcgi_pass unix:/tmp/php.socket;
}
}
Today I implemented the horizontal jScrollPane script and the element I intended to scrolls like a charm. Via CSS I'm using an image for the jspDrag element.
Now for my question; I see that there are a few css classes added to the jspDrag like jspHover and jspActive. Is it also possible to add css classes when I scroll to the left or right?
I would like to do this, so I can change the image according to the scroll.
(Hoping my question is clear, a reaction would be highly appreciated. Kind regards)
Trying to use regex refind tag to find the content within the brackets in this example using coldfusion
joe smith <[email protected]>
The resulting text should be
[email protected]
Not having any luck. Any suggestions?
I have a problem parsing a stored procedure parameter in the form:
declare @S varchar(100)
set @S = '4=2,24=1534'
Here's the query:
select
cast(idx as varchar(100)) 'idx'
, value
, SUBSTRING(value, 1, charindex(value, '=')+1) 'first'
, SUBSTRING(value, charindex(value, '=')+1, LEN(value)-charindex(value, '=')-1) 'second'
from Common.SplitToTable(@S, ',') -- returns (idx int, value varchar(max))
where len(value) > 0
But here is the result I get:
idx value first second
0 4=2 4 4=
1 24=1534 2 24=153
Here's what I expected:
idx value first second
0 4=2 4 2
1 24=1534 2 1534
Help?
How do I return the everything in a string from a sql query before a certain character?
My data looks like this:
HD TV HM45VM - HDTV widescreen television set with 45" lcd
I want to limit or truncate the string to include everything before the dash.
So the final result would be "HD TV HM45VM"
i JUST PUT A asp:ScriptManager WITH IN MY LOGIN PAGE AND FOR THE USE OF A TAG CLOUD . AND AFTER LOGIN PROVIDING UNAME AND PWORD REDIRECT TO HOME PAGE.
HOME PAGE CONSIST OF A MASTER PAGE AND I PUT A asp:ScriptManager WITH IN THE MASTER FILE. BUT WHEN THE HOME PAGE LOADING THE FOLLOWING ERROR APPEARS
"The control with ID 'AutoCompleteExtender1' requires a ScriptManager on the page. The ScriptManager must appear before any controls that need it. "
HOME PAGE HAVE SEVERAL CONTROLS USE WITH AJAX.
CAN ANY ONE HELP ME ???
I have a simple array with x number of items. I am displaying them individually via a link click... I want to update a number that say 1 of 10. when the next one is displayed i want it to display 2 of 10 etc...
I have looked all around and my brain is fried right now... I know its simple I just cant get it out.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Page Title</title>
<link rel="stylesheet" href="style.css" type="text/css" media="screen" charset="utf-8"/>
<script type="text/javascript">
var quotations = new Array()
quotations[0]= "1"
quotations[1]= "2"
quotations[2]= "3"
quotations[3]= "4"
quotations[4]= "5"
quotations[5]= "6"
quotations[6]= "7"
numQuotes = quotations.length;
curQuote = 1;
function move( xflip ) {
curQuote = curQuote + xflip;
if (curQuote > numQuotes)
{ curQuote = 1 ; }
if (curQuote == 0)
{ curQuote = numQuotes ; }
document.getElementById('quotation').innerHTML=quotations[curQuote - 1];
}
var curPage = //this is where the current index should go
</script>
</head>
<body>
<div id="quotation">
<script type="text/javascript">document.write(quotations[0]);</script>
</div>
<div>
<p><a href="javascript();" onclick="move(-1)">GO back</a>
<script type="text/javascript">document.write(curPage + " of " + numQuotes)</script>
<a href="javascript();" onclick="move(1)">GO FORTH</a></p>
</div>
</body>
</html>
I have a Java code which is a controller for a jsp page, called: HomeController.java. Code is as follows:
@Controller
public class HomeController {
protected final transient Log log = LogFactory.getLog(getClass());
@RequestMapping(value = "/mypage")
public String home() {
System.out.println("HomeController: Passing through...");
return "home";
}
}
There is nothing especial in the jsp page: home.jsp. If I go to this url:
http://localhost:8080/adcopyqueue/mypage
I can view mypage and everything works fine. Also in the tomcat Dos page I can see the comment:
HomeController: Passing through...
As expected.
Now under the same directory that I have HomeController.java, I've created another file called: LoginController.java. Following is the code:
@Controller
public class LoginController {
protected final transient Log log = LogFactory.getLog(getClass());
@RequestMapping(value = "/loginpage")
public String login() {
System.out.println("LoginController: Passing through...");
return "login";
}
}
And under the same place which I have home.jsp, I've created login.jsp.
Also under tomcat folders, LoginController.class exists under the same folder that HomeController.class exists and login.jsp exists under the same folder which home.jsp exists.
But when I go to this url: http://localhost:8080/adcopyqueue/loginpage
Nothing is displayed! I think tomcat does not pick up LoginController.class b/c on the tomcat Dos window, I do NOT see this comment:
LoginController: Passing through...
Instead I see following which I do not know what do they mean?
[ INFO] [http-8080-1 01:43:45] (AppInfo.java:populateAppInfo:34) got manifest
[ INFO] [http-8080-1 01:43:45] (AppInfo.java:populateAppInfo:36) manifest entrie
s 8
The structure and the code for HomeController.java and LoginController.java plus the jsp files match. I have no idea why tomcat sees one of the files and not the other?
Clean build did not help. Does anybody have any idea? Any help is greatly appraciated.
I understand there are multiple questions about this on SO, but I have yet to find a definitive answer of "yes, here's how..."
So here it is again: What are the possible ways to store an unsigned integer value (32-bit value or 32-bit bitmap) into a 4-byte field in SQL Server?
Here are ideas I have seen:
1) Use a -1*2^31 offset for all values
Disadvantages: need to perform math on the values before reading/writing/aggregating.
2) Use 4 tinyint fields
Disadvantages: need to concatenate values to perform any operations
3) Use binary(4)
Disadvantages: actually uses 4 + 2 bytes of space
I have a list of fixtures.Each fixture has a home club and a away club attribute.I want to slice the list in association of its home club and away club.The sliced list should be of homeclub items and awayclub items.
Easier way to implement this is to first slice a list of fixtures.Then make a new list of the corresponding Home Clubs and Away Clubs.I wanted to know if we can do this one step.
Hello I have the following code:
if(_deviceSegmentCntrl.selectedSegmentIndex == 0)
{
deviceOne = [[NSString alloc] initWithFormat:@"string01"];
}
if(_deviceSegmentCntrl.selectedSegmentIndex == 1)
{
deviceOne = [[NSString alloc] initWithFormat:@"string02"];
}
if(_deviceSegmentCntrl.selectedSegmentIndex == 2)
{
deviceOne = [[NSString alloc] initWithFormat:@"string03"];
}
NSString *deviceType = [[NSString alloc] initWithFormat:_deviceSegmentCntrl];
I am wanting to have the NSString output the string the user selects in the segmented control.
How do I append the initWithFormat: so that it reflects the chosen index?
Cheers