We have a number of VMWare Server 2.0 virtual machines that were created using VMWare Converter (It copies a physical machine to a virtual machine). If we need to convert the virtual machine back to a physical machine is there way to accomplish this easily? Essentially doing the VMWare Converter process in reverse.
Hi.
I have created a small and simple android app. I tried installing it on an actual android device. But because it won't install, I created an AVD resembling my phone. I tried copying and installing app on that AVD and it still says that error. "Application xxx could not be installed on this phone".
Before I tried installing my app on the phone or AVD I following steps:
1. Exported an unsigned copy of application onto my hard-drive.
2. User jarsigner to sign the app
3. Verified with jarsigner that my app is signed properly.
4. Used zipalign to optimize the app resources.
I do not have an icon assigned to myapp but mandatory properties like version etc. have been specified properly.
I had initially developed app using 2.1 version but because of compatability issues with my phone I reverted code to compile on 1.5 and it still doesn't get installed either on AVD or my phone.
My AVD is on 2.1 though and code is compiled with 1.5.
Is there a place where I can see the logs as to why app is not getting installed. It would be really helpful.
Cheers
Related question: http://stackoverflow.com/questions/199333/best-way-to-detect-integer-overflow-in-c-c
In C code, should integer overflow be addressed whenever integers are added? It seems like pointers and array indexes should be checked at all. When should integer overflow be checked for?
When numbers are added in C without type explicitly mentioned, or printed with printf, when will overflow occur?
Is there a way to automatically detect when an integer arithmetic overflow?
I want a string type that is Unicode and that stores the string directly at the adress of the variable, as is the case of the (Ansi-only) ShortString type.
I mean, if I declare a S: ShortString and let S := 'My String', then, at @S, I will find the length of the string (as one byte, so the string cannot contain more than 255 characters) followed by the ANSI-encoded string itself.
What I would like is a Unicode variant of this. That is, I want a string type such that, at @S, I will find a unsigned 32-bit integer containing the length of the string in bytes (or in characters, which is half the number of bytes) followed by the Unicode representation of the string. I have tried WideString, UnicodeString, and RawByteString, but they all appear only to store an adress at @S, and the actual string somewhere else (I guess this has do do with reference counting and such).
I suspect that there is no built-in type to use, and that I have to come up with my own way of storing text the way I want (which actually is fun). Am I right?
I have a base class "Parent" like this:
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication1
{
class Parent
{
private int parentVirtualInt = -1;
public virtual int VirtualProperty
{
get
{
return parentVirtualInt;
}
set
{
if(parentVirtualInt != value)
{
parentVirtualInt = value;
}
}
}
}
}
and a child class like this:
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication1
{
class Child : Parent
{
public override int VirtualProperty
{
get
{
if(base.VirtualProperty > 0)
{
throw new ApplicationException("Dummy Ex");
}
return base.VirtualProperty;
}
set
{
if(base.VirtualProperty != value)
{
base.VirtualProperty = value;
}
}
}
}
}
Note that the getter in Child is calling the getter of Parent (or at least this is what I intend).
I now use the "Child" class by instantiating it, assigning a value (let's say 4) to its VirtualProperty and then reading the property again.
Child c = new Child();
c.VirtualProperty = 4;
Console.Out.WriteLine("Child.VirtualProperty: " + c.VirtualProperty);
When I run this, I obviously get an ApplicationException saying "Dummy Ex". But if I set a breakpoint on the line
if(base.VirtualProperty > 0)
in Child and check the value of base.VirtualProperty (by hovering the mouse over it) before the exception can be thrown (I assume(d)), I already get the Exception. From this I convey that the statement base.VirtualProperty in the "Child-Getter calls itself"; kind of.
What I would like to achieve is the same behavior I get when I change the definition of parentVirutalInt (in Parent) to protected and use base.parentVirtualInt in the Getter of Child instead of base.VirtualProperty. And I don't yet see why this is not working. Can anybody shed some light on this? I feel that overridden properties behave differently than overridden methods?
By the way: I am doing something very similar with subclassing a class I do not have any control over (this is the main reason why my "workaround" is not an option).
Kind regards
This program takes string like that 192.168.1.125 and cut every number then converts it to integer, but it returns an error.
import java.lang.String;
import java.lang.Number;
import java.lang.Integer;
class Ip
{
public static void main ( String [] args )
{
int i ;
i = args[0].indexOf ( '.' );
do
{
if ( i != -1 )
args[0].substring ( 0, i );
String str = args[0].substring ( i + 1, args[0].length() );
String str2 = Integer.parseInt ( str );
System.out.println ( str2 );
}
while ( i != -1 );
}
}
Hello!
[I am rather new to Java and Object Oriented programming]
I have an abstract class Moveable with the method abstract void move() which is extended by the class Bullet and the abstract class Character, and Character is extended by the class Survivor and the class Zombie. In Survivor and Bullet the move() method doesnt require any parameters while in the class Zombie the move() method depends on the actual position of the survivor. The survivor and multiple zombies are created in the class Gui.
I wanted to access the survivor in Zombie - what's the best way of doing this? In Gui i wrote a method getSurvivor() but i don't see how to access this method in Zombie?
I am aware that as a workaround i could just pass a [Survivor survivor] as parameter in move() and ignore it in Bullet and Survivor, but that feels so ... bad practice.
Thank you for your time!
Samuel
[I am not sure what tags to set here, please correct me if i'm wrong]
I have the following foloder tree on my shared hosting server:
www.somesite.com
|
|_ public_html (document folder)
|_ .htaccess (Apache file)
|_ inde.html (page shown by server now when someone looks for www.somesite.com)
|
|_ site_editor (folder)
| |_login.html (site editor control panel)
| |_file1.php
| |_file2.php
| |_ ...
|
|_ website (folder)
|_ index.html (website HOME PAGE)
|_ page1.html
|_ page2.html
|_ etc.
Now when someone looks for www.somesite.com the webserver look for index.html in public_html folder.
I would like the web server to show website/index.html when someone looks for www.somesite.com and I would like his browser bar to show only www.somesite.com/index.html and not www.somesite.com/website/index.html
I would also like the web server to show site_editor/login.html when someone looks for www.somesite.com/site_editor/
Is it possible to accomplish both task by setting .htaccess files in some ways???
Thanks!
I have a Fabric task that needs to access the settings of my Django project.
On Windows, I'm unable to install Fabric into the project's virtualenv (issues with Paramiko + pycrypto deps). However, I am able to install Fabric in my system-wide site-packages, no problem.
I have installed Django into the project's virtualenv and I am able to use all the " python manage.py" commands easily when I activate the virtualenv with the "VIRTUALENV\Scripts\activate.bat" script.
I have a fabric tasks file (fabfile.py) in my project that provides tasks for setup, test, deploy, etc. Some of the tasks in my fabfile need to access the settings of my django project through "from django.conf import settings".
Since the only usable Fabric install I have is in my system-wide site-packages, I need to activate the virtualenv within my fabfile so django becomes available. To do this, I use the "activate_this" module of the project's virtualenv in order to have access to the project settings and such. Using "print sys.path" before and after I execute activate_this.py, I can tell the python path changes to point to the virtualenv for the project. However, I still cannot import django.conf.settings.
I have been able to successfully do this on *nix (Ubuntu and CentOS) and in Cygwin. Do you use this setup/workflow on Windows? If so Can you help me figure out why this wont work on Windows or provide any tips and tricks to get around this issue?
Thanks and Cheers.
REF:
http://virtualenv.openplans.org/#id9 | Using Virtualenv without
bin/python
Local development environment:
Python 2.5.4
Virtualenv 1.4.6
Fabric 0.9.0
Pip 0.6.1
Django 1.1.1
Windows XP (SP3)
Googled for this to no avail. Didn't find anything in the API either. I was expecting some kind of class method or configuration option to set it...
So, rather than calling
from "[email protected]"
for every method, it could be called automatically.
I'm trying to write an extension that will block access to (configurable) list of URLs if they are accessed more than N times per hour. From what I understand, I need to have a start script pass a "should I load this" message to a global HTML page (who can access the settings object to get the list of URLs), who will give a thumbs up/thumbs down message back to the start script to deny/allow loading.
That works out fine for me, but when I use the usual beforeLoad/canLoad handlers, I get messages for all the sub-items that need to be loaded (images/etc..), which screws up the #accesses/hour limit I'm trying to make.
Is there a way to synchronously pass messages back and forth between the two sandboxes so I can tell the global HTML page, "this is the URL in the window bar and the timestamp for when this request came in", so I can limit duplicate requests?
Thanks!
I'd like to create a virtual machine running on Windows 7. On Win XP / Vista I have been using either MS Virtual PC or VMWare Workstation. I believe I heard somewhere that virtualization is part of Windows 7.
Can someone tell me how I can create a virtual machine or point me in the right direction?
I frequently find myself creating classes which use this form (A):
abstract class Animal {
public void Walk() {
// TODO: do something before walking
// custom logic implemented by each subclass
WalkInternal();
// TODO: do something after walking
}
protected abstract void WalkInternal();
}
class Dog : Animal {
protected override void WalkInternal() {
// TODO: walk with 4 legs
}
}
class Bird : Animal {
protected override void WalkInternal() {
// TODO: walk with 2 legs
}
}
Rather than this form (B):
abstract class Animal {
public abstract void Walk();
}
class Dog : Animal {
public override void Walk() {
// TODO: do something before walking
// custom logic implemented by each subclass
// TODO: walk with 4 legs
// TODO: do something after walking
}
}
class Bird : Animal {
public override void Walk() {
// TODO: do something before walking
// custom logic implemented by each subclass
// TODO: walk with 2 legs
// TODO: do something after walking
}
}
As you can see, the nice thing about form A is that every time you implement a subclass, you don't need to remember to include the initialization and finalization logic. This is much less error prone than form B.
What's a standard convention for naming these methods?
I like naming the public method Walk since then I can call Dog.Walk() which looks better than something like Dog.WalkExternal(). However, I don't like my solution of adding the suffix "Internal" for the protected method. I'm looking for a more standardized name.
Btw, is there a name for this design pattern?
I'm sorry if the question title may mis-inform you, but I cannot find a proper word to explain that.
If you ever working with .NET, you would know that there is Assert class that will automatically wake up and attach debugger if necessary and then have debugger (Visual Studio) pausing at the Assert command, given the Assert command failed.
Given I'm running a java program and having debugger connected, then how can I have debugger to break on certain condition without manually setup a break point?
I'm expecting something like that:
void doSomeThing(String x){
if (x==null) breakDebuggerNow();
}
hi,
how to know email-Id of sender using MFmailComposerView controller.My requirement is to get all email-Id's who are sending mails using my application. i tried by adding Bcc to my mail-Id. But it may erase by user(sender), so i will not get his/her mail-Id. So how to overcome this issue. is it possible to get email-Id's of all using our Application
I have a web application where users can register them self and then save Java and C++ programs in their account.
Programs are saved in a tmp directory like,
/tmp
-user1
--program1
--program2
-user2
--program1
--program2
So all the users folders are in same "tmp" directory.
I want to know how can I proved security by not allowing a user to access files of other users. A user will be executing a java or c++ program in his folder which can be used to read files on the server. How to prevent this?
I am new to this thing I don't know how to go about this.
The server is Linux server and project is in python using Django.
Thank in advance
This thread can be treated as a sister thread of this. It's will be very tedious that when you want to bind a link local adress to a ipv6 socket you need to the set sin6_scope_id
field of sockaddr_in6 struct as well. I'm wondering if someone can provide a good practise like solution here for me or anyone who interested in this topic to learn from.
I have a Windows virtual machine running inside Parallels in my Mac OSX.
This virtual machine is setup to use shared network.
What I want is: How to access a IIS service running inside this virtual machine from other computers in the network?
Hi, guys.
Now on unauthorized attempt to access an action my ASP.NET MVC app redirects user to the login page and generates URL shown below:
http://www.mysite.com/Account/Log?ReturnUrl=%2Ftest%2Fsampleaction
So, is there a way to eliminate this string from the URL, but to save it somewhere to be able to redirect user back after login?
Hi
I would like to write a piece of code which checks, for each network device (e.g. eth0, lo, master devices) some statistics and configuration data about that device.
I could find the statistics data (and most of the configuration data) in /sys/class/net/..., however, I couldn't find any C/C++ API or any entry in procfs/sysfs listing the inet addr, netmask and gateway.
Some alternatives I checked:
parsing the output from ifconfig/route/some other utilities: I don't want to start a subprocess every time I need to do the inspection.
parsing /etc/sysconfig/network-scripts/: will give me only the start-up configuration, and not the current state.
Also, since this code is intended for a product in my workplace, where every external library is inspected thoroughly (meaning it will take me forever to add any external library) I prefer solutions which rely on Linux native API and not external libraries.
Thanks!
context 1: class D : public B1, public B2{};
context 2: B2 takes B1 to initialize: B2( B1 * ) //B2's constructor
my question is in D's initialization list:
D::D() : B1(), B2( ? )... What should be in ?
I don't want to put " (B1*)this " in the ? place, because it's no good to use "this" in initialization list. And since B1 part has been initialized, it makes sense to use it.
What should I do ?