CodingDir.com RSSCodingDir.com RSS http://codingdir.com/rss/35230731How to disable registered OpenCL platforms on Windows?http://codingdir.com/questions/35230731/How-to-disable-registered-OpenCL-platforms-on-Windows-As you mention, the OpenCL ICD loader gets the list of available OpenCL platforms from the Windows registry. To prevent an OpenCL platform from appearing to any OpenCL application running on your system, you just need to remove the corresponding value from one or both of these registry keys: For 32-bit machines or 64-bit apps on a 64-bit machine: HKEY_LOCAL_MACHINESOFTWAREKhronosOpenCLVendors For 32-bit apps on a 64-bit machine: HKEY_LOCAL_MACHINESOFTWAREWow6432NodeKhronosOpenCLVendors The name of the registry value will be the full path to the .dll providing the OpenCL runtime implementation. This is a fairly heavy-handed approach to solving the problem, in my opinion. Most OpenCL applications provide the user with a means to manually select/override the desired OpenCL platform (e.g. 35230730Is Observable broken in Angular 2 Beta 3?http://codingdir.com/questions/35230730/Is-Observable-broken-in-Angular-2-Beta-3-Yes. There is small change in the module of map operator, Here is commit link Before while importing rxjs operators, below is used rxjs/add/operators/map now its changed to rxjs/add/operator/map Angular2 beta 2.0.3 Changelog.md35230729Cross-thread operation not valid when using Invokehttp://codingdir.com/questions/35230729/Cross-thread-operation-not-valid-when-using-InvokeIf the value of the receivedMessage variable changes before the invoked Action executes, the new value of that variable will be used - if it's functioning in the same way as your messageTb.Text example, the value is cleared immediately, and the invoked Action will only see the post-Clear blank value. Try copying the usersName.Text + ": " + receivedMessage string into a single-use variable and referencing that in your Invoke, e.g. string newMessage = usersName.Text + ": " + receivedMessage; Invoke(new Action(() => messageBox.Items.Add(newMessage))); 35230726How to pass an IEnumerable or queryable list of properties from Controller to Viewhttp://codingdir.com/questions/35230726/How-to-pass-an-IEnumerable-or-queryable-list-of-properties-from-Controller-to-ViewI JUST FOUND A SOLUTION TO MY PROBLEM :'D DAYUMN, this issue was buggin me O.Ô Just in case some future noob will have the same problem I had: in my Controller I have this: Dim categoryList As New List(Of IEnumerable) For Each DistinctCategory In (From prod In database.tblProducts Select prod.prodcategor< Distinct) categoryList .Add(DistinctCategor) Next ViewBag.allCategoriesList = categoryList While in my View I have: <% For Each cat In ViewBag.allCategoriesList %> <a href="/Index/?category=<%= cat%>"> <%=cat%></a> <%Next%> Now I can select this Link from my View to pass back the filter for category and only select the products that are in this particular category. I just co35230723Finding numbers after a certain keyword using Pythonhttp://codingdir.com/questions/35230723/Finding-numbers-after-a-certain-keyword-using-PythonYou can use findall() with a positive look behind: >>> import re >>> >>> s = ">>1244" >>> re.findall(r"(?<=>>)d+", s) ['1244'] >>> >>> s = ">>1244 something >>500" >>> re.findall(r"(?<=>>)d+", s) ['1244', '500'] Here the (?<=>>)d+ expression would match one or more digits (d+) that go after the >>.35230722Pocketsphinx recognizes random phrases in a silencehttp://codingdir.com/questions/35230722/Pocketsphinx-recognizes-random-phrases-in-a-silenceYou need to use keyword spotting mode. Pocketsphinx supports keyword spotting mode where you can specify the keyword list to look for. The advantage of this mode is that you can specify a threshold for each keyword so that keyword can be detected in continuous speech. All other modes will try to detect the words from grammar even if you used words which are not in grammar. The keyword list looks like this: oh mighty computer /1e-40/ hello world /1e-30/ other phrase /1e-20/ To run pocketsphinx with keyword list use: pocketsphinx_continuous -inmic yes -dict dict.dict -hmm /home/pi/zero_ru.cd_cont_4000 -kws keyword.list Threshold must be specified for every keyphrase. For shorter keyphrase you can use smaller thresholds like 1e-1, for longer threshold must be bigger. Threshold must be 35230710Passing non-thread-safe objects through thread-safe containershttp://codingdir.com/questions/35230710/Passing-non-thread-safe-objects-through-thread-safe-containers The queue ensures thread safety by creating a lock_guard<...> on queue operations. Wouldn't memory consistency of the object being moved between threads be guaranteed since the memory fencing and synchronization would be taken care by the lock_guard? Yes. Part of me wants to ensure I am only passing thread-safe objects between threads, but I feel like this case there should be no problem. Is this true? Yes. This is essentially why volatile is inapplicable as a device for concurrent data access in C++; it doesn't solve race conditions and, once you've brought concurrency devices (e.g. mutexes) into the fray to fix that, those are also taking care of the memory consistency issue so there's simply nothing left for volatile to do.35230708React scroll navhttp://codingdir.com/questions/35230708/React-scroll-navfound this: https://www.npmjs.com/package/react-scroll-nav code in this library helped me to implement what I want quite easily.35230704BizTalk WCF-BasicHttp Adapter does not allow Empty string for Service Certificate Propshttp://codingdir.com/questions/35230704/BizTalk-WCF-BasicHttp-Adapter-does-not-allow-Empty-string-for-Service-Certificate-PropsThat's because when you select Transport type security with certificate you are telling it to use certificates to both authenticate yourself and the server you are connecting too. You should be able to obtain the certificate you need for the Service Certificate just by browsing to the web service and then using the browser to copy the certificate to a file and then installing it into the Other People store in the Local Machine location and putting the Thumbprint into the ServiceCertificate setting. If that does not work, as the owners of the service to send you the public cert. In fact to use the service with client certificate authentication, you will most likely have to send your public certificate to the owner of the web service. If the service does not have a SSL/TSL certificate th35230698Why property ''cause" of Exception is repeating forever?http://codingdir.com/questions/35230698/Why-property-cause-of-Exception-is-repeating-forever-Do you have access to source where this Exception was created? Looks like the HttpClientErrorException object was created and then its cause field was modified to be the same object, perhaps using initCause. 35230695Optimal image size for icon in Watch app table rowhttp://codingdir.com/questions/35230695/Optimal-image-size-for-icon-in-Watch-app-table-rowWhile the default row is 40 points high, an image could generally be as large as 36 points (for 42mm or 34 points for 38mm), assuming default interface group and image settings, to avoid scaling the image. Answer to original question: There's no optimal point size for a WKInterfaceTable row image. It's more of a UX issue, since the size of an image is based on how prominent you want it to be versus any adjacent text. If you compare these two examples, the Apple Music watch app uses a 24 point image, while the WatchKit Catalog sample code uses a 35 point location marker image. It's easier to focus on the Music text, since the font size is larger, and the image is not significantly larger than the text. It's more difficult to concentrate on the WKCatalog text, because of the tendency f35230690Can't get Spark to work on IPython Notebook in Windowshttp://codingdir.com/questions/35230690/Can-t-get-Spark-to-work-on-IPython-Notebook-in-WindowsTry escaping the backslashes. file = sc.textFile("E:\scripts.sql") Edited to add a second item to look at: Also, I notice you called: words = sc.count() Try this instead, which worked on my Windows 10 install: file = sc.textFile("E:/scripts.sql") words = file.count() 35230687How fill dropdownlist by selection on another dropdownlist item in mvchttp://codingdir.com/questions/35230687/How-fill-dropdownlist-by-selection-on-another-dropdownlist-item-in-mvcI assume that you are using Entity Framework Code First, Here are some POCO classes that may help you build your data layer. public class Category { private ICollection<Brand> brands; public Category() { this.brands = new HashSet<Brand>(); } public int Id { get; set; } public string Name { get; set; } public virtual ICollection<Brand> Brands { get { return this.brands; } set { this.brands = value; } } } public class Brand { private ICollection<Category> categories; private ICollection<Product> products; public Brand() { this.categories = new HashSet<Category>(); this.products = new HashSet<Product>(); } public int Id { get; set; } publi35230685The best way to apply a git patch via Ansiblehttp://codingdir.com/questions/35230685/The-best-way-to-apply-a-git-patch-via-Ansible Use the Ansible script module. Write a shell script that attempts to patch a git repository with a local patch. Handle the various possibilities like : being invoked during a cookbook re-run. the latest upstream source already containing the identical change as the local patch. the local patch no longer being applicable on the latest upstream source. A sample shell script template for the above : # sync the local copy with latest changes from the upstream git repository. # TODO : Check here for return code of "git am" for failure. # # If <filename.patch> already applied, then : # - This is probably a cookbook re-run, # or # - The latest upstream source now comes with the patch applied. # Display/Log an info message about this and skip to the end of the35230681Why am I allowed to create multiple instances of Singleton, even though its constructor is private?http://codingdir.com/questions/35230681/Why-am-I-allowed-to-create-multiple-instances-of-Singleton-even-though-its-constructor-is-private-Playground can access the private constructor because Swift lets you access anything that is private as long as your code is in the same file with the private code. Since everything typed directly into the playground editor's window is considered a single file, you can access anything from everywhere. Once you put the code outside Playground, though, the constructor's visibility would be enforced, preventing your code from creating instances of GameManager as intended.35230680Control SplitView borders in QMLhttp://codingdir.com/questions/35230680/Control-SplitView-borders-in-QMLTry to set the visible attribute of your rectangle to false (instead of changing width to 0) In the example you can change the visible left 'border' of the splitview (the border is not a border, it's the splitview slider between the first and the second element): ApplicationWindow { title: qsTr("Hello World") width: 640 height: 480 visible: true SplitView { anchors.fill: parent Rectangle { id: rec width: 0 height: parent.height visible: false } Rectangle { width: 200 color:"red" height: parent.height } Button { text: "change left border of splitview" onClicked: { rec.visible = !rec.visible; 35230674How to keep past value after error in html?http://codingdir.com/questions/35230674/How-to-keep-past-value-after-error-in-html-Just fixed it! Simply by putting {{request.form.msg}} in between , like this: <textarea type="text" rows="3" class="form-control" name="message" id="msg" required>{{request.form.msg}}</textarea> 35230664Getting error message on while AJAX-get on localhost with node.jshttp://codingdir.com/questions/35230664/Getting-error-message-on-while-AJAX-get-on-localhost-with-node-jsCross domain often fails the ajax call because of violation of same origin policy. Therefore, you need to modify your code and remove crossDomain : true,. Also, add a timeout:5000, or write async: false, for safe side. It will work then.35230661PayPal IPN settingshttp://codingdir.com/questions/35230661/PayPal-IPN-settingsIt doesn't seem like you can create multiple IPN's for a single PayPal account. You may have to consider using the REST API to create webhooks (you can have up to 10 different webhooks).35230660LaTeX not rendering in webpagehttp://codingdir.com/questions/35230660/LaTeX-not-rendering-in-webpageThe page doesn't recognizes LaTeX. To make it recognize, add the following CDN MathJax script: <script type="text/x-mathjax-config"> MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\(','\)']]}}); </script> <script type="text/javascript" async src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_CHTML"> </script> Also, add $ before any LaTeX statement in the page.35230644Use the first occurred implementation when linking C programshttp://codingdir.com/questions/35230644/Use-the-first-occurred-implementation-when-linking-C-programsDepending on linker argument order to select which function to use is in general a bad idea. However, your requirements can be implemented using weak symbols. To make a function "weak", i.e. overridable by another implementation, mark it with GCC __attribute__((weak)), for example: int op(void) __attribute__((weak)); int op(void){ return 2; } If you declare both implementations as "weak" in this way, the one that comes first is going to be preferred. If you mark just one as weak, the other one will be strictly preferred regardless of the linking order. I would suggest to go this way to increase the maintainability of the code.35230640How to get user info into in visualforce / salesforcehttp://codingdir.com/questions/35230640/How-to-get-user-info-into-in-visualforce-salesforceYou are looking for the built-in "User" object. https://developer.salesforce.com/docs/atlas.en-us.200.0.pages.meta/pages/pages_variables_global_user.htm UserFirtname={!$User.FirstName} UserLastname={!$User.LastName} user-email ={!$User.Email} 35230638Laravel Blade create Button with childhttp://codingdir.com/questions/35230638/Laravel-Blade-create-Button-with-childYou can do it like this: {!! Form::button('<i class="fa fa-plus"></i> Benutzer hinzufügen', array('class' => 'btn btn-block btn-primary', 'type' => 'submit')) !!} It will work for what you want!35230637SVG as image view in different locationhttp://codingdir.com/questions/35230637/SVG-as-image-view-in-different-locationYou should be able to make this work using the AndroidSVG library. The SVGImageView class has a method setImageURI, so you could do something like this: String path = Environment.getExternalStorageDirectory().toString() + "/JunieFolder/junie_screenShot" + now + ".svg"; File file = new File(path); Uri uri = Uri.fromFile(file); svgImageView.setImageURI(uri); You can also use the setImageAsset and setImageResource methods to load the SVGs from the assets or the resources.35230636Insert embedded document in mongodb via angularjshttp://codingdir.com/questions/35230636/Insert-embedded-document-in-mongodb-via-angularjserror 404 its about not existe the resource in this case URL's to make a post, try with this route: router.post('/offer/:id',expositionController.createOffer); also may you can try define a rout with get, only to view the response and access resource via GET/browser paste url: router.get('/offer/:id',expositionController.createOffer); you only received attributes via GET for example if you create this route: router.get('/offer/:id',expositionController.createOffer); you invoque: paste this url in your browser http://localhost:3000/exposition/offer/0001 and you can log the id to expected: exports.createOffer = function(req,res){ console.log(req.params.id) var id = req.params.id; try{ id = new ObjectId(id); Exposition.findById(id,function(err,exposition){ if(35230635Type hinting in Python 2?http://codingdir.com/questions/35230635/Type-hinting-in-Python-2-According to PEP484 which defined type hinting, there is an alternative synthax for compatibility with python 2.7. It is however not mandatory so I don't know how well supported it is, but quoting the PEP: Some tools may want to support type annotations in code that must be compatible with Python 2.7. For this purpose this PEP has a suggested (but not mandatory) extension where function annotations are placed in a # type: comment. Such a comment must be placed immediately following the function header (before the docstring). An example: the following Python 3 code: def embezzle(self, account: str, funds: int = 1000000, *fake_receipts: str) -> None: """Embezzle funds from account using fake receipts.""" <code goes here> is equivalent to the following: def emb35230633Exclude children of the first span tag inside divhttp://codingdir.com/questions/35230633/Exclude-children-of-the-first-span-tag-inside-divMight as well include jQuery to make your life easier when selecting elements. One solution for this: var casper = require('casper').create({ logLevel:"verbose", debug:true, clientScripts: ['jquery.js'] }); var jsonObj = {}; var links; var name; var paragraph; var contact; var description; var location; var expression = /[-a-zA-Z0-9@:%_+.~#?&//=]{2,256}.[a-z]{2,4}(/[-a-zA-Z0-9@:%_+.~#?&//=]*)?/gi; var regex = new RegExp(expression); casper.start('http://www.houzz.com/professionals/c/Nashville,-TN'); casper.then(function getLinks(){ links = this.evaluate(function(){ var links = document.getElementsByClassName('pro-title'); links = Array.prototype.map.call(links,function(link){ return link.getAttribute('href'); }); return links; }); }); caspe35230632Is there any way to "hide" a View to Screen Readers, like "aria-hidden" do in HTML?http://codingdir.com/questions/35230632/Is-there-any-way-to-hide-a-View-to-Screen-Readers-like-aria-hidden-do-in-HTML-Try view.setVisibility(HIDDEN);35230631How to use regex with not ^ and capture groups?http://codingdir.com/questions/35230631/How-to-use-regex-with-not-and-capture-groups-Regex only has negative lookaheads and lookbehinds. Their spirit is: you only look, you don't move forward. This is a negative lookahead: (?!nomatch) And this is a negative lookbehind: (?<!nomatch) You can incorporate these lookarounds into your regex like this: var notAPI = /^((?!api).)*$/; Take a look at this answer - it also explains how it works.35230627positioning a nav bar so it's fixedhttp://codingdir.com/questions/35230627/positioning-a-nav-bar-so-it-s-fixedBest to wrap everything you want to be static in a new div i.e. <body> <div id="fixed"> <div class="header"> <a class="logo" href="home.html"><img src="VL-Logo.png"></a> </div> <nav role="navigation"> <div class="Nav"> <a href="home.html">Home</a></li> <a href="portfolio.html">Portfolio</a></li> <a href="process.html">Process</a></li> <a href="#">Contact</a></li> </div> </nav> </div> css #fixed{position:fixed; top:0; width:100%; z-index:9999;/*High z-index so nothing can hide it*/ background:rgb(255,255,255); padding:5px 0; } *{margin:0;padding:0;} and change this div.Nav a{ background-color: #FFF; color: #000; font-size35230623How to loop an embeded YouTube video?http://codingdir.com/questions/35230623/How-to-loop-an-embeded-YouTube-video-You shoud add playlist=VIDEO_ID at your src <div class='embed-container'><iframe src="https://www.youtube.com/embed/Yo19ZhO7CAc?autoplay=1&loop=1&cc_load_policy=1rel=0&amp;controls=0&amp;showinfo=0&playlist=Yo19ZhO7CAc" frameborder="0" allowfullscreen></iframe></div> 35230616Disabling back ground of the popup using angularjs without using bootstraphttp://codingdir.com/questions/35230616/Disabling-back-ground-of-the-popup-using-angularjs-without-using-bootstrapI'd simplify a bit--you seem to have two mechanisms doing the same job (ng-if and ng-style). <div ng-app> <button ng-click="showModal=1">Show modal</button> <div id="popupBackGround" class="popupModal-backdrop" ng-if="showModal"></div> <div id="popupBackGroundDialog" class="popupModal-dialog" ng-show="showModal"> <div class="popupModal-content"> <div class="popupModal-body"> <p style="margin-left: 20px;">{{showModal}}</p> <p> <button ng-click="showModal=0">Hide modal</button> </p> </div> </div> </div> </div> Demo I did simplify your CSS, also. 35230615$state.go after a timeout or in $ionicPlatform.ready makes a boolean seem truthy and falsy at the same timehttp://codingdir.com/questions/35230615/-state-go-after-a-timeout-or-in-ionicPlatform-ready-makes-a-boolean-seem-truthy-and-falsy-at-the-same-timeTry using $ionicPlatform.ready(function() { doNormalStartup(); } instead of your code35230614Table cells too narrow on Firefoxhttp://codingdir.com/questions/35230614/Table-cells-too-narrow-on-FirefoxOf course right after I write up the question and pare down the code, I find the solution. For some reason it fixes Firefox to add min-width:4em along with width:4em on the third column. tr > *:nth-child(1) { } tr > *:nth-child(2) { width:30% } tr > *:nth-child(3) { width:4em; min-width:4em } https://jsfiddle.net/y4p93kmn/2/35230613MySQL get the nearest future date to given date, from the dates located in different table having Common IDhttp://codingdir.com/questions/35230613/MySQL-get-the-nearest-future-date-to-given-date-from-the-dates-located-in-different-table-having-Common-IDFor this query, I suggest applying your WHERE condition >= CURDATE() and then SELECT the MIN(dated) with GROUP BY client_id: SELECT b.client_id, MIN(b.dated) FROM banquet b WHERE b.dated >= CURDATE() GROUP BY b.client_id; From this, you can add the necessary JOIN to the client table to get the client name: SELECT b.client_id, c.name, MIN(b.dated) FROM banquet b INNER JOIN client c ON c.id = b.client_id WHERE b.dated >= CURDATE() GROUP BY b.client_id; SQLFiddle: http://sqlfiddle.com/#!9/aded8/18 EDITED TO REFLECT NEW PARTS OF QUESTION: Based on the new info you added - asking how to handle nulls and the 'meal' column, I've made some changes. This updated query handles possible null values (by adjusting the WHERE clause) in dated, and also includes meal information. SELECT 35230610Implementing another list dropdown upon extra selectionhttp://codingdir.com/questions/35230610/Implementing-another-list-dropdown-upon-extra-selectionActually you need to make multiselect drop down. If you add multiple = "multiple" HTML tag then drop down will be used as a multi select. <select name="anyName[]" multiple> <?php while ($row = mysql_fetch_array($result)){ echo "<option>$row[1]</option>"; } ?> </select> For more help you will need to look this link. jQuery multiselect drop down menu Hope It will help you. Thanks35230589How do you add text vertically underneath a headinghttp://codingdir.com/questions/35230589/How-do-you-add-text-vertically-underneath-a-headingMaybe you mean this: https://jsfiddle.net/v4awe9p8/ small { color: grey; font-size: 0.5em; } <h1> Title <small>Subtitle</small> </h1> Final version (see comments): https://jsfiddle.net/u34tcaja/35230578list friend from sqlhttp://codingdir.com/questions/35230578/list-friend-from-sqlSELECT user2 , user1 FROM friends; fetch all friends user1,user2 column and after that (user1 = '$log_username' OR user2 = '$log_username') condition get and fetch user match with atleast one column as well as last condition filter accept always 1 and friend is blocked 0. $sql="SELECT user2 , user1 FROM friends WHERE (user1 = '$log_username' OR user2 = '$log_username') AND (accepted ='1' AND IsBlocked='0') "; $query = mysqli_query($db_conx, $sql); 35230571C iterate list for objects without some fieldshttp://codingdir.com/questions/35230571/C-iterate-list-for-objects-without-some-fieldsIt looks like you're just trying to filter items out of a collection - what you're doing works fine, but it's (arguably) more idiomatically written as: foreach(var l in list.Where(x => x.Salary == 0)) { Console.WriteLine(" {0} {1}", l.Name, l.Age); } 35230567Operator '!' cannot be applied to operand of type longhttp://codingdir.com/questions/35230567/Operator-cannot-be-applied-to-operand-of-type-longComplete code, hopefully correct: public int Value { get { if ((_value < 32768)) { return _value; } else { return -32768 + (_value - 32768); } } set { _value = value; } } public bool B0 { get { if (((_value & 0x1) == 0x1)) { return true; } else { return false; } } set { if ((value == true)) { _value = _value | 0x1; } else { _value = _value & (~0x1); } } 35230566Nuget Telnet v0.6.0 Does not support Framework DNXCore, Ver5.0http://codingdir.com/questions/35230566/Nuget-Telnet-v0-6-0-Does-not-support-Framework-DNXCore-Ver5-0http://odetocode.com/blogs/scott/archive/2015/10/13/dnx-framework-choices-and-asp-net-5.aspx The post above really helped me understand this. I had to remove the dependency on DNXCore. I deleted it from the project.json35230557Remove spam from loop command in batch filehttp://codingdir.com/questions/35230557/Remove-spam-from-loop-command-in-batch-fileto elaborate on Stephan's response. Put another label below the text you want to omit, then change your goto to point to that. For example, see the :scannolabel changes below :scan echo "Running scan again..." :scannolabel for /F %%I in ('%SystemRoot%System32schtasks.exe /query /s SERVER /fo list /tn "TASK" ^| %SystemRoot%System32find.exe /c "Running"') do if "%%I" == "3" goto :scannolabel 35230548Service not defining when injecting it for Karma testing - AngularJShttp://codingdir.com/questions/35230548/Service-not-defining-when-injecting-it-for-Karma-testing-AngularJSWhen you instantiate the module in your test, you don't need the function declaration. So instead of beforeEach(function() { module('cst-error-framework'); angular.mock.module('templates'); }); try beforeEach(module('cst-error-framework'); beforeEach(angular.mock.module('templates'); 35230541Can ngClass use ternary operator in Angular 2?http://codingdir.com/questions/35230541/Can-ngClass-use-ternary-operator-in-Angular-2-<div [ngClass]="{'css-class-1':varA === varB, 'css-class-2': varA !== varB}"> See also https://angular.io/docs/ts/latest/api/common/NgClass-directive.html35230533How to upload an image in php mysqlhttp://codingdir.com/questions/35230533/How-to-upload-an-image-in-php-mysql<?php $connection = mysql_connect("localhost", "root", "") or die(mysql_error()); $db = mysql_select_db("accountant", $connection); $title=$_POST['blog_title']; $description=$_POST['blog_description']; $name=$_FILES["image"]["name"]; $type=$_FILES["image"]["type"]; $size=$_FILES["image"]["size"]; $temp=$_FILES["image"]["tmp_name"]; $error=$_FILES["image"]["error"]; if($error>0) die("error while uploading"); else { if($type == "image/png" || $type == "image/jpeg" ||$type == "image/jpg" || $type == "image/svg" || $size >2000000) { move_uploaded_file($temp,"upload/".$name); $sql=mysql_query("INSERT INTO blogs(image,blog_title,blog_description)values('$name','$title','$description')" ); echo "upload complete"; } else { die("Format not allowed or file size too big!"); } } 35230529Low Impact End-to-End Database Connection Query Testhttp://codingdir.com/questions/35230529/Low-Impact-End-to-End-Database-Connection-Query-TestYou are better off checking for VALID objects under the user you are connecting as. select count(*) from user_objects where status != 'VALID'; or if you are looking for all valid objects in DB, then: select count(*) from obj$ where status != 'VALID'; Just make sure the query is not run too often - like 50 times a minute. An even better approach would to be just be optimistic and attempt the operation - select/update/insert/delete that you want to do against the DB. Invalid objects cause errors(which you will need to handle in your code anyway), so focus on having robust error handling in your application and don't worry about making a connection just to see if is all is OK in the DB. Your test to check DB object status may pass, but the very next instant, the DB object can go inva35230528Display results on keyup event and values inside form how to?http://codingdir.com/questions/35230528/Display-results-on-keyup-event-and-values-inside-form-how-to-Use keyup event for input and you are using same id result for an input and h3. I've changed the id of h3 to result2. $('input').on('keyup input', function () { var actualprice = Number($("#actualprice").val().trim()); var discount = Number($("#discount").val().trim()); var shipping = Number($("#shipping").val().trim()); var discountRate = (100 - discount) / 100; var result = (actualprice * discountRate) + shipping; $("#result").val("Result :" + result.toFixed(2)); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <form id="myForm"> <input id="actualprice" type="number" placeholder="Actual Price"> <input id="discount" type="number" placeholder="Discount"> <input id="shipping" type="n35230525Loading text into a list boxhttp://codingdir.com/questions/35230525/Loading-text-into-a-list-boxOK. This code to be brutally honest isn't good. These lines Dim FullName As String Dim PhoneNumber As Decimal Dim AccNumber As Decimal Dim MinutesAllowed As Integer Dim TextsAllowed As Integer Dim DataAllowed As Integer Dim MinutesUsed As Integer Dim TextsUsed As Integer Dim DataUsed As Integer Dim MonthlyCost As Double Dim TotalCost As Double are declaring variables of specific types - strings,decimals and integers and so on. That means they can only accept values that are the same type. Having Option Strict On in your code will help you correct these errors as it will show errors you have with your code. These lines should be: FullName = "" PhoneNumber = 0D AccNumber = 0D MinutesAllowed = 0 TextsAllowed = 0 DataAllowed = 0 MinutesUsed = 0 TextsUsed = 0 DataUsed = 0 MonthlyCost = 0R 35230524Seaborn FacetGrid barplots and huehttp://codingdir.com/questions/35230524/Seaborn-FacetGrid-barplots-and-hueBecause interval is nested within the x variable (segment), you need to tell barplot about all of the possible levels of the x variable, so that they are not drawn on top of each other: times = df.interval.unique() g = sns.FacetGrid(df, row="variable", hue="segment", palette="Set3", size=4, aspect=2) g.map(sns.barplot, 'interval', 'value', order=times) 35230522UWP navigation causing Access Viloationhttp://codingdir.com/questions/35230522/UWP-navigation-causing-Access-ViloationYou might need to use a dispatcher to execute the code on the correct thread. //Initiate and set this at the startup of your app, on the UI thread. dispatcher = Windows.UI.Core.CoreWindow.GetForCurrentThread().Dispatcher; Then use the dispatcher to run the code: private async void Button1_Click(object sender, RoutedEventArgs e) { await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => this.Frame.Navigate(typeof(TestPage)); } 35230518Meteor displaying base64 image in HTMLhttp://codingdir.com/questions/35230518/Meteor-displaying-base64-image-in-HTMLActually, I found the answer. The mistake was in the regular expression: posts:function(){ var posts = Posts.find({}); var postsArray = []; posts.forEach(function(entry){ var regex = /<img.*?src='(.*?)'/; var object = new Object(); object.title = entry.title; object.image = entry.content.match(/<img src="(.*?)"/)[1]; console.log(object); postsArray.push(object); }) return postsArray; },// returns posts 35230507The right way to kill a process in Javahttp://codingdir.com/questions/35230507/The-right-way-to-kill-a-process-in-JavaIf the process you want to kill has been started by your application Then you probably have a reference to it (ProcessBuilder.start() or Runtime.exec() both return a reference). In this case, you can simply call p.destroy(). I think this is the cleanest way (but be careful: sub-processes started by p may stay alive, check http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4770092 for more info). The destroyForcibly should only be used if destroy() failed after a certain timeout. In a nutshell terminate process with destory() allow process to exit gracefully with reasonable timeout kill it with destroyForcibly() if process is still alive If the process you want to kill is external Then you don't have much choices: you need to pass through the OS API (Runtime.exec). On Windows, t35230506multiple figures in matplotlibhttp://codingdir.com/questions/35230506/multiple-figures-in-matplotlibI strongly suggest using the OO interface as much as possible (instead of the pyplot 'state machine' API). What you want is something like: fig1, ax1 = plt.subplots() fig2, ax2 = plt.subplots() ax1.plot(x, y, 'ro') ax2.plot(x, y, 'go') Running these commands an ipython session (after doing %matplotlib) will give you two interactive figures to play with.35230495phpbrew not connecting to mysqlhttp://codingdir.com/questions/35230495/phpbrew-not-connecting-to-mysqlI figured it out. It turns out that the mysql host variable in my php scripts was set to "localhost". Explicitly setting it to "127.0.0.1" did the trick. Not sure why localhost wasn't resolving but whatevs. IT WORKS! XD35230490Trying to retain a user selection from a drop down menu across multiple pageshttp://codingdir.com/questions/35230490/Trying-to-retain-a-user-selection-from-a-drop-down-menu-across-multiple-pagesI would take a closer look at the localStorage api. There is an event fired whenever a new item is added to storage: https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API/Using_the_Web_Storage_API That being said, state management in the browser across multiple clients in offline/online modes with on-the-fly updates is not a trivial "here let me just whip up a script" problem. A complete solution might include websockets for server communication and a database or in-memory cache acting as the state manager for the clients.35230489Use different database for the npm test phasehttp://codingdir.com/questions/35230489/Use-different-database-for-the-npm-test-phaseWell, Its seems the magic lies inside supertest. replace: var server = supertest.agent(config.baseUrl); with: var app = require('../server'); var server = supertest.agent(app); 35230488Thrift syntax errorhttp://codingdir.com/questions/35230488/Thrift-syntax-errorYou need to add some data types. exception LedUnavailableException { 1: string message; 2: string cause; } Additionally, (at least) newer versions will tell you that ... [FAILURE:test.thrift:22] Oneway methods can't throw exceptions. 35230483Swift ViewController without prepareForSeguehttp://codingdir.com/questions/35230483/Swift-ViewController-without-prepareForSegueYou can instanciate the Viewcontroller through the Storyboard, //instanciate storyboard let mainStoryBoard = UIStoryboard(name:"StoryboardName", bundle:nil) let myViewcontroller = mainStoryBoard.instanciateViewControllerWithIdentifier("viewcontrolleridentifier") as? ViewController1 You can set the identifier in Interface builder35230482How to keep rule head as null using Protege swrl tabhttp://codingdir.com/questions/35230482/How-to-keep-rule-head-as-null-using-Protege-swrl-tabThe rule body can be empty, but it does not imply a contradiction, as in your intentions; it is interpreted as the rule not applying. The specs are here. If I understand your intent correctly, what you are after can be achieved by creating two classes: define an exact cardinality restriction of 0 for hasSon and an exact cardinality restriction of 0 for hasDaughter, then assign these classes as range of hasDaughter and hasSon respectively. This way, stating that A hasSon B and A hasDaughter B will cause an inconsistency.35230480Accessing nested route parameter from parent route/templatehttp://codingdir.com/questions/35230480/Accessing-nested-route-parameter-from-parent-route-templateYou could get rid of that .set is not a function error by using global Ember.set. So, instead of: parentModel.coverageId = params.coverageId; Try: Ember.set(parentModel, 'coverageId', params.coverageId); 35230478Continuously populate twitter-bootstrap navigation menu as the width increases.http://codingdir.com/questions/35230478/Continuously-populate-twitter-bootstrap-navigation-menu-as-the-width-increases-Bootstrap has a 'hidden' class that will hide elements based on size, which would be suffixed on the end of the class. Bootstrap gives you these classes that trigger at certain breakpoints: hidden-xs, hidden-sm, hidden-md, hidden-lg. So in your scenario, you could do something like this: <ul> <li>Menu Item 1</li> <li>Menu Item 2</li> <li>Menu Item 3</li> <li>Menu Item 4</li> <li class="hidden-xs hidden-sm">Item 5</li> <li class="hidden-xs hidden-sm hidden-md">Item 6</li> <ul> Basically, these classes mean that element will be hidden until it falls into a breakpoint range outside of the ones the hidden classes cover, in this case, md and lg for the last 2 elements. Alternativel35230475Symbolic Link Host to Docker Containerhttp://codingdir.com/questions/35230475/Symbolic-Link-Host-to-Docker-ContainerIf you want to share data between the host and a container, or visa versa, you need to use a docker volume. There are many ways to do this, but for your situation the easiest is to mount a host directory as a data volume. This is done with the -v flag with docker. For example docker run -it -v /path/to/.m2:/root/.m2 ubuntu:latest /bin/bash will run the ubuntu:latest image with the host directory /path/to/.m2 'symlinked' to the container directory /root/.m2. Hope that helps.35230469Get human readable name of extension point contributorhttp://codingdir.com/questions/35230469/Get-human-readable-name-of-extension-point-contributorLets say element is IConfigurationElement ' then element.getContributor().getName()35230467How to $watch changes in array item but not the array itselfhttp://codingdir.com/questions/35230467/How-to-watch-changes-in-array-item-but-not-the-array-itselfYou can use a function to return the required value to watch: $scope.$watch(function(scope) { return scope.array && scope.array[0].foo; }, function(newValue, oldValue) { // any action here } ); if you need to observe more itens, you can to return another array with all foo's objects, for example.35230464How do I call a Javascript Function using JQuery?http://codingdir.com/questions/35230464/How-do-I-call-a-Javascript-Function-using-JQuery-live for event handling was removed in jQuery 1.9, you are using 1.11., Try using on instead. Chrome works fine. Here is a fiddle https://jsfiddle.net/atg5m6ym/359/ Also check that your keyup is returning the 13 you need. $(document).ready(function() { $('#search-box').on("keyup", function(event) { $('#submit').click(); }); }); If you input anything in the label on keyup you'll see the hello world. if(event.keyCode == '13') would be for the enter or return key35230462Serializer field filtering in Django Rest Framework?http://codingdir.com/questions/35230462/Serializer-field-filtering-in-Django-Rest-Framework-Try this: class BoxSerializer(serializers.ModelSerializer): # ... def __init__(self, *args, **kwargs): user = kwargs['context']['request'].user super(BoxSerializer, self).__init__(*args, **kwargs) self.fields['playlist'].queryset = Playlist.objects.filter(user=user) 35230457Pulling Data from File Generated From GoogleSheetshttp://codingdir.com/questions/35230457/Pulling-Data-from-File-Generated-From-GoogleSheetsYou shouldn't do this manually, there are libraries that lets you fetch information from google spreadsheets. Check out this for starters: https://developers.google.com/apps-script/guides/sheets35230456Query half of valuehttp://codingdir.com/questions/35230456/Query-half-of-valueYou can use substring to do this. SELECT * FROM `tabel` WHERE substring(`column`, 1, length(`column`)/2) like %'search_for_string'%; To handle even and odd lengths of the column, use SELECT * FROM `tabel` WHERE substring(`column`, 1, if(mod(length(`column`),2)=0, length(`column`)/2, 1+length(`column`)/2) like %'search_for_string'%; 35230453sonar jdbc properties are not supported anymore in sonarqube 5.3 versionhttp://codingdir.com/questions/35230453/sonar-jdbc-properties-are-not-supported-anymore-in-sonarqube-5-3-versionYou only need to configure the sonar.host.url. All communication between scanner and server is done with web services, and the scanner no longer talks to the database at all.35230452How can I improve this one to many active record data modelhttp://codingdir.com/questions/35230452/How-can-I-improve-this-one-to-many-active-record-data-modelI see you are indexing several columns already which is good. I would say one of the best ways you can ensure your queries are as efficient as possible is to make sure ALL of the conditions that deal with querying/retrieval in the db, have their corresponding columns indexed. 35230451POSTing RAW body with restify clienthttp://codingdir.com/questions/35230451/POSTing-RAW-body-with-restify-clientOne thing is that you would need to specify a content-type of multi-part/form-data. However, it looks like restify doesn't support that content type, so you're probably out of luck using the restify client to post a file.35230450Change video quality and bitrate of a videohttp://codingdir.com/questions/35230450/Change-video-quality-and-bitrate-of-a-videoThere is a project which compiled ffmpeg to javascript to allow videos be manipulated and converted in the browser: https://github.com/bgrins/videoconverter.js It was originally developed as part of a Node Hackathon, but its not clear whether it is still maintained (see the GitHub activity). Its worth nothing that it is probably more of an experimental project that a practical one, because of the very large file size.35230446Merging dataframes together in a for loophttp://codingdir.com/questions/35230446/Merging-dataframes-together-in-a-for-loopSince you've already made coins a list, why not just something like data2['merged'] = data2[coins[0]] for coin in coins[1:]: data2['merged'] = pd.merge(.... Unless I'm misunderstanding, this question isn't specific to dataframes, it's just about how to write a loop when the first element has to be treated differently to the rest.35230442viewController.title is nil after init of Google analyticshttp://codingdir.com/questions/35230442/viewController-title-is-nil-after-init-of-Google-analyticsInit on didFinishLaunchingWithOptions let gai = GAI.sharedInstance() let id = "UA-ID" gai.trackerWithTrackingId(id) gai.trackUncaughtExceptions = true gai.logger.logLevel = GAILogLevel.Warning gai.defaultTracker.allowIDFACollection = false Easy way to call google analytics via setScreenName on viewDidAppear. extension UIViewController { func setScreeName(name: String) { self.title = name self.sendScreenView() } func sendScreenView() { let tracker = GAI.sharedInstance().defaultTracker tracker.set(kGAIScreenName, value: self.title) let builder = GAIDictionaryBuilder.createScreenView() tracker.send(builder.build() as [NSObject : AnyObject]) } func trackEvent(category: String, action: String, label: String, value: NSNumb35230441Regex to replace non-numeric characters and insert dashes for phone number as it is typedhttp://codingdir.com/questions/35230441/Regex-to-replace-non-numeric-characters-and-insert-dashes-for-phone-number-as-it-is-typedAssuming you want the format "123-456-7890": function formatPhoneNumber(s) { var s2 = (""+s).replace(/D/g, ''); var m = s2.match(/^(d{3})(d{3})(d{4})$/); return (!m) ? null : m[1] + " -" + m[2] + "-" + m[3]; } 35230439Trying to open a form using DoCmd.OpenForm based on sub form controlhttp://codingdir.com/questions/35230439/Trying-to-open-a-form-using-DoCmd-OpenForm-based-on-sub-form-controlThis was not the answer I wanted but: I created a query that yields the ID number of frmDisclosure corresponding to Text0 on the unbound form. I then retreive that ID number using DLookup from within the unbound form and open frmDisclosure that way. It would have been nicer to do it all from within the unbound form.35230435Can I avoid Maven deployed war version with timestamp in Archiva?http://codingdir.com/questions/35230435/Can-I-avoid-Maven-deployed-war-version-with-timestamp-in-Archiva-Maven repositories wasn't designed to distribute deployable components, your continuous integration environment should take care of this. Jenkins has eg Archive Artifacts (native) and Copy Artifact Plugin which you can use to store and recover binaries in your pipelines. But you can workaround this behavior changing the version of the war to a stable one - removing the -SNAPSHOT suffix. This will lead you with a predictable URL.35230430Hue: oozie parametershttp://codingdir.com/questions/35230430/Hue-oozie-parametersWhat about setting Hive parameters with Oozie parameters... <param>hr=${bilouteHR}</param> <param>dt=${bilouteDT}</param> ...then setting values for these Oozie parameters at submission time? bilouteHR 00 bilouteDT 20160105 Hope that solves your issue, biloute.35230424using a while loop instead of for loophttp://codingdir.com/questions/35230424/using-a-while-loop-instead-of-for-loopYou can do this: secret_word = "python" correct_word = "yo" count = 0 while count < len(secret_word): print(secret_word[count] if secret_word[count] in correct_word else '_', end=" ") count += 1 35230423Avoid repetition of method name in actionshttp://codingdir.com/questions/35230423/Avoid-repetition-of-method-name-in-actionsYour code looks okay. If you really want to change something you could make foo method an action: Ember.Component.extend({ ... actions: { bar() { this.send('foo', this.get('val')); // .. other code }, foo(val) { this.set('baz', val); } } }); 35230421Multithread in ios plugin for Unityhttp://codingdir.com/questions/35230421/Multithread-in-ios-plugin-for-UnityIn Unity everything runs on one thread. Unity is not multithreaded in any way. (If you do launch a thread, you must "get back to" the main thread, to do anything in Unity, eg UI.) In your iOS level plugin, if you go to another thread that is "your problem". It won't go to another thread unless you specifically do that. And then, you must entirely look after it.35230418Selenium: Check i the testcase pass or failhttp://codingdir.com/questions/35230418/Selenium-Check-i-the-testcase-pass-or-failI think you meant was this. But there is work around for this. You need to add your code accordingly. if (TestContext.CurrentContext.Result.Outcome.Equals(ResultState.Failure)) { IntegrationTest.WriteInLog("FAILS"); } else if (TestContext.CurrentContext.Result.Outcome.Equals(ResultState.Success)) { IntegrationTest.WriteInLog("SUCESS"); } 35230417GeoJson "Not Well Formed" message in console, and appears undefinedhttp://codingdir.com/questions/35230417/GeoJson-Not-Well-Formed-message-in-console-and-appears-undefinedAvoid defining several functions and try just using this: $(document).ready(function(){ $.ajax("data/MegaCities.GeoJSON", { dataType: "json", success: function(response){ $("#mydiv").append('<br>GeoJSON data:<br>' + JSON.stringify(response)); } }); }); Note that after we get response/data from ajax call, we proceed formatting as JSON.35230414Use an if statement in Javascript to determine if a cell in a google spreadsheet has contentshttp://codingdir.com/questions/35230414/Use-an-if-statement-in-Javascript-to-determine-if-a-cell-in-a-google-spreadsheet-has-contentsYou could add some code in between these line: var arrayOfData = []; var weekBegining = sheet.getRange(4, 11).getValue(); Change to: var arrayOfData = []; var B8_Value = sheet.getRange(8, 2).getValue(); if (B8_Value === "") {return;};//If cell value is empty stop code here var weekBegining = sheet.getRange(4, 11).getValue(); 35230413Django is not rendering second applications HTMLhttp://codingdir.com/questions/35230413/Django-is-not-rendering-second-applications-HTMLYou need to add "about" app in your settings.py file under the INSTALLED_APPS. Like this: INSTALLED_APPS = [ 'about.apps.AboutConfig', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'home.apps.HomeConfig', 'about', ] 35230393Close Modal using CSS onlyhttp://codingdir.com/questions/35230393/Close-Modal-using-CSS-onlyBased on your js code, you are injecting modal elements into the dom document.getElementById("alert").innerHTML = 'modal stuff' if you want to get rid of it, the most simplest way, use an empty string like this: document.getElementById("alert").innerHTML = '' CSS way would be something like display: none. The proper way you should close it, by invoking javascript close function, which would remove modal and clean up after itself (so old code is not there anymore). This method depends on the types of modals and what you want to achieve. 35230390Automatically fill data from another sheethttp://codingdir.com/questions/35230390/Automatically-fill-data-from-another-sheetPut this Array formula in C2: =IFERROR(INDEX(Sheet2!C$2:C$9,MATCH($A2&$B2,Sheet2!$A$2:$A$9&Sheet2!$B$2:$B$9,0)),0) Being an array formula you must confirm with Ctrl-Shift-Enter to exit the edit mode instead of Enter. Then copy over one column and down. The picture is not exact because I left it on one sheet. 35230388Why does Pandas coerce my numpy float32 to float64?http://codingdir.com/questions/35230388/Why-does-Pandas-coerce-my-numpy-float32-to-float64-I think it is worth posting this as a GitHub issue. The behavior is certainly inconsistent. The code takes a different branch based on whether the DataFrame is mixed-type or not (source). In the mixed-type case the ndarray is converted to a Python list of float64 numbers and then converted back into float64 ndarray disregarding the DataFrame's dtypes information (function maybe_convert_objects()). In the non-mixed-type case the DataFrame content is updated pretty much directly (source) and the DataFrame keeps its float32 dtypes. 35230387Application on Device Close on openhttp://codingdir.com/questions/35230387/Application-on-Device-Close-on-openonCreate(Bundle) is where you initialize your activity. Most importantly, here you will usually call setContentView(int) with a layout resource defining your UI, and using findViewById(int) to retrieve the widgets in that UI that you need to interact with programmatically. Try to get your ui in onCreate(Bundle ) Just try @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); User = (EditText)findViewById(R.id.EnterUser); Pass = (EditText)findViewById(R.id.EnterPass); Acc = (EditText)findViewById(R.id.EnterAcc); 35230379preg_match/regex format neededhttp://codingdir.com/questions/35230379/preg-match-regex-format-neededUse preg_match() docs for this purpose, and that is a sample of how the code would look like: $subject="Quantity_12038_16061_24960"; $pattern='/Quantity_(d+)_(d+)_(d+)/'; preg_match($pattern, $subject, $matches); echo $matches[0]; //12038 {Category} echo $matches[1]; //16061 {Product} echo $matches[2]; //24960 {Item} you can see how this regex is performing here.35230368Print binary search tree using texthttp://codingdir.com/questions/35230368/Print-binary-search-tree-using-textWhat you can do is to take a queue and initialize it with nodes at each level as you go down traversing at each level. After that pop each element , print it and push to queue its left and right node. Like this go on traversing till entire depth and you shall be able to print the tree in your desired format.35230367parameterized IN clause using multiple columnshttp://codingdir.com/questions/35230367/parameterized-IN-clause-using-multiple-columnsUnfortunately, there isn't any easy way to bind a nested collection bind variable to PostgreSQL. You could generate the following SQL string instead SELECT * FROM mytable WHERE (key, value) IN ( (?, ?), (?, ?), ... ); That's a bit of work to keep the SQL string and the variable bindings in sync. You could, however, encode the map as JSON as such: SELECT * FROM mytable WHERE (key, value) IN ( SELECT t->>'key', t->>'value' FROM json_array_elements(?) AS t(v) ) E.g. SELECT * FROM mytable WHERE (key, value) IN ( SELECT t->>'key', t->>'value' FROM json_array_elements( '[{"key":"key1","value":"value1"}, {"key":"key2","value":"value2"}]' ) AS t(v) ) In that case, you would only ever need a single VARCHAR bind variable35230363Trouble with logic on how to query for all possible 5 number combinations of numbers 1 - 69 into SQL tablehttp://codingdir.com/questions/35230363/Trouble-with-logic-on-how-to-query-for-all-possible-5-number-combinations-of-numbers-1-69-into-SQL-tableTry this: select r1.num1, r2.num1, r3.num1, r4.num1, r5.num1 from TEST1 r1, TEST1 r2, TEST1 r3, TEST1 r4, TEST1 r5 where r1.num1 not in(r2.num1, r3.num1, r4.num1, r5.num1) and r2.num1 not in(r3.num1, r4.num1, r5.num1) and r3.num1 not in(r4.num1, r5.num1) and r4.num1 not in(r5.num1) order by r1.num1, r2.num1, r3.num1, r4.num1, r5.num1 By doing this you don't need to select the other columns, assuming that the rest of the columns have the same values. In case the other columns(num2, num3, num4, num5) have other values, then you need this: select r1.num1, r2.num2, r3.num3, r4.num4, r5.num5 from TEST1 r1, TEST1 r2, TEST1 r3, TEST1 r4, TEST1 r5 where r1.num1 not in(r2.num2, r3.num3, r4.num4, r5.num5) and r2.num2 not in(r3.num3, r4.num4, r5.num5) and r3.num3 not in(r4.num4, r5.num5) and 35230353How GROUP BY and COUNT or SUM works together in SQL querieshttp://codingdir.com/questions/35230353/How-GROUP-BY-and-COUNT-or-SUM-works-together-in-SQL-queriesAggregate function like sum or count return result based on a group of rows (aggregated by the column specified in group by clause) then in you case you obtain both: the sum of the value contained in the rows with the same product_name and the count of these rows. The group by condition lead the aggregation and work for all the Aggregate funtion in same way .. 35230348error parsing xml not well-formed (invalid token) error on androidhttp://codingdir.com/questions/35230348/error-parsing-xml-not-well-formed-invalid-token-error-on-androidThere shouldn't be a space between < and TextView. It should be as follows <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:paddingLeft="10dp" android:paddingRight="10dp" android:paddingTop="10dp" android:text="First Name" android:textSize="17sp"/> 35230343How to store words read from a file into a listhttp://codingdir.com/questions/35230343/How-to-store-words-read-from-a-file-into-a-listIf you want to store the data list for further use, you need to retrieve the list that the read_text method returns: def main(): resultList = read_text(dir_path) # store the list # use it... 35230340why my C json Deserialization failed?http://codingdir.com/questions/35230340/why-my-C-json-Deserialization-failed-The Json that you get is an array of RootObject so you must change oRootObject = oJS.Deserialize<RootObject>(jsonText); to oRootObject = oJS.Deserialize<RootObject[]>(jsonText); After that in oRootObject[0] you will have your json deserialized35230339join confusion for mssqlhttp://codingdir.com/questions/35230339/join-confusion-for-mssqlBetter way to write your query SELECT * FROM product p INNER JOIN attributecodesbyproduct atp ON atp.product_id = p.product_id AND Ltrim(Rtrim(atp.attrval)) IN ( 'Sil - ghi','Sil - def', 'Sil - abc' ) WHERE p.class = 2 Or If you don't want to include a product when it has atleast one 'xyz' as attribute then try this SELECT * FROM product p INNER JOIN attributecodesbyproduct atp ON atp.product_id = p.product_id WHERE p.class = 2 AND Ltrim(Rtrim(atp.attrval)) IN ('Sil - ghi', 'Sil - def', 'Sil - abc') AND EXISTS (SELECT 1 FROM product p1 INNER JOIN attributecodesbyproduct atp1 ON atp1.product_id = p1.product_id 35230338how to make an virtual chat bot in java?http://codingdir.com/questions/35230338/how-to-make-an-virtual-chat-bot-in-java-If you want to make this with a window you can use a jtextfield and add a actionlistener to it and if you want to make this with the console then use a input then get the message aka store it in a variable and then do this in your respond method if(STRINGVARIABLENAME.contains("Your word that you want it to check if it contains")) { then make the bot respond by Console or just do JTEXTFIELDNAME.setText("ANSWER HERE") } and add as many response possibilities by doing a else if after the if like this if(){ } else if(STRINGVARIABLENAME.contains("")){ } you can do this as many times as you want and there you have your chat bot :D35230326Swift game error messagehttp://codingdir.com/questions/35230326/Swift-game-error-messageYou declare a constant as let precent but then attempt to use percent. Check your spelling carefully.