Daily Archives

Articles indexed Wednesday December 22 2010

Page 13/32 | < Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >

  • Draw and move animation from xml in android

    - by Muahammad Yousuf Saif
    What I want to do: I want to draw image from xml and then animate it from xml. this image should move with constant speed anywhere on our screen. Now the problem is: I can draw and animate image from xml but i can not move this image with constant speed. I am using two xml files: One for animate and other for moving. XML for animation: android:duration="200"/ XML file for move: <translate android:interpolator="@android:anim/linear_interpolator" android:fromXDelta="2%" android:toXDelta="400%" android:fromYDelta="2%" android:toYDelta="800%"/> Activity.java file code in onCreate() method: ImageView rocketImage = (ImageView) findViewById(R.id.rocket_image); Animation hyperspaceJump = AnimationUtils.loadAnimation(this, R.anim.hyperspace_jump); rocketImage.setBackgroundResource(R.drawable.rocket_thrust); AnimationDrawable rocketAnimation = (AnimationDrawable) rocketImage.getBackground(); rocketAnimation.start(); rocketImage.startAnimation(hyperspaceJump);

    Read the article

  • thread destructors in C++0x vs boost

    - by Abruzzo Forte e Gentile
    Hi All These days I am reading the pdf Designing MT programs . It explains that the user MUST explicitly call detach() on an object of class std::thread in C++0x before that object gets out of scope. If you don't call it std::terminate() will be called and the application will die. I usually use boost::thread for threading in C++. Correct me if I am wrong but a boost::thread object detaches automatically when it get out of scope. Is seems to me that the boost approach follow a RAII principle and the std doesn't. Do you know if there is some particular reason for this? Kind Regards AFG

    Read the article

  • Refactoring method that was previously injected with implement

    - by ryber
    Greetings, I'm trying to override or extend the Element.show() and .hide() methods in mootools in order to add some WAI-Aria toggling. I was trying to use the Class.Refactor() method like this: Element = Class.refactor(Element, { show: function(displayString) { result = this.previous(displayString); // Do my thing return result; }, hide: function() { result = this.previous(); // Do my thing return result; } }); however, this is not working, previous is null and I think the reason is that Mootools injects those methods through Element.implement. So the methods are not native? I have figured out how to completely replace .show and .hide but I would like to retain all of their existing functionality and just add to it. Any ideas?

    Read the article

  • Read some content of a resource on internet

    - by Andreas Johannessen
    Hi For my iPhone application I need to read some content of a plain html file on the web. It's just some text within a pre-tag. However I don't want to download the whole file and then get the line I need. The format is: TextTextTextTextTextTextTextText TextTextTextTextTextTextTextText TextTextTextTextTextTextTextText TextTextTextTextTextTextTextText I only need the first line and then close the connection to that resource. Thanks in advance.

    Read the article

  • How to make TObjectDictionary.Values accessible as property?

    - by Holgerwa
    I have an object like this: TMyObj = class private FObjList: TObjectDictionary <integer, TMyObject>; public constructor Create; destructor Destroy; // How to access Values correctly? Something similar to this not working code property Values: TValueCollection read FObjList.Values write FObjList.Values; end; var MyObj: TMyObj; To access the values of FObjList, I'd like to write: for tmpObject in MyObj.Values do ... How do I need to declare the property "Values" so that MyObj.Values behaves exactly as if I would access MyObj.FObjList.Values?

    Read the article

  • Recommended/Standard image thumbnails sizes

    - by Rakan
    Hello, Based on my experience in web development, HTML page designs for every website may have different < img tags showing the same image in different sizes. i.e: the website's main page might show the image in 500*500, the listing page might show it in 200*150 and other sections of the website will use different sizes. As you can see the ratios of the images to be displayed to the user are different and therefore will cause a problem in having the image stretched, pixelated and/or other quality problems. How i currently handle this issue is by using a jQuery cropping tool to make the user select the area to crop the thumbnail from. the cropped image is then resized using imagick to fit every position in the page design. However, although i can force the user to crop an image based on a pre-defined ratio, the HTML will still contain image placeholders which require a different ratio for its thumbnail. So for every image, i will have to force the user to crop the uploaded image based on every possible ratio my site requires. I don't think this is a friendly solution, how would you do it? is there a standard/recommended ratio for the web? Thanks

    Read the article

  • NetUserGetLocalGroups - how to call it?

    - by SteveL
    Hi, I am using Delphi 2010, latest version (from repository) of JEDI WinAPI and Windows Security Code Library (WSCL). I don't know how to call the NetUserSetGroups function. The way I am doing it, it is throwing an exception: Access violation at address 5B8760BE in module 'netapi32.dll'. Write of address 00000000. Following is my code: unit uFunc; interface uses Windows, SysUtils, JwaWindows, JwsclSid, Classes; function UserExists(const username: PChar): boolean; stdcall; function AddUser(const username, password: PChar; resetpassword: boolean): boolean; stdcall; //function AddLogonAsAService(ID: pchar): boolean; implementation uses Dialogs; // Returns true if the username exists on the local computer function UserExists(const username: PChar): boolean; stdcall; var NetApiStatus: NET_API_STATUS; ui: PUSER_INFO_0; begin NetApiStatus := NetUserGetInfo(nil, PWideChar(username), 0, PByte(ui)); if Assigned(ui) then NetApiBufferFree(ui); if (NetApiStatus <> NERR_Success) and (NetApiStatus <> NERR_UserNotFound) then RaiseLastOSError(NetApiStatus); Result := (NetApiStatus = NERR_Success); end; function AddPrivilegeToAccount(AAccountName, APrivilege: String): DWORD; var lStatus: TNTStatus; lObjectAttributes: TLsaObjectAttributes; lPolicyHandle: TLsaHandle; lPrivilege: TLsaUnicodeString; lSid: PSID; lSidLen: DWORD; lTmpDomain: String; lTmpDomainLen: DWORD; lTmpSidNameUse: TSidNameUse; lPrivilegeWStr: String; begin ZeroMemory(@lObjectAttributes, SizeOf(lObjectAttributes)); lStatus := LsaOpenPolicy(nil, lObjectAttributes, POLICY_LOOKUP_NAMES, lPolicyHandle); if lStatus <> STATUS_SUCCESS then begin Result := LsaNtStatusToWinError(lStatus); Exit; end; try lTmpDomainLen := DNLEN; // In 'clear code' this should be get by LookupAccountName SetLength(lTmpDomain, lTmpDomainLen); lSidLen := SECURITY_MAX_SID_SIZE; GetMem(lSid, lSidLen); try if LookupAccountName(nil, PChar(AAccountName), lSid, lSidLen, PChar(lTmpDomain), lTmpDomainLen, lTmpSidNameUse) then begin lPrivilegeWStr := APrivilege; lPrivilege.Buffer := PWideChar(lPrivilegeWStr); lPrivilege.Length := Length(lPrivilegeWStr) * SizeOf(Char); lPrivilege.MaximumLength := lPrivilege.Length; lStatus := LsaAddAccountRights(lPolicyHandle, lSid, @lPrivilege, 1); Result := LsaNtStatusToWinError(lStatus); end else Result := GetLastError; finally FreeMem(lSid); end; finally LsaClose(lPolicyHandle); end; end; //if user does not exists, create a local username with the supplied password //if resetpassword, then reset password to the supplied parameter //add the user to the local administrators group (note that this must work //on all languages, use the SID of the group) //give the user the "run as a service" privilege. //enable the user if it is disabled. function AddUser(const username, password: PChar; resetpassword: boolean): boolean; stdcall; var NetApiStatus: NET_API_STATUS; UserInfo1003: USER_INFO_1003; // UserInfo1005: USER_INFO_1005; ui: USER_INFO_1; grp: String; sidstring: String; lgmi3: LOCALGROUP_MEMBERS_INFO_3; jwSid: TJwSecurityID; dwEntriesRead, dwEntriesTotal: PDWORD; lgi01: LOCALGROUP_USERS_INFO_0; plgi01 : PLOCALGROUP_USERS_INFO_0; i: Integer; gsl: TStringList; begin if UserExists(username) then begin if resetpassword then begin NetApiStatus := NetUserChangePassword(nil, PChar(username), PChar(''), PChar(password)); // If old password is incorrect then force password change if (NetApiStatus = ERROR_INVALID_PASSWORD) then begin UserInfo1003.usri1003_password := PChar(password); NetApiStatus := NetUserSetInfo(nil, PChar(username), 1003, @UserInfo1003, nil); end; if (NetApiStatus <> NERR_Success) and (NetApiStatus <> NERR_UserNotFound) then RaiseLastOSError(NetApiStatus); // UserInfo1005.usri1005_priv := USER_PRIV_ADMIN; // NetApiStatus := NetApiStatus and NetUserSetInfo(nil, PChar(username), 1005, @UserInfo1005, nil); end; end else begin ui.usri1_name := PChar(username); ui.usri1_password := PChar(Password); ui.usri1_password_age := 0; // ignored in this call ui.usri1_priv := USER_PRIV_USER; // ui.usri1_home_dir := nil; ui.usri1_comment := PChar(''); ui.usri1_flags := UF_SCRIPT or UF_DONT_EXPIRE_PASSWD; ui.usri1_script_path := nil; NetApiStatus := NetUserAdd(nil, 1, @ui, nil); if NetApiStatus <> NERR_Success then RaiseLastOSError(NetApiStatus); end; Result := (NetApiStatus = NERR_Success); //check if user already belongs to Administrators group if Result then begin sidstring := 'S-1-5-32-544'; //Local Administrators group jwSid := TJwSecurityID.Create(sidstring); try grp := jwSid.GetAccountName(''); finally jwSid.Free; end; gsl := TStringList.Create; try // New(plgi01); NetApiStatus := NetUserGetLocalGroups(nil, PChar(username), 0, LG_INCLUDE_INDIRECT, PByte(plgi01), MAX_PREFERRED_LENGTH, dwEntriesRead, dwEntriesTotal); if NetApiStatus = NERR_SUCCESS then showmessage('messg ' + IntTostr(dwEntriesRead^)); for i := 0 to dwEntriesRead^ - 1 do begin gsl.Add(PLOCALGROUP_USERS_INFO_0(plgi01)^.lgrui0_name); Inc(Integer(plgi01), SizeOf(Pointer)); end; Result := (NetApiStatus = NERR_Success); NetAPIBufferFree(plgi01); if Result then Result := gsl.Find(grp, i); finally gsl.Free; end; end; //Add user to administrators group if Result then begin lgmi3.lgrmi3_domainandname := PChar(UserName); NetApiStatus := NetLocalGroupAddMembers(nil, PChar(grp), 3, @lgmi3, 1); if NetApiStatus <> NERR_Success then RaiseLastOSError(NetApiStatus); end; Result := (NetApiStatus = NERR_Success); try AddPrivilegeToAccount(UserName, 'SeServiceLogonRight'); except // showmessage('messg in an Excecpt'); end; end; end. Would appreciate if someone could kindly show me how I can call this function? Thanks in advance.

    Read the article

  • Stretching across 2 rows in Table Layout

    - by Will03uk
    How do I stretch across 2 columns in the Table Layout. I have 2 rows with a label and edit text on 1 row and I want to have a single button stretch across the whole second row. <?xml version="1.0" encoding="utf-8"?> <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="fill_parent" android:layout_width="fill_parent" android:background="#000000" android:stretchColumns="1"> <TableRow> <TextView android:text = "Name: " /> <EditText android:id = "@+id/txtAddName" android:gravity = "right" android:layout_width = "fill_parent" /> </TableRow> <TableRow> <TextView android:text = "Phone: " /> <EditText android:id = "@+id/txtAddPhone" android:gravity = "right" android:layout_width = "fill_parent" /> </TableRow> <TableRow> <Button android:id = "@+id/btnAdd" android:text = "Add Entrie" android:layout_width = "fill_parent" /> </TableRow> <TableRow> <Button android:id = "@+id/btnShow" android:text = "Show all Entries" android:layout_width = "fill_parent" /> </TableRow> <TableRow> <Button android:id = "@+id/btnDelete" android:text = "Delete all Entries" android:layout_width = "fill_parent" /> </TableRow> </TableLayout>

    Read the article

  • How to make a SUM of Dictionary Value nested into a list with LINQ ?

    - by user551108
    Hi All, I have a product object declared as : Product { int ProductID; string ProductName; int ProductTypeID; string ProductTypeName; int UnitsSold Dictionary <string, int> UnitsSoldByYear; } I want to make a sum on UnitsSold and UnitsSoldByYear properties with a Linq query but I didn't know how to make this kind of sum on a dictionary ! Here is my begining linq query code : var ProductTypeSum = from i in ProductsList group i by new { i.ProductTypeID, i.ProductTypeName} into pt select new { ProductTypeID= pt.Key.ProductTypeID, ProductTypeName= pt.Key.ProductTypeName, UnitsSoldSum= pt.Sum(i => i.UnitsSold), // How to make a Dictionary sum here } Thank you for your help !

    Read the article

  • How to log python exception ?

    - by Maxim Veksler
    Hi, Coming from java, being familiar with logback I used to do try { ... catch (Exception e) { log("Error at X", e); } I would like the same functionality of being able to log the exception and the stacktrace into a file. How would you recommend me implementing this? Currently using boto logging infrastructre, boto.log.info(...) I've looked at some options and found out I can access the actual exception details using this code: import sys try: 1/0 except: exc_type, exc_value, exc_traceback = sys.exc_info() traceback.print_exception(exc_type, exc_value, exc_traceback) I would like to somehow get the string print_exception() throws to stdout so that I can log it. Thank you, Maxim.

    Read the article

  • How to write php->mysql queries?

    - by Bluemagica
    Is there any good tutorial that has all the basic rules for writing queries to store $_Post vars from php to mysql? Like when to use backticks and singleqoutes, and how to safely write code with functions like get_magic_quotes_gpc()? Another thing is, assuming there is no javascript validation(since the user can easily turn it off), how should I handle empty form fields being sent as empty $_post variables and throwing errors? Do I have to use isset() call on all the post variables? What is the best way to handle users turning off javascript validation on a form?

    Read the article

  • Problematic tags displaying HTML in Java

    - by Andez
    Hi again, I have the following tag included in my HTML which causes the JEditorPane not to show the HTML output. <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> Not so much a big deal but anyone know why this would happen? Cannot find too much documentation on this - best I came up with was someone having a go a few years ago to see what was supported on retro virus site. At the minute I'm doing a simple find replace on the string which is not good - are there any better ways? I've seen a lot of people saying that RegEx is no good. The code I have used is this._html = this._html.replace( "<META http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">", ""); Andez

    Read the article

  • WPF: How to data bind an object to an element and apply a data template through code?

    - by Boris
    I have created a class LeagueMatch. public class LeagueMatch { public string Home { get { return home; } set { home = value; } } public string Visitor { get { return visitor; } set { visitor = value; } } private string home; private string visitor; public LeagueMatch() { } } Next, I have defined a datatemplate resource for LeagueMatch objects in XAML: <DataTemplate x:Key="MatchTemplate" DataType="{x:Type entities:LeagueMatch}"> <Grid Name="MatchGrid" Width="140" Height="50" Margin="5"> <Grid.RowDefinitions> <RowDefinition Height="*" /> <RowDefinition Height="*" /> <RowDefinition Height="*" /> </Grid.RowDefinitions> <TextBlock Grid.Row="0" Text="{Binding Home}" /> <TextBlock Grid.Row="1" Text="- vs -" /> <TextBlock Grid.Row="2" Text="{Binding Visitor}" /> </Grid> </DataTemplate> In the XAML code-behind, I want to create a ContentPresenter object and to set it's data binding to a previously initialized LeagueMatch object and apply the defined data template. How is that supposed to be done? Thanks.

    Read the article

  • How do you monitor a monitoring server?

    - by organicveggie
    So we run Groundworks (with Nagios) on CentOS to monitor our various servers and processes. I have it setup to automatically send emails and SMS texts when things reach a WARNING or CRITICAL state. Normally this works perfectly. However, twice we've had problems with Postfix on that server where Postfix decides to stop sending email. The most recent time lasted 4 days because none of us noticed. That leads me to a important question: how am I supposed to monitor my monitoring server?

    Read the article

  • virutal users in postfix

    - by facha
    Hello everyone, I'd like to setup postfix as an MTA for 2 domains, about 10 users each. I'm a bit confused with the documentation. Postfix has so many options for mail delivery. I'd like to have a simple file where I would store all the email addresses (and possibly their corresponding mailboxes). I wouldn't like neither system's passswd file nor mysql to be used for storing email users. What parts of documentation I should be focused on?

    Read the article

  • Server Performance

    - by Burt
    We have a dedicated server that we use to stage websites (our test server). The performance of the server has become really bad and we regularly have to restart it. When performance is poor I have checked task manager for the processes and memory but everything looks OK. We use a content management system and it is always when using the admin section of this CMS that we notice the performance degrade which makes me think it may have something to do with DB calls the CMS is making. Does this sound viable? Any other sggestions of how I can go about testing this? Thanks in advance...

    Read the article

  • Mails are coming from mail server to my account automatically...???

    - by Jayakrishnan T
    Hi all, i am getting same mail from admin account of my mail server every day automatically.The content of the mail is given below. Click here to access your spam quarantine. The spam quarantine contains emails that are being held from your email account. Quarantined emails can be released to your inbox or deleted using the spam quarantine link. Please give me an advice to solve this problem.

    Read the article

  • Addition of an Extra link to an existing link.

    - by Lawdricky
    I would like to know how to configure a extra link to my Mikrotik Routern or Cisco 3800 series router.In my office our bandwidth is 1mb, which is insufficient.But an extra 4mb was made available to us by a different ISP/hub.How do we integrate this new link into our existing link to boost our bandwidth (N.B it uses a private IP)?Our router has 2 interfaces:1 to the modem n the other to the switch.Kindly reply asap.

    Read the article

  • Running multiple FCGI/Django on Nginx for load sharing

    - by Barry
    I am running a web-service on Nginx/FastCGI/Django. Our processing time is fairly long and CPU intensive and I would like to be able to run multiple processes of Django/FastCGI to share the load. How do I set Nginx to rout requests from a single source to multiple instances of Django/FastCGI? (I can run the multiple instances on multiple ports/sockets, but I don't know how to make Nginx share the processing load between them.) Any help much appreciated.

    Read the article

  • Sound from both speakers and headphones with SoundMAX ADI AD1986A on Windows 7: possible?

    - by oKtosiTe
    My ASUS A8N-VM CSM motherboard has an on-board sound chip–the SoundMAX ADI AD1986A. Although sound does work reliably on Windows 7, I was a bit disappointed that neither ASUS nor the manufacturer of the sound chip offer drivers for it for Windows 7 (or Vista for that matter). Among other things jack detection, output to front and read jack simultaneously and surround sound are no longer available using Microsoft's default HD Audio driver under Windows 7. Under Windows XP and several Linux distributions (Arch, Gentoo and Ubuntu) that I've tried everything works as it should. Since I switch between headphones and speakers quite often, this annoyance begs me to ask: aside from buying a sound card, is there any way to get sound from both outputs at the same time?

    Read the article

  • How to prevent windows 7 shutdown/lock/logoff?

    - by user507993
    Hi, guys In my company staff have to check in after retch to company and check out before leave company on a internal site, sometimes I forget it totally...it's awful. Now i want a program which shows a prompt window when lock/logoff/shutdown, in this way i won't forget any more. Indeed i develop a program (some words and two buttons), and configure this program started when lock/logoff/shutdown in group policy, here is the question: how can i prevent my windows 7 shutdown/logoff/lock? it means i click the button "yes, i want" my pc still running and chrome or something showed up, if i click the button "no, thanks", my pc will shutdown/logoff/lock. please help, thx! i am looking forward to you. ps: i am not good in english, hope you understand. thx again!

    Read the article

  • How to remove a package I compiled and installed manually?

    - by macek
    I recently compiled and installed Git on a new install of Mac OS 10.6 but it didn't install the documentation. I now realize I should've used the precompiled package offered here: http://code.google.com/p/git-osx-installer/downloads/list How do I remove all the files that I added to my system using make install with the Git source code? Edit: I've had similar problems in the past with other packages, too. For example, ./configure with the incorrect --prefix= or something. What's the general practice for removing unix packages?

    Read the article

  • how can i edit my admission form which i filled wrong . their is no other form is avilable now ...what i do ??? [closed]

    - by user60065
    Hi, I am a 2nd year student in graduation. Recently I filled an admission form for final year admission but it came back to me after 2 days because I had entered wrong information. I want to edit the wrong information and I have scanned the form. I am looking for a good online site where I can upload the scanned document and convert same into an editable format. I don’t mind paying. If any can point to a good site will be great & thanks in advance

    Read the article

  • Is there a multi-user Remote Desktop app for Mac OS X?

    - by Peter Walke
    Is there a remote desktop app for the Mac that allows multiple people to be remoted in at the same time, similar to RDP in Windows? I've used VNC, but that only allows one person to control the computer. For some background: I'd like to set up a mac that many users can RDP into from PC's to do XCode development. I did some searching and didn't find anything, so I'm assuming it's just not possible, but I want to confirm. Thanks. Update: Thanks to a link in one of the answers, I found a reasonable solution: AquaConnect

    Read the article

  • Problem with Windows Boot Manager after using GParted

    - by Cenoc
    I Get the follow: Windows failed to start. A recent hardware or software change might be the cause. To fix the problem: Insert your windows installation disc and restart your computer. Choose your language settings, and then click "Next." Click "Repair your computer." If you do not have this disc, Contact your system administrator or computer manufacturer for assistance. Status: 0XC0000225 Info: The boot selection failed because a required device is inaccessible. After I tried to expand the Windows partition. I dont know where I put the Windows 7 CD and I was wondering if anyone knew of any way of fixing this problem? I'm guessing I deleted something I shouldnt have deleted....... I actually wanted to get some more space at the expense of the recovery drive. Thanks in advance!

    Read the article

< Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >