Daily Archives

Articles indexed Tuesday May 18 2010

Page 9/121 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • Error with mounting partiotn ubuntu

    - by Master
    I have ext3 partition and i get this error mount: wrong fs type, bad option, bad superblock on /dev/sdb1, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so Command in fstab is /dev/sdb1 /media/Server ext3 defaults 0 0

    Read the article

  • Send html array as post variable using Request.JSON

    - by ian
    I have an html: First name: <input type='text' name='first_name' value='' /><br/> Last name: <input type='text' name='last_name' value='' /><br/> <input type='checkbox' name='category[]' value='Math' /> Math<br/> <input type='checkbox' name='category[]' value='Science' /> Science<br/> <input type='checkbox' name='category[]' value='History' /> History<br/> etc..... I want to send(using post method) the selected categories(category[]) via mootools ajax so that if I dump the $_POST variable in the server I will get something like: array(1) { [category]=> array(2) { [0]=> string(4) "Math" [1]=> string(7) "History" } } What should be the javascript(mootools) code for it? Below is my partial code. new Request.JSON({url: '/ajax_url', onSuccess: function(){ alert('success'); } }).post(???); Note that I don't want to send first_name and last_name fields. I only want to send the category field which is an html array.

    Read the article

  • How to access webbrowser object on this code? C++

    - by extintor
    I found this example http://www.mvps.org/user32/webhost.cab that host an Internet Explorer WebBrowser object, and it uses this code to access the object void webhostwnd::CreateEmbeddedWebControl(void) { OleCreate(CLSID_WebBrowser,IID_IOleObject,OLERENDER_DRAW,0,&site,&storage,(void**)&mpWebObject); mpWebObject->SetHostNames(L"Web Host",L"Web View"); // I have no idea why this is necessary. remark it out and everything works perfectly. OleSetContainedObject(mpWebObject,TRUE); RECT rect; GetClientRect(hwnd,&rect); mpWebObject->DoVerb(OLEIVERB_SHOW,NULL,&site,-1,hwnd,&rect); IWebBrowser2* iBrowser; mpWebObject->QueryInterface(IID_IWebBrowser2,(void**)&iBrowser); VARIANT vURL; vURL.vt = VT_BSTR; vURL.bstrVal = SysAllocString(L"http://google.com"); VARIANT ve1, ve2, ve3, ve4; ve1.vt = VT_EMPTY; ve2.vt = VT_EMPTY; ve3.vt = VT_EMPTY; ve4.vt = VT_EMPTY; iBrowser->put_Left(0); iBrowser->put_Top(0); iBrowser->put_Width(rect.right); iBrowser->put_Height(rect.bottom); iBrowser->Navigate2(&vURL, &ve1, &ve2, &ve3, &ve4); VariantClear(&vURL); iBrowser->Release(); } I don't have much experience with cpp, I want to know how to access that same ie object (to use Navigate2 for example) from a button or something like that. How could I achieve this?

    Read the article

  • What are the original reasons for ToString() in Java and .NET?

    - by d.
    I've used ToString() modestly in the past and I've found it very useful in many circumstances. However, my usage of this method would hardly justify to put this method in none other than System.Object. My wild guess is that, at some point during the work carried out and meetings held to come up with the initial design of the .NET framework, it was decided that it was necessary - or at least extremely useful - to include a ToString() method that would be implemented by everything in the .NET framework. Does anyone know what the exact reasons were? Am I missing a ton of situations where ToString() proves useful enough as to be part of System.Object? What were the original reasons for ToString()? Thanks a lot! PS - Again: I'm not questioning the method or implying that it's not useful, I'm just curious to know what makes it SO useful as to be placed in System.Object. Side note - Imagine this: AnyDotNetNativeClass someInitialObject = new AnyDotNetNativeClass([some constructor parameters]); AnyDotNetNativeClass initialObjectFullCopy = AnyDotNetNativeClass.FromString(someInitialObject.ToString()); Wouldn't this be cool? EDIT(1): (A) - Based on some answers, it seems that .NET languages inherited this from Java. So, I'm adding "Java" to the subject and to the tags as well. If someone knows the reasons why this was implemented in Java then please shed some light! (B) - Static hypothetical FromString vs Serialization: sure, but that's quite a different story, right?

    Read the article

  • Tagging CALayers in iPhone

    - by Peyman
    Hi I am looking for a general way to be able to search for a unique CALayer in a hierarchy without having to remember where the layer is in a hierarchy (and use the sublayer: and superlayer: methods). I know this is possible with UIViews (which makes flipping views easy) but is it possible for CALayer? thank you in advance for your help Peyman

    Read the article

  • Can a class inherit from LambdaExpression in .NET? Or is this not recommended?

    - by d.
    Consider the following code (C# 4.0): public class Foo : LambdaExpression { } This throws the following design-time error: Foo does not implement inherited abstract member System.Linq.Expressions.LambdaExpression.Accept(System.Linq.Expressions.Compiler.StackSpiller) There's absolutely no problem with public class Foo : Expression { } but, out of curiosity and for the sake of learning, I've searched in Google System.Linq.Expressions.LambdaExpression.Accept(System.Linq.Expressions.Compiler.StackSpiller) and guess what: zero results returned (when was the last time you saw that?). Needless to say, I haven't found any documentation on this method anywhere else. As I said, one can easily inherit from Expression; on the other hand LambdaExpression, while not marked as sealed (Expression<TDelegate> inherits from it), seems to be designed to prevent inheriting from it. Is this actually the case? Does anyone out there know what this method is about? EDIT (1): More info based on the first answers - If you try to implement Accept, the editor (C# 2010 Express) automatically gives you the following stub: protected override Expression Accept(System.Linq.Expressions.ExpressionVisitor visitor) { return base.Accept(visitor); } But you still get the same error. If you try to use a parameter of type StackSpiller directly, the compiler throws a different error: System.Linq.Expressions.Compiler.StackSpiller is inaccessible due to its protection level. EDIT (2): Based on other answers, inheriting from LambdaExpression is not possible so the question as to whether or not it is recommended becomes irrelevant. I wonder if, in cases like this, the error message should be Foo cannot implement inherited abstract member System.Linq.Expressions.LambdaExpression.Accept(System.Linq.Expressions.Compiler.StackSpiller) because [reasons go here]; the current error message (as some answers prove) seems to tell me that all I need to do is implement Accept (which I can't do).

    Read the article

  • Python urllib3 and how to handle cookie support?

    - by bigredbob
    So I'm looking into urllib3 because it has connection pooling and is thread safe (so performance is better, especially for crawling), but the documentation is... minimal to say the least. urllib2 has build_opener so something like: #!/usr/bin/python import cookielib, urllib2 cj = cookielib.CookieJar() opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj)) r = opener.open("http://example.com/") But urllib3 has no build_opener method, so the only way I have figured out so far is to manually put it in the header: #!/usr/bin/python import urllib3 http_pool = urllib3.connection_from_url("http://example.com") myheaders = {'Cookie':'some cookie data'} r = http_pool.get_url("http://example.org/", headers=myheaders) But I am hoping there is a better way and that one of you can tell me what it is. Also can someone tag this with "urllib3" please.

    Read the article

  • SWT Global Menu bar items listener

    - by vigilant
    Is it possible to attach a listener to all MenuItems in a Menu bar after creating the entire menu bar? Otherwise I need to call addListener on each MenuItem individually, which is a pain with hundreds of menu items (don't ask why). With a listener attached to each MenuItem, I would then be able to demultiplex using the text string of the MenuItem.

    Read the article

  • Oracle: '= ANY()' vs. 'IN ()'

    - by eidylon
    Hi all, I just stumbled upon something in ORACLE SQL (not sure if it's in others), that I am curious about. I am asking here as a wiki, since it's hard to try to search symbols in google... I just found that when checking a value against a set of values you can do WHERE x = ANY (a, b, c) As opposed to the usual WHERE x IN (a, b, c) So I'm curious, what is the reasoning for these two syntaxes? Is one standard and one some oddball Oracle syntax? Or are they both standard? And is there a preference of one over the other for performance reasons, or ? Just curious what anyone can tell me about that '= ANY' syntax. CheerZ!

    Read the article

  • Why not use Git?

    - by Tom R
    A lot of people like git (in particular this guy) against other SCMs such as SVN, but many projects, even new ones, are set up using alternative SCMs. Furthermore, Google Code still does not support it (although many of their large open source projects use it). My question is: what are the reasons for not using git in any project, whether it be personal or collaborative? Maybe I've just been brainwashed by this guy, but I can't see any area in which other SCMs excel over git.

    Read the article

  • Acr.ExtDirect &ndash; Part 1 &ndash; Method Resolvers

    - by Allan Ritchie
    One of the most important things of any open source libraries in my opinion is to be as open as possible while avoiding having your library become invasive to your code/business model design.  I personally could never stand marking my business and/or data access code with attributes everywhere.  XML also isn’t really a fav with too many people these days since it comes with a startup performance hit and requires runtime compiling.  I find that there is a whole ton of communication libraries out there currently requiring this (ie. WCF, RIA, etc).  Even though Acr.ExtDirect comes with its own set of attributes, you can piggy-back the [ServiceContract] & [OperationContract] attributes from WCF if you choose.  It goes beyond that though, there are 2 others “out-of-the-box” implementations – Convention based & XML Configuration.    Convention – I don’t actually recommend using this one since it opens up all of your public instance methods to remote execution calls. XML Configuration – This isn’t so bad but requires you enter all of your methods and there operation types into the Castle XML configuration & as I said earlier, XML isn’t the fav these days.   So what are your options if you don’t like attributes, convention, or XML Configuration?  Well, Acr.ExtDirect has its own extension base to give the API a list of methods and components to make available for remote execution.  1: public interface IDirectMethodResolver { 2:   3: bool IsServiceType(ComponentModel model, Type type); 4: string GetNamespace(ComponentModel model); 5: string[] GetDirectMethodNames(ComponentModel model); 6: DirectMethodType GetMethodType(ComponentModel model, MethodInfo method); 7: }   Now to implement our own method resolver:   1: public class TestResolver : IDirectMethodResolver { 2:   3: #region IDirectMethodResolver Members 4:   5: /// <summary> 6: /// Determine if you are calling a service 7: /// </summary> 8: /// <param name="model"></param> 9: /// <param name="type"></param> 10: /// <returns></returns> 11: public bool IsServiceType(ComponentModel model, Type type) { 12: return (type.Namespace == "MyBLL.Data"); 13: } 14:   15: /// <summary> 16: /// Return the calling name for the client side 17: /// </summary> 18: /// <param name="model"></param> 19: /// <returns></returns> 20: public string GetNamespace(ComponentModel model) { 21: return model.Name; 22: } 23:   24: public string[] GetDirectMethodNames(ComponentModel model) { 25: switch (model.Name) { 26: case "Products" : 27: return new [] { 28: "GetProducts", 29: "LoadProduct", 30: "Save", 31: "Update" 32: }; 33:   34: case "Categories" : 35: return new [] { 36: "GetProducts" 37: }; 38:   39: default : 40: throw new ArgumentException("Invalid type"); 41: } 42: } 43:   44: public DirectMethodType GetMethodType(ComponentModel model, MethodInfo method) { 45: if (method.Name.StartsWith("Save") || method.Name.StartsWith("Update")) 46: return DirectMethodType.FormSubmit; 47: 48: else if (method.Name.StartsWith("Load")) 49: return DirectMethodType.FormLoad; 50:   51: else 52: return DirectMethodType.Direct; 53: } 54:   55: #endregion 56: }   And there you have it, your own custom method resolver.  Pretty easy and pretty open ended!

    Read the article

  • System information shown when booting Debian

    - by WebDevHobo
    When booting Debian, you'll see it printing a lot of information about the system variables and such. I don't really need to see all that, so I'd like to modify some scripts to make sure that on boot, it just does what it has to do, without printing it on the screen. Just something I fancy. Offcourse, still seeing errors would be nice. But that long slur of text, I could do without. I've tried looking it up, but I can't find documentation on this specific thing anywhere.

    Read the article

  • Ajax load div , part of CSS not working

    - by user225228
    Hello, I'm using the ajax to load a div content, but the div content is not taking the CSS of the page. Example :- This link will load into <a href="#" onclick="javascript:loadAjax('test.html')">Test</a> <div id="result"> <table class="tablesorter"> <thead> <tr> <th>Header 1</th><th>Header 2</th> </tr> </thead> <tbody> <tr><td>Record 1</td><td>Desc 1</td></tr> </tbody> </table> </div> In my CSS : table.tablesorter thead tr th, table.tablesorter tfoot tr th { background-color: #e6EEEE; border: 1px solid #FFF; font-size: 8pt; padding: 4px; } table.tablesorter thead tr .header { background-image: url(bg.gif); background-repeat: no-repeat; background-position: center right; cursor: pointer; } In my test.html, it's the same table with different record : <table class="tablesorter"> <thead> <tr> <th>Header 1</th><th>Header 2</th> </tr> </thead> <tbody> <tr><td>Record 2</td><td>Desc 2</td></tr> </tbody> </table> The issue I'm facing is that before "test.html" is load, the CSS is fine. But after clicking on the link which suppose to loads test.html, the CSS background still shows but "cursor:pointer" and "background-image" not longer works. What should I do to make it work? Thanks in advance!

    Read the article

  • php not well formed?

    - by Idealflip
    Hi Everyone, when my site loads, it stops half way because of specific php code. When I try commenting out the php code, the whole page loads properly (input boxes, buttons etc.) This is the code that causes the issue <?php //if the add location button is clicked, the add location, the whole form will not be submitted if($_REQUEST['command'] == 'Add'){ if($_POST['companyLocation'] == ""){ $errmsg="Please enter a location1"; } elseif($_POST['companySize'] == ""){ $errmsg="Please enter a size for the location"; } else{ $location = Location::instance(); $testing = $location->doesExist($_POST['companyLocation']); if ($testing == true){ $errmsg="Location already exists"; } else{ $objLocation = new Obj_Location(); $objLocation->set_Name($_POST['companyLocation']); $objLocation->set_Size($_POST['companySize']); $location->addLocation($objLocation); $location->saveInstance(); } } } //this is the part that breaks! when I comment it out, the page loads properly. $location = Location::instance(); $location->deleteItem($_GET["item"]); $location->saveInstance(); $location->listItems(); ?>

    Read the article

  • Anything like the Debian Package Manager for Windows?

    - by interstar
    I know that sounds a weird request. But I was installing a bunch of packages in Ubuntu yesterday, using apt-get and I started wondering if anyone had adapted it or produced anything similar for Windows. What I mean is a) an package manager / installer for Windows. And b) a repository of free-software packages in a compatible format.

    Read the article

  • ELMAH - Filtering 404 Errors

    - by Nathan Taylor
    I am attempting to configure ELMAH to filter 404 errors and I am running into difficulties with the XML-provided filter rules in my Web.config file. I followed the tutorial here and here and added an <is-type binding="BaseException" type="System.IO.FileNotFoundException" /> declaration under my <test><or>... declaration, but that completely failed. When I tested it locally I stuck a breakpoint in protected void ErrorLog_Filtering() {} of the Global.asax found that the System.Web.HttpException that gets fired by ASP.NET for a 404 doesn't have a base type of System.IO.FileNotFound, but rather it is simply a System.Web.HttpException. Next I decided to try a <regex binding="BaseException.Message" pattern="The file '/[^']+' does not exist" /> in the hopes that any exception matching the pattern "The file '/foo.ext' does not exist" would get filtered, but that too having no effect. As a last resort I tried <is-type binding="BaseException" type="System.Exception" />, and even that is entirely disregarded. I'm inclined to think there's a configuration error with ELMAH, but I fail to see any. Am I missing something blatantly obvious? Here's the relevant stuff from my web.config: <configuration> <configSections> <sectionGroup name="elmah"> <section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah"/> <section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah"/> <section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler, Elmah"/> <section name="errorFilter" requirePermission="false" type="Elmah.ErrorFilterSectionHandler, Elmah" /> </sectionGroup> </configSections> <elmah> <errorFilter> <test> <or> <equal binding="HttpStatusCode" value="404" type="Int32" /> <regex binding="BaseException.Message" pattern="The file '/[^']+' does not exist" /> </or> </test> </errorFilter> <errorLog type="Elmah.XmlFileErrorLog, Elmah" logPath="~/App_Data/logs/elmah" /> </elmah> <system.web> <httpModules> <add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah"/> <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah"/> </httpModules> </system.web> <system.webServer> <modules> <add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah"/> <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" /> </modules> </system.webServer> </configuration>

    Read the article

  • Merging Passed Parameters

    - by Josh Crowder
    I have a two data arrays sent in from a form, one called transloaded and the other video which is the actual form for the model. I need to get [:video_encoded][:url] and save that to [:video][:flash_url] This is the passed arguments or transloaded, when I try and access [:transload][:results][:video_encode] I get nil. print params[:transload] { "assembly_id":"d59b4293b3d79d2ccd1948c02421c6a6", "status":"success", "uploads":{ "video":{ "name":"bbc_one.mp4", "mime":"video/mp4", "ext":"mp4", "size":601104, "meta":{ "width":720, "height":404, "video_fps":25, "video_bitrate":null, "video_format":"avc1", "video_codec":"ffh264", "audio_bitrate":"128k", "audio_codec":"faad", "duration":3.07, "device_vendor":null, "device_name":null, "device_software":null, "latitude":null, "longitude":null }, "url":"http://tmp.transloadit.com/" } }, "results":{ "video_encode":{ "name":"bbc_one.flv", "mime":"video/x-flv", "steps":["encode","export"], "ext":"flv", "size":388317, "meta":{ "width":480, "height":320, "video_fps":25, "video_bitrate":"512k", "video_format":"FLV1", "video_codec":"ffflv", "audio_bitrate":"64k", "audio_codec":"mp3", "duration":3.11, "device_vendor":null, "device_name":null, "device_software":null, "latitude":null, "longitude":null }, "url":"http://s3.transloadit.com/b7deac9c96af6c745e914e25d0350baa/7a/2b09e822265ac2328789b40dcc02ae/bbc_one.flv" }, "video_encode_iphone":{ "name":"bbc_one.qt", "mime":"video/quicktime", "steps":["encode_iphone","export"], "ext":"qt", "size":218236, "meta":{ "width":480, "height":320, "video_fps":25, "video_bitrate":null, "video_format":"avc1", "video_codec":"ffh264", "audio_bitrate":"128k", "audio_codec":"faad", "duration":3.04, "device_vendor":null, "device_name":null, "device_software":null, "latitude":null, "longitude":null }, "url":"http://s3.transloadit.com/31/58bcc80d5345e52a42c9773125e8f0/bbc_one.qt" } } } Here is what I am trying to use video_links = { :flash_url => params[:transload][:results][:video_encode][:url], :mp4_url => params[:transload][:results][:video_encode_iphone][:url] } params[:video].merge(video_links)

    Read the article

  • Setting the origin to center of the screen instead of the top left screen?(iPhone)

    - by thyrgle
    Hi, I am working on an iPhone app and I am trying to make something that has to do with line-circle collision detection. I am using the slope of the line and checking if the coordinates of a circle suffice the equation y = mx + b. But, with the current origin (0,0) at the top left it is a pain to get the slope. Any way I can convert the coordinates so the origin is in the center of the screen?

    Read the article

  • Does Team Foundation Server supports Checkpoints?

    - by marco.ragogna
    My dev team used in the past MKS Source Integrity source control and we are not evaluating to migrate to TFS 2010. Some concepts and meaning are a bit different and we need sometime to learn how to do the same things we do before in TFS or how to change our approach. First of all, we used to do Checkpoints for each software release. MKS in this case does a snapshot of all source code files. You can later compare different checkpoints to see the code differences, or extract a whole checkpoint as a build. Does TFS have a similar feature? Do you know where can I read something about it? Thanks in advance, Marco

    Read the article

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