Daily Archives

Articles indexed Sunday May 30 2010

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

  • I wired up a z 80 using telephone wire and put a jump to 0000 0000 0000 0000

    - by john
    I put 1100 0011 0000 0000 0000 0000 in the 2764 eprom --- this is supposed to test the z80 -- I have a 555 timer running at 500 khz. Can this small program work with the z80 ? I looked at the address pins on a m465 oscilloscope. The address shows highs up to 0100 0000. I think it should only count to 0000 0000 0000 0011. Can the z80 be tested? The Santa Clara Valley also made the lm1871 radio control chip that could not show a high or a low without completing the entire rc loop.

    Read the article

  • WCF Data Service BeginSaveChanges not saving changes in Silverlight app

    - by Enigmativity
    I'm having a hell of a time getting WCF Data Services to work within Silverlight. I'm using the VS2010 RC. I've struggled with the cross domain issue requiring the use of clientaccesspolicy.xml & crossdomain.xml files in the web server root folder, but I just couldn't get this to work. I've resorted to putting both the Silverlight Web App & the WCF Data Service in the same project to get past this issue, but any advice here would be good. But now that I can actually see my data coming from the database and being displayed in a data grid within Silverlight I thought my troubles were over - but no. I can edit the data and the in-memory entity is changing, but when I call BeginSaveChanges (with the appropriate async EndSaveChangescall) I get no errors, but no data updates in the database. Here's my WCF Data Services code: public class MyDataService : DataService<MyEntities> { public static void InitializeService(DataServiceConfiguration config) { config.SetEntitySetAccessRule("*", EntitySetRights.All); config.SetServiceOperationAccessRule("*", ServiceOperationRights.All); config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V2; } protected override void OnStartProcessingRequest(ProcessRequestArgs args) { base.OnStartProcessingRequest(args); HttpContext context = HttpContext.Current; HttpCachePolicy c = HttpContext.Current.Response.Cache; c.SetCacheability(HttpCacheability.ServerAndPrivate); c.SetExpires(HttpContext.Current.Timestamp.AddSeconds(60)); c.VaryByHeaders["Accept"] = true; c.VaryByHeaders["Accept-Charset"] = true; c.VaryByHeaders["Accept-Encoding"] = true; c.VaryByParams["*"] = true; } } I've pinched the OnStartProcessingRequest code from Scott Hanselman's article Creating an OData API for StackOverflow including XML and JSON in 30 minutes. Here's my code from my Silverlight app: private MyEntities _wcfDataServicesEntities; private CollectionViewSource _customersViewSource; private ObservableCollection<Customer> _customers; private void UserControl_Loaded(object sender, RoutedEventArgs e) { if (!System.ComponentModel.DesignerProperties.GetIsInDesignMode(this)) { _wcfDataServicesEntities = new MyEntities(new Uri("http://localhost:7156/MyDataService.svc/")); _customersViewSource = this.Resources["customersViewSource"] as CollectionViewSource; DataServiceQuery<Customer> query = _wcfDataServicesEntities.Customer; query.BeginExecute(result => { _customers = new ObservableCollection<Customer>(); Array.ForEach(query.EndExecute(result).ToArray(), _customers.Add); Dispatcher.BeginInvoke(() => { _customersViewSource.Source = _customers; }); }, null); } } private void button1_Click(object sender, RoutedEventArgs e) { _wcfDataServicesEntities.BeginSaveChanges(r => { var response = _wcfDataServicesEntities.EndSaveChanges(r); string[] results = new[] { response.BatchStatusCode.ToString(), response.IsBatchResponse.ToString() }; _customers[0].FinAssistCompanyName = String.Join("|", results); }, null); } The response string I get back data binds to my grid OK and shows "-1|False". My intent is to get a proof-of-concept working here and then do the appropriate separation of concerns to turn this into a simple line-of-business app. I've spent hours and hours on this. I'm being driven insane. Any ideas how to get this working?

    Read the article

  • Iphone: Change Audio Speed

    - by mauro
    Hi, I purchased Amazing Slow Downer for iphone. It permits to change audio speed without changing pitch. Could someone please help me in finding the source code for obtaining such a function. Thank you Mauro

    Read the article

  • questions about name mangling in C++

    - by Tim
    I am trying to learn and understand name mangling in C++. Here are some questions: (1) From devx When a global function is overloaded, the generated mangled name for each overloaded version is unique. Name mangling is also applied to variables. Thus, a local variable and a global variable with the same user-given name still get distinct mangled names. Are there other examples that are using name mangling, besides overloading functions and same-name global and local variables ? (2) From Wiki The need arises where the language allows different entities to be named with the same identifier as long as they occupy a different namespace (where a namespace is typically defined by a module, class, or explicit namespace directive). I don't quite understand why name mangling is only applied to the cases when the identifiers belong to different namespaces, since overloading functions can be in the same namespace and same-name global and local variables can also be in the same space. How to understand this? Do variables with same name but in different scopes also use name mangling? (3) Does C have name mangling? If it does not, how can it deal with the case when some global and local variables have the same name? C does not have overloading functions, right? Thanks and regards!

    Read the article

  • ASP.NET: What's the best way to validate 3 drop downs boxes that are used to select a date (month, d

    - by Josh
    I have two sets of drop downs for start date and end date. Each date is created by selecting a month, day, and year from 3 separate drop downs. I currently have RequiredFieldValidators on all the drop downs (which just shows a * if nothing has been selected yet), but I need to validate that the end date is greater than the start date. I can take care of the logic behind comparing the dates, but in terms of the validation method used, can someone help me out (I essentially need to validate 6 drop downs all at one time)? I tried a custom validation using client side javascript but couldn't get it to work. Can you even validate multiple drop downs using ASP.NET validation controls? (which is what I would like to do - I can always write the javascript, but was trying to stay away from this). Thanks.

    Read the article

  • Cancel page forward/back hotkeys in Firefox with Greasemonkey

    - by Stimulating Pixels
    First the background: In Firefox 3.6.3 on Mac OS X 10.5.8 when entering text into a standard the hotkey combination of Command+LeftArrow and Command+RightArrow jump the cursor to the start/end of the current line, respectively. However, when using CKEditor, FCKEditor and YUI Editor, Firefox does not seem to completely recognize that it's a text area. Instead, it drops back to the default function for those hotkeys which is to move back/forward in the browser history. After this occurs, the text in the editor is also cleared when you return to the page making it very easy to loose whatever is being worked on. I'm attempting to write a greasemonkey script that I can use to capture the events and prevent the page forward/back jumps from being executed. So far, I've been able to see the events with the following used as a .user.js script in GreaseMonkey: document.addEventListener('keypress', function (evt) { // grab the meta key var isCmd = evt.metaKey; // check to see if it is pressed if(isCmd) { // if so, grab the key code; var kCode = evt.keyCode; if(kCode == 37 || kCode == 39) { alert(kCode); } } }, false ); When installed/enabled, pressing command+left|right arrow key pops an alert with the respective code, but as soon as the dialog box is closed, the browser executes the page forward/back move. I tried setting a new code with evt.keyCode = 0, but that didn't work. So, the question is, can this Greasemonkey script be updated so that it prevents the back/forward page moves? (NOTE: I'm open to other solutions as well. Doesn't have to be Greasemonkey, that's just the direction I've tried. The real goal is to be able to disable the forward/back hotkey functionality.)

    Read the article

  • ASP.NET MVC OutputCache with POST Controller Actions

    - by Maxim Z.
    I'm fairly new to using the OutputCache attribute in ASP.NET MVC. Static Pages I've enabled it on static pages on my site with code such as the following: [OutputCache(Duration = 7200, VaryByParam = "None")] public class HomeController : Controller { public ActionResult Index() { //... If I understand correctly, I made the whole controller cache for 7200 seconds (2 hours). Dynamic Pages However, how does it work with dynamic pages? By dynamic, I mean where the user has to submit a form. As an example, I have a page with an email form. Here's what that code looks like: public class ContactController : Controller { // // GET: /Contact/ public ActionResult Index() { return RedirectToAction("SubmitEmail"); } public ActionResult SubmitEmail() { //In view for CAPTCHA: <%= Html.GenerateCaptcha() %> return View(); } [CaptchaValidator] [AcceptVerbs(HttpVerbs.Post)] public ActionResult SubmitEmail(FormCollection formValues, bool captchaValid) { //Validate form fields, send email if everything's good... if (isError) { return View(); } else { return RedirectToAction("Index", "Home"); } } public void SendEmail(string title, string name, string email, string message) { //Send an email... } } What would happen if I applied OutputCache to the whole controller here? Would the HTTP POST form submission work? Also, my form has a CAPTCHA; would that change anything in the equation? In other words, what's the best way to approach caching with dynamic pages? Thanks in advance.

    Read the article

  • Can I subnet a subnet?

    - by Portman
    Apologies in advance for the botched terminology. I have read the Server Fault Subnet Wiki but this is more of an ISP question. I currently have a /27 block of public IPs. I use give my router the first address in this pool and then use 1-to-1 NAT for all the servers behind the firewall, so that they each get their own public IP. The router/firewall is currently using (actual addresses removed to protect the guilty): IP Address: XXX.XXX.XXX.164 Subnet mask: 255.255.255.224 Gateway: XXX.XXX.XXX.161 What I would like to do is break out my subnet into two separate /28 subnets. And do this in a way that is transparent to the ISP (i.e., they see me as continuing to operate a single /27). Currently, my topology looks like: ISP | [Router/Firewall] | [Managed Ethernet Switch] / \ \ [Server1] [Server2] [Server3] (etc) Instead, I would like it to look like: ISP | [Switch] / \ [Router1] [Router2] | | | | [S1] [S2] [S3] [S4] (etc) As you can see, this would partition me into two separate networks. I'm struggling with what the correct IP settings would be on Router1 and Router2. Here's what I have right now: Router1 Router2 IP Address: XXX.XXX.XXX.164 XXX.XXX.XXX.180 Subnet mask: 255.255.255.240 255.255.255.240 Gateway: XXX.XXX.XXX.161 XXX.XXX.XXX.161 Note that normally you would expect Router2 to have a gateway of .177, but I'm trying to get them both to use the gateway originally given to me by the ISP. Is subnetting like this in fact possible, or am I completely botching the most basic concepts?

    Read the article

  • Security measures for CentOS

    - by cappuccinodrinker
    I have been tightening up my web server security and wanted to know what else I can do. I am running CentOS 5 with these measures: - All passwords to FTP, MySQL etc are generated from grc.com/passwords.htm and microsoft.com/protect/fraud/passwords/create.aspx (for the ones which cannot be too long). - Running iptables with all ports shut off except for http mail and smtp, the important ports like FTP SSH are blocked to all except my static office IP. There is also no response to pings. - Rootkit Hunter running daily - The server is PCI compliant according to Comodo - Not running any crappy made php apps, we use Zend Framework for our stuff and do have kayako installed and keep them up to date. Can't really think of anything else I can do... I could implement a brute force measure, but I think I already have by simply changing my SSH port to a number above 10000 and blocking it off with iptables.

    Read the article

  • How to re-do the hard disks in a WD Word Book Edition II ?

    - by jfmessier
    I recently purchased a WD World Book II, a 2 TB one. I call it the "White Box". It has those 2 1TB drives, and they were in this RAID 1 config, only giving me about 1 TB. I could not delete the raid array, and I took the drives in a Linux box. But I also deleted the entire partitions of the disks, and I cannot even et the existing RAID array on this WD White Box. The drives are fine, but I cannot get them to work on the WD White Box. My goal was to get back to a real 2 TB storage space. If I cannot get those drives back in the White Box, I can re-use them elsewhere, but this would mean a waste of the firmware and network connection. After the fact, I read that, anyway, the network performance is rather poor. Thanks :-)

    Read the article

  • How to use the same element name in different purposes ( in XML and DTD ) ?

    - by BugKiller
    Hi, I Want to create a DTD schema for this xml document: <root> <student> <name> <firstname>S1</firstname> <lastname>S2</lastname> </name> </student> <course> <name>CS101</name> </course> </root> as you can see , the element name in the course contains plain text ,but the element name in the student is complex type ( first-name, last-name ). The following is the DTD: <!ELEMENT root (course|student)*> <!ELEMENT student (name)> <!ELEMENT name (lastname|firstname)> <!ELEMENT firstname (#PCDATA)> <!ELEMENT lastname (#PCDATA)> <!ELEMENT course (name)> When I want to validate it , I get an error because the course's name has different structure then the student's name . My Question: how can I make a work-around solution for this situation without changing the name of element name using DTD not xml schema . Thanks.

    Read the article

  • I'm using the correct content type & Headers so Why is FireFox saving Zip Files without extensions

    - by The_AlienCoder
    Users on my site have the option to download all the photos in an album as a zip file.The Zip file is dynamically created and saved to Response.OutPutStream to be detected as a file download on the user's browser. Here is the Header and Content-type I am outputing context.Response.AddHeader("Content-Disposition", "attachment; filename=Photos.zip"); context.Response.ContentType = "application/x-zip-compressed"; ..Well everything works fine with every browser except FireFox. Although Firefox correctly detects the download as a Zip file, It saves the file without the .zip extension. I thought adding this header context.Response.AddHeader("Content-Disposition", "attachment; filename=Photos.zip"); ..is supposed to force FF to save the extension. I believe I am following the correct protocol so why is FF behaving this way and how do I fix this?

    Read the article

  • ClickOnce application configured to perform updates programmatically still sometimes displays the Cl

    - by Tom Hall
    We have a WPF application deployed using ClickOnce which checks for and performs updates programmatically on application startup. This generally behaves perfectly except for the case where the user chooses "No" to our "Do you wish to update?" prompt. In this case, the next time the user launches the application (consistently) the ClickOnce framework's "Update Available" dialog launches with the option to update or skip. This doesn't cause a technical problem but will be confusing to the user to potentially see two completely differently styled dialogs. (If the user chooses Skip to the ClickOnce dialog then the application then launches and renders our own "Update Available" dialog). Any ideas why the ClickOnce framework dialog is showing in this case? Thanks.

    Read the article

  • finding common prefix of array of strings

    - by bumperbox
    I have an array like this $sports = array( 'Softball - Counties', 'Softball - Eastern', 'Softball - North Harbour', 'Softball - South', 'Softball - Western' ); and i would like to find the longest common part of the string so in this instance, it would be 'Softball - '; I am thinking that I would follow the this process $i = 1; // loop to the length of the first string while ($i < strlen($sports[0]) { // grab the left most part up to i in length $match = substr($sports[0], 0, $i); // loop through all the values in array, and compare if they match foreach ($sports as $sport) { if ($match != substr($sport, 0, $i) { // didn't match, return the part that did match return substr($sport, 0, $i-1); } } // foreach // increase string length $i++; } // while // if you got to here, then all of them must be identical Questions is there a built in function or much simpler way of doing this ? for my 5 line array that is probably fine, but if i were to do several thousand line arrays, there would be a lot of overhead, so i would have to be move calculated with my starting values of $i, eg $i = halfway of string, if it fails, then $i/2 until it works, then increment $i by 1 until we succeed. so that we are doing the least number of comparisons to get a result If there a formula/algorithm out already out there for this kind of problem ? thanks alex

    Read the article

  • Windows 7 task bar program jump list

    - by MrStatic
    I am looking for a way to make a jump list for the windows task bar for application shortcuts. Kinda like the quick launch toolbar but with the jump list look. I tried to make my own 'toolbar' but that does what the quick launch bar did before.

    Read the article

  • Big table or multiple separate tables? (database design question)

    - by Khou
    This is a database design question. I want to build an invoice web application, an invoice can have many items, and each user can have an inventory list of product items that they can store and choose to add to an invoice item. My questions are: 1. Should I store all product inventory for all users using my application under one single table? Or have a separate product inventory table created for each user? 2. Is this even possible? 1 table is easier, but what if this single table grows too big, will I have a problem? (primary key INT).

    Read the article

  • Microsoft Sync Framework - How to reprovision a table (or entire scope) fater schema changes?

    - by Rabbi
    B"H I have already setup Syncing with Microsoft Sync Framework, and now I need to add fields to a table. How do I re-provision the databases? The setup is exceedingly simple: Two sql express 2008 servers The scope includes the entire database Using Microsoft Sync Framework 2.0 Synchronizing by direct access. Using the standard new SqlSyncProvider Do I make the structural changes at both ends? Or do I only change one Server and let Sync Framework somehow propagate the change? Do I need to delete the _tracking tables and/or the stored procedures? How about the triggers? Has anyone been using the Sync Framework? Please help.

    Read the article

  • Texture repeats even with GL_CLAMP_TO_EDGE set

    - by Lliane
    Hi, i'm trying to put a translucing texture on a face which uses points 1 to 4 (don't mind the numbers) on the following screenshot Sadly as you can see the texture repeats herself in both dimensions, I tried to switch the TEXTURE_WRAP_S from REPEAT to CLAMP_to_EDGE but it doesn't change anything. Texture loading code is here : gl.glBindTexture(gl.GL_TEXTURE_2D, mTexture.get(4)); gl.glActiveTexture(4); gl.glTexParameterf(gl.GL_TEXTURE_2D, gl.GL_TEXTURE_MIN_FILTER, gl.GL_LINEAR); gl.glTexParameterf(gl.GL_TEXTURE_2D, gl.GL_TEXTURE_MAG_FILTER, gl.GL_LINEAR); gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_S, GL10.GL_CLAMP_TO_EDGE); gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T, GL10.GL_CLAMP_TO_EDGE); gl.glTexImage2D(gl.GL_TEXTURE_2D, 0, gl.GL_RGBA, shadowbmp.width, shadowbmp.height, 0, gl.GL_RGBA, gl.GL_UNSIGNED_SHORT_4_4_4_4, shadowbmp.buffer); Texture coordinates are the following : float shadow_bot_text[] = { 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f, 1.0f }; Thanks

    Read the article

  • How can I implement forum privileges

    - by RobertPitt
    I've started developing a forum application in PHP on my MVC Framework and I've got to the stage where I assign permissions to members (for example: READ, WRITE, UPDATE, DELETE). Now, I know I can add 5 columns under the user table in my database and set them to 1 | 0, but that to me seems like too much if I want to add other rules, like MOVE for example. And how can I dynamically assign these privileges them to users individually? I've heard of using a bitmasks, but it would be really good if I could fully understand them before I continue. Do you have an example of how I might implement this?

    Read the article

  • How do I work with constructs in PHPUnit?

    - by Ben Dauphinee
    I am new into PHPUnit, and just digging through the manual. I cannot find a decent example of how to build a complete test from end to end though, and so, am left with questions. One of these is how can I prep my environment to properly test my code? I am trying to figure out how to properly pass various configuration values needed for both the test setup/teardown methods, and the configs for the class itself. // How can I set these variables on testing start? protected $_db = null; protected $_config = null; // So that this function runs properly? public function setUp(){ $this->_acl = new acl( $this->_db, // The database connection for the class passed // from whatever test construct $this->_config // Config values passed in from construct ); } // Can I just drop in a construct like this, and have it work properly? // And if so, how can I set the construct call properly? public function __construct( Zend_Db_Adapter_Abstract $db, $config = array(), $baselinedatabase = NULL, $databaseteardown = NULL ){ $this->_db = $db; $this->_config = $config; $this->_baselinedatabase = $baselinedatabase; $this->_databaseteardown = $databaseteardown; } // Or is the wrong idea to be pursuing?

    Read the article

  • php encrypting an integer to get only alphanumeric characters?

    - by Matthew Steiner
    When I use some of php's encryption functions, I end up getting a few characters I don't want (+, /, =). The problem is that my application doesn't allow these in the url. I'm wondering if there's a good way of encrypting an integer and having only alphanumeric characters in the result? I'm trying to pass some data through the url. I know it's possible to do some workarounds (put data in database and pass the id to the row or something), but I really want to try it this way. Ideas?

    Read the article

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