Search Results

Search found 4252 results on 171 pages for 'david 85'.

Page 95/171 | < Previous Page | 91 92 93 94 95 96 97 98 99 100 101 102  | Next Page >

  • How to scrap the first paragraphe from a wikipedia page?

    - by David
    Hi, Let's say i want to grab the first paragraphe in This wikipedia Page How to get the principal text between the title and CONTENTS box using XPath or DOM & PHP or something similar? Is there any php library for that? i don't want to use the api because it's a bit complex. Note: i just need that to add a widget under my pages that displays related infos from wikipedia. Thanks

    Read the article

  • General many-to-many relationship problem ( Postgresql )

    - by David
    Hi, i have two tables: CREATE TABLE "public"."auctions" ( "id" VARCHAR(255) NOT NULL, "auction_value_key" VARCHAR(255) NOT NULL, "ctime" TIMESTAMP WITHOUT TIME ZONE NOT NULL, "mtime" TIMESTAMP WITHOUT TIME ZONE NOT NULL, CONSTRAINT "pk_XXXX2" PRIMARY KEY("id"), ); and CREATE TABLE "public"."auction_values" ( "id" NUMERIC DEFAULT nextval('default_seq'::regclass) NOT NULL, "fk_auction_value_key" VARCHAR(255) NOT NULL, "key" VARCHAR(255) NOT NULL, "value" TEXT, "ctime" TIMESTAMP WITHOUT TIME ZONE NOT NULL, "mtime" TIMESTAMP WITHOUT TIME ZONE NOT NULL, CONSTRAINT "pk_XXXX1" PRIMARY KEY("id"), ); if i want to create a many-to-many relationship on the auction_value_key like this: ALTER TABLE "public"."auction_values" ADD CONSTRAINT "auction_values_fk" FOREIGN KEY ("fk_auction_value_key") REFERENCES "public"."auctions"("auction_value_key") ON DELETE NO ACTION ON UPDATE NO ACTION NOT DEFERRABLE; i get this SQL error: ERROR: there is no unique constraint matching given keys for referenced table "auctions" Question: As you might see, i want "auction_values" to be be "reused" by different auctions without duplicating them for every auction... So i don't want a key relation on the "id" field in the auctions table... Am i thinking wrong here or what is the deal? ;) Thanks

    Read the article

  • Passing Variable Length Arrays to a function

    - by David Bella
    I have a variable length array that I am trying to pass into a function. The function will shift the first value off and return it, and move the remaining values over to fill in the missing spot, putting, let's say, a -1 in the newly opened spot. I have no problem passing an array declared like so: int framelist[128]; shift(framelist); However, I would like to be able to use a VLA declared in this manner: int *framelist; framelist = malloc(size * sizeof(int)); shift(framelist); I can populate the arrays the same way outside the function call without issue, but as soon as I pass them into the shift function, the one declared in the first case works fine, but the one in the second case immediately gives a segmentation fault. Here is the code for the queue function, which doesn't do anything except try to grab the value from the first part of the array... int shift(int array[]) { int value = array[0]; return value; } Any ideas why it won't accept the VLA? I'm still new to C, so if I am doing something fundamentally wrong, let me know.

    Read the article

  • flex textarea text attribute but still renders as html

    - by David
    actually i got to the cause of the issue. if you feed the textarea text attribute with an tag that has a valid src url, then for some reason flex will try to render everything as html. Eg, try this: <mx:TextArea id="textArea" width="100%" height="90%" text="<img src='http://url-to-a-valid-img"/> and instead of it rendering it as raw text it will render it as an html. any idea?

    Read the article

  • rails routes for permalink with namespaced class

    - by David
    this one in my routes works perfectly: map.connect ':permalink', :controller = 'pages', :action = 'show' for this class: class PagesController < BackendController and on /xxx/pages it is shown like this: <%= link_to "#{item.link_name}", {:controller = :pages, :action = :show, :permalink = item.permalink} % which will generate a link like "how-to-create-permalinks". but i decided to move the PagesController into a subdirectory so the class is now written like so: class Backend::PagesController < BackendController But how does the route look like now? And how do i display it on the template so it links using the permalink? Thanks!

    Read the article

  • new Facebook Like button for Blogger

    - by David
    I want to add the new facebook like button to my blogger website. http://developers.facebook.com/docs/reference/plugins/like I have to pass the url to the blog posts in the iframe src tag. I can get the blogger posts url from <data:post.url/> but I can't put that in a src string because Bloggers template system is weird. I want to do this:<iframe allowTransparency='true' frameborder='0' scrolling='no' src='http://www.facebook.com/plugins/like.php?href=<data:post.url/>&amp;layout=standard&amp;show-faces=true&amp;width=450&amp;action=like&amp;colorscheme=light' style='border:none; overflow:hidden; width:450px; height:px'/>but blogger complains: "Your template could not be parsed as it is not well-formed. Please make sure all XML elements are closed properly. XML error message: The value of attribute "src" associated with an element type "null" must not contain the '<' character." Anybody have this working yet?

    Read the article

  • Throwing Exception in CTOR and Smart Pointers

    - by David Relihan
    Is it OK to have the following code in my constructor to load an XML document into a member variable - throwing to caller if there are any problems: MSXML2::IXMLDOMDocumentPtr m_docPtr; //member Configuration() { try { HRESULT hr = m_docPtr.CreateInstance(__uuidof(MSXML2::DOMDocument40)); if ( SUCCEEDED(hr)) { m_docPtr->loadXML(CreateXML()); } else { //throw exception to caller } } catch(...) { //throw exception to caller } } Based on Scott Myers RAII implementations in More Effective C++ I believe I am alright in just allowing exceptions to be thrown from CTOR as I am using a smart pointer(IXMLDOMDocumentPtr). Let me know what you think....

    Read the article

  • Compiled Queries and "Parameters cannot be sequences"

    - by David B
    I thought that compiled queries would perform the same query translation as DataContext. Yet I'm getting a run-time error when I try to use a query with a .Contains method call. Where have I gone wrong? //private member which holds a compiled query. Func<DataAccess.DataClasses1DataContext, List<int>, List<DataAccess.TestRecord>> compiledFiftyRecordQuery = System.Data.Linq.CompiledQuery.Compile <DataAccess.DataClasses1DataContext, List<int>, List<DataAccess.TestRecord>> ((dc, ids) => dc.TestRecords.Where(tr => ids.Contains(tr.ID)).ToList()); //this method calls the compiled query. public void FiftyRecordCompiledQueryByID() { List<int> IDs = GetRandomInts(50); //System.NotSupportedException //{"Parameters cannot be sequences."} List<DataAccess.TestRecord> results = compiledFiftyRecordQuery (myContext, IDs); }

    Read the article

  • What's the Matlab equivalent of NULL, when it's calling COM/ActiveX methods?

    - by David M
    Hi, I maintain a program which can be automated via COM. Generally customers use VBS to do their scripting, but we have a couple of customers who use Matlab's ActiveX support and are having trouble calling COM object methods with a NULL parameter. They've asked how they do this in Matlab - and I've been scouring Mathworks' COM/ActiveX documentation for a day or so now and can't figure it out. Their example code might look something like this: function do_something() OurAppInstance = actxserver('Foo.Application'); OurAppInstance.Method('Hello', NULL) end where NULL is where in another language, we'd write NULL or nil or Nothing, or, of course, pass in an object. The problem is this is optional (and these are implemented as optional parameters in most, but not all, cases) - these methods expect to get NULL quite often. They tell me they've tried [] (which from my reading seemed the most likely) as well as '', Nothing, 'Nothing', None, Null, and 0. I have no idea how many of those are even valid Matlab keywords - certainly none work in this case. Can anyone help? What's Matlab's syntax for a null pointer / object for use as a COM method parameter? Update: Thanks for all the replies so far! Unfortunately, none of the answers seem to work, not even libpointer. The error is the same in all cases: Error: Type mismatch, argument 2 This parameter in the COM type library is described in RIDL as: HRESULT _stdcall OurMethod([in] BSTR strParamOne, [in, optional] OurCoClass* oParamTwo, [out, retval] VARIANT_BOOL* bResult); The coclass in question implements a single interface descending from IDispatch.

    Read the article

  • ASP.NET MVC null ViewResult

    - by David Neale
    How should one deal with an MVC controller returning a null ViewResult? As an example I am creating a simple edit view: public ActionResult Edit(int id) { var person = (from p in context.SWLiftShare_Persons where p.id == id select p).SingleOrDefault(); if (person != null) { return View(person); } else return View(); } I guess in reality there's no point in checking for a null result in the controller because the view picks out properties from the model: <h2>Edit - <%= Html.Encode(Model.Name) %></h2> <%= Html.ValidationSummary("Edit was unsuccessful. Please correct the errors and try again.") %> <% using (Html.BeginForm()) {%> <fieldset> <legend>Fields</legend> <p> <label for="id">id: <%= Html.Encode(Model.id) %></label> </p> <p> <label for="CollarNumber">CollarNumber:</label> <%= Html.TextBox("CollarNumber", Model.CollarNumber)%> <%= Html.ValidationMessage("CollarNumber", "*") %> </p> <p> <label for="Name">Name:</label> <%= Html.TextBox("Name", Model.Name)%> <%= Html.ValidationMessage("Name", "*") %> </p> <p> <label for="EmailAddress">EmailAddress:</label> <%= Html.TextBox("EmailAddress", Model.EmailAddress, new { style = "width:300px" })%> <%= Html.ValidationMessage("EmailAddress", "*") %> </p> <p> <input type="submit" value="Save" /> </p> </fieldset> <% } %> I could just wrap everything in a <% if(Model != null) { //render edit markup... etc. but that seems rather unelegant. Is there a better way to deal with this?

    Read the article

  • Using vsx how do you create a sub menu with commands?

    - by David Basarab
    I have created the following vsct file xml. <?xml version="1.0" encoding="utf-8"?> <CommandTable xmlns="http://schemas.microsoft.com/VisualStudio/2005-10-18/CommandTable" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <Extern href="stdidcmd.h"/> <Extern href="vsshlids.h"/> <Extern href="msobtnid.h"/> <Commands package="guidMyVSXCommandsPkg"> <Menus> <Menu guid="guidMyVSXCommandsCmdSet" id="TopLevelMenu" priority="0x100" type="Menu"> <Parent guid="guidSHLMainMenu" id="IDM_VS_CTXT_PROJNODE"/> <Strings> <MenuText>Work???</MenuText> <ButtonText>FigureMain</ButtonText> <CommandName>TryMainMenu</CommandName> </Strings> </Menu> </Menus> <Groups> <Group guid="guidMyVSXCommandsCmdSet" id="TopLevelMenuGroup" priority="0x0600"> <Parent guid="guidMyVSXCommandsCmdSet" id="TopLevelMenu"/> </Group> </Groups> <Buttons> <Button guid="guidMyVSXCommandsCmdSet" id="cmdidMyCommand" priority="0x0100" type="Button"> <Parent guid="guidMyVSXCommandsCmdSet" id="TopLevelMenuGroup" /> <Icon guid="guidImages" id="bmpPic1" /> <Strings> <CommandName>cmdidMyCommand</CommandName> <ButtonText>DO SOMETHING REAL COOL!!!!!!!!</ButtonText> </Strings> </Button> </Buttons> <Bitmaps> <Bitmap guid="guidImages" href="Resources\Images_32bit.bmp" usedList="bmpPic1, bmpPic2, bmpPicSearch, bmpPicX, bmpPicArrows"/> </Bitmaps> </Commands> <Symbols> <!-- This is the package guid. --> <GuidSymbol name="guidMyVSXCommandsPkg" value="{70e6574c-ebed-4856-b78b-0927966cc800}" /> <!-- This is the guid used to group the menu commands together --> <GuidSymbol name="guidMyVSXCommandsCmdSet" value="{301c910a-65eb-42c4-bf0f-bc5aaac737f1}"> <IDSymbol name="TopLevelMenu" value="0x0100" /> <IDSymbol name="TopLevelMenuGroup" value="0x0200" /> <IDSymbol name="cmdidMyCommand" value="0x0300" /> </GuidSymbol> <GuidSymbol name="guidImages" value="{1997bf57-349c-434a-ad64-32a3a65e35f3}" > <IDSymbol name="bmpPic1" value="1" /> <IDSymbol name="bmpPic2" value="2" /> <IDSymbol name="bmpPicSearch" value="3" /> <IDSymbol name="bmpPicX" value="4" /> <IDSymbol name="bmpPicArrows" value="5" /> </GuidSymbol> </Symbols> </CommandTable> What the end result is I want to see when I right click a project to see the MenuText Work??? with a command of DO SOMETHING REAL COOL!!!!!!!!

    Read the article

  • Launch Scala REPL programatically?

    - by David Crawshaw
    I would like to launch a Scala Swing application from the command line, then after the application is started, drop into the Scala REPL to use as a control interface. Ideally I would also like to pre-bind some variable names. Even better would be using a Java2D terminal emulator for the REPL, but I couldn't find anything appropriate. Does the Scala REPL have a public API?

    Read the article

  • Triple Quotes? How do I delimit a databound Javascript string parameter in ASP.NET?

    - by David HAust
    How do I delimit a Javascript databound string parameter in an anchor OnClick event? I have an anchor tag in an ASP.NET Repeater control. The OnClick event of the anchor contains a call to a Javascript function. The Javascript funciton takes a string for it's input parameter. The string parameter is populated with a databound value from the Repeater. I need the 'double quotes' for the Container.DataItem. I need the 'single quotes' for the OnClick. And I still need one more delimiter (triple quotes?) for the input string parameter of the Javascript function call. Since I can't use 'single quotes' again, how do I ensure the Javascript function knows the input parameter is a string and not an integer? Without the extra quotes around the input string parameter, the Javascript function thinks I'm passing in an integer. Cheers in advance for any knowledge you can drop. The anchor: <a id="aShowHide" onclick='ToggleDisplay(<%# DataBinder.Eval(Container.DataItem, "JobCode") %>);' >Show/Hide</a> and here is the Javascript: <script language="JavaScript" type="text/javascript">/* Shows/Hides the Jobs Div */ function ToggleDisplay(jobCode) { /* Each div has it's ID set dynamically ('d' plus the JobCode) */ var elem = document.getElementById('d' + jobCode); if (elem) { if (elem.style.display != 'block') { elem.style.display = 'block'; elem.style.visibility = 'visible'; } else { elem.style.display = 'none'; elem.style.visibility = 'hidden'; } } }</script>

    Read the article

  • Testing objects for changes

    - by David Veeneman
    I have an application that needs to determine whether a user has made a change to an object. So, when the object is first loaded, I create a deep copy (using serialization/deserialization) and save the copy to a separate field. The copy becomes myCurrentObject, and the original becomes myOriginalObject. Now I need to test myCurrentObject for changes, which I plan to do by comparing it to myOriginalObject. All I need is a boolean result indicating whether any changes have been made. I have already determined that a simple hashcode comparison won't work. GetHashCode() generates different results for the two objects, even when there are no changes. I am getting ready to write a method to do a property-by-property comparison, but before I do, I thought I would check to see if there is a simpler and more reusable way to test myCurrentObject to see if it has changed from myOriginalObject. Any suggestions? Thanks for your help.

    Read the article

  • Databases design - one link table or multiple link tables?

    - by David
    Hi there, I'm working on a front end for a database where each table essentially has a many to many relationship with all other tables. I'm not a DB admin, just a few basic DB courses. The typical solution in this case, as I understand it, would be multiple link tables to join each 'real' table. Here's what I'm proposing instead: one link table that has foreign key dependencies to all other PKs of the other tables. Is there any reason this could turn out badly in terms of scalability, flexibility, etc down the road?

    Read the article

  • DataTable won't DataBind with a DataTable.NewRow()

    - by David
    Is DataRow.NewRow() insufficient as the only row in a DataTable? I would expect this to work, but it doesn't. It's near the end of my Page_Load inside my If(!Postback) block. gridCPCP is GridView DataTable dt = new DataTable(); dt.Columns.Add("ID", int.MinValue.GetType()); dt.Columns.Add("Code", string.Empty.GetType()); dt.Columns.Add("Date", DateTime.MinValue.GetType()); dt.Columns.Add("Date2", DateTime.MinValue.GetType()); dt.Columns.Add("Filename", string.Empty.GetType()); //code to add rows if (dt.Rows.Count > 0) { gridCPCP.DataSource = dt; gridCPCP.DataBind(); } else { dt.Rows.Add(dt.NewRow()); gridCPCP.DataSource = dt; gridCPCP.DataBind(); //EXCEPTION int TotalColumns = gridCPCP.Rows[0].Cells.Count; gridCPCP.Rows[0].Cells.Clear(); gridCPCP.Rows[0].Cells.Add(new TableCell()); gridCPCP.Rows[0].Cells[0].ColumnSpan = TotalColumns; gridCPCP.Rows[0].Cells[0].Text = "No Record Found"; } The exception throws on gridCPCP.DataBind() and only when execution reaches the else block. If there were rows added above via dt.Rows.Add(new object[] { ... } binding works. System.ArgumentOutOfRangeException: Length cannot be less than zero. Parameter name: length

    Read the article

  • Where to start when programming process synchronization algorithms like clone/fork, semaphores

    - by David
    I am writing a program that simulates process synchronization. I am trying to implement the fork and semaphore techniques in C++, but am having trouble starting off. Do I just create a process and send it to fork from the very beginning? Is the program just going to be one infinite loop that goes back and forth between parent/child processes? And how do you create the idea of 'shared memory' in C++, explicit memory address or just some global variable? I just need to get the overall structure/idea of the flow of the program. Any references would be appreciated.

    Read the article

  • Learning Lisp - Why ?

    - by David
    I really feel that I should learn Lisp and there are plenty of good resources out there to help me do it. I'm not put off by the complicated syntax, but where in "traditional commercial programming" would I find places it would make sense to use it instead of a procedural language. Is there a commercial killer-app out there that's been written in Lisp ?

    Read the article

  • Create jQuery Slider Range With One Handle Not Using Min/Max

    - by David Savage
    Hey all, Is there any possible way to create a slider that will create a range similar to what is done with one handle using min/max, only instead of min/max, starting the range from say 50 (on a scale from 1-100)? I realize this will most likely require modification of the slider or creating a plugin, just wondering if anyone has done this already or knows how to go about it. I.e. something like this: http://jqueryui.com/demos/slider/rangemin.html Only, instead of the range going from the min, going off of where the handle is, and allowing the user to slide either left or right of that fixed starting point to create the range. Any help is appreciated, and I'd be glad to clarify what I need if that doesn't make sense! :)

    Read the article

  • Count rows against to SQL server (2005) table?

    - by David.Chu.ca
    I have a simple question with two options to get count of rows in a SQL server (2005). I am using VS 2005. There are two options to get the count: SELECT id FROM Table1 WHERE dt >= startDt AND dt < endDt;; I get a list of ids from above call in cache and then I get count by List.Count. Another option is SELECT COUNT(*) FROM Table1 WHERE dt >= startDt AND dt < endDt; The above call will get the count directly. The issue is that I had several cases of exceptions with the second method: timeout. What I found is that the table1 is too big with millions of data. When I used the first option, it seems OK. I am confused by the fact that Count() takes more time than getting all the rows(is that true?). Not sure if the aggregation call with Count() would cause SQL server to create temporary table or cache on server side and it would result in slow performance when table is too big? I am not sure what is the best way to get the count?

    Read the article

  • Modifying my website to allow anonymous comments

    - by David
    I write the code for my own website as an educational/fun exercise. Right now part of the website is a blog (like every other site out there :-/) which supports the usual basic blog features, including commenting on posts. But I only have comments enabled for logged-in users; I want to alter the code to allow anonymous comments - that is, I want to allow people to post comments without first creating a user account on my site, although there will still be some sort of authentication involved to prevent spam. Question: what information should I save for anonymous comments? I'm thinking at least display name and email address (for displaying a Gravatar), and probably website URL because I eventually want to accept OpenID as well, but would anything else make sense? Other question: how should I modify the database to store this information? The schema I have for the comment table is currently comment_id smallint(5) // The unique comment ID post_id smallint(5) // The ID of the post the comment was made on user_id smallint(5) // The ID of the user account who made the comment comment_subject varchar(128) comment_date timestamp comment_text text Should I add additional fields for name, email address, etc. to the comment table? (seems like a bad idea) Create a new "anonymous users" table? (and if so, how to keep anonymous user ids from conflicting with regular user ids) Or create fake user accounts for anonymous users in my existing users table? Part of what's making this tricky is that if someone tries to post an anonymous comment using an email address (or OpenID) that's already associated with an account on my site, I'd like to catch that and prompt them to log in.

    Read the article

< Previous Page | 91 92 93 94 95 96 97 98 99 100 101 102  | Next Page >