Search Results

Search found 8959 results on 359 pages for 'bad decisions'.

Page 76/359 | < Previous Page | 72 73 74 75 76 77 78 79 80 81 82 83  | Next Page >

  • How to estimate the quality of a web page?

    - by roddik
    Hello, I'm doing a university project, that must gather and combine data on a user provided topic. The problem I've encountered is that Google search results for many terms are polluted with low quality autogenerated pages and if I use them, I can end up with wrong facts. How is it possible to estimate the quality/trustworthiness of a page? You may think "nah, Google engineers are working on the problem for 10 years and he's asking for a solution", but if you think about it, SE must provide up-to-date content and if it marks a good page as a bad one, users will be dissatisfied. I don't have such limitations, so if the algorithm accidentally marks as bad some good pages, that wouldn't be a problem.

    Read the article

  • regex pattern to match only strings that don't contain spaces PHP

    - by Jamex
    Hi, I want to match the word/pattern that is contained in the variable, but only match against the words that don't have white spaces. Please give suggestions. $var = 'look'; $array = ('look', 'greatlook', 'lookgreat', 'look great', 'badlook', 'look bad', 'look ', ' look'); matches words: look, greatlook, lookgreat, badlook non matches: look great, bad look, look (trailing space(s)), (space(s)) look. The syntax of the below functions are OK, but it matches everything $match = preg_grep ("/$var/", $array); $match = preg_grep ("/^$var/", $array); (match words with 'look' at the start) but when I include the [^\s], it gives an error $match = preg_grep ("/$var[^\s]/", $array); Parse error: syntax error, unexpected '^', expecting T_STRING or T_VARIABLE TIA

    Read the article

  • MVC - Same URL, multiple views

    - by Amati
    Hi, Is it considered bad practice to have multiple views for same URL in MVC, based on different user roles? For example: http://www.domain.com/ViewProductID/123 will show a "normal" product page for a regular user and it will show an "enhanced" (product stats, ability to edit title etc..) version to someone logged in as admin. If it's bad practice, why? If it's ok, what's the best way to implement it? 2 separate templates or 1 template scattered with if..else? Thanks!

    Read the article

  • VB6 Parser/Lexer/Scripter

    - by rlb.usa
    I've got a game in VB6 and it works great and all, but I have been toying with the idea of creating a scripting engine. Ii'm thinking I'd like VB6 to read in flat text script files for me and then lex/parse/execute them. I have good programming experience, and I've built a simple C compiler, as well as a LOGO emulator before. My question is: Are there any tools that I can use, like Lexx/Yakk/Bison to help me? How should I approach this problem in regards to lexing, parsing, and feeding the commands back to VB6 so I can handle them? Is this idea a BAD IDEA in the sense that there are too many obstacles in the way (For example, building minesweeper in assembly, though not impossible, is very difficult, and a bad idea.)?

    Read the article

  • On what platform did these popular programming languages originate?

    - by speciousfool
    Perhaps you know the story of HTTP and HTML being developed on a NeXT computer. I am curious which platform served as the first home for these programming languages: Ada C C++ C# D Erlang Fortran Haskell Java Javascript Lisp Logo MATLAB ML Perl PHP Prolog Python R Ruby Scheme SQL Smalltalk I thought it might be interesting to reflect on how the machine and operating environment lead to different design decisions. Or to see if some architecture or operating system variant was particularly fruitful for programming language development. A question for the historians among us.

    Read the article

  • How to check for an active Internet Connection on iPhone SDK?

    - by Brock Woolf
    I would like to check to see if I have an Internet connection on the iPhone using the Cocoa Touch libraries. I came up with a way to do this using an NSUrl. The way I did it seems a bit unreliable (because even Google could one day be down and relying on a 3rd party seems bad) and while I could check to see for a response from some other websites if Google didn't respond, it does seem wasteful and an unnecessary overhead on my application. - (BOOL) connectedToInternet { NSString *URLString = [NSString stringWithContentsOfURL:[NSURL URLWithString:@"http://www.google.com"]]; return ( URLString != NULL ) ? YES : NO; } Is what I have done bad? (Not to mention 'stringWithContentsOfURL' is deprecated in 3.0) And if so what is a better way to accomplish this?

    Read the article

  • ClickOnce deployment with VS2008 - prerequisites not installing on Windows 7 (only)

    - by dataft
    I have a VS2008 clickonce application with a custom prerequiste, which I install with the bootstrapper. When deployed online, the prerequisite is downloaded and installed fine. No problems. When deployed via CD to a Windows XP machine, also fine as above. No problems. However, when deployed via CD to a Windows 7 machine: the prerequisite is downloaded - good then the user is asked for permission to the run the file - good then the installation of the prerequiste is just SKIPPED - bad and the ClickOnce application installation begins without the prerequisite - bad Has anyone encountered this weird behaviour? I cannot find a solution anywhere.

    Read the article

  • What theoretical and/or experimental programming-language features are there?

    - by Gary Rake
    I'm designing a programming language, purely for fun, and want to add as many experimental features as I can, just to make programming in it something completely different, and that not in a bad way like Brainf*ck or Malbolge. However, I seem to be quite bad at coming up with new things for it but I'm sure that there are tons of things out there that have been talked about but never really tried out. What experimental language features or concepts not implemented in mainstream languages are there at the moment? E.g: If I asked this in, let's say, 1960, an answer could be "Object-oriented programming". I'm sure that there are a lot of unimplemented ideas computer-scientists have (recently) come up with, at least I was told so.

    Read the article

  • How to change FPU context in signal handler (C++/Linux)

    - by Henry Fané
    I wrote a signal handler to catch FPE errors. I need to continue execution even if this happens. I receive a ucontext_t as parameter, I can change the bad operand from 0 to another value but the FPU context is still bad and I run into an infinite loop ? Does someone already manupulate the ucontext_t structure on Linux ? I finally found a way to handle these situations by clearing the status flag of ucontext_t like this: ... const long int cFPUStatusFlag = 0x3F; aContext->uc_mcontext.fpregs->sw &= ~cFPUStatusFlag; ... 0x3F is negated to put 0 in the 6 bits of the status register of the FPU (x87). Doing this implies to check for FPE exceptions after calculation.

    Read the article

  • Branching and remote heads in Mercurial

    - by hekevintran
    I created a new branch using this command: hg branch new_branch After the first commit to the new branch, the default branch becomes inactive. If this is pushed the central repository will have only one head which belongs to the new branch. When my colleague pushes his commits on the default branch, he will get this error: pushing to ssh://... searching for changes abort: push creates new remote heads! (did you forget to merge? use push -f to force) Is there anything bad about forcing the push? Why are remote heads bad? How do you work remotely on separate branches and push to one repository?

    Read the article

  • How can I merge CSS definitions in files into inline style attributes, using Perl?

    - by mintywalker
    Many email clients don't like linked CSS stylesheets, or even the embedded <style> tag, but rather want the CSS to appear inline as style attributes on all your markup. BAD: <link rel=stylesheet type="text/css" href="/style.css"> BAD: <style type="text/css">...</style> WORKS: <h1 style="margin: 0">...</h1> However this inline style attribute approach is a right pain to manage. I've found tools for Ruby and PHP that will take a CSS file and some separate markup as input and return you the merged result - a single file of markup with all the CSS converted to style attributes. I'm looking for a Perl solution to this problem, but I've not found one on CPAN or by searching Google. Any pointers? Alternatively, are there CPAN modules one could combine to achieve the same result? Ruby http://code.dunae.ca/premailer.web/ PHP http://www.pelagodesign.com/sidecar/emogrifier/ Perl ?

    Read the article

  • calling startActivity() inside of a instance method - causing a NullPointerException

    - by Cole
    Heya - I'm trying to call startActivity() from a class that extends AsyncTask in the onPostExecute(). Here's the flow: Class that extends AsyncTask: protected void onPostExecute() { Login login = new Login(); login.pushCreateNewOrChooseExistingFormActivity(); } Class that extends Activity: public void pushCreateNewOrChooseExistingFormActivity() { // start the CreateNewOrChooseExistingForm Activity Intent intent = new Intent(Intent.ACTION_VIEW); **ERROR_HERE*** intent.setClassName(this, CreateNewOrChooseExistingForm.class.getName()); startActivity(intent); } And I get this error… every time: 03-17 16:04:29.579: ERROR/AndroidRuntime(1503): FATAL EXCEPTION: main 03-17 16:04:29.579: ERROR/AndroidRuntime(1503): java.lang.NullPointerException 03-17 16:04:29.579: ERROR/AndroidRuntime(1503): at android.content.ContextWrapper.getPackageName(ContextWrapper.java:120) 03-17 16:04:29.579: ERROR/AndroidRuntime(1503): at android.content.ComponentName.(ComponentName.java:62) 03-17 16:04:29.579: ERROR/AndroidRuntime(1503): at android.content.Intent.setClassName(Intent.java:4850) 03-17 16:04:29.579: ERROR/AndroidRuntime(1503): at com.att.AppName.Login.pushCreateNewOrChooseExistingFormActivity(Login.java:47) For iOS developers - I'm just trying to push a new view controller on to a navigational controller's stack a la pushViewController:animated:. Which apparently - is hard to do on this platform. Any ideas? Thanks in advance! UPDATE - FIXED: per @Falmarri advice, i managed to resolve this issue. first of all, i'm no longer calling Login login = new Login(); to create a new login object. bad. bad. bad. no cookie. instead, when preparing to call .execute(), this tutorial suggests passing the applicationContext to the class the executes the AsyncTask, for my purposes, as shown below: CallWebServiceTask task = new CallWebServiceTask(); // pass the login object to the task task.applicationContext = login; // execute the task in the background, passing the required params task.execute(login); now, in onPostExecute(), i can get to my Login objects methods like so: ((Login) applicationContext).pushCreateNewOrChooseExistingFormActivity(); ((Login) applicationContext).showLoginFailedAlert(result.get("httpResponseCode").toString()); ... hope this helps someone else out there! especially iOS developers transistioning over to Android...

    Read the article

  • Find recipes that can be cooked from provided ingridients

    - by skaurus
    Sorry for bad English :( Suppose i can preliminary organize recipes and ingredients data in any way. How can i effectively conduct search of recipes by user-provided ingredients, preferably sorted by max match - so, first going recipes that use maximum of provided ingridients and do not contain any other ingrs, after them recipes that uses less of provided set and still not any other ingrs, after them recipes with minimum additional requirements and so on? All i can think about is represent recipe ingridients like bitmasks, and compare required bitmask with all recipes, but it is obviously a bad way to go. And related things like Levenstein distance i don't see how to use here. I believe it should be quite common task...

    Read the article

  • oracle update procedure problem

    - by murali
    hi, i want to update the following procedure in the oracle table..but it is throwing error CREATE OR REPLACE PROCEDURE update_keywords (aKEYWORD IN VARCHAR2, aCOUNT IN NUMBER) AS BEGIN update searchable_keywords set KEYWORD =:new.aKEYWORD or COUNT =:new.aCOUNT where KEUWORD_ID = : old.KEYWORD_ID; END; this is my procedure, i want to update the keyword & count in the searchable_keywords table with keyword_id(primary key) but it is throwing error as follows... LINE/COL ERROR 3/4 PL/SQL: SQL Statement ignored 4/17 PLS-00049: bad bind variable 'NEW.AKEYWORD' 4/31 PL/SQL: ORA-00933: SQL command not properly ended 4/41 PLS-00049: bad bind variable 'NEW.ACOUNT' can you pls help me slove this problem..thanks

    Read the article

  • Manage bad_alloc exception in C++ construtor

    - by Jimmy zhang
    I have Java experience and recently am doing some C++ coding. My question is that if I have class A, in which I have to instantiate class B and class C as two of the member variables of A. If in the constructor of A, should I assume that allocations of class B and C never fail, and handle the bad allocation exception in the destructor of A? If I don't make that assumption, meaning that I add some try catch block to catch bad_alloc of class B and class C, then if the allocation exception occurs, should I do clean up in the constructor of A? What are the recommended practices? If "new" generates a bad allocation, what value does the pointer carry?

    Read the article

  • Validation file upload CakePHP

    - by kicaj
    How validate file upload in CakePHP? When i wrote some like this:var $validate = array( 'file' => array( 'select' => array( 'rule' => array('selectFile', false), 'message' => 'There is no file!'), 'type' => array( 'rule' => array('typeFile'), 'message' => 'Bad type!'), 'size' => array( 'rule' => array('sizeFile'), 'message' => 'Bad with size!'))); Works only with the last validate, here 'size'. Maybe You know solution, for validation for files with many messages?

    Read the article

  • What are the main reasons against the Windows Registry?

    - by dbemerlin
    If i want to develop a registry-like System for Linux, which Windows Registry design failures should i avoid? Which features would be absolutely necessary? What are the main concerns (security, ease-of-configuration, ...)? I think the Windows Registry was not a bad idea, just the implementation didn't fullfill the promises. A common place for configurations including for example apache config, database config or mail server config wouldn't be a bad idea and might improve maintainability, especially if it has options for (protected) remote access. I once worked on a kernel based solution but stopped because others said that registries are useless (because the windows registry is)... what do you think?

    Read the article

  • Allowing AsyncTask to Manipulate Values in Different Activity Classes

    - by Matt
    Hi guys, This title may seem strange, so let me try to explain what I'm trying to do. I have several activity classes, each representing a different view in my application. My initial activity class gets loaded when the application launches. The user enters values and eventually a TCP socket is opened, and I then use AsyncTask to listen for and respond to messages from the server. I'd like for this AsyncTask class to essentially listen until the app is closed/error condition reached, and be able to update values in other activity classes after they are started. Does this make sense (it's been a long, frustrating night)? I know that static activity class references are bad practice, and touching the UI thread from other activities is bad as well, but I'm having trouble finding a clean solution to this problem. Maybe using AsyncTask is not the best approach here? Should I be using a service instead or something else entirely? Thanks in advance.

    Read the article

  • GoTo statements and alternatives in VB.NET

    - by qais
    I've posted a code snippet on another forum asking for help and people pointed out to me that using GoTo statements is very bad programming practice. I'm wondering: why is it bad? What alternatives to GoTo are there to use in VB.NET that would be considered generally more of a better practice? Consider this snippet below where the user has to input their date of birth. If the month/date/year are invalid or unrealistic(using if statements checking the integer inputs size, if there's a better way to do this, I'd appreciate if you could tell me that also :D) How would I be able to loop back to ask the user again? retryday: Console.WriteLine("Please enter the day you were born : ") day = Console.ReadLine If day > 31 Or day < 1 Then Console.WriteLine("Please enter a valid day") GoTo retryday End If

    Read the article

  • MySQL query optimization.

    - by PiKey
    I'm so bad in making good MySQL queries. I've created this one: http://pastebin.com/GtDfgky8 products Table have about 17k rows, allegro Table have about 3k of rows. The query Idea is select all products, where stock_quanity 3, where is photo, and where is no product id in allegro table. Now query takes about 10 seconds... I have no idea how I can optimize this query. Please help my, I'll be thankfully! :) & Sorry for my bad English also

    Read the article

  • Can't insert a number into a C++ custom streambuf/ostream

    - by 0xbe5077ed
    I have written a custom std::basic_streambuf and std::basic_ostream because I want an output stream that I can get a JNI string from in a manner similar to how you can call std::ostringstream::str(). These classes are quite simple. namespace myns { class jni_utf16_streambuf : public std::basic_streambuf<char16_t> { JNIEnv * d_env; std::vector<char16_t> d_buf; virtual int_type overflow(int_type); public: jni_utf16_streambuf(JNIEnv *); jstring jstr() const; }; typedef std::basic_ostream<char16_t, std::char_traits<char16_t>> utf16_ostream; class jni_utf16_ostream : public utf16_ostream { jni_utf16_streambuf d_buf; public: jni_utf16_ostream(JNIEnv *); jstring jstr() const; }; // ... } // namespace myns In addition, I have made four overloads of operator<<, all in the same namespace: namespace myns { // ... utf16_ostream& operator<<(utf16_ostream&, jstring) throw(std::bad_cast); utf16_ostream& operator<<(utf16_ostream&, const char *); utf16_ostream& operator<<(utf16_ostream&, const jni_utf16_string_region&); jni_utf16_ostream& operator<<(jni_utf16_ostream&, jstring); // ... } // namespace myns The implementation of jni_utf16_streambuf::overflow(int_type) is trivial. It just doubles the buffer width, puts the requested character, and sets the base, put, and end pointers correctly. It is tested and I am quite sure it works. The jni_utf16_ostream works fine inserting unicode characters. For example, this works fine and results in the stream containing "hello, world": myns::jni_utf16_ostream o(env); o << u"hello, wor" << u'l' << u'd'; My problem is as soon as I try to insert an integer value, the stream's bad bit gets set, for example: myns::jni_utf16_ostream o(env); if (o.badbit()) throw "bad bit before"; // does not throw int32_t x(5); o << x; if (o.badbit()) throw "bad bit after"; // throws :( I don't understand why this is happening! Is there some other method on std::basic_streambuf I need to be implementing????

    Read the article

  • How to change PHP's eregi to preg_match

    - by jasondavis
    I need help, below is a small VERY basic regex to somewhat validate an email, I do realize it does not work the greatest but for my needs it is ok for now. It currently uses PHP's eregi function which php.net says is now a depreciated function and I should use preg_match instead, simply replacing erei with preg_match does not work, can someone show me how to make it work? function validate_email($email) { if (!eregi("^[[:alnum:]][a-z0-9_.-]*@[a-z0-9.-]+\.[a-z]{2,4}$", $email)) { echo 'bad email'; } else { echo 'good email'; } } function validate_email($email) { if (!preg_match("^[[:alnum:]][a-z0-9_.-]*@[a-z0-9.-]+\.[a-z]{2,4}$", $email)) { echo 'bad email'; } else { echo 'good email'; } }

    Read the article

< Previous Page | 72 73 74 75 76 77 78 79 80 81 82 83  | Next Page >