首页 \ 问答 \ Jquery显示/隐藏修复[关闭](Jquery show / hide fix [closed])

Jquery显示/隐藏修复[关闭](Jquery show / hide fix [closed])

我需要修复这个小代码:

jQuery(document).ready(function() {

    $('.plus').click(function(){
        $('#top:hidden').show('slow');
        $('.plus').click(function(){
            $('#top:visible').hide('slow');

        });
    });
});

I need fix this little code:

jQuery(document).ready(function() {

    $('.plus').click(function(){
        $('#top:hidden').show('slow');
        $('.plus').click(function(){
            $('#top:visible').hide('slow');

        });
    });
});

原文:
更新时间:2021-11-08 21:11

最满意答案

在谷歌搜索解决方案时,我遇到了sql::Driver::threadInit()sql::Driver::threadEnd() 。 但是,正如我在C ++连接器的1.0.5版本上所做的那样,我无法使用这些功能。 添加driver->threadInit(); 获取驱动程序实例和driver->threadEnd(); 在我的功能结束时,这个问题得到了解决。

以下是MySQL 1.1.0更改历史记录中提到的这个线程init和end功能:

添加了Driver :: threadInit()和Driver :: threadEnd()方法。 线程客户端的每个线程必须在线程的最开始时调用Driver :: threadInit(),然后才能使用Connector / C ++执行任何其他操作,并且每个线程在完成时都必须调用Driver :: threadEnd()。 您可以在examples / pthreads.cpp中找到一个演示用例的示例。 强烈建议不要在线程之间共享连接。 理论上,如果你设置某些(未记录的)互斥锁,但它根本不受支持。 每个线程使用一个连接。 没有两个线程同时使用相同的连接。 请查看MySQL手册中关于线程的C API说明。 Connector / C ++包装了C API。 (劳伦,安德烈,乌尔夫)

TL; DR:如果您遇到此问题,请确保您的C ++ MySQL Connector版本> = 1.1.0并使用sql::Driver::threadInit()sql::Driver::threadEnd()方法包围您的连接代码。


While Googling around for a solutions, I came across mentions of sql::Driver::threadInit() and sql::Driver::threadEnd(). However, as I was on version 1.0.5 of the C++ Connector, these functions were not available to me. Adding a driver->threadInit(); after getting a driver instance and driver->threadEnd(); at the end of my function, this problem was resolved.

The following is the mention of this thread init and end functionality in MySQL's 1.1.0 change history:

Added Driver::threadInit() and Driver::threadEnd() methods. Every thread of a threaded client must call Driver::threadInit() at the very start of the thread before it does anything else with Connector/C++ and every thread must call Driver::threadEnd() when it finishes. You can find an example demonstrating the use in examples/pthreads.cpp. It is strongly discouraged to share connections between threads. It is theoretically possible, if you set certain (undocumented) mutexes, but it is not supported at all. Use one connection per thread. Do not have two threads using the same connection at the same time. Please check the C API notes on threading on the MySQL manual. Connector/C++ wraps the C API. (Lawrin, Andrey, Ulf)

TL;DR: If you come across this problem, make sure that your version of the C++ MySQL Connector is >= 1.1.0 and use the sql::Driver::threadInit() and sql::Driver::threadEnd() methods to surround your connection code.

相关问答

更多
  • mysql_thread_init()就是诀窍。 您需要为使用C API的每个线程执行它。 mysql_init()隐式地执行它。 mysql_thread_init() is the trick. You need to execute it for every thread that is using C API. mysql_init() does it implicitly.
  • 函数mysql_thread_id()需要一个指向由本机MySQL C API的mysql_connect(...)函数创建的连接对象的指针。 Connector / C ++已将该对象埋藏得非常深(我看)。 MySQL的文档建议的替代方法是执行查询SELECT CONNECTION_ID() ,返回的结果将是您要查找的ID。 The function mysql_thread_id() expects a pointer to a connection object created by the nati ...
  • 最后我这样做了: void renameCharac(std::string guid, std::string pseudo) { sql::Statement *declaration; declaration = connection->createStatement(); declaration->executeUpdate("UPDATE characters SET name = '" + pseudoChoisi + "' WHERE chara ...
  • 而不是试图使其与下面的动态库一起使用: / usr / lib64 /(我有任何库因为我跑了: yum install boost ) 我决定试试静态的。 在我下载了boost之后 :我只需要指向父目录: cmake . -DBOOST_ROOT:STRING=/home/boost_1_54_0/ 并且cmake完成没有问题。 有人可能会尝试使cmake进程与动态库一起工作,但应该相应地编辑CMakeLists.txt文件。 例如 SET(Boost_USE_STATIC_LIBS TRUE) 应该 ...
  • 如果您使用相同的连接句柄,则需要使用锁来保护对它的访问,因为低级别上的MySQL连接API不是线程安全的。 如果您需要并行发送查询,请考虑为每个线程创建单独的MySQL连接句柄。 If you are using the same connection handle, you need to protect access to it with a lock as MySQL connection API on the low level is not thread-safe. If you need to ...
  • 随机崩溃很可能与MySQL客户端库的多线程使用有关。 尝试这个 mysql_library_init(0, nullptr, nullptr); 在产生任何线程之前。 这里,来自MySQL文档的更具体的信息: 在非多线程环境中,可能会省略对mysql_library_init()的调用,因为mysql_init()会根据需要自动调用它。 但是,mysql_library_init()在多线程环境中不是线程安全的,因此调用mysql_library_init()的mysql_init()也不是。 您必须在产 ...
  • 在头文件statement.hi中挖掘后发现有一个名为executeUpdate的函数(下面的函数头) virtual int executeUpdate(const sql::SQLString& sql) = 0; 这最终做了我想做的事。 程序将值添加到数据库中而不抛出任何异常。 我希望mySQL C ++连接器库没有那么糟糕的文档。 after digging around in the header file statement.h i found out that there was a fun ...
  • 对于Visual Studio 2010,请设置以下内容: MySQL SERVER 5.5.38(mysql-5.5.38-win32.msi) MySQL Connector Net 6.8.3(mysql-connector-net-6.8.3.msi) 在Visual Studio中= >> File = >> New = >> Project = >> Visual C ++ = >> CLR = >> CLR空项目 打开项目后,View = >> Solution Explorer = >> O ...
  • 是的,您需要该库,但它随附连接器: 要使用静态连接器/ C ++库,请链接两个库文件libmysqlcppconn-static.a和libmysqlclient.a 。 文件的位置取决于您的设置,但通常前者位于/usr/local/lib ,后者位于/usr/lib 。 文件libmysqlclient.a不是Connector / C ++的一部分,而是与MySQL Server一起分发的MySQL客户端库文件。 (请记住,MySQL客户端库是作为MySQL服务器安装过程一部分的可选组件。) MySQL ...
  • 在谷歌搜索解决方案时,我遇到了sql::Driver::threadInit()和sql::Driver::threadEnd() 。 但是,正如我在C ++连接器的1.0.5版本上所做的那样,我无法使用这些功能。 添加driver->threadInit(); 获取驱动程序实例和driver->threadEnd(); 在我的功能结束时,这个问题得到了解决。 以下是MySQL 1.1.0更改历史记录中提到的这个线程init和end功能: 添加了Driver :: threadInit()和Driver : ...

相关文章

更多

最新问答

更多
  • h2元素推动其他h2和div。(h2 element pushing other h2 and div down. two divs, two headers, and they're wrapped within a parent div)
  • 创建一个功能(Create a function)
  • 我投了份简历,是电脑编程方面的学徒,面试时说要培训三个月,前面
  • PDO语句不显示获取的结果(PDOstatement not displaying fetched results)
  • Qt冻结循环的原因?(Qt freezing cause of the loop?)
  • TableView重复youtube-api结果(TableView Repeating youtube-api result)
  • 如何使用自由职业者帐户登录我的php网站?(How can I login into my php website using freelancer account? [closed])
  • SQL Server 2014版本支持的最大数据库数(Maximum number of databases supported by SQL Server 2014 editions)
  • 我如何获得DynamicJasper 3.1.2(或更高版本)的Maven仓库?(How do I get the maven repository for DynamicJasper 3.1.2 (or higher)?)
  • 以编程方式创建UITableView(Creating a UITableView Programmatically)
  • 如何打破按钮上的生命周期循环(How to break do-while loop on button)
  • C#使用EF访问MVC上的部分类的自定义属性(C# access custom attributes of a partial class on MVC with EF)
  • 如何获得facebook app的publish_stream权限?(How to get publish_stream permissions for facebook app?)
  • 如何防止调用冗余函数的postgres视图(how to prevent postgres views calling redundant functions)
  • Sql Server在欧洲获取当前日期时间(Sql Server get current date time in Europe)
  • 设置kotlin扩展名(Setting a kotlin extension)
  • 如何并排放置两个元件?(How to position two elements side by side?)
  • 如何在vim中启用python3?(How to enable python3 in vim?)
  • 在MySQL和/或多列中使用多个表用于Rails应用程序(Using multiple tables in MySQL and/or multiple columns for a Rails application)
  • 如何隐藏谷歌地图上的登录按钮?(How to hide the Sign in button from Google maps?)
  • Mysql左连接旋转90°表(Mysql Left join rotate 90° table)
  • dedecms如何安装?
  • 在哪儿学计算机最好?
  • 学php哪个的书 最好,本人菜鸟
  • 触摸时不要突出显示表格视图行(Do not highlight table view row when touched)
  • 如何覆盖错误堆栈getter(How to override Error stack getter)
  • 带有ImageMagick和许多图像的GIF动画(GIF animation with ImageMagick and many images)
  • USSD INTERFACE - > java web应用程序通信(USSD INTERFACE -> java web app communication)
  • 电脑高中毕业学习去哪里培训
  • 正则表达式验证SMTP响应(Regex to validate SMTP Responses)