Search Results

Search found 5136 results on 206 pages for 'comment bot'.

Page 174/206 | < Previous Page | 170 171 172 173 174 175 176 177 178 179 180 181  | Next Page >

  • How to strengthen Mysql database server Security?

    - by i need help
    If we were to use server1 for all files (file server), server2 for mysql database (database server). In order for websites in server1 to access to the database in server2, isn't it needed to connect to to ip address of second (mysql server) ? In this case, is remote mysql connection. However, I seen from some people comment on the security issue. remote access to MySQL is not very secure. When your remote computer first connects to your MySQL database, the password is encrypted before being transmitted over the Internet. But after that, all data is passed as unencrypted "plain text". If someone was able to view your connection data (such as a "hacker" capturing data from an unencrypted WiFi connection you're using), that person would be able to view part or all of your database. So I just wondering ways to secure it? Allow remote mysql access from server1 by allowing the static ip adress allow remote access from server 1 by setting port allowed to connect to 3306 change 3306 to other port? Any advice?

    Read the article

  • Do double forward slashes direct IE to use specific css?

    - by kjh
    I have just found something very weird while developing a website. While trying to get a div element to display across the top of the screen, I noticed that I wasn't achieving a desired result in any browser except for old versions of IE. In order to test some different code, instead of deleting the faulty line, I used '//' to comment it out (I'm not really even sure if that works in css) but what happened was, the compatible browsers used the uncommented code, while IE used the code marked by '//'. here is the code: #ban-menu-div{ position:fixed;top:0; //position:relative; //<-- IE keeps the banner with rel pos while the other display:block; // browsers used fixed margin:auto; padding:0px; width:100%; text-align:center; background:black; } so basically, it seems as though // can be used to instruct newer browsers to ignore specific lines of code, and instruct older versions of IE to use it? If this is common practice someone please let me know. it sure makes developing for older browsers a hell of a lot easier

    Read the article

  • howto catch jQuery for multiple links but not all

    - by user247245
    I'm trying to dig into jQuery but would like some feedback on how to do things the best way, I have a list with items, which each contains a hidden div that should show upon click on it's parent, list div:ed item1 with link hidden div div:ed item2 with link hidden div .. My current solution is to trace the calling link by it's id and then reusing that ID for showing the correct hidden one: $(document).ready(function() { //jQ should only trigger on links with id="cmLinkINT" $("a").click(function() { //see if it's a comment request. var s = $(this).attr("id"); if (s.indexOf('cmLink') != -1) { //ok, it was a 'show'-link, get the id.. var j = s.substring(6); //ok, now I have the id i want to show (detailsINT) return false; } }); }); What's not clear to me is the best approach, Should I use id for requesting a or trace the id of the parent div. How to avoid that the code triggers on any link? Class? Thankful for any feedback, regards //t

    Read the article

  • Threads syncronization with ThreadPoolExecutor

    - by justme1
    I'm trying to implement some logic when I create main(father) thread witch executes several other threads. Then it waits for some condition which child threads creates. After condition is meet the father executes some more child threads. The problem that when I use wait/notify I have java.lang.IllegalMonitorStateException exception. Here is the code: public class MyExecutor { final static ArrayBlockingQueue<Runnable> queue = new ArrayBlockingQueue<Runnable>(10); final static ExecutorService svc = Executors.newFixedThreadPool(1); static final ThreadPoolExecutor threadPool = new ThreadPoolExecutor(5, 8, 10, TimeUnit.SECONDS, queue); public static void main(String[] args) throws InterruptedException { final MyExecutor me = new MyExecutor(); svc.execute(new Runnable() { public void run() { try { System.out.println("Main Thread"); me.execute(threadPool, 1); System.out.println("Main Thread waiting"); wait(); System.out.println("Main Thread notified"); me.execute(threadPool, 2); Thread.sleep(100); threadPool.shutdown(); threadPool.awaitTermination(20000, TimeUnit.SECONDS); } catch (InterruptedException e) { e.printStackTrace(); } } }); svc.shutdown(); svc.awaitTermination(10000, TimeUnit.SECONDS); System.out.println("Main Thread finished"); } public void execute(ThreadPoolExecutor tpe, final int id) { tpe.execute(new Runnable() { public void run() { try { System.out.println("Child Thread " + id); Thread.sleep(2000); System.out.println("Child Thread " + id + " finished"); notify(); } catch (InterruptedException e) { e.printStackTrace(); } } }); } } When I comment wait and notify line I have the following output: Main Thread Main Thread waiting Main Thread notified Child Thread 1 Child Thread 2 Child Thread 1 finished Child Thread 2 finished Main Thread finished

    Read the article

  • Getting the Item Count of a large sharepoint list in fastest way

    - by sooraj
    I am trying to get the count of the items in a sharepoint document library programatically. The scale I am working with is 30-70000 items. We have usercontrol in a smartpart to display the count . Ours is a TEAM site. This is the code to get the total count SPList VoulnterrList = web.Lists[ListTitle]; SPQuery query = new SPQuery(); query.ViewAttributes = "Scope=\"Recursive\""; string queries = "<Where><Eq><FieldRef Name='ApprovalStatus' /><Value Type='Choice'>Pending</Value></Eq></Where>"; query.Query = queries; SPListItemCollection lstitemcollAssoID = VoulnterrList.GetItems(query); lblCount.Text = "Total Proofs: " + VoulnterrList.Items.Count.ToString() + " Pending Proofs: " + lstitemcollAssoID.Count.ToString(); The problem is this has serious performance issue it takes 75 to 80 sec to load the page. if we comment this page load will decrees to 4 sec. Any better approch for this problem Ours is sharepoint 2007

    Read the article

  • optimization math computation (multiplication and summing)

    - by wiso
    Suppose you want to compute the sum of the square of the differences of items: $\sum_{i=1}^{N-1} (x_i - x_{i+1})^2$, the simplest code (the input is std::vector<double> xs, the ouput sum2) is: double sum2 = 0.; double prev = xs[0]; for (vector::const_iterator i = xs.begin() + 1; i != xs.end(); ++i) { sum2 += (prev - (*i)) * (prev - (*i)); // only 1 - with compiler optimization prev = (*i); } I hope that the compiler do the optimization in the comment above. If N is the length of xs you have N-1 multiplications and 2N-3 sums (sums means + or -). Now suppose you know this variable: sum = $x_1^2 + x_N^2 + 2 sum_{i=2}^{N-1} x_i^2$ Expanding the binomial square: $sum_i^{N-1} (x_i-x_{i+1})^2 = sum - 2\sum_{i=1}^{N-1} x_i x_{i+1}$ so the code becomes: double sum2 = 0.; double prev = xs[0]; for (vector::const_iterator i = xs.begin() + 1; i != xs.end(); ++i) { sum2 += (*i) * prev; prev = (*i); } sum2 = -sum2 * 2. + sum; Here I have N multiplications and N-1 additions. In my case N is about 100. Well, compiling with g++ -O2 I got no speed up (I try calling the inlined function 2M times), why?

    Read the article

  • LNK4221 and LNK4006 Warnings!

    - by user295030
    Hi, I basically making a static library of my own. I have taken my code which works and now put it into a static library for another program to use. In my library I am using another static library which I don't want the people who will be using my API to know. Since, I want to hide that information from them I can't tell them to install the other static library. Anyway, I used the command line Lib.exe to extract and create a smaller lib file of just the obj's I used. However, I get a bunch of "LNK4006 :second definition ignored" linker warnings for each obj I use followed by "LNK4221 no public symbols found;archive member will be inaccessible". I am doing this work in vs2008 and I am not sure what I am doing wrong. I am using the #pragma comment line in my .cpp file I have also modified the librarian to add my smaller .lib along with its location. my code simply makes calls to a couple functions which it should be able to get from those Obj file in the smaller lib. All my functions are implemented in .cpp file and my header just have the includes of the third party header files and come standard c++ header files. nothing fancy. I have actually no function definitions in there atm. I was going to put the API definition in there and implement that in the .cpp for this static lib that i was going to make. However, I just wanted to build my code before I added more to it. s Any help would be appreciated. is this a vs2008 configuration issue? or a program issue I am not sure. thanks for the help!

    Read the article

  • trying to redirect the php page is get id is empty ir does not exists.

    - by user570782
    <? include..... if ($picid != $_GET['picid']) || (empty($picid)) { echo "page not working"; } else { $picid = $_GET['picid']; $query = mysql_query("SELECT * FROM pic_info WHERE picid = 'picid1' ");// problem while($rows = mysql_fetch_assoc($query)): $picid = $rows['picid']; $title = $rows['title']; $link = $rows['link']; $description = $rows['description']; $movie_pic = $rows['movie_pic']; $source = $rows['source']; } $get_comment = mysql_query("SELECT * FROM comment WHERE picid ='$picid'");// work partially $comment_count = mysql_num_rows($get_comment); if ($comment_count>0) { messages = " "; while ($com = mysql_fetch_array($get_comment)){ $comment_id = $com['comment_id']; $name = $com['name']; $message = $com['message']; $time_post= $com['time_post']; $messages .= '<em> on ' .$time_post.'</em><b> '.$name.' said.....</b><br/> '.$message.'<hr/>'; // line with problem } } ?> i am stuck i am trying to say that if $_GET['picid']; is empty echo out error message or if the movid does not exist in the db echo out error message. when i run it i get an error. not sure if i am calling the correct function. what am i doing wrong please help

    Read the article

  • Creating a Variable From Two Others

    - by John
    Hello, In the HTML table below, I would like to add a third column that equals $row["countSubmissions"] times 10 plus $row["countComments"]. How could I do this? Thanks in advance, John $sqlStr = "SELECT l.loginid, l.username, COALESCE(s.total, 0) AS countSubmissions, COALESCE(c.total, 0) AS countComments FROM login l LEFT JOIN ( SELECT loginid, COUNT(1) AS total FROM submission GROUP BY loginid ) s ON l.loginid = s.loginid LEFT JOIN ( SELECT loginid, COUNT(1) AS total FROM comment GROUP BY loginid ) c ON l.loginid = c.loginid GROUP BY l.loginid ORDER BY countSubmissions DESC LIMIT 10"; $result = mysql_query($sqlStr); $arr = array(); echo "<table class=\"samplesrec1edit\">"; while ($row = mysql_fetch_array($result)) { echo '<tr>'; echo '<td class="sitename1edit1"><a href="http://www...com/.../members/index.php?profile='.$row["username"].'">'.stripslashes($row["username"]).'</a></td>'; echo '<td class="sitename1edit2">'.stripslashes($row["countSubmissions"]).'</td>'; echo '<td class="sitename1edit2">'.stripslashes($row["countComments"]).'</td>'; echo '</tr>'; } echo "</table>";

    Read the article

  • why no implicit conversion from pointer to reference to const pointer.

    - by user316606
    I'll illustrate my question with code: #include <iostream> void PrintInt(const unsigned char*& ptr) { int data = 0; ::memcpy(&data, ptr, sizeof(data)); // advance the pointer reference. ptr += sizeof(data); std::cout << std::hex << data << " " << std::endl; } int main(int, char**) { unsigned char buffer[] = { 0x11, 0x11, 0x11, 0x11, 0x22, 0x22, 0x22, 0x22, }; /* const */ unsigned char* ptr = buffer; PrintInt(ptr); // error C2664: ... PrintInt(ptr); // error C2664: ... return 0; } When I run this code (in VS2008) I get this: error C2664: 'PrintInt' : cannot convert parameter 1 from 'unsigned char *' to 'const unsigned char *&'. If I uncomment the "const" comment it works fine. However shouldn't pointer implicitly convert into const pointer and then reference be taken? Am I wrong in expecting this to work? Thanks!

    Read the article

  • The elements do not fall into document('').

    - by Kalinin
    xslt: <my:translations xmlns:my="my:my"> <w e="name" r="????????"/> <w e="model" r="??????"/> <w e="year" r="???"/> <w e="glass_type" r="???"/> <w e="scancode" r="???????"/> <w e="eurocode" r="???????"/> <w e="comment" r="???????????"/> <w e="glass_size" r="??????"/> <w e="vendor" r="?????????????"/> <w e="trademark" r="???????? ?????"/> <w e="fprice" r="????"/> </my:translations> <xsl:value-of select="count(document('')//w)"/> returns 0. In what may be the problem?

    Read the article

  • Coloring Default Buttons - color filter only on unfocused state

    - by rlo
    I want to buttons of different colors, but I want to do so while using the default button background resource in order to preserve the onfocus and onclick states. This is because I want to use the default highlight color of the OS for my app, which is NOT always orange (HTC Sense makes it green). I found that adding a color filter to the button's background drawable works great (in this case, blue): myButton.getBackground().setColorFilter(Color.parseColor(this.getString (R.color.button_blue)), Mode.MULTIPLY); BUT, when the button is focused or clicked, it turns a nasty orange_blue because it mixes the color filter with the orange of the background drawable. I want to ONLY set this color filter for the unfocused/unclicked nine- patch drawable within the default button's statelistdrawable. I'm not sure how else to do this. I see a similar solution here: http://stackoverflow.com/questions/2065430/fixed-android-detecting-fo... but I have some concerns with that solution, mainly what if the OS changes the graphic of the default button? Since the normal unfocused/ unpressed graphic is now hardcoded into the app, it would break the flow. Maybe can someone comment on whether it would be good or bad practice to hardcode the default graphic into the app? What are the chances of the OS completely changing the graphic? Any help please? Thanks very much!!

    Read the article

  • How to document an existing small web site (web application), inside and out?

    - by Ricket
    We have a "web application" which has been developed over the past 7 months. The problem is, it was not really documented. The requirements consisted of a small bulleted list from the initial meeting 7 months ago (it's more of a "goals" statement than software requirements). It has collected a number of features which stemmed from small verbal or chat discussions. The developer is leaving very soon. He wrote the entire thing himself and he knows all of the quirks and underlying rules to each page, but nobody else really knows much more than the user interface side of it; which of course is the easy part, as it's made to be intuitive to the user. But if someone needs to repair or add a feature to it, the entire thing is a black box. The code has some minimal comments, and of course the good thing about web applications is that the address bar points you in the right direction towards fixing a problem or upgrading a page. But how should the developer go about documenting this web application? He is a bit lost as far as where to begin. As developers, how do you completely document your web applications for other developers, maintainers, and administrative-level users? What approach do you use, where do you start, do you have a template? An idea of magnitude: it uses PHP, MySQL and jQuery. It has about 20-30 main (frontend) files, along with about 15 included files and a couple folders of some assets. So overall it's a pretty small application. It interfaces with 7 MySQL tables, each one well-named, so I think the database end is pretty self-explanatory. There is a config.inc.php file with definitions of consts like the MySQL user details, some from/to emails, and URLs which PHP uses to insert into emails and pages (relative and absolute paths, basiecally). There is some AJAX via jQuery. Please comment if there is any other information that would help you help me and I will be glad to edit it in.

    Read the article

  • PHP OOP class Sensative To Counter field name !

    - by Mac Taylor
    hey guys recently i managed to write a class for my stories , and everything is fine , unless counter field that stores page's hits here is my class : class nk_posts { var $data = array(); public function _data() { global $db; $result = $db->sql_query(" SELECT bt_stories.*, bt_tags.*, bt_topics.*, group_concat(DISTINCT bt_tags.tag ) as mytags, group_concat(DISTINCT bt_topics.topicname ) as mytopics FROM bt_stories,bt_tags,bt_topics WHERE CONCAT( ' ', bt_stories.tags, ' ' ) LIKE CONCAT( '%', bt_tags.tid, '%' ) AND CONCAT( ' ', bt_stories.associated, ' ' ) LIKE CONCAT( '%', bt_topics.topicid, '%' ) AND time<=now() AND section='news' AND approved='1' GROUP BY bt_stories.sid ORDER BY bt_stories.sid DESC "); while ($this->data = $db->sql_fetchrow($result)) { $this->sid = $this->data['sid']; $this->title = $this->data['title']; $this->counter = $this->data['counter']; //------Rest of Fields ------ $this->_output(); } } public function _output() { themeindex( $this->sid, $this->title, $this->counter, //------Rest of Fields ------ ); } } problem this class can't show counter filed value , but if i change counter field name to other thing like hit , .. everything goes fine im sure its okay if i write it in normal php mysql way , but i need this to be in OOP way any comment why it's sensitive to counter field name ?!

    Read the article

  • Why isn't this json/jquery function returning 10 results and why does it return 0 sometimes?

    - by Scarface
    Hey guys, quick question. I have a json function returning results from a php query but it is not working out because it seems to keep executing the query until all results are returned and sometimes returns 0 results (if I keep refreshing page, it returns 0 results sometimes). I want to limit results returned to 10 so I was wondering if anyone could point out the error of my code. Would really appreciate it. PS I am positive the query is returning the correct results and only 10 on its own. It just seems to be this one function that is not working out. SELECT time, user, comment FROM comments WHERE topic_id='$topic_id' ORDER BY time DESC LIMIT 10 var count=0; function prepare(response) { count++; var string = '<li class="list" id="list-'+count+'">' +'</li>'; return string; } $.getJSON(files+"comments.php?action=view&load=initial&topic_id="+topic_id+"&t=" + (new Date()), function(json) { if(json.length) { for(i=0; i < json.length; i++) { $('#shoutbox-list').prepend(prepare(json[i])); $('#list-' + count).fadeIn(1500); } var j = i-1; lastTime = json[j].time; } });

    Read the article

  • an error "has no member named"

    - by helloWorld
    I have this snippet of the code account.cpp #include "account.h" #include <iostream> #include <string> using namespace std; Account::Account(string firstName, string lastName, int id) : strFirstName(firstName), strLastName(lastName), nID(id) {} void Account::printAccount(){ cout << strFirstName; } account.h #include <string> using std::string; class Account{ private: string strLastName; //Client's last name string strFirstName; //Client's first name int nID; //Client's ID number int nLines; //Number of lines related to account double lastBill; public: Account(string firstName, string lastName, int id); void printAccount(); }; company.h #ifndef CELLULAR_COMPANY_H #define CELLULAR_COMPANY_H #include <string> #include <list> #include <iostream> #include "account.h" using namespace std; class Company { private: list<Account> listOfAccounts; public: void addAccount(string firstName, string lastName, int id) { Account newAccount(firstName, lastName, id); listOfAccounts.push_back(newAccount); } void printAccounts(){ for(list<Account>::iterator i = listOfAccounts.begin(); i != listOfAccounts.end(); ++i){ i.printAccount; //here bug } } }; #endif // CELLULAR_COMPANY_H main.cpp #include "cellularcompany.h" int main(){ Company newCompany; newCompany.addAccount("Pavel", "Nedved", 11111); newCompany.printAccounts(); return 0; } can somebody please explain what does my error mean? thanks in advance (I have it in company.h see comment there) I have bug 'struct std::_List_iterator<Account>' has no member named 'printAccount'

    Read the article

  • Given a linked list of numbers. Swap every 2 adjacent links.

    - by Learner
    Given a linked list of numbers. Swap every 2 adjacent links. For eg if a linked list given to you is- a-b-c-d-e-f O/p expected- b-a-d-c-f-e Every 2 alternate links have to be swapped. I have written a solution here. Can you suggest me some other solution. Can you comment on my solution and help me better write it? void SwapAdjacentNodes (Node head) { if (head == null) return; if (head.next == null) return; Node curr = head; Node next = curr.Next; Node temp = next.Next; while (true) { temp = next.Next; next.Next = curr; curr.Next = temp; if (curr.Next != null) curr = curr.Next; else break; if (curr.Next.Next!=null) next = curr.Next.Next; else break; } }

    Read the article

  • Invoking [SKProductsRequest start] hangs on iOS 4.0

    - by figelwump
    Encountering an issue with SKProductsRequest that is specific to iOS 4.0. The problematic code: - (void)requestProductData { NSSet *productIdentifiers = [NSSet setWithObjects:kLimitedDaysUpgradeProductId, kUnlimitedUpgradeProductId, nil]; self.productsRequest = [[SKProductsRequest alloc] initWithProductIdentifiers:productIdentifiers]; self.productsRequest.delegate = self; [self.productsRequest start]; } - (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response { NSLog(@"didReceiveResponse"); } When [SKProductsRequest start] is invoked, the productsRequest:didReceiveResponse: delegate method is never invoked; further, the entire app hangs and is completely unresponsive to input. Obviously, this is a huge issue for our iOS 4.0 users as it not only breaks payments but makes the app completely unusable. Some other things to note: this only happens on iOS 4.0; iOS 4.2, 3.x are fine. Also: if the delegate is not set on the SKProductsRequest (i.e. comment out the line "self.productsRequest.delegate = self;"), the app doesn't hang (but of course in that case we have no way of getting the product info). Also, the problem still reproduces with everything stripped out of the productsRequest:didReceiveResponse: callback (that method never actually gets called). Finally, if the productIdentifiers NSSet object is initialized to an empty set, the hang doesn't occur. Has anybody else experienced this? Any ideas/thoughts on what could be going on here, and how we might be able to work around this?

    Read the article

  • Remove the hash after Ajax loading (I'm ajaxing wordpress 8-) )

    - by Alberto
    Hi everybody, I followed this great tutorial to"ajax" my blog:http://www.deluxeblogtips.com/2010/05/how-to-ajaxify-wordpress-theme.html But it creates some problems and I think the problem is in the hash that ajax creates. So, after the content is loaded, how can I remove the hash from the url? I copy my code here: jQuery(document).ready(function($) { var $mainContent = $("#content"), siteUrl = "http://" + top.location.host.toString(), url = ''; $(document).delegate("a[href^='"+siteUrl+"']:not([href*=/wp-admin/]):not([href*=/wp-login.php]):not([href$=/feed/]):not([href*=/go.php]):not(.comment-reply-link)", "click", function() { location.hash = this.pathname; $('html, body').animate({scrollTop:0}, 'fast'); return false; }); $("#searchform").submit(function(e) { location.hash = '?s=' + $("#search").val(); e.preventDefault(); }); $(window).bind('hashchange', function(){ url = window.location.hash.substring(1); if (!url) { return; } url = url + " #inside"; $mainContent.html('<div id="loader">Caricamento in corso...</div>').load(url, function() { //$mainContent.animate({opacity: "1"}); scriptss(); }); }); $(window).trigger('hashchange'); }); Thank all very much!

    Read the article

  • sockaddr_in causing segfault?

    - by Curlystraw
    Working on creating a server/client system in C right now, and I'm having a little trouble with the client part. From what I've seen, I need to use sockaddr_in so I can connect to the server. However, I've been getting a segfault every time. I believe that sockaddr_in has something to do with it, as comment it and it's references later in the program fixes the segfault. code: #include <stdio.h> #include <sys/types.h> #include <sys/socket.h> #include <unistd.h> #include <netinet/in.h> int main(int argc, char** argv) { int Csock; int con; char *data = 0; char buf[101] = ""; struct sockaddr_in addr; Csock = socket(AF_INET, SOCK_STREAM, 0); addr.sin_family = AF_INET; addr.sin_port = htons(3435); con = connect(Csock, (struct sockaddr*) &addr, sizeof(&addr)); write(con, "Text", sizeof("Text")); *data = read(con, buf, 100); puts(data); return 0; } sadly, I am rather new to C, so that's as much as I can figure... can anyone tell me a way to go about eliminating the segfault? Thanks!

    Read the article

  • Only first word of two strings gets added to db

    - by dkgeld
    When trying to add words to a database via php, only the first word of both strings gets added. I send the text via this code: public void sendTextToDB() { valcom = editText1.getText().toString(); valnm = editText2.getText().toString(); t = new Thread() { public void run() { try { url = new URL("http://10.0.2.2/HB/hikebuddy.php?function=setcomm&comment="+valcom+"&name="+valnm); h = (HttpURLConnection)url.openConnection(); if( h.getResponseCode() == HttpURLConnection.HTTP_OK){ is = h.getInputStream(); }else{ is = h.getErrorStream(); } h.disconnect(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); Log.d("Test", "CONNECTION FAILED 1"); } } }; t.start(); } When tested with spaces and commas etc. in a browser, the php function adds all text. The strings also return the full value when inserted into a dialog. How do I fix this? Thank you.

    Read the article

  • Temporarily disable vim plugin without relaunching

    - by simont
    I'm using c-support in Vim. One of it's features is the automatic comment expansion. When I'm pasting code into Vim from an external editor, the comments are expanded (which gives me double-comments and messes up the paste - see below for example). I'd like to be able to disable the plugin, paste, then re-enable it, without relaunching Vim. I'm not sure if this is possible. The SO questions here, here and here all describe methods to disable plugins, but they all require me to close Vim, mess with my .vimrc or similar, and relaunch; if I have to close Vim, I might as well cat file1 >> myfile; vim myfile, then shift the lines internally, which will be just as quick. Is it possible to disable a plugin while running vim without relaunching, preferably in a way which allows me to map a hot-key toggle-plugin (so re-sourcing ~/.vimrc is alright; that's mappable to a hotkey [I imagine, haven't tried it yet])? Messed up comments: /* * * Authors: * * A Name * * * * Copyright: * * A Name, 2012 * */ EDIT: It turns out you can :set paste, :set nopaste (which, to quote :help paste, will "avoid unexpected effects [while pasting]". (See the comments). However, I'm still curious whether you can disable/enable a plugin as per the original question, so I shall leave the question open.

    Read the article

  • Connector/C++ compile error

    - by rizzo0917
    When I compile code that includes Connector/C++ headers, I get the following errors: c:\qt\2010.03\mingw\bin../lib/gcc/mingw32/4.4.0/../../../../include/stdint.h:27: error: 'int8_t' has a previous declaration as 'typedef signed char int8_t' c:\qt\2010.03\mingw\bin../lib/gcc/mingw32/4.4.0/../../../../include/stdint.h:31: error: 'int32_t' has a previous declaration as 'typedef int int32_t' c:\qt\2010.03\mingw\bin../lib/gcc/mingw32/4.4.0/../../../../include/stdint.h:32: error: 'uint32_t' has a previous declaration as 'typedef unsigned int uint32_t' Literally all I do is this: #include <cppconn/driver.h> #include <cppconn/exception.h> #include <cppconn/resultset.h> #include <cppconn/statement.h> #include <cppconn/prepared_statement.h> Now I can go into the file and comment the lines out that give me errors: //typedef signed char int8_t; //typedef int int32_t; //typedef unsigned uint32_t; It compiles, but when I try to run the mysql code: sql::Driver *driver; driver = get_driver_instance(); I get this output test.exe exited with code -1073741515 Any Ideas?

    Read the article

  • POSIX Sockets: How to detect Ctrl-C sent over Telnet?

    - by ogott
    Short Question What's the right way to handle a Ctrl-C event sent over Telnet on the server side? Long Question After calling recv() on a socket, I'd like to handle some situations appropriately. One of them is to return a certain error code when Ctrl-C was received. What's the correct way to detect this? The following works, but it just doesn't seem right: size_t recv_count; static char ctrl_c[5] = {0xff, 0xf4, 0xff, 0xfd, 0x06}; recv_count = recv(socket, buffer, buffer_size, 0); if (recv_count == sizeof(ctrl_c) && memcmp(buffer, ctrl_c, sizeof(ctrl_c) == 0) { return CTRL_C_RECEIVED; } I found a comment on Ctrl-C in a side-note in this UNIX Socket FAQ: [...] (by the way, out-of-band is often used for that ctrl-C, too). As I understand, receiving out-of-band data is done using recv() with a certain flag as the last parameter. But when I'm waiting for data using recv() as I do in the code above, I can't read out-of-band data at the same time. Apart from that, I'm getting something using recv() without that oob-flag.

    Read the article

  • How can I pull multiple rows from a MySQL table and use all of them automatically for the same thing

    - by Rob
    Basically, I have multiple URL's stored in a MySQL table. I want to pull those URLs from the table and have cURL connect to all of them. Currently I've been storing the URL's in the local script, but I've added a new page that I can add and remove them from the database, and I'd like the page to reflect it appropriately. Here is what I currently have: $sites[0]['url'] = "http://example0.com "; $sites[1]['url'] = "http://example1.com"; $sites[2]['url'] = "http://example2.com"; $sites[3]['url'] = "http://example3.com"; foreach($sites as $s) { // Now for some cURL to run it. $ch = curl_init($s['url']); //load the urls and send GET data curl_setopt($ch, CURLOPT_TIMEOUT, 2); //No need to wait for it to load. Execute it and go. curl_exec($ch); //Execute curl_close($ch); //Close it off } Now I assume it can't be too amazingly difficult to do, I just don't know how. So if you could point me in the right direction, I'd be grateful. But if you supply me with some code, please comment it appropriately so that I can understand what each line is doing.

    Read the article

< Previous Page | 170 171 172 173 174 175 176 177 178 179 180 181  | Next Page >