Daily Archives

Articles indexed Sunday January 2 2011

Page 4/27 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Problem with Apache webserver and MySQL after installing cPanel

    - by Santhosh S
    I have a Fedora machine with Apache webserver and MySQL installed with some data present in both the servers. I installed cPanel on this machine with a test license. After installing cPanel I am not able to start Apache Webserver and login to MySQL. I am getting the following error when I try to start the webserver Building global cache for cpanel...warn [Cpanel::AdvConfig::apache::modules] Unable to locate executable Apache binary warn [Cpanel::AdvConfig::apache::modules] Unable to locate executable Apache binary

    Read the article

  • Replication from OSX OpenDirectory to OpenLDAP

    - by natacado
    I have an OpenDirectory server running on an OSX Server machine, and I'd like to increase the reliability of the service by having a slave server. The problem is, I only have 1 OSX Server but I have plenty of Linux servers available. I'm happy with Apple's tools that integrate with OpenDirectory, but given Apple's recent discontinuation of the XServe, I'm not particularly interested in continuing with Apple hardware. I remember hearing that OpenDirectory is (now-distantly) based off the OpenLDAP code base; is there any way I could replicate from OpenDirectory to OpenLDAP instead of having to purchase another OSX server?

    Read the article

  • Windows XP installation problems

    - by Samurai Waffle
    I recently asked a question on here, and thought I had it working... Here is a link to it. Windows XP Installation problems So basically I'm having trouble getting XP installed. To sum it up, a computer I have had a boot sector virus, and I used Darik's Nuke and Boot to wipe the hard drive clean. So the hard drive has nothing on it. I had to try and install Windows through a DOS prompt, because for some reason it won't read it off the DVD. The UBCD is able to look at the files located on the DVD I have in, but I can't boot from it for some reason. So I extracted it to a USB drive, booted to DOS and started the setup process. Here's the weird thing with DOS... It can only find the C: drive. The C: drive in DOS is the flash drive that I have in, running DOS. I can't find the hard drive anywhere! So anyways, after starting the setup process, it copied the files over to the "hard drive" (which took 16 hours because the version of DOS I ran couldn't run smartdrv.exe), and it said the computer had to reboot. So I let it reboot, and it stopped and said there is no boot device. So I popped in UBCD that I have installed on a flash drive, and I discovered that it had copied the Windows files over to the flash drive and not the hard drive. It never asked where it should extract the files... So I toyed around with UBCD, ran a memory test on the hard drive to make sure it was fine, and it came out clean. So I'm stuck now. How can I get this installed? Writing this, I came up with an idea. If I copy the DOS startup files over to the hard drive, would I be able to start DOS from it? If so, I believe that could fix my problems. Any help is greatly appreciated, because I am running out of ideas and am at my wits end with this computer.

    Read the article

  • Virtualbox - USB Devices don't install correctly using Windows 7

    - by MetaDark
    I am trying to install the drivers for my HTC Magic (2.1) and my iPod Touch "3G" 8GB (4.1), but when I plug them in, neither of them successfully install their drivers. They work perfectly fine when running on Windows natively, why are they behaving like this on Virtual Box? I am using Windows 7 (AMD64) - Natively & Non Natively. Ubuntu 10.10 - Also Natively Virtual Box 4.0.0 Hopefully someone has encountered this before and has an answer XD

    Read the article

  • pix 501, static route to d-link router (different subnet)

    - by ra170
    I have pix 501 cisco firewall with internal ip 192.168.10.1. I have connected d-link router (dir-655) to pix 501. The d-link router has internal ip 192.168.0.1 The picture would like something like that: |pix 501| has 192.168.10.1 ip |DIR-655| has 192.168.0.1 ip 1. |cable modem|----|pix 501|-------|DIR-655|-----PC 2. PC--------|pix 501|---------|DIR-655| | | |cable modem| When I'm on the wireless network (dir-655) with assigned ip of 192.168.0.x I can cross the subnet and connect to my firewall 192.168.10.1. (pic. 1) The problem is that if I'm on the 192.168.10.x network I can't connect to anything over at 192.168.0.x network. (pic.2) I've tried entering a static route like this: `route inside 192.168.0.0 255.255.255.0 192.168.10.1 1` I also tried assigning static ip to wan interface on DIR-655 to 192.168.10.30 and then tried this: route inside 192.168.0.0 255.255.255.0 192.168.10.30 1 But still, can't connect to 192.168.0.1 or anything on that subnet. Is there a way to setup a static route? Would adding a separate router between PIX 501 and DIR-655 help? I would think that static route like this should take care of it, but it doesn't. This is my route config and nat: (config)# sh route outside 0.0.0.0 0.0.0.0 (outside_IP) 1 DHCP static outside (outside_IP) 255.255.248.0 (outside_IP) 1 CONNECT static inside 192.168.0.0 255.255.255.0 192.168.10.1 1 OTHER static inside 192.168.10.0 255.255.255.0 192.168.10.1 1 CONNECT static or (route inside 192.168.0.0 255.255.255.0 192.168.10.30 1) (config)# sh nat nat (inside) 1 192.168.1.0 255.255.255.0 0 0 nat (inside) 1 192.168.10.0 255.255.255.0 0 0 nat (inside) 1 0.0.0.0 0.0.0.0 0 0 I ended up turning DIR-655 into an Access Point (turning off DHCP and pluging cable from PIX lan interface into one of the LAN interfaces on DIR-655, and leaving WAN port empty), that works as far as DIR-655 being on the same subnet now, and I can access every machine. However the question is, why can't I simply route between those two? would router between these two help? One of the reasons is, that the PIX 501 has only 10 licences, so now I'm using almost all of them. (I have few computers, iphones, ps3, print server, etc.) I would really appreciate some help! Thanks.

    Read the article

  • How to enable an external USD harddrive with ubuntu

    - by LarsOn
    Hello I'm trying to install a new LaCie Hard Disk design by Neil Poulton 1TB USB 2.0 GParted reports /dev/sda1 (with exclamation mark and key sign) ntfs 1 KiB unallocated 320 MiB /dev/sda2 hfs+ 2.84 MiB unallocated 931.2 GiB When trying to create a partition with Disk Utility it says Daemon is inhibited It seems I can't create the partition that way. Can you recommend how I can proceed? Thank you

    Read the article

  • VPS to replace MobileMe or Google Apps.

    - by Alex
    All, Yes, this has been touched on in other questions, but I can't find something similar enough. I currently have Google Apps hosting personal email, calendars, contacts, etc. I do like the other google services, but they're outside of Apps. One of the little google irritations that I have to maintain a separate account for Picassa, etc. So, I'm thinking about moving myself away from Google, but purely for personal, privacy type issues. Do I really like the ads, the email snooping, etc? I've had, and liked MobileMe, back when it was iTools, and then .Mac, but it doesn't offer that much really. How easily can I replicate it all on a VPS? I don't want to host it myself at home, I'd lose all the wonderful datacenter goodness. THis isn't about personal geekery in my own basement, just about taking a little control back from Google. So, email is fine running an IMAP server, a nice front-end, etc. What about Calendars and Contacts? And, how easily can it be setup to sync to the desktop and iPhone? Thanks.

    Read the article

  • using GNU GPL v2 software as pointers to solution to problem

    - by Patrick
    I am coding a PHP serial access class and have been taking pointers from the PHP-serial class on Google Code (here). That class is based on PHP 4 and I'm creating a PHP 5 class that allows more functionality and is specific to some business demands I have. There is no code copied and I have done all the coding. Does the class I'm writing fall under the Google Code's GPL or am I free to select a license that I feel is appropriate? I'm not sure of the standard that applies to licensing when you are only looking to another work for pointers.

    Read the article

  • CENTOS Named (BIND DNS) and OPENVPN - How to allow VPN clients to Connect to BIND as DNS

    - by David
    Hi, I have setup OpenVPN. All seems to be working fine except that Name Lookups are not done via the BIND DNS server on the server. I have added push "redirect-gateway def1" and push "dhcp-option DNS 10.8.0.1" to the OpenVPN server config. It does seem like this is being pushed to the Client. The problem however is that I believe the BIND DNS is not allowing the Client to connect and do name lookups. How do I go about configuring BIND to allow connections from the VPN clients?

    Read the article

  • What is the right way to structure HTML and CSS?

    - by Meke
    So, I'm a script monkey at the core. Lately I seem to get stuffed into doing design too for some odd reason and, well, let's just say I should probably have studied better. Either way - What I ask is, what's the Right way to structure a website? This one has a header with links, then a block with tabs, right under another block which consists of two parts and under those a few others who I'm not at yet. However, the thing is, I need to make a block that consists of two parts that are in the same box but structured independently. I'll try to draw it up. Browser window..................-[]X ------------------------------------ |.................Header Links Here| ||Tab|Tab|Tab|_____________........| ||Tab content.............|Small...| ||........................|Section.| ||---Line signing new section------| ||........................|Another.| ||..Content Area..........|Small...| ||........................|Section.| ------------------------------------ My issue is in the division of small sections and tab/content areas. I tried using floats, making them as tables, aligning and whatnot. The putting float:left on both tables worked. Kinda. Until I tried to resize the window. So, how do you PROPERLY structure a site like this? three divs and tables? Something else? I'll clarify this again: It's the Code to use to create the look above that I'm trying to figure out the proper way to do, not the design As requested here's the current structure I have <div class="container"> <div class="topBlock"> //Header Links Here </div> <div class="inputBlock"> <ul id="tabs"> <li><a href="#strict">Strict</a></li> <li><a href="#flex">Flex</a></li> <li><a href="#multiStep">Multi-Step</a></li> </ul> <div id="strict" class="tabContent"> <table class="tableLeft"> <tr> <td>From</td> </tr> <tr> <td><input id="inputBlockFrom" type="text" placeholder="FROM"/></td> </tr> <tr> <td>To</td> </tr> <tr> <td><input id="inputBlockTo" type="text" placeholder="TO"/></td> </tr> </table> <table class="tableRight"> <tr> <td>Leave</td> </tr> <tr> <td><input id="inputBlockLeave" type="text" name="leave" placeholder="LEAVE"/></td> <td><input id="inputBlockOne" type="radio" name="one"/></td> <td>One</td> </tr> <tr> <td>Return</td> </tr> <tr> <td><input id="inputBlockReturn" type="text" name="return" placeholder="RETURN"/></td> <td><input id="inputBlockBut" type="radio" name="one" checked/></td> <td>Return</td> </tr> <tr> <td><input id="inputBlockSubmit" type="submit" value="Search"/></td> </tr> </table> </div> <div id="flex" class="tabContent"> Test Two </div> <div id="multiStep" class="tabContent"> Test Three </div> </div> <div class="mapBlock tabContent"> <table class="tableLeft"> <tr><td> <div id="map" class="google_map"></div> </td></tr> </table> <table class="tableRight smallTable"> <tr> <td>Distance</td> </tr> <tr> <td>[-------------|------------]</td> //Slider to be </tr> </table> <table class="tableRight smallTable"> <tr> <td>Choice / Choice</td> </tr> </table> <table class="tableRight"> <tr> <td>Show:</td> </tr> <tr> <td><input type="radio"/></td> <td>Price</td> <td><input type="radio"/></td> <td>Button!</td> </tr> <tr> <td><input type="radio"/></td> </tr> <tr> <td><input type="radio"/></td> </tr> </table> </div> </div> </body> Sorry if it's messed up in the whitespacing somewhere.. The CSS: body { font-size: 80%; font-family: 'Lucida Grande', Verdana, Arial, Sans-Serif; background-color: #e2edff; } .container { margin: 5px 5px 5px 5px; padding: 5px 5px 5px 5px; } .pageBlock { /* To future me: This class is for One Full Screen ideas */ min-height: 300px; } .topBlock { text-align: right; color: #000000; } .topBlock a { text-decoration: none; color: #000000; } .tableLeft { width: 75%; float: left; border-right: dotted 2px black; } .tableRight { float: left; overflow: auto; } .smallTable { border-bottom: 1px dotted #c9c3ba; } .google_map { height: 270px; width: 100%; }

    Read the article

  • Why is a NullReferenceException thrown when a ToolStrip button is clicked twice with code in the `Click` event handler?

    - by Patrick
    I created a clean WindowsFormsApplication solution, added a ToolStrip to the main form, and placed one button on it. I've added also an OpenFileDialog, so that the Click event of the ToolStripButton looks like the following: private void toolStripButton1_Click(object sender, EventArgs e) { openFileDialog1.ShowDialog(); } I didn't change any other properties or events. The funny thing is that when I double-click the ToolStripButton (the second click must be quite fast, before the dialog opens), then cancel both dialogs (or choose a file, it doesn't really matter) and then click in the client area of main form, a NullReferenceException crashes the application (error details attached at the end of the post). Please note that the Click event is implemented while DoubleClick is not. What's even more strange that when the OpenFileDialog is replaced by any user-implemented form, the ToolStripButton blocks from being clicked twice. I'm using VS2008 with .NET3.5. I didn't change many options in VS (only fontsize, workspace folder and line numbering). Does anyone know how to solve this? It is 100% replicable on my machine, is it on others too? One solution that I can think of is disabling the button before calling OpenFileDialog.ShowDialog() and then enabling the button back (but it's not nice). Any other ideas? And now the promised error details: System.NullReferenceException was unhandled Message="Object reference not set to an instance of an object." Source="System.Windows.Forms" StackTrace: at System.Windows.Forms.NativeWindow.WindowClass.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at System.Windows.Forms.UnsafeNativeMethods.PeekMessage(MSG& msg, HandleRef hwnd, Int32 msgMin, Int32 msgMax, Int32 remove) at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.Run(Form mainForm) at WindowsFormsApplication1.Program.Main() w C:\Users\Marchewek\Desktop\Workspaces\VisualStudio\WindowsFormsApplication1\Program.cs:line 20 at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() InnerException:

    Read the article

  • How does PHP's list function work?

    - by Jacob Relkin
    After recently answering a couple of questions here on SO that involved utilizing PHP's list function, I wondered, "how in the world does that function actually work under the hood?". I was thinking about something like using func_get_args() and then iterating through the argument list, and that's all nice and peachy, but then how in the world does the assignment part work? list(...) = array($x, $y, $z); isn't this ^ evaluated first? So to be precise, my question is how is the list function able to create scoped variables which get assigned to the not-yet evaluated array?

    Read the article

  • PHP 5.3: Late static binding doesn't work for properties when defined in parent class while missing in child class

    - by DavidPesta
    Take a look at this example, and notice the outputs indicated. <?php class Mommy { protected static $_data = "Mommy Data"; public static function init( $data ) { static::$_data = $data; } public static function showData() { echo static::$_data . "<br>"; } } class Brother extends Mommy { } class Sister extends Mommy { } Brother::init( "Brother Data" ); Sister::init( "Sister Data" ); Brother::showData(); // Outputs: Sister Data Sister::showData(); // Outputs: Sister Data ?> My understanding was that using the static keyword would refer to the child class, but apparently it magically applies to the parent class whenever it is missing from the child class. (This is kind of a dangerous behavior for PHP, more on that explained below.) I have the following two things in mind for why I want to do this: I don't want the redundancy of defining all of the properties in all of the child classes. I want properties to be defined as defaults in the parent class and I want the child class definition to be able to override these properties wherever needed. The child class needs to exclude properties whenever the defaults are intended, which is why I don't define the properties in the child classes in the above example. However, if we are wanting to override a property at runtime (via the init method), it will override it for the parent class! From that point forward, child classes initialized earlier (as in the case of Brother) unexpectedly change on you. Apparently this is a result of child classes not having their own copy of the static property whenever it isn't explicitly defined inside of the child class--but instead of throwing an error it switches behavior of static to access the parent. Therefore, is there some way that the parent class could dynamically create a property that belongs to the child class without it appearing inside of the child class definition? That way the child class could have its own copy of the static property and the static keyword can refer to it properly, and it can be written to take into account parent property defaults. Or is there some other solution, good, bad, or ugly?

    Read the article

  • Is there already FUSE filesystem that serialise each request to stream?

    - by Vi
    Concept: nc -lp 1234 -e fusexmp_server nc 127.0.0.1 1234 -c "fusestream /mnt/tmp" Advantages are: Easy implementation of servers in high level language (without need of any arch-dependent things like JNI or whatever) Simple ad-hoc networking filesystem out of the box. Accessibility without actual FUSE (when it is inaccessible): nc -lp 1234 -e fusexmp_server& fakefusestream 127.0.0.1 1234 % ls bin lib usr proc etc % get /etc/hosts % exit Is there already such thing or I should implement it?

    Read the article

  • NSMutableSet addObject question

    - by Jacob Relkin
    I've got a class that wraps around an NSMutableSet object, and I have an instance method that adds objects (using the addObject: method) to the NSMutableSet. This works well, but I'm smelling a performance hitch because inside the method i'm explicitly calling containsObject: before adding the object to the set. Three part question: Do I need to be calling containsObject: before I add an object to the set? If so, then what actual method should I be using, containsObject or containsObjectIdenticalTo:? If that is not so, what contains method gets invoked under the hood of addObject:? This is important to me because if I pass an object to containsObject: it would return true, but if I pass it to containsObjectIdenticalTo: it would return false.

    Read the article

  • C Static Function Confusion

    - by Lime
    I am trying to make the s_cord_print function visible in the cord_s.c file only. Currently the function is visible/runnable in main.c even when it is declared static. How do I make the s_cord_print function private to cord_s.c? Thanks! s_cord.c typedef struct s_cord{ int x; int y; struct s_cord (*print)(); } s_cord; void* VOID_THIS; #define $(EL) VOID_THIS=&EL;EL static s_cord s_cord_print(){ struct s_cord *THIS; THIS = VOID_THIS; printf("(%d,%d)\n",THIS->x,THIS->y); return *THIS; } const s_cord s_cord_default = {1,2,s_cord_print}; main.c #include <stdio.h> #include <stdlib.h> #include "s_cord.c" int main(){ s_cord mycord = s_cord_default; mycord.x = 2; mycord.y = 3; $(mycord).print().print(); //static didn't seem to hide the function s_cord_print(); return 0; } ~

    Read the article

  • Intelligent web features, algorithms (people you may follow, similar to you ...)

    - by hilal
    I have 3 main questions about the algorithms in intelligent web (web 2.0) Here the book I'm reading http://www.amazon.com/Algorithms-Intelligent-Web-Haralambos-Marmanis/dp/1933988665 and I want to learn the algorithms in deeper 1. People You may follow (Twitter) How can one determine the nearest result to my requests ? Data mining? which algorithms? 2. How you’re connected feature (Linkedin) Simply algorithm works like that. It draws the path between two nodes let say between Me and the other person is C. Me - A, B - A connections - C . It is not any brute force algorithms or any other like graph algorithms :) 3. Similar to you (Twitter, Facebook) This algorithms is similar to 1. Does it simply work the max(count) friend in common (facebook) or the max(count) follower in Twitter? or any other algorithms they implement? I think the second part is true because running the loop dict{count, person} for person in contacts: dict.add(count(common(person))) return dict(max) is a silly act in every refreshing page. 4. Did you mean (Google) I know that they may implement it with phonetic algorithm http://en.wikipedia.org/wiki/Phonetic_algorithm simply soundex http://en.wikipedia.org/wiki/Soundex and here is the Google VP of Engineering and CIO Douglas Merrill speak http://www.youtube.com/watch?v=syKY8CrHkck#t=22m03s What about first 3 questions? Any ideas are welcome ! Thanks

    Read the article

  • Help with why my app crashed?

    - by Moshe
    I'm writing an iPad app that is a "kiosk" app. The iPad should be hanging on the wall and the app should just run. I did a test, starting the app last night (Friday, December 31) and letting it run. This morning, when I woke up, it was not running. I just checked the iPad's console and I can't figure out why it crashed. The iPad was plugged in and so the battery is not the issued. I did disable the idleTimer in my application delegate. The app was seen running as late as midnight last night. I would like to note that my app acts as a Bluetooth server through Game Kit and large portion of the console output is occupied by bluetooth status messages. When I opened the iPad, the app was paused and there was a system alert which prompted me to check an "Expiring Provisioning Profile". I tapped "dismiss" and the alert went away. The app crashed about a second after I dismissed the system alert. Any ideas how I can diagnose this problem? Why would my app crash? Here is my iPad's Console log, as copied from Xcode's organizer. Edit: A bit of Googling lead me to this site which says that alert views cause the app to lose focus. Could that be involved? What can I do to fix the problem? EDIT2: My Crash log describes the situation as: Application Specific Information: appname failed to resume in time Elapsed total CPU time (seconds): 10.010 (user 8.070, system 1.940), 100% CPU Elapsed application CPU time (seconds): 9.470, 95% CPU

    Read the article

  • JQuery Bind click event to appended element with an argument

    - by Gabor Szauer
    Hi guys, I'm trying to populate a ul list with some li elements and give each li element a link that calls the same function with a different argument. However it doesn't seem to work, i've attached the code below, CheckForNewMail is called on document load. Can anyone please help me out? function CheckForNewMail() { ////////////////////////////////////////////////////////////////// // This will be dynamic MailInInbox[0] = new Array("0", "Mail One"); MailInInbox[1] = new Array("12", "Mail Two"); MailInInbox[2] = new Array("32", "Mail Three"); MailInInbox[3] = new Array("5", "Mail Four"); ////////////////////////////////////////////////////////////////////// $('#mail-in-inbox').children().remove(); size = 4; element = $('#mail-in-inbox'); for(i = 0; i < size; ++i) { var link = $('<a href="#" class="inbox-link">'+ MailInInbox[i][1] +'</a>'); link.live('click', function() { LoadMailById(i); }); li = $('<li></li>'); li.append(link); element.append(li); } } function LoadMailById(id) { alert("Button "+ id +" clicked!"); }

    Read the article

  • Stored procedure does not return result when using Temp table

    - by Muhammad Akhtar
    I have used temp table in my stored procedure and unable to get the result when executing. It return result fine when running the same as query. my query structure is something like... ALTER PROCEDURE [dbo].[test] as begin SET NOCOUNT ON; SELECT * INTO #Dates FROM Dates -- Used temp table SET @Query = ' SELECT [Name], [HotelName], '+@Dates+' FROM ( SELECT , HD.[Name], HD.[HotelName], HD.Price FROM #Dates D LEFT JOIN #HotelData HD ON D.DateVal = HD.OccDate) T PIVOT ( SUM(Price) FOR [Date] IN ('+@Dates+') ) AS PT' execute(@Query) end Exec test -- Exectuting, I am getting message command completed successfully

    Read the article

  • Manage network database with SQL Management Studio 2005 express

    - by johntotetwoo
    hi there mates :) i'm new with database and database handling and i was wondering if it is possible to manage network database with SQL Server Management Studio Express 2005. I have here two PCs in my home and were connected via router. PC 1 has SQL Server 2005 Express and SQL Server Management Studio 2005 Express while PC 2 has only SQL Server 2005 Express. Can it be possible that PC1's management studio can manage PC2's server? im glad if you could help me with this. Happy New YEar!

    Read the article

  • scope equivalent in rails 2.3.x?

    - by Jacob Relkin
    Is there a way to generate a group of routes under an admin scope without having to create a new physical directory (like namespace requires you to). I know that in Rails 3 there is a scope method on the route mapper, and this appears to do what I want, but apparently it doesn't exist in Rails 2.3.x My goal is to have a route like this: "/admin/products" map to "app/controllers/products_controller, not "app/controllers/admin/products_controller". Is there any way to accomplish this in Rails 2.3.x?

    Read the article

  • IOException: Unable To Delete Images Due To File Lock

    - by Arslan Pervaiz
    I am Unable To Delete Image File From My Server Path It Gaves Error That The Process Cannot Access The File "FileName" Because it is being Used By Another Process. I Tried Many Methods But Still All In Vain. Please Help me Out in This Issue. Here is My Code Snippet. using System; using System.Data; using System.Web; using System.Data.SqlClient; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Globalization; using System.Web.Security; using System.Text; using System.DirectoryServices; using System.Collections; using System.IO; using System.Drawing; using System.Drawing.Imaging; using System.Drawing.Drawing2D; //============ Main Block ================= byte[] data = (byte[])ds.Tables[0].Rows[0][0]; MemoryStream ms = new MemoryStream(data); Image returnImage = Image.FromStream(ms); returnImage.Save(Server.MapPath(".\\TmpImages\\SavedImage.jpg"), System.Drawing.Imaging.ImageFormat.Jpeg); returnImage.Dispose(); \\ I Tried this Dispose Method To Unlock The File But Nothing Done. ms.Close(); \\ I Tried The Memory Stream Close Method Also But Its Also Not Worked For Me. watermark(); \\ Here is My Water Mark Method That Print Water Mark Image on My Saved Image (Image That is Converted From Byte Array) DeleteImages(); \\ Here is My Delete Method That I Call To Delete The Images //===== ==== My Delete Method To Delete Files================== public void DeleteImages() { try { File.Delete(Server.MapPath(".\\TmpImages\\WaterMark.jpg")); \\This Image Deleted Fine. File.Delete(Server.MapPath(".\\TmpImages\\SavedImage.jpg")); \\ Exception Thrown On Deleting of This Image. } catch (Exception ex) { LogManager.LogException(ex, "Error in Deleting Images."); Master.ShowMessage(ex.Message, true); } } \ ==== Method Declartion That Make Watermark of One Image On Another Image.======= public void watermark() { //create a image object containing the photograph to watermark Image imgPhoto = Image.FromFile(Server.MapPath(".\\TmpImages\\SavedImage.jpg")); int phWidth = imgPhoto.Width; int phHeight = imgPhoto.Height; //create a Bitmap the Size of the original photograph Bitmap bmPhoto = new Bitmap(phWidth, phHeight, PixelFormat.Format24bppRgb); bmPhoto.SetResolution(imgPhoto.HorizontalResolution, imgPhoto.VerticalResolution); //load the Bitmap into a Graphics object Graphics grPhoto = Graphics.FromImage(bmPhoto); //create a image object containing the watermark Image imgWatermark = new Bitmap(Server.MapPath(".\\TmpImages\\PrintasWatermark.jpg")); int wmWidth = imgWatermark.Width; int wmHeight = imgWatermark.Height; //Set the rendering quality for this Graphics object grPhoto.SmoothingMode = SmoothingMode.AntiAlias; //Draws the photo Image object at original size to the graphics object. grPhoto.DrawImage( imgPhoto, // Photo Image object new Rectangle(0, 0, phWidth, phHeight), // Rectangle structure 0, // x-coordinate of the portion of the source image to draw. 0, // y-coordinate of the portion of the source image to draw. phWidth, // Width of the portion of the source image to draw. phHeight, // Height of the portion of the source image to draw. GraphicsUnit.Pixel); // Units of measure //------------------------------------------------------- //to maximize the size of the Copyright message we will //test multiple Font sizes to determine the largest posible //font we can use for the width of the Photograph //define an array of point sizes you would like to consider as possiblities //------------------------------------------------------- //Define the text layout by setting the text alignment to centered StringFormat StrFormat = new StringFormat(); StrFormat.Alignment = StringAlignment.Center; //define a Brush which is semi trasparent black (Alpha set to 153) SolidBrush semiTransBrush2 = new SolidBrush(Color.FromArgb(153, 0, 0, 0)); //define a Brush which is semi trasparent white (Alpha set to 153) SolidBrush semiTransBrush = new SolidBrush(Color.FromArgb(153, 255, 255, 255)); //------------------------------------------------------------ //Step #2 - Insert Watermark image //------------------------------------------------------------ //Create a Bitmap based on the previously modified photograph Bitmap Bitmap bmWatermark = new Bitmap(bmPhoto); bmWatermark.SetResolution(imgPhoto.HorizontalResolution, imgPhoto.VerticalResolution); //Load this Bitmap into a new Graphic Object Graphics grWatermark = Graphics.FromImage(bmWatermark); //To achieve a transulcent watermark we will apply (2) color //manipulations by defineing a ImageAttributes object and //seting (2) of its properties. ImageAttributes imageAttributes = new ImageAttributes(); //The first step in manipulating the watermark image is to replace //the background color with one that is trasparent (Alpha=0, R=0, G=0, B=0) //to do this we will use a Colormap and use this to define a RemapTable ColorMap colorMap = new ColorMap(); //My watermark was defined with a background of 100% Green this will //be the color we search for and replace with transparency colorMap.OldColor = Color.FromArgb(255, 0, 255, 0); colorMap.NewColor = Color.FromArgb(0, 0, 0, 0); ColorMap[] remapTable = { colorMap }; imageAttributes.SetRemapTable(remapTable, ColorAdjustType.Bitmap); //The second color manipulation is used to change the opacity of the //watermark. This is done by applying a 5x5 matrix that contains the //coordinates for the RGBA space. By setting the 3rd row and 3rd column //to 0.3f we achive a level of opacity float[][] colorMatrixElements = { new float[] {1.0f, 0.0f, 0.0f, 0.0f, 0.0f}, new float[] {0.0f, 1.0f, 0.0f, 0.0f, 0.0f}, new float[] {0.0f, 0.0f, 1.0f, 0.0f, 0.0f}, new float[] {0.0f, 0.0f, 0.0f, 0.3f, 0.0f}, new float[] {0.0f, 0.0f, 0.0f, 0.0f, 1.0f}}; ColorMatrix wmColorMatrix = new ColorMatrix(colorMatrixElements); imageAttributes.SetColorMatrix(wmColorMatrix, ColorMatrixFlag.Default, ColorAdjustType.Bitmap); //For this example we will place the watermark in the upper right //hand corner of the photograph. offset down 10 pixels and to the //left 10 pixles int xPosOfWm = ((phWidth - wmWidth) - 10); int yPosOfWm = 10; grWatermark.DrawImage(imgWatermark, new Rectangle(xPosOfWm, yPosOfWm, wmWidth, wmHeight), //Set the detination Position 0, // x-coordinate of the portion of the source image to draw. 0, // y-coordinate of the portion of the source image to draw. wmWidth, // Watermark Width wmHeight, // Watermark Height GraphicsUnit.Pixel, // Unit of measurment imageAttributes); //ImageAttributes Object //Replace the original photgraphs bitmap with the new Bitmap imgPhoto = bmWatermark; grPhoto.Dispose(); grWatermark.Dispose(); //save new image to file system. imgPhoto.Save(Server.MapPath(".\\TmpImages\\WaterMark.jpg"), ImageFormat.Jpeg); imgPhoto.Dispose(); imgWatermark.Dispose(); }

    Read the article

  • XCode - Copy sqlite DB from simulator and copy onto device for testing

    - by Neal L
    Hello, I am working on a Core Data app, and have populated the sqlite file in the iPhone Simulator with all of the fixtures/data that I use to test the app. I would like to use that sqlite file as a standardized set of testing data. The devices that I test the app on all have different data sets, and I would like to standardize on the one in the simulator. Is there a way in XCode (3 or 4) to add a step to the build/install process that will copy the sqlite file from the iPhone Simulator and install it over the file on the phone (if one exists)? Thanks, Neal

    Read the article

  • Unable to add SSH pub key for GitHub

    - by Kaushik
    I am trying to set up a new GitHub account as part of learning ruby on rails. My OS is windows. I am having the following problem while trying to add my public key to the GitHub SSH public keys. When I put the key in the text area, supply a name, and click 'Add Key', I am taken to the Job profile page without any confirmation that the key has been added.(I am using SSH client GUI to generate RSA keys). When I come back to the SSH public keys page, I see that the key is not there. I tried this multiple times...without any result. Just as a test, I tried to ssh to the GitHub account using 'ssh -v [email protected]' and here is the verbose output: OpenSSH_4.6p1, OpenSSL 0.9.8e 23 Feb 2007 debug1: Connecting to github.com [207.97.227.239] port 22. debug1: Connection established. debug1: identity file /c/Users/Administrator/.ssh/identity type -1 debug1: identity file /c/Users/Administrator/.ssh/id_rsa type -1 debug1: identity file /c/Users/Administrator/.ssh/id_dsa type -1 debug1: Remote protocol version 2.0, remote software version OpenSSH_5.1p1 Debian-5github2 debug1: match: OpenSSH_5.1p1 Debian-5github2 pat OpenSSH* debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_4.6 debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: kex: server->client aes128-cbc hmac-md5 none debug1: kex: client->server aes128-cbc hmac-md5 none debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP debug1: SSH2_MSG_KEX_DH_GEX_INIT sent debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY debug1: Host 'github.com' is known and matches the RSA host key. debug1: Found key in /c/Users/Administrator/.ssh/known_hosts:1 debug1: ssh_rsa_verify: signature correct debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug1: SSH2_MSG_NEWKEYS received debug1: SSH2_MSG_SERVICE_REQUEST sent debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey debug1: Next authentication method: publickey debug1: Trying private key: /c/Users/Administrator/.ssh/identity debug1: Trying private key: /c/Users/Administrator/.ssh/id_rsa debug1: Trying private key: /c/Users/Administrator/.ssh/id_dsa debug1: No more authentication methods to try. Permission denied (publickey). Also, why is it looking for the keys in c/Users/Administrator/.ssh/ Is there a possibility of changing this default location? EDIT: With Mozila, I get error msg: Oops! The key has already been taken. The key is invalid. It must begin with 'ssh-rsa' or 'ssh-dss'. My key looks like: ---- BEGIN SSH2 PUBLIC KEY ---- Comment: "[2048-bit rsa, Administrator@Kaushik-THINK, Sun Jan 02 2011 \ 02:40:03]" AAAAB3NzaC1yc2EAAAADAQABAAABAQDoA5xqJozKmAHTGh9hgmagsFOl2hdPzS8ZPV9Ta1 xU0JiUnHef38Rvz/5oqL1wW7SjmZbc/+tCPOfU1lg3UisFXajJhek2bjJ2qsKd4Sjax2Nj ZMYD7djPb8rokUYSKW3bdYyJHtJH+murz04UGdCcZ8HqkMTzqlh3zAIK7SIlCy+mtAi5A/ sm0JbqlNGHB6YrL1aWIcOSolIx2HWt8cWhlK77guT9dPgd0HT59Gn0uhO7UWGLrNdJut0x ian3HdvNYMUXoO/SkNlxvWRgZ1UOhaB+qf4hw5RCGcBbqP3fM4LKpurHZx4wEpgmM0e4EM +2PYdf46uxChNdBl7J5sZF ---- END SSH2 PUBLIC KEY ---- I still can't see the key..so not sure how it says it is already taken.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >