C++ 多线程不能通过编译问题('thread' is not a member of 'std') 10C
 #include <iostream>
#include <thread>
using namespace std;

void thread_task()
    std::cout << "hello thread" << std::endl;

int main(int argc, const char *argv[])
    std::thread t(thread_task);
    return EXIT_SUCCESS;

'thread' is not a member of 'std'|

windows 7 64 bit;

gcc -v
Using built-in specs.
Target: i686-pc-mingw32
Configured with: ../configure --prefix=/mingw/opt/gcc --with-local-prefix=/mingw/opt/gcc --with-native-system-header-dir=/mingw/opt/gcc/i686-pc-mingw32/include --with-gxx-include-dir=/mingw/opt/gcc/i686-pc-mingw32/include/c++/6.1.0 --target=i686-pc-mingw32 --enable-languages=c,c++,fortran,java,objc,obj-c++ --enable-static --enable-shared --enable-libgomp --enable-lto --enable-threads=posix --enable-libstdcxx --enable-libstdcxx-debug --enable-graphite --enable-tls --enable-nls --disable-bootstrap --disable-stage1-checking --disable-multilib --disable-libvtv --disable-sjlj-exceptions --disable-libstdcxx-pch --disable-win32-registry --with-dwarf2 --with-gmp=/mingw/opt/gcc --with-mpfr=/mingw/opt/gcc --with-mpc=/mingw/opt/gcc --with-isl=/mingw/opt/gcc
Thread model: posix
gcc version 6.1.0 (GCC)

IDE:codeBlocks 16.10



不清楚using namespace std么
还有使用线程需要调用库 -lpthread

这是C++11的特性, linux下gcc版本最好在4.8.1以上, 编译时记得带上-std=c++11。windows下VS版本最少要VS2012, vs越新越好.


yokeyoke 已经是GCC6.1了
3 年多之前 回复




Csdn user default icon

mvn package无错误 java -jar target/eureka-server.jar ``` Exception in thread "main" java.lang.IllegalAccessException: Class org.springframework.boot.loader.MainMethodRunner can not access a member of class cn.com.smartning.cloudproject.eurekaserver.EurekaServerApplication with modifiers "public static" at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:102) at java.lang.reflect.AccessibleObject.slowCheckMemberAccess(AccessibleObject.java:296) at java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:288) at java.lang.reflect.Method.invoke(Method.java:491) at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) at org.springframework.boot.loader.Launcher.launch(Launcher.java:50) at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51) ```


<div class="post-text" itemprop="text"> <p>In a script on our web server, we display users who are online in-game by looking at a MSSQL database for specific values then displaying the members based on such data.</p> <p>Lets say user login 'blargh' has 3 characters: MasteR, MasTeR, and BlarGh<br> Lets also say that he has logged in as 'MasteR'</p> <p>The below script will look for the value of '1' in 'connectstat' field then grab his username along with some other pertinent data, then display it.</p> <p>The problem lies when someone has two similar in-game names on a single account.</p> <p>With the above example, this script will show MasteR, and MasTeR are both online, even though only one is actually in-game. I believe this is a case sensitivity issue where when it identifies 'MasteR' as online, it's ignoring the case and believes 'MasTeR' is online as well.</p> <p>Anyone have ideas on how to isolate this by making it case-sensitive?</p> <blockquote> <p>$query = 'Select GameIDC, Resets, Class, MapNumber, MapPosX, MapPosY, ServerName, OnlineHours, clevel From MEMB_STAT, AccountCharacter, Character where MEMB_STAT.Connectstat=1 and AccountCharacter.Id=MEMB_STAT.memb___id AND AccountCharacter.GameIDC=Character.Name collate Chinese_PRC_CI_AS order by GameIDC, ServerName desc';</p> <p>$result = mssql_query($query); </p> </blockquote> <p>This is on a xampp-based web server on winxp x86 using php5 and MSSQL (ODBC)</p> </div>


![图片说明](https://img-ask.csdn.net/upload/201803/16/1521209835_713047.png) 答案没看懂,可否来个大神解释下,感激不尽 a. t1 ←Πisbn(σpublisher=“McGraw−Hill′′ (books)) Πname ((member ⋈ borrowed) ⋈ t1)) b. t1 ←Πisbn(σpublisher=“McGraw−Hill′′ (books)) Πname,i sbn(member ⋈ borrowed) ÷ t1 c. t1 ←member⋈ borrowed⋈ (σpublisher=“McGraw−Hill′′ (books)) Πname (σcountisbn > 5 (( memb_no Gcount-distinct(isbn) as countisbn(t1)))) d. t1 ←member⋈borrowed⋈books ⋈publisher,name (σcountisbn > 5 (( publisher, memb_no Gcount-distinct(isbn) as countisbn(t1)))


我的文件addressbook.txt为空时,执行这个程序i仍然会等于1,这个怎么解决FILE *fp; int n,i=0; fp=fopen("d:\\addressbook.txt","r"); if(fp==NULL) { printf("无法打开文件\n"); exit(0); } while(!feof(fp)) { fscanf(fp,"%s%s\n",memb[i].num,memb[i].nam); fscanf(fp,"%s%s\n",memb[i].sex,memb[i].bir); fscanf(fp,"%s%s\n",memb[i].tel,memb[i].QQ); fscanf(fp,"%s%s\n",memb[i].add,memb[i].rem); i++; } n=i; fclose(fp) 我编辑的addressbook文本为空时,i仍然会变成1,这个怎么解决


protected方法不是说只要外包继承了就可以直接调用父类的protected方法吗?那Object类是被各类默认继承的,为什么clone方法还要子类覆写,不能直接调用呢?这点不懂,请教大家。下面是参考代码。 ```java package cn.classes.demo; public class 对象克隆 { public static void main(String[] args) throws Exception{ Member memA=new Member("小明",18); Member memB=(Member)memA.clone(); System.out.println(memA); System.out.println(memB); } } class Member implements Cloneable{ private String name; private int age; public Member(String name, int age) { super(); this.name = name; this.age = age; } @Override public String toString() { return "["+super.toString()+"]"+"name="+this.name+"age="+this.age; } @Override protected Object clone() throws CloneNotSupportedException { return super.clone(); } } ```


<div class="post-text" itemprop="text"> <p>I am using the <a href="http://simplehtmldom.sourceforge.net/" rel="nofollow">'PHP Simple HTML DOM Parser'</a> library. My code basically loops through my different sites and lists all the relevant anchors I need, my question is: how do I print the 1st value of the <code>href</code> in the anchor of the "selector" in each of the <code>$memb(n)</code> variables in the array of <code>$team</code>.</p> <p>This is my code:</p> <pre><code>$memb1 = 'http://www.xyz1.org'; $memb2 = 'http://www.abc3.org'; $memb(n) = '...etc...etc' $teams = array( array("url" =&gt; $memb1, "selector" =&gt; ".product-list &gt; table:nth-child(1) &gt; tbody:nth-child(1) &gt; tr:nth-child(2) &gt; td:nth-child(2) &gt; a"), array("url" =&gt; $memb2, "selector" =&gt; ".product-list &gt; table:nth-child(1) &gt; tbody:nth-child(1) &gt; tr:nth-child(2) &gt; td:nth-child(2) &gt; a"), array("url" =&gt; $memb(n), "selector" =&gt; ".product-list &gt; table:nth-child(1) &gt; tbody:nth-child(1) &gt; tr:nth-child(2) &gt; td:nth-child(2) &gt; a"),...etc...etc </code></pre> <p>When running the foreach loop like this:</p> <pre><code>foreach($teams as $site) { $url = $site["url"]; $html = file_get_html($url); foreach ($html-&gt;find($site["selector"]) as $a) { $links[] = $a-&gt;href; } } ?&gt; &lt;pre&gt; &lt;?php print_r($links);?&gt; &lt;/pre&gt; </code></pre> <p>I get all the selected anchors I wanted from all the <code>$memb</code> variables all together, yet i'm trying to print the 1st value of the href in the anchor of the "selector" in each of the <code>$memb(n)</code> variables in the array of <code>$team</code>, yet I can't find a way to do this.</p> <p>I already tried <code>print_r(array_values($links)[0]);</code> yet I get only the 1st anchor from <code>$memb1</code> and it stops there, it doesn't continue to print the first anchor of <code>$memb2</code> and so on.</p> <p>How can I print the 1st anchor (index 0) from every different $memb site?</p> </div>


<div class="post-text" itemprop="text"> <p>I am trying to figure out what's wrong with my pingback.php code for the Paymentwall system and I can't figure it out. I am not an expert at all in php and I am looking for help.</p> <p>The error on PINGBACK Test:</p> <blockquote> <p><em>Signature base string</em> uid=1currency=1type=0ref=99917bc736b9199ed98e8548d787cd57f5c7</p> <p><em>Signature = MD5(Signature base string)</em> 3c97f449ef1456685f21bad0863a4196</p> </blockquote> <p><strong>Request</strong></p> <blockquote> <p>GET <a href="http://MYWANIP:80/paymentwall_process.php?uid=1&amp;currency=1&amp;type=0&amp;ref=9991&amp;is_test=1&amp;sig=3c97f449ef1456685f21bad0863a4196" rel="nofollow noreferrer">http://MYWANIP:80/paymentwall_process.php?uid=1&amp;currency=1&amp;type=0&amp;ref=9991&amp;is_test=1&amp;sig=3c97f449ef1456685f21bad0863a4196</a> HTTP/1.1 Host: Accept: <em>/</em> Proxy-Connection: Keep-Alive Connection: close Accept-encoding: gzip, deflate User-Agent: Paymentwall API</p> </blockquote> <p><strong>Response</strong></p> <blockquote> <p>HTTP/1.1 200 OK Date: Sat, 22 Dec 2018 20:48:30 GMT Server: Apache/2.2.21 (Win32) mod_ssl/2.2.21 OpenSSL/1.0.0e PHP/5.3.8 mod_perl/2.0.4 Perl/v5.10.1 X-powered-by: PHP/5.3.8 Content-length: 8 Content-type: text/html X-cache-lookup: MISS from proxy6.paymentwall.com:3128 Connection: keep-alive</p> <p>ERROR</p> </blockquote> <p><strong>My Pingback.php file</strong></p> <pre class="lang-php prettyprint-override"><code>&lt;?php // CONFIG $mssql_host = ''; $mssql_user = 'sa'; $mssql_pw = 'MYPASS'; $mssql_db = 'MyDB'; $secret_key = 'MYSECRETKEY'; $app_key = 'MYAPPKEY'; // DO NOT EDIT BELOW THIS LINE $link = mssql_connect($mssql_host, $mssql_user, $mssql_pw); $db = mssql_select_db($mssql_db); if (!$link) { die('Something went wrong while connecting to MSSQL'); } if (!$db) { die('Something went wrong while connecting to MSSQL'); } $userId = isset($_GET['uid']) ? $_GET['uid'] : null; $credits = isset($_GET['currency']) ? $_GET['currency'] : null; $type = isset($_GET['type']) ? $_GET['type'] : null; $refId = isset($_GET['ref']) ? $_GET['ref'] : null; $signature = isset($_GET['sig']) ? $_GET['sig'] : null; $result = false; function SignatureGenerator($params, $secret) { $str = ''; foreach ($params as $k=&gt;$v) { $str .= "$k=$v"; } $str .= $secret; return md5($str); } if (!empty($userId) &amp;&amp; !empty($credits) &amp;&amp; isset($type) &amp;&amp; !empty($refId) &amp;&amp; !empty($signature)) { $signatureParams = array('uid' =&gt; $userId, 'currency' =&gt; $credits, 'type' =&gt; $type, 'ref' =&gt; $refId); $signatureCalculated = SignatureGenerator($signatureParams, $secret_key); $query = mssql_query("SELECT memb___id FROM MEMB_CREDITS WHERE memb___id = '$userId'"); $check = mssql_fetch_row($query); // check if account is exists if($check[0]) { // check if IP is in whitelist and if signature matches if (in_array($_SERVER['REMOTE_ADDR'], array('', '', '', '', '')) &amp;&amp; ($signature == $signatureCalculated)) { $result = true; if ($type == 2) { // Deduct credits from user mssql_query("INSERT INTO Donate (memb___id, currency, type, date) VALUES ('".$userId."', '".$credits."', 'Chargeback', '".date("d-m-Y H:i:s")."')"); mssql_query("UPDATE MEMB_CREDITS SET credits = credits - ".$credits." WHERE memb___id = '".$userId."'"); echo 'OK'; } elseif ($type == 0 || $type == 1) { // Give credits to user mssql_query("INSERT INTO Donate (memb___id, currency, type, date) VALUES ('".$userId."', '".$credits."', 'Payment', '".date("d-m-Y H:i:s")."')"); mssql_query("UPDATE MEMB_CREDITS SET credits = credits + ".$credits." WHERE memb___id = '".$userId."'"); echo 'OK'; } } } else { $result = false; echo 'ERROR'; } } ?&gt; </code></pre> <p>Why does my paymentwall pingback not update the DB and I get an error on pingback test?</p> </div>


![图片说明](https://img-ask.csdn.net/upload/201703/06/1488791364_497807.png) ![图片说明](https://img-ask.csdn.net/upload/201703/06/1488791384_26939.png) 打包完jar后,用命令java -jar运行却出现下面的错误,怎么解决啊?求大神帮忙看一下!

复杂查询,重复参数在PHP PDO中不起作用

<div class="post-text" itemprop="text"> <p>I have a somewhat complex query (using a subquery) for an election database where I'm trying to get the number of votes per particular candidate for a position.</p> <p>The headers for the <code>votes</code> table are: <em>id (PRIMARY KEY), timestamp, pos1, pos2, ..., pos6</em> where <em>pos1-pos6</em> are the position names. A cast ballot becomes a new row in this table, with the member id number of the selected candidate (candidates are linked to profiles in a "membership" table in the database) stored as the value for each position. So for instance, one row in the database might look like the following (except with the actual 6 position names):</p> <pre><code>id timestamp pos1 pos2 pos3 (and so on) ================================================= 6 1386009129 345 162 207 </code></pre> <p>I want to get the results for each position using PHP PDO, listing for each position the candidate's name and the number of votes they have received for this position. So the raw database results should appear as (for "pos1", as an example):</p> <pre><code>name votecount ====================== Joe Smith 27 Jane Doe 45 </code></pre> <p>I have a raw SQL query which I can successfully use to get these results, the query is (making pos1 the actual column/position name <code>President</code>):</p> <pre><code>SELECT (SELECT fullname FROM membership memb WHERE member_id=`President`) name, count(`President`) votecount FROM `election_votes` votes GROUP BY `President` </code></pre> <p>So as you can see, the position name (<code>President</code>, here) is <strong>repeated 3 times in the query</strong>. This seems to cause a problem in the PHP PDO code. My code is as follows:</p> <pre><code>$position = "President"; // set in earlier code as part of a loop $query = "SELECT (SELECT fullname FROM membership memb WHERE member_id=:pos1) name, count(:pos2) votecount FROM `election_votes` votes GROUP BY :pos3"; $query2 = "SELECT (SELECT fullname FROM membership memb WHERE member_id=$position) name, count($position) votecount FROM `election_votes` votes GROUP BY $position"; // NOT SAFE! $STH = $DBH-&gt;prepare($query); $STH-&gt;bindParam(':pos1', $position); $STH-&gt;bindParam(':pos2', $position); $STH-&gt;bindParam(':pos3', $position); $STH-&gt;execute(); while($row = $STH-&gt;fetch(PDO::FETCH_ASSOC)) { print_r($row); // I'd like to do other things with these results } </code></pre> <p>When I run this, using the query <code>$query</code>, I don't get results per-person as desired. My output is:</p> <pre><code>Array ( [name] =&gt; [votecount] =&gt; 47 ) </code></pre> <p>where <strong>47</strong> is the total number of ballots cast instead of an array for each candidate contianing their name and number of votes (<em>out of the total</em>). However if I use the obviously insecure <code>$query2</code>, which just inserts the value of <code>$position</code> into the query string three times, I get the results I want.</p> <p>Is there something wrong with my PHP code above? Am I doing something that's impossible in PDO (I hope not!)? My underlying database is MySQL 5.5.32. I've even tried replacing the three named parameters with the <code>?</code> unnamed ones and passing an array <code>array($position, $position, $position)</code> into the <code>$STH-&gt;execute()</code> method with no greater success.</p> </div>


``` </set> where member_id = #{member_id} ``` ``` memb.setMember_id(memId); ``` 数据库里存储的memberid是a,检测以后我存进去的memId也是a ``` service.updateMember(memb); ``` 但是报错是这样的:![图片说明](https://img-ask.csdn.net/upload/201705/28/1495936617_667262.png)


有两个类A、B,如果在A类中包含B类的头文件,并定义了一个B类的指针成员变量*memB,我想通过memB由B类向A类发送消息,请问该怎么做呢,或者说需要用什么其他的机制去实现? p.s. 之前一直使用QT,使用信号与槽机制很容易解决,最近刚接触MFC,对消息机制理解的不是很透彻,求指导~


<div class="post-text" itemprop="text"> <p>I'm trying to use this coding but its not processing, and its not outputing any errors.</p> <pre><code>function send_email($subject='Activate Your Account', $html_content, $text_content, $headers) { $en['email'] = 'test@email.com'; $to = $en['email']; $en['memb_id'] = '39'; $en['confcode'] = '69696969'; $en['user'] = 'couple'; $text_content = "Confirm Your domain.com Account "; $text_content.= "UserName: " . $en['user'] . " "; $text_content.= "Activate Your Account by visiting this link below: "; $text_content.= "http://www.domain.com/confirm/" . $en['memb_id'] . "/" . $en['confcode'] . " "; $text_content.= " "; $text_content.= "______________________ "; $text_content.= "Thanks, "; $text_content.= "Staff"; $html_content = "&lt;html&gt;&lt;body&gt;&lt;h1&gt;Confirm Your domain.com Account&lt;/h1&gt;"; $html_content.= "&lt;p&gt;UserName: " . $en['user'] . "&lt;br&gt;"; $html_content.= "Activate Your Account by visiting this link below:&lt;br&gt;"; $html_content.= "&lt;a href=http://www.domain.com/confirm/" . $en['memb_id'] . "/" . $en['confcode'] . "&gt;http://www.domain.com/confirm/" . $en['memb_id'] . "/" . $en['confcode'] . "&lt;/a&gt;"; $html_content.= "&lt;/p&gt;"; $html_content.= "______________________&lt;br&gt;"; $html_content.= "Thanks,&lt;br&gt;"; $html_content.= " Staff"; $html_content.= "&lt;/body&gt;&lt;/html&gt;"; $mime_boundary = 'Multipart_Boundary_x'.md5(time()).'x'; $headers = "MIME-Version: 1.0 "; $headers.= "Content-Type: multipart/alternative; boundary=\"$mime_boundary\" "; $headers.= "Content-Transfer-Encoding: 7bit "; $body = "This is a multi-part message in mime format. "; $body.= "--$mime_boundary "; $body.= "Content-Type: text/plain; charset=\"charset=us-ascii\" "; $body.= "Content-Transfer-Encoding: 7bit "; $body.= $text_content; $body.= " "; $body.= "--$mime_boundary "; $body.= "Content-Type: text/html; charset=\"UTF-8\" "; $body.= "Content-Transfer-Encoding: 7bit "; $body.= $html_content; $body.= " "; $body.= "--$mime_boundary-- "; $headers.= 'From: &lt;support@domain.com&gt;' . " "; $headers.= "X-Sender-IP: $_SERVER[SERVER_ADDR] "; $headers.= 'Date: '.date('n/d/Y g:i A')." "; $headers.= 'Reply-To: &lt;support@domain.com&gt;' . " "; return mail($to, $subject, $body, $headers); echo $to; echo $subject; echo $body; echo $headers; } </code></pre> </div>

Symfony 4中的Sonata Media Bundle模板

<div class="post-text" itemprop="text"> <p>I have installed Sonata Media Bundle in Symfony 4 and all is correct, but something is different respect t Symfony 3.</p> <p>I can't see the service in Sonata Admin and when I add the sonata media bundle field to an Admin Class this shows a different template.</p> <p>Here images:</p> <p><a href="https://i.stack.imgur.com/LTpbF.png" rel="nofollow noreferrer">Sonata Media Bundle template - Symfony 4, in User Entity</a></p> <p><a href="https://i.stack.imgur.com/lw6Mq.png" rel="nofollow noreferrer">Sonata Media Bundle template - Symfony 3, in User Entity</a></p> <p><a href="https://i.stack.imgur.com/EpwuW.png" rel="nofollow noreferrer">Sonata Media Bundle template - Symfony 3, Adding new image</a></p> <p>As you can see the template is not working in Symfony 4 or I'm missing something in my code.</p> <p>My Sonata Media config</p> <p>sonata_media.yaml</p> <pre><code> sonata_media: class: media: App\Application\Sonata\MediaBundle\Entity\Media gallery: App\Application\Sonata\MediaBundle\Entity\Gallery gallery_has_media: App\Application\Sonata\MediaBundle\Entity\GalleryHasMedia default_context: default contexts: default: providers: - sonata.media.provider.dailymotion - sonata.media.provider.youtube - sonata.media.provider.image - sonata.media.provider.file - sonata.media.provider.vimeo formats: small: { width: 100 , quality: 70} big: { width: 500 , quality: 70} cdn: server: path: /upload/media filesystem: local: # Directory for uploads should be writable directory: "%kernel.project_dir%/public/upload/media" create: false providers: # ... file: # the resizer must be set to false, otherwhise this can delete icon files from the fs resizer: false image: thumbnail: sonata.media.thumbnail.format # default value # thumbnail: sonata.media.thumbnail.consumer.format # can be used to dispatch the resize action to async task # thumbnail: sonata.media.thumbnail.liip_imagine # use the LiipImagineBundle to resize the image vimeo: thumbnail: sonata.media.thumbnail.format # default value # thumbnail: sonata.media.thumbnail.consumer.format # can be used to dispatch the resize action to async task # thumbnail: sonata.media.thumbnail.liip_imagine # use the LiipImagineBundle to resize the image youtube: thumbnail: sonata.media.thumbnail.format # default value # thumbnail: sonata.media.thumbnail.consumer.format # can be used to dispatch the resize action to async task # thumbnail: sonata.media.thumbnail.liip_imagine # use the LiipImagineBundle to resize the image dailymotion: thumbnail: sonata.media.thumbnail.format # default value # thumbnail: sonata.media.thumbnail.consumer.format # can be used to dispatch the resize action to async task # thumbnail: sonata.media.thumbnail.liip_imagine # use the LiipImagineBundle to resize the image </code></pre> <p>My User's Admin Class</p> <p> </p><pre><code> // src/Admin/OgaUsersAdmin.php namespace App\Admin; use Sonata\AdminBundle\Admin\AbstractAdmin; use Sonata\AdminBundle\Datagrid\ListMapper; use Sonata\AdminBundle\Datagrid\DatagridMapper; use Sonata\AdminBundle\Form\FormMapper; use Sonata\MediaBundle\Form\Type\MediaType; use Symfony\Component\Form\Extension\Core\Type\TextType; class OgaUsersAdmin extends AbstractAdmin { protected function configureFormFields(FormMapper $formMapper) { $formMapper-&gt;add('userFirstName', TextType::class) -&gt;add('userCollection', MediaType::class, array( 'provider' =&gt; 'sonata.media.provider.image', 'context' =&gt; 'default' )); } protected function configureDatagridFilters(DatagridMapper $datagridMapper) { $datagridMapper-&gt;add('userFirstName'); } protected function configureListFields(ListMapper $listMapper) { $listMapper-&gt;addIdentifier('userFirstName'); } } </code></pre> <p>My Users Entity and Media Bundle field</p> <p> </p><pre><code> namespace App\Entity; use Application\Sonata\MediaBundle\Entity\Media; use Doctrine\ORM\Mapping as ORM; /** * OgaUsers * * @ORM\Table(name="oga_users", indexes={@ORM\Index(name="memb_id_idx", columns={"memb_id"}), @ORM\Index(name="comp_id_idx", columns={"comp_id"}), @ORM\Index(name="u_ui_id_idx", columns={"user_collection"})}) * @ORM\Entity */ class OgaUsers { /** * @var int * * @ORM\Column(name="user_id", type="integer", nullable=false) * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ private $userId; /** * @var Media * * @ORM\ManyToOne(targetEntity="App\Application\Sonata\MediaBundle\Entity\Media") * @ORM\JoinColumns({ * @ORM\JoinColumn(name="userCollection", referencedColumnName="id") * }) */ private $userCollection; </code></pre> <p>Getter and Settter</p> <pre><code>public function getUserCollection(): ?\App\Application\Sonata\MediaBundle\Entity\Media { return $this-&gt;userCollection; } public function setUserCollection(?\App\Application\Sonata\MediaBundle\Entity\Media $userCollection): self { $this-&gt;userCollection = $userCollection; return $this; } </code></pre> <p>Thank's</p> </div>


<div class="post-text" itemprop="text"> <p>my problem is i whenever i input <code>fname</code> and <code>mname</code> i got an error from the database. i just want to search both of <code>fname</code> and <code>mname</code> in search field. </p> <p>my <code>search</code> controller function</p> <pre><code> public function search() { $li = $this-&gt;session-&gt;userdata('logged_in'); $id = $this-&gt;session-&gt;userdata('idnumber'); if($li == TRUE) { $this-&gt;load-&gt;model('users_model'); $this-&gt;load-&gt;helper('smiley'); $this-&gt;load-&gt;library('table'); $image_array = get_clickable_smileys('http://localhost/efg/images/smileys', 'status'); $col_array = $this-&gt;table-&gt;make_columns($image_array, 8); $image_array2 = get_clickable_smileys('http://localhost/efg/images/smileys', 'status'); $col_array2 = $this-&gt;table-&gt;make_columns($image_array2, 8); $this-&gt;data['smiley_table1'] = $this-&gt;table-&gt;generate($col_array); $this-&gt;data['smiley_tables'] = $this-&gt;table-&gt;generate($col_array2); if($this-&gt;input-&gt;post()) { $search = $this-&gt;input-&gt;post('search'); $memb = $this-&gt;users_model-&gt;search($search); $usersearch = $this-&gt;users_model-&gt;search($search); $grpsearch = $this-&gt;users_model-&gt;searchgrp($search); redirect ('home/profile/'.$memb); } } } </code></pre> <p><strong>My <code>users_model</code> model</strong></p> <pre><code> public function search($search) { $this-&gt;db-&gt;select('*'); $this-&gt;db-&gt;from('users'); $this-&gt;db-&gt;like('username',$search); $this-&gt;db-&gt;or_like('fname',$search); $this-&gt;db-&gt;or_like('lname',$search); $this-&gt;db-&gt;or_like('mname',$search); $query = $this-&gt;db-&gt;get(); foreach ($query-&gt;result_array() as $row) { $memb = $row['idnumber']; } $error = 'There is no record for the one you searched. Please go Back.'; $query1 = $this-&gt;db-&gt;query("SELECT * FROM users WHERE idnumber ='$memb'"); $hehe = $query1-&gt;result_array(); if($hehe==NULL) { echo $error; exit; } else { return $memb; } } </code></pre> </div>


<div class="post-text" itemprop="text"> <p>i have team member table and team table. In team member table have , three columns are there teamid, staff_id and stafftype(leader or technician). Only one leader (staff_type column value) will comes in one team. So when i insert data to team member table i need to check whether any leader is there in same team.</p> <p>How to show an error message that "already have leader in this team"?Team member table looks like,</p> <pre><code>team_id staff_id stafftype 1 2 leader //see here already have leader for team_id 1 2 1 other 3 8 other 1 5 Technician 2 3 Other 1 4 Leader //This should not come. becoz already teamid-1 have Leader </code></pre> <p>When trying to save from frond end, need to show error message ie;"already have leader in this team"</p> <p><strong>MODAL</strong></p> <pre><code>public function addteam_memb($datas) { $this-&gt;db-&gt;select('*'); $this-&gt;db-&gt;from('team_members'); $querySS = $this-&gt;db-&gt;get()-&gt;result(); if(array_search('1', array_column($querySS, 'team_id')) !== false) { return 1; } else { $insert_id = 0; if ( ! empty($datas)) { $this-&gt;db-&gt;insert('team_members', $datas); $insert_id = $this-&gt;db-&gt;insert_id(); } } } </code></pre> <p><strong>CONTROLLER</strong></p> <pre><code>public function editteammember() { $getaddstafftype = $this-&gt;input-&gt;post( 'getaddstafftype' ); $getaddstaffname = $this-&gt;input-&gt;post( 'getaddstaffname' ); $getteamid = $this-&gt;input-&gt;post('getteamid'); $getstatus = $this-&gt;input-&gt;post('getstatus'); //if ( ! empty($getaddstaffname) ) if ( ! empty($getaddstaffname) &amp;&amp; ! empty($getaddstafftype) ) { foreach ($getaddstaffname as $key =&gt; $value ){ $data['Staff_id'] = $value; $data['Staff_type'] = $getaddstafftype[$key]; $data['team_id'] = $getteamid[$key]; $data['status'] = "active"; $value = $this-&gt;mastertable_model-&gt;addteam_memb($data); } if($value == 1) { echo "Already have leader in this team"; } else { //$this-&gt;load-&gt;view('team_memb_creation'); } } } </code></pre> </div>

android 如何在sql数据库中创建一张学生列表并插入数据?

android 如何在sql数据库中创建一张学生列表并插入数据 名字 性别 年龄等

求解答,请问为什么会报错error:cannot call member function 'void Time::get_time()'without object

``` #include <iostream> using namespace std; class Time{ public: Time(int,int,int); int hour; int minute; int sec; void get_time(); }; void Time::get_time(){ cout<<hour<<":"<<minute<<":"<<sec<<endl; } int main(){ Time t1(10,13,56); int *p1=&t1.hour; cout<<*p1<<endl; t1.get_time(); Time *p2=&t1; p2->get_time(); void (Time::*p3)(); p3=&Time::get_time();//就是这里报的错 (t1.*p3)(); return 0; } ```


我用postman测试,访问淘宝评论请求的url,给我返回 jsonp_tbcrate_reviews_list({"rgv587_flag":"sm","url":"https://login.taobao.com/member/login.jhtml?style=mini&from=sm&full_redirect=false&redirectURL=https%3a%2f%2frate.taobao.com:443/feedRateList.htm/_____tmd_____ 我猜测是要加上cookie什么的去访问才行?请问我该怎么获取cookie?越详细越好

MySQL 8.0.19安装教程(windows 64位)

话不多说直接开干 目录 1-先去官网下载点击的MySQL的下载​ 2-配置初始化的my.ini文件的文件 3-初始化MySQL 4-安装MySQL服务 + 启动MySQL 服务 5-连接MySQL + 修改密码 先去官网下载点击的MySQL的下载 下载完成后解压 解压完是这个样子 配置初始化的my.ini文件的文件 ...



Vue.js 2.0之全家桶系列视频课程

基于新的Vue.js 2.3版本, 目前新全的Vue.js教学视频,让你少走弯路,直达技术前沿! 1. 包含Vue.js全家桶(vue.js、vue-router、axios、vuex、vue-cli、webpack、ElementUI等) 2. 采用笔记+代码案例的形式讲解,通俗易懂






【为什么学爬虫?】 &nbsp; &nbsp; &nbsp; &nbsp;1、爬虫入手容易,但是深入较难,如何写出高效率的爬虫,如何写出灵活性高可扩展的爬虫都是一项技术活。另外在爬虫过程中,经常容易遇到被反爬虫,比如字体反爬、IP识别、验证码等,如何层层攻克难点拿到想要的数据,这门课程,你都能学到! &nbsp; &nbsp; &nbsp; &nbsp;2、如果是作为一个其他行业的开发者,比如app开发,web开发,学习爬虫能让你加强对技术的认知,能够开发出更加安全的软件和网站 【课程设计】 一个完整的爬虫程序,无论大小,总体来说可以分成三个步骤,分别是: 网络请求:模拟浏览器的行为从网上抓取数据。 数据解析:将请求下来的数据进行过滤,提取我们想要的数据。 数据存储:将提取到的数据存储到硬盘或者内存中。比如用mysql数据库或者redis等。 那么本课程也是按照这几个步骤循序渐进的进行讲解,带领学生完整的掌握每个步骤的技术。另外,因为爬虫的多样性,在爬取的过程中可能会发生被反爬、效率低下等。因此我们又增加了两个章节用来提高爬虫程序的灵活性,分别是: 爬虫进阶:包括IP代理,多线程爬虫,图形验证码识别、JS加密解密、动态网页爬虫、字体反爬识别等。 Scrapy和分布式爬虫:Scrapy框架、Scrapy-redis组件、分布式爬虫等。 通过爬虫进阶的知识点我们能应付大量的反爬网站,而Scrapy框架作为一个专业的爬虫框架,使用他可以快速提高我们编写爬虫程序的效率和速度。另外如果一台机器不能满足你的需求,我们可以用分布式爬虫让多台机器帮助你快速爬取数据。 &nbsp; 从基础爬虫到商业化应用爬虫,本套课程满足您的所有需求! 【课程服务】 专属付费社群+每周三讨论会+1v1答疑




时钟功能 还有闹钟功能,温湿度功能,整点报时功能 你值得拥有

学生成绩管理系统(PHP + MYSQL)

做的是数据库课程设计,使用的php + MySQL,本来是黄金搭配也就没啥说的,推荐使用wamp服务器,里面有详细的使用说明,带有界面的啊!呵呵 不行的话,可以给我留言!

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?



获取讲师答疑方式: 在付费视频第一节(触摸命令_ALL)片头有二维码及加群流程介绍 限时福利 原价99元,今日仅需39元!购课添加小助手(微信号:itxy41)按提示还可领取价值800元的编程大礼包! 讲师介绍: 苏奕嘉&nbsp;前阿里UC项目工程师 脚本开发平台官方认证满级(六级)开发者。 我将如何教会你通过【定制脚本】赚到你人生的第一桶金? 零基础程序定制脚本开发课程,是完全针对零脚本开发经验的小白而设计,课程内容共分为3大阶段: ①前期将带你掌握Q开发语言和界面交互开发能力; ②中期通过实战来制作有具体需求的定制脚本; ③后期将解锁脚本的更高阶玩法,打通任督二脉; ④应用定制脚本合法赚取额外收入的完整经验分享,带你通过程序定制脚本开发这项副业,赚取到你的第一桶金!


原价169,限时立减100元! 系统掌握Python核心语法16点,轻松应对工作中80%以上的Python使用场景! 69元=72讲+源码+社群答疑+讲师社群分享会&nbsp; 【哪些人适合学习这门课程?】 1)大学生,平时只学习了Python理论,并未接触Python实战问题; 2)对Python实用技能掌握薄弱的人,自动化、爬虫、数据分析能让你快速提高工作效率; 3)想学习新技术,如:人工智能、机器学习、深度学习等,这门课程是你的必修课程; 4)想修炼更好的编程内功,优秀的工程师肯定不能只会一门语言,Python语言功能强大、使用高效、简单易学。 【超实用技能】 从零开始 自动生成工作周报 职场升级 豆瓣电影数据爬取 实用案例 奥运冠军数据分析 自动化办公:通过Python自动化分析Excel数据并自动操作Word文档,最终获得一份基于Excel表格的数据分析报告。 豆瓣电影爬虫:通过Python自动爬取豆瓣电影信息并将电影图片保存到本地。 奥运会数据分析实战 简介:通过Python分析120年间奥运会的数据,从不同角度入手分析,从而得出一些有趣的结论。 【超人气老师】 二两 中国人工智能协会高级会员 生成对抗神经网络研究者 《深入浅出生成对抗网络:原理剖析与TensorFlow实现》一书作者 阿里云大学云学院导师 前大型游戏公司后端工程师 【超丰富实用案例】 0)图片背景去除案例 1)自动生成工作周报案例 2)豆瓣电影数据爬取案例 3)奥运会数据分析案例 4)自动处理邮件案例 5)github信息爬取/更新提醒案例 6)B站百大UP信息爬取与分析案例 7)构建自己的论文网站案例


这门课程基于主流的java8平台,由浅入深的详细讲解了java SE的开发技术,可以使java方向的入门学员,快速扎实的掌握java开发技术!


&nbsp; &nbsp; &nbsp; &nbsp; 本课程为Python数据挖掘方向的入门课程,课程主要以真实数据为基础,详细介绍数据挖掘入门的流程和使用Python实现pandas与numpy在数据挖掘方向的运用,并深入学习如何运用scikit-learn调用常用的数据挖掘算法解决数据挖掘问题,为进一步深入学习数据挖掘打下扎实的基础。


本课程从初学者角度出发,提供了C#从入门到成为程序开发高手所需要掌握的各方面知识和技术。 【课程特点】 1 由浅入深,编排合理; 2 视频讲解,精彩详尽; 3 丰富实例,轻松易学; 4 每章总结配有难点解析文档。 15大章节,228课时,1756分钟与你一同进步!






想学好JAVA必须要报两万的培训班吗? Java大神勿入 如果你: 零基础想学JAVA却不知道从何入手 看了一堆书和视频却还是连JAVA的环境都搭建不起来 囊中羞涩面对两万起的JAVA培训班不忍直视 在职没有每天大块的时间专门学习JAVA 那么恭喜你找到组织了,在这里有: 1. 一群志同道合立志学好JAVA的同学一起学习讨论JAVA 2. 灵活机动的学习时间完成特定学习任务+每日编程实战练习 3. 热心助人的助教和讲师及时帮你解决问题,不按时完成作业小心助教老师的家访哦 上一张图看看前辈的感悟: &nbsp; &nbsp; 大家一定迫不及待想知道什么是极简JAVA学习营了吧,下面就来给大家说道说道: 什么是极简JAVA学习营? 1. 针对Java小白或者初级Java学习者; 2. 利用9天时间,每天1个小时时间; 3.通过 每日作业 / 组队PK / 助教答疑 / 实战编程 / 项目答辩 / 社群讨论 / 趣味知识抢答等方式让学员爱上学习编程 , 最终实现能独立开发一个基于控制台的‘库存管理系统’ 的学习模式 极简JAVA学习营是怎么学习的? &nbsp; 如何报名? 只要购买了极简JAVA一:JAVA入门就算报名成功! &nbsp;本期为第四期极简JAVA学习营,我们来看看往期学员的学习状态: 作业看这里~ &nbsp; 助教的作业报告是不是很专业 不交作业打屁屁 助教答疑是不是很用心 &nbsp; 有奖抢答大家玩的很嗨啊 &nbsp; &nbsp; 项目答辩终于开始啦 &nbsp; 优秀者的获奖感言 &nbsp; 这是答辩项目的效果 &nbsp; &nbsp; 这么细致的服务,这么好的氛围,这样的学习效果,需要多少钱呢? 不要1999,不要199,不要99,只要9.9 是的你没听错,只要9.9以上所有就都属于你了 如果你: 1、&nbsp;想学JAVA没有基础 2、&nbsp;想学JAVA没有整块的时间 3、&nbsp;想学JAVA没有足够的预算 还等什么?赶紧报名吧,抓紧抢位,本期只招300人,错过只有等时间待定的下一期了 &nbsp; 报名请加小助手微信:eduxy-1 &nbsp; &nbsp;


董付国系列教材《Python程序设计基础》、《Python程序设计(第2版)》、《Python可以这样学》配套视频,讲解Python 3.5.x和3.6.x语法、内置对象用法、选择与循环以及函数设计与使用、lambda表达式用法、字符串与正则表达式应用、面向对象编程、文本文件与二进制文件操作、目录操作与系统运维、异常处理结构。


文章目录Java概述何为编程什么是Javajdk1.5之后的三大版本JVM、JRE和JDK的关系什么是跨平台性?原理是什么Java语言有哪些特点什么是字节码?采用字节码的最大好处是什么什么是Java程序的主类?应用程序和小程序的主类有何不同?Java应用程序与小程序之间有那些差别?Java和C++的区别Oracle JDK 和 OpenJDK 的对比基础语法数据类型Java有哪些数据类型switc...


机器学习实战系列套餐以实战为出发点,帮助同学们快速掌握机器学习领域必备经典算法原理并结合Python工具包进行实战应用。建议学习顺序:1.Python必备工具包:掌握实战工具 2.机器学习算法与实战应用:数学原理与应用方法都是必备技能 3.数据挖掘实战:通过真实数据集进行项目实战。按照下列课程顺序学习即可! 课程风格通俗易懂,用最接地气的方式带领大家轻松进军机器学习!提供所有课程代码,PPT与实战数据,有任何问题欢迎随时与我讨论。


发现网上很多Java面试题都没有答案,所以花了很长时间搜集整理出来了这套Java面试题大全,希望对大家有帮助哈~ 本套Java面试题大全,全的不能再全,哈哈~ 一、Java 基础 1. JDK 和 JRE 有什么区别? JDK:Java Development Kit 的简称,java 开发工具包,提供了 java 的开发环境和运行环境。 JRE:Java Runtime Environ...


已经连续五年参加大厂校招、社招的技术面试工作,简历看的不下于万份 这篇文章会用实例告诉你,什么是差的程序员简历! 疫情快要结束了,各个公司也都开始春招了,作为即将红遍大江南北的新晋UP主,那当然要为小伙伴们做点事(手动狗头)。 就在公众号里公开征简历,义务帮大家看,并一一点评。《启舰:春招在即,义务帮大家看看简历吧》 一石激起千层浪,三天收到两百多封简历。 花光了两个星期的所有空闲时...


深度学习系列课程从深度学习基础知识点开始讲解一步步进入神经网络的世界再到卷积和递归神经网络,详解各大经典网络架构。实战部分选择当下最火爆深度学习框架PyTorch与Tensorflow/Keras,全程实战演示框架核心使用与建模方法。项目实战部分选择计算机视觉与自然语言处理领域经典项目,从零开始详解算法原理,debug模式逐行代码解读。适合准备就业和转行的同学们加入学习! 建议按照下列课程顺序来进行学习 (1)掌握深度学习必备经典网络架构 (2)深度框架实战方法 (3)计算机视觉与自然语言处理项目实战。(按照课程排列顺序即可)


本课程为HoloLens2开发入门教程,讲解部署开发环境,安装VS2019,Unity版本,Windows SDK,创建Unity项目,讲解如何使用MRTK,编辑器模拟手势交互,打包VS工程并编译部署应用到HoloLens上等。


本文的面试题如下: Redis 持久化机制 缓存雪崩、缓存穿透、缓存预热、缓存更新、缓存降级等问题 热点数据和冷数据是什么 Memcache与Redis的区别都有哪些? 单线程的redis为什么这么快 redis的数据类型,以及每种数据类型的使用场景,Redis 内部结构 redis的过期策略以及内存淘汰机制【~】 Redis 为什么是单线程的,优点 如何解决redis的并发竞争key问题 Red...



【数据结构与算法综合实验】欢乐连连看(C++ & MFC)案例

这是武汉理工大学计算机学院数据结构与算法综合实验课程的第三次项目:欢乐连连看(C++ & MFC)迭代开发代码。运行环境:VS2017。已经实现功能:开始游戏、消子、判断胜负、提示、重排、计时、帮助。


YOLOv3是一种基于深度学习的端到端实时目标检测方法,以速度快见长。本课程将手把手地教大家使用labelImg标注和使用YOLOv3训练自己的数据集。课程分为三个小项目:足球目标检测(单目标检测)、梅西目标检测(单目标检测)、足球和梅西同时目标检测(两目标检测)。 本课程的YOLOv3使用Darknet,在Ubuntu系统上做项目演示。包括:安装Darknet、给自己的数据集打标签、整理自己的数据集、修改配置文件、训练自己的数据集、测试训练出的网络模型、性能统计(mAP计算和画出PR曲线)和先验框聚类。 Darknet是使用C语言实现的轻型开源深度学习框架,依赖少,可移植性好,值得深入探究。 除本课程《YOLOv3目标检测实战:训练自己的数据集》外,本人推出了有关YOLOv3目标检测的系列课程,请持续关注该系列的其它课程视频,包括: 《YOLOv3目标检测实战:交通标志识别》 《YOLOv3目标检测:原理与源码解析》 《YOLOv3目标检测:网络模型改进方法》 敬请关注并选择学习!




学生成绩管理系统,分三个模块:学生,教师和管理员。 管理员模块:负责学生、老师信息的增删改;发布课程信息的增删改,以便让学生选课;审核老师提交的学生成绩并且打印成绩存档;按照课号查询每个课号的学生成绩


分享思维,改变世界. web网页制作,期末大作业. 所用技术:html css javascript 分享所学所得

相关热词 c#跨线程停止timer c#批量写入sql数据库 c# 自动安装浏览器 c#语言基础考试题 c# 偏移量打印是什么 c# 绘制曲线图 c#框体中的退出函数 c# 按钮透明背景 c# idl 混编出错 c#在位置0处没有任何行