Daily Archives

Articles indexed Wednesday January 5 2011

Page 11/35 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • asp.net mvc rhino mocks mocking httprequest values

    - by Matthew
    Hi Is there a way to mock request params, what is the best approach when testing to create fake request values in order to run a test would some thing like this work? _context = MockRepository.GenerateStub<HttpContext>(); request = MockRepository.GenerateStub<HttpRequest>(); var collection = new NameValueCollection(); collection.Add("", ""); SetupResult.For(request.Params).Return(collection); SetupResult.For(_context.Request).Return(request);

    Read the article

  • Problem sending ASCII Art via SMS and Email in iPhone SDK

    - by PARTH
    Hi Guys, In my iPhone app, I have ASCII art, which I am sharing via email and SMS. I have inserted the ASCII art into the Sqlite database along with the newline character and spaces. Problem is when I send them through SMS and Email, the whole ASCII art comes in left alignment and spacing between characters is lost. ASCII Art fetched in Label in my app is as below Same ASCII Art when inserted to Email API (MFMailComposeViewController) is as below How to maintain the spaces? What can be done? Please Help and Suggest. Thanks

    Read the article

  • autocomplete and $.getJSON problem

    - by Dusty Roberts
    Hi There I have a script: <script type="text/javascript"> $(document).ready(function(){ $("#PrincipleMember_IdNumber").autocomplete({ close: function(event, ui) { var member = {}; member.IDNumber = $("#PrincipleMember_IdNumber").val(); $.getJSON("<%= Url.Action("MemberLookup","Member") %>", member, function(data) { $("#PrincipleMember_Firstname").val(data.FirstName); }); } }); }); A form: <fieldset class="fieldsetSection"> <legend>Principle Member</legend> <table> <tr> <td width="150px" class="editor-label"><%=Html.LabelFor(l=>l.PrincipleMember.IdNumber)%></td> <td class="editor-field"><%= Html.AutoCompleteTextBoxFor(i => i.PrincipleMember.IdNumber, "IdNumber", "AutoComplete")%></td> <td><%=Html.ValidationMessageFor(v => v.PrincipleMember.IdNumber)%></td> </tr> <tr> <td width="150px" class="editor-label"><%=Html.LabelFor(l=>l.PrincipleMember.Firstname)%></td> <td class="editor-field"><%=Html.TextBoxFor(t => t.PrincipleMember.Firstname)%></td> <td><%=Html.ValidationMessageFor(v => v.PrincipleMember.Firstname)%></td> </tr> </table> and finally a json result action: public JsonResult MemberLookup(Member member) { member = _memberRepository.GetMember(member.IDNumber); return this.Json(member); } my json result is executed perfectly and i get a result, but for some reason this section of the script is not executing: $("#PrincipleMember_Firstname").val(data.FirstName); i've tried replacing it with an alert();, but that too is not executing. Can anyone see what i am doing wrong here?

    Read the article

  • How to use data receive event in Socket class?

    - by affan
    I have wrote a simple client that use TcpClient in dotnet to communicate. In order to wait for data messages from server i use a Read() thread that use blocking Read() call on socket. When i receive something i have to generate various events. These event occur in the worker thread and thus you cannot update a UI from it directly. Invoke() can be use but for end developer its difficult as my SDK would be use by users who may not use UI at all or use Presentation Framework. Presentation framework have different way of handling this. Invoke() on our test app as Microstation Addin take a lot of time at the moment. Microstation is single threaded application and call invoke on its thread is not good as it is always busy doing drawing and other stuff message take too long to process. I want my events to generate in same thread as UI so user donot have to go through the Dispatcher or Invoke. Now i want to know how can i be notified by socket when data arrive? Is there a build in callback for that. I like winsock style receive event without use of separate read thread. I also do not want to use window timer to for polling for data. I found IOControlCode.AsyncIO flag in IOControl() function which help says Enable notification for when data is waiting to be received. This value is equal to the Winsock 2 FIOASYNC constant. I could not found any example on how to use it to get notification. If i am write in MFC/Winsock we have to create a window of size(0,0) which was just used for listening for the data receive event or other socket events. But i don't know how to do that in dotnet application.

    Read the article

  • create a folder and files in c:\program files\myApp\data in windows 7

    - by ile
    I have an old c++ application that needs to be modified to work with windows 7. Problem is in creating a new folder and saving a file in that folder. This folder should be created in c:\program files\myApp\data\newFolder. This is function I use to create new folder and get errors: if(!CreateDirectory(pathSamples,NULL)) //Throw Error { DWORD errorcode = GetLastError(); LPVOID lpMsgBuf; FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, errorcode, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&lpMsgBuf, 0, NULL ); MessageBox(NULL, (LPCTSTR)lpMsgBuf, TEXT("Error"), MB_OK); } In XP this works, but in Windows 7 it doesn't. If I run application as administrator than the folder is created, otherwise "Access is denied" error is thrown. My question is following: Is there an option to make changes to the code so that the folder can be created in "program files" nad that files can be saved in this folder? PS I saw this thread already but it doesn't answer my question. Thanks, Ilija

    Read the article

  • How to dismiss modal view controller from UITabBarController

    - by user563697
    Currently im developing an iPhone Game...When app loaded a login page is seen...when logged in...from login view controller a welcome screen view controller with tabbar(UITabbarcontroller iVar declared inside and connected to tabbarcontroller with interface builder) is presented(using presentModalViewCotroller)..There the first tab is dealing with account ..loaded from accountController NIb and view controller...inside which there's a logout button...when clicked i need to go to login page under loginview controller... Inside logout button click action method...i had coded like this [self dismissModalViewControllerAnimated:NO]; but on button click nothing happening... first : parent--loginviewcontroller child--welcomescreen view controller Inside welcome screen,in account tab,on logout button click: how could i dismiss the above MVC.... can anyone give me a solution as soon as possible...its urgent...

    Read the article

  • how to hex edit a .dll file

    - by manraj82
    We've been using Seagate Info Desktop 7.5 for a while and it stopped working after 31 Dec 2010. After a lot searching on the web, we found out from the SAP threads that a particular dll file(ciweb.dll) had this line of code "expires= Friday,31-Dec-2010 00:00:00 GMT",and this was causing the problem. The solution to the problem was to hexedit this dll file by changing the date to a later date. I have got no experience in hex editing a file. Would some please advise me with steps to do it? Thank You

    Read the article

  • Adding Class instance as a new Row in DataGridView (c#)

    - by Amit Shah
    Hi All, I have a class say [Serializable] public class Answer { [DisplayName("ID")] public string ID { get; set; } [DisplayName("Value")] public string Value { get; set; } } and I have a datagridview with bounded columns to the above class. instances of this class Answer are created dynamically as and when required. How do I update datagridview when each and every instance of class is created. is it possible to do something of this sort. dataGridView.Rows.Add(classInstance); Thanks in Advance, Amit

    Read the article

  • Use JQuery UI Datepicker with Icons from Jquery UI Theme

    - by Craig McGuff
    I have a datepicker control setup using the JQuery UI, I am also using the JQuery UI themes which provide a bunch of default icons that I want to use. The DatePicker allows for specifying a specific image, i.e.: <script type="text/javascript"> $(document).ready(function() { $("#DateFrom").datepicker({ showOn: 'button', buttonImageOnly: true, buttonImage: 'images/ui-icon-calendar.png' }); }); </script> To display an icon from the icon set you use something like: <span class="ui-icon ui-icon-calendar"></span> Is there an easy to integrate the two or do I just need to hack out the styles/images manually?

    Read the article

  • is php language C?

    - by avon_verma
    Ok: I edited my question: I heared somewhere, that php language is written by C. So i have question: what happens for example when you run a function in php such as date("Ymd"); or file_get_contents("file.txt");? Does it translate that code to C and request to server, or does php do it? sorry i haven't a clue And if it does translate it and request, that means besically it is C? sorry for english Thank you, Anon Verma

    Read the article

  • Maven. How to include specific folder or file when assemblying project depending on is it dev build or production?

    - by user563588
    Using maven-assembly-plugin <plugin> <artifactId>maven-assembly-plugin</artifactId> <version>2.1</version> <configuration> <descriptors> <descriptor>descriptor.xml</descriptor> </descriptors> <finalName>xxx-impl-${pom.version}</finalName> <outputDirectory>target/assembly</outputDirectory> <workDirectory>target/assembly/work</workDirectory> </configuration> in descriptor.xml file we can specify <fileSets> <fileSet> <directory>src/install</directory> <outputDirectory>/</outputDirectory> </fileSet> </fileSets> Is it possible to include specific file from this folder or sub-folder depending on profile? Or some other way... Like this: <profiles> <profile> <id>dev</id> <activation> <activeByDefault>false</activeByDefault> </activation> <build> <resources> <resource> <directory>src/install/dev</directory> <includes> <include>**/*</include> </includes> </resource> </resources> </build> </profile> <profile> <id>prod</id> <build> <resources> <resource> <directory>src/install/prod</directory> <includes> <include>**/*</include> </includes> </resource> </resources> </build> </profile> </profiles> But it puts resources in jar when packaging. But we need to put it in zip when assemblying as I already mentioned above :( Thanks!

    Read the article

  • EF4 POCO Not Updating Navigation Property On Save

    - by Gavin Draper
    I'm using EF4 with POCO objects the 2 tables are as follows Service ServiceID, Name, StatusID Status StatusID, Name The POCO objects look like this Service ServiceID, Status, Name Status StatusID, Name With Status on the Service object being a Navigation Property and of type Status. In my Service Repository I have a save method that takes a service objects attaches it to the context and calls save. This works fine for the service, but if the status for that service has been changed it does not get updated. My Save method looks like this public static void SaveService(Service service) { using (var ctx = Context.CreateContext()) { ctx.AttachModify("Services", service); ctx.AttachTo("Statuses",service.Status); ctx.SaveChanges(); } } The AttachModify method attaches an object to the context and sets it to modified it looks like this public void AttachModify(string entitySetName, object entity) { if (entity != null) { AttachTo(entitySetName, entity); SetModified(entity); } } public void SetModified(object entity) { ObjectStateManager.ChangeObjectState(entity, EntityState.Modified); } If I look at a SQL profile its not even including the navigation property in the update for the service table, it never touches the StatusID. Its driving me crazy. Any idea what I need to do to force the Navigation Property to update?

    Read the article

  • Python: Problem Importing Function From Another Module

    - by Rafid K. Abdullah
    I have a module called nbemail.py and in this module I want to use the function package_post defined in the module main.py. I am using this statement: from api.main import package_post But I am getting this error: ImportError: cannot import name package_post I really don't know why I am getting this error! I do have _init_.py files in the api directory (which contains the files nbemail.py and main.py) and I do have the function package_post defined in main.py. Any idea to help fixing this problem?

    Read the article

  • APress Deal of the Day 4/Jan/2011 - Pro SQL Server 2008 Mirroring

    - by TATWORTH
    Todays Apress $10 deal of the day at http://www.apress.com/info/dailydeal is "Pro SQL Server 2008 Mirroring is your complete guide to planning, using, deploying, and maintaining database mirroring as a high-availability option. Mirroring protects you by maintaining one or more duplicate copies of your database for use in the event the primary copy is damaged. It is a key component of any production-level, high-availability solution. This book covers the full spectrum of database mirroring, taking you from the planning phase through the implementation to the maintenance phase and beyond."

    Read the article

  • In Ubuntu I make changes to php.ini but nothing happens

    - by MrAn3
    Hi, Apache with php works well, but none of the changes I make in php.ini have effect, I've even delete all the contents of the file, then restart Apache, and run phpinfo() and surprisingly everything continues working well. The file I'm editing is the one that appears in the phpinfo() like "Loaded Configuration File". (/etc/php5/apache2/php.ini) P.S. I'm running Ubuntu 9.04 and PHP 5.2 Thanks in advance. More Details: I'm restarting with sudo /etc/init.d/apache2 restart, I've also tried sudo /etc/init.d/apache2 stop, and then start, at restarting I get: Restarting web server apache2 apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName ... waiting apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName [ OK ] "which php" did not produce any results. My installation of PHP was done using Synaptic Package Manger, choosing "Mark Packages by task" and then LAMP server. I don't have any clue of what to do...

    Read the article

  • How do I speed up load times on roaming profiles with Active Directory?

    - by user65712
    I've done some reading and apparently the main obstacle to fast remote profile syncing is that Samba takes a long time to transfer lots of little files like cookies. After reading Roaming Profiles: Best Practices , I plan to use Folder Redirection, but I want my users to be able to login as rapidly as possible, even if it means that their data is still coming in when they reach their desktop. Is there a way to do this with GPO or a third party add-on that can load user profile data faster/speed up the login process for users?

    Read the article

  • Error importing large MySQL dump file which includes binary BLOBs in Windows

    - by Daniel Magliola
    I'm trying to import a MySQL dump file, which I got from my hosting company, into my Windows dev machine, and i'm running into problems. I'm importing this from the command line, and i'm getting a very weird error: ERROR 2005 (HY000) at line 3118: Unknown MySQL server host '+?*á±dÆ-N+Æ·h^ye"p-i+ Z+-$?P+Y.8+|?+l8/l¦¦î7æ¦X¦XE.ºG[ ;-ï?éµ?º+¦¦].?+f9d릦'+ÿG?-0à¡úè?-?ù??¥'+NÑ' (11004) I'm attaching the screenshot because i'm assuming the binary data will get lost... I'm not exactly sure what the problem is, but two potential issues are the size of the file (2 Gb) which is not insanely large, but it's not trivially small either, and the other is the fact that many of these tables have JPG images in them (which is why the file is 2Gb large, for the most part). Also, the dump was taken in a Linux machine and I'm importing this into Windows, not sure if that could add to the problems (I understand it shouldn't) Now, that binary garbage is why I think the images in the file might be a problem, but i've been able to import similar dumps from the same hosting company in the past, so i'm not sure what might be the issue. Also, trying to look into this file (and line 3118 in particular) is kind of impossible given its size (i'm not really handy with Linux command line tools like grep, sed, etc). The file might be corrupted, but i'm not exactly sure how to check it. What I downloaded was a .gz file, which I "tested" with WinRar and it says it looks OK (i'm assuming gz has some kind of CRC). If you can think of a better way to test it, I'd love to try that. Any ideas what could be going on / how to get past this error? I'm not very attached to the data in particular, since I just want this as a copy for dev, so if I have to lose a few records, i'm fine with that, as long as the schema remains perfectly sound. Thanks! Daniel

    Read the article

  • (Some) security perms in WinXP corrupted (shows GUID instead of username)

    - by Andy
    I've been using my Win XP machine (part of a domain) over the holiday period, so until yesterday it hadn't rebooted for about five days. I used it yesterday perfectly fine and shut it down. When I switched it on this morning the majority (but not all) of my shortcut links in the Quick Launch toolbar showed as generic file icons. If you open the folder and get properties on one of the failing shortcuts it says ''Target type: This is not a valid shortcut''. Then in Outlook I noticed my signature wasn't showing (I checked my sent folder and the sig was ok yesterday). Checking the signature folder, I can't see the security tab on any of the sig files, and I have an access denied message on trying to open them. I can see the security tab on the signature folder itself, just none of the contents. If I try and use the parent folder's security tab and ''Replace permission entries on all child objects with entries shown here that apply to child objects'' it appears to work fine, but makes no actual difference. I logged in as administrator and saw that the owner of the files showed up as a GUID (clearly should've been my account in its place). Any ideas what might have made that happen? So far I haven't heard any similar complaints from anyone else at the office...

    Read the article

  • Setting up MySQL Linux slave with a Windows master

    - by philwilks
    I'm running a MySQL 5.0 database server on Windows Server 2008. The total size of the database is about 1Gb. I make daily backups, but I'd like to step up to having a slave server for extra protection. My thinking was that I wouldn't need the expense of a Windows machine to do this, and a Linux "cloud server" from RackSpace would do the job well for quite a low cost. However I have little experience with Linux, so I have a few questions... Does this sound like a good idea? Is there anything wrong with linking Windows and Linux MySQL servers? Does Linux have the equivalent of Remote Desktop Connection? If so can I use this from a Windows machine? Would a particular Linux distro be well suited to this task? RackSpace offer ArchLinux, CentOS, Debian, Fedora and Ubuntu. My immediate thinking is to go with Ubuntu as I've heard it's more friendly for people coming from a Windows background. Any comments you have would be very appreciated! Phil

    Read the article

  • command to show the shell command prompt

    - by LinuxPenseur
    Hi, Is there a shell command to display the command prompt. I will explain what i want through the illustration below. When i execute script.sh, i should get the following output $sh script.sh $ /* command prompt and then print hi */ hi My script.sh is like this #! /bin/bash <command to display the shell command prompt> echo "hi" exit 0 what should the code that has to go in the place of angle brackets to get an output like above? Thanks

    Read the article

  • What would Stack Exchange's yearly expenses be if it were to be using a third party host?

    - by abel
    StackExchange manages it's own servers, as it should, but if SE were to be hosted on a 3rd party "cloud" hosting (like Amazon's), what would it's monthly / yearly expenses be(keeping everything else the same)? A detailed answer comparing it to the bills that Stackexchange boots currently (including power/property/staff) would help. (PS: I know that the blog is a good resource. I also understand that managing your own hosting is almost the same as setting up a hosting company and using it for your own needs. Plus is this a question for meta or does it fit within serverfault's purview?)

    Read the article

  • Cant logon to domain over site-to-site vpn

    - by 3molo
    Tied together branch office with main office over two Cisco ASAs. The (internal) networks on either side can communicate with the other. I can ping, use the DC's DNS service and even join a domain on a new client. I can't however logon, I get the "domain controller is not available" error message on client. I find nothing peculiar in DC's event logs. Sicne it's site-to-site (with ping), it's always up so it should work. No firewall rules (except allow any any) between the two networks (of either side). Main site internal net: 10.10.10.0/24 Branch office net: 10.180.3.0/24 Am I overlooking something here? Where should I start investigating this?d

    Read the article

  • Apache Derby running within Tomcat causes shutdown issues

    - by Luke
    I have set up Derby Network Server to be hosted within a Tomcat environment. This works great. However, when I shut down Tomcat I get the following errors: 04/01/2011 10:41:41 AM org.apache.catalina.core.StandardService stop INFO: Stopping service Catalina 04/01/2011 10:41:41 AM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc SEVERE: The web application [/derby] registered the JBDC driver [org.apache.derby.jdbc.ClientDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered. 04/01/2011 10:41:41 AM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc SEVERE: The web application [/derby] registered the JBDC driver [org.apache.derby.jdbc.AutoloadedDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered. 04/01/2011 10:41:41 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: The web application [/derby] appears to have started a thread named [derby.NetworkServerStarter] but has failed to stop it. This is very likely to create a memory leak. 04/01/2011 10:41:41 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: The web application [/derby] appears to have started a thread named [NetworkServerThread_4] but has failed to stop it. This is very likely to create a memory leak. 04/01/2011 10:41:41 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: The web application [/derby] appears to have started a thread named [DRDAConnThread_5] but has failed to stop it. This is very likely to create a memory leak. 04/01/2011 10:41:41 AM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: The web application [/derby] appears to have started a thread named [DRDAConnThread_13] but has failed to stop it. This is very likely to create a memory leak. 04/01/2011 10:41:41 AM org.apache.coyote.http11.Http11Protocol destroy INFO: Stopping Coyote HTTP/1.1 on http-8080 I'm currently starting and stopping Tomcat with the following commands: ./catalina run ./catalina stop Is there a better way to shutdown Tomcat with Derby or can this be solved by a configuration change?

    Read the article

  • Remote Management/VNC Mac OSX Server 10.6 from Windows Server 2008

    - by Jonar
    What is the most compatible/reliable software to remote manage an osx server using windows server? I tried to activate the remote management from osx server then use remote desktop login from windows(failed) Tried to activate built in vnc server from osx server then use vnc client from windows(failed) tried to install osxvnc server(vine server) on osx then use either tightvnc or ultravnc on windows (connects but after sometime disconnect) PS. I would prefer a free software for both servers.

    Read the article

  • Weird behaviour/rendering of backspace in Terminal.app when SSHing into zsh

    - by Nils Riedemann
    Hi there, I just stumbled upon a weird problem. When I SSH into my server (centos, zsh) and I type some stuff and hit backspace It looks like a space - but internally it really deleted the characters. ls -l a Note that the space between land a is actually when I hit backspace. When I now hit return ls -a gets executed. This is only in zsh, in bash it works fine. Hope anyone has an idea what this is all about and how to fix this.

    Read the article

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