input
stringlengths
51
42.3k
output
stringlengths
18
55k
How do I define an Array in the Default.rd.xml file <p>I am testing an app in Release mode and it fails when serializing my data with InvalidDataContractException citing SerializationCodeIsMissingForType.</p> <p>By a process of elimination the objects that fail serialisation in Release (not Debug) mode are Row[], Colu...
<p>I managed to get it working by much trial and error. Obviously everything had been build and tested in Debug mode so there was a list of objects being serialised that failed a Release build with SerializationCodeIsMissingForType.</p> <p>To help others (as there aren't too many examples out there yet) this was my jo...
How do I handle data entry in a scala.js bootstrap modal dialog? <p>I am using scala.js, plus the <a href="https://github.com/Karasiq/scalajs-bootstrap" rel="nofollow">bootstrap facade</a>, to collect some data from my user:</p> <pre><code>def showModal(kopiUser: KopiUser): Unit = { def modal = Modal().withTitle("mo...
<p>This is modified example of object TestModal from bootstrap/scala.js v1.1.1. There are certainly also other ways to do this but one solution is to move field definitions out of the apply() and out of the form. This way you can see and use them outside the TestModal2 object.</p> <pre><code>object TestModal2 { val ...
SQL SELECT Query for appending an "and" before the last car <p>I have a table called <code>carDetail</code> with the following data.</p> <p><a href="http://i.stack.imgur.com/ixWwN.png" rel="nofollow"><img src="http://i.stack.imgur.com/ixWwN.png" alt="Table"></a></p> <p>I just want the records who have Car more than "...
<p>try this:</p> <pre><code> SET @var := (SELECT concat(`Name`, ' has ', GROUP_CONCAT(car SEPARATOR ' ,'),' Cars') as result from cardetail where `Name` IN (SELECT `Name` FROM `cardetail` GROUP BY `Name` HAVING COUNT(`Car`) &gt; (select count(`Car`) from cardetail where `Name` = 'Jignesh'...
C++: How to make "core" dump file being overwritten when new crash is encountered? <p>I got a simple c program to test "core dump" behavior</p> <p>$ cat 1.c </p> <pre><code>int main() { int buf[]={1,2}; int j=buf[20000]+buf[30000]; return 0; } </code></pre> <p>I did: </p> <pre><code>$ ulimit -c unlim...
<p>You can toggle adding pid to core file, so every time program started with new pid core name will have new pid as 'extension'</p> <pre><code>echo 1 &gt; /proc/sys/kernel/core_uses_pid </code></pre> <p>also, read <a href="https://sigquit.wordpress.com/2009/03/13/the-core-pattern/" rel="nofollow">this</a> with much ...
TFS 2013 Get all team specific iteration paths <p>Need help with retrieving all team specific iteration paths under a specific project. I used this <a href="http://stackoverflow.com/questions/27952536/how-to-get-all-iteration-paths-with-a-tfs-api-2013">link</a> to get some hint, but with GetTeamConfigurationsForUser, I...
<p><a href="https://msdn.microsoft.com/en-us/library/microsoft.teamfoundation.processconfiguration.client.teamsettingsconfigurationservice.getteamconfigurationsforuser(v=vs.110).aspx" rel="nofollow">TeamSettingsConfigurationService.GetTeamConfigurationsForUser </a> method get the team settings for teams that <strong>t...
SQL How to add if else conditions in sql <p>Table A consists of firstname, secondname, lastname, msisdn, registrationdate.. table b have firstname, secondname, lastname, msisdn, registrationdate and a few other columns - but i only want to consider these mentioned 5 columns. I have something like this</p> <pre><code>S...
<p>This should do the trick :</p> <pre><code>SELECT A.*, B.* FROM TABLE1 A INNER JOIN TABLE2 B ON A.MSISDN = B.MSISDN WHERE (UPPER(B.FIRSTNAME),UPPER(B.LASTNAME)) NOT IN ((UPPER(A.FIRSTNAME),UPPER(A.LASTNAME)),(UPPER(A.FIRSTNAME),UPPER(A.SECONDNAME))) </code></pre> <p>No need for <code>IF</code> , if this condition ...
Angular - how to access object from promise <p>I am getting an object in my app by calling a function in service like this:</p> <pre><code>$scope.quiz= QuizService.fetch($stateParams.quiz).$promise.then(function(result) { return result; </code></pre> <p>When I do <code>console.log($scope.quiz)</code> I get this...
<p>Essentially, you need to chain your functions using <code>promises</code> and <code>resolve</code> or <code>callback</code>. Take a look <a class='doc-link' href="http://stackoverflow.com/documentation/javascript/231/promises#t=201609140807432265706">SO Documentation on JS Promises</a>. Said that, you should refacto...
Ansible expect module doesn't respond to password prompt <p>I am trying to create a password to <code>openvp</code>n user using Ansible. I am using the <code>expect</code> module, but it does not work.</p> <p>The next is the task I am trying to execute.</p> <pre><code>- name: Crear contraseña expect: command: ...
<p>The following is the syntax for multiple prompts and answers:</p> <pre><code>- name: Crear contraseña expect: command: passwd openvpn responses: (?i)Enter new password: "a1245" (?i)Enter new password: "a1245" </code></pre> <p>Notice: <code>ñ</code> is a Unicode character, so it might requir...
Executing SQL query via OracleDataReader always returns limited set of data <p>I am trying to get some data from Oracle DB via Powershell using OracleDataReader. Things seems to be working fine except that I alwyas get a limited set of data. Say, 40 records while it returns me over 5000 with SQL manager apps. Did I mis...
<p>I would skip array creation and pass results directly to pipeline. PSObject and arrays are also prone to unwrapping. Try this solution instead (code taken from <a href="http://dev.cdur.pl/Artykuly/PowerShell-wykonywanie-polecen-SQL-Server" rel="nofollow">http://dev.cdur.pl/Artykuly/PowerShell-wykonywanie-polecen-SQL...
Python CGI Script "Cannot allocate memory" Import Error <p>I have a simple CGI script on a shared 64bit Ubuntu hosting environment.</p> <pre><code>#!/kunden/homepages/14/d156645139/htdocs/htdocs/anaconda2/bin/python # -*- coding: UTF-8 -*- import sys import cgi import cgitb cgitb.enable() import numpy from pandas_dat...
<p>I was able to increase the RAM of the machine to a guaranteed 2GB which solved the problem.</p>
Maven: Failed to execute goal on project. Hibernate 5 gone from repo.spring.io? <p>All of a sudden I am receiving an error while building my project using Maven. This is the stacktrace: </p> <pre><code>[ERROR] Failed to execute goal on project repgen: Could not resolve dependencies for project ee.estcard.repgen:repgen...
<p>There is no version 5.2.0.Final according to <a href="https://mvnrepository.com/artifact/org.hibernate/hibernate-entitymanager" rel="nofollow">https://mvnrepository.com/artifact/org.hibernate/hibernate-entitymanager</a></p> <p>Try 5.2.2.Final</p>
vim change base of relative path to source to other dir <p>I have a local Makefile which simply calls <code>make -C ..</code>. As a result I get the output from the compiler with filenames and path to the directory relative to <code>..</code>.</p> <p>Now vim isn't able to get the correct path for quickfix.</p> <p>Q: ...
<p>Appending the localized version with <code>set errorformat+=&lt;localized version&gt;</code> should work.</p> <p>I am not aware that VIM supports it out of the box. After looking at the output of <code>:set errorformat</code>, which on my machine is a scary...</p> <pre><code> errorformat=%*[^"]"%f"%*\D%l: %m,"%f"...
CURL NTML authentication is working from command line but not working with php script <p>I need to call a .net web service. This web service requires NTLM authentication. For that, I wrote some code with NTLM authentication. And I am trying to connect using curl with NTLM authentication. But from php script I am gettin...
<p>please try it..</p> <pre><code>$url="http://qtskofaxweb01.etch.com/TotalAgility/Services/Sdk/JobService.svc?wsdl"; $user = 'kofax'; $password = 'Jagadish6^'; $parameters=array(); class Emp { public $user = ""; public $password = ""; } $e = new Emp(); $e-&gt;user = $user ; ...
How To Order ActiveRecord Relation Based on Column Of Last Record Of Associated Object <p>I have 2 models as below:</p> <pre><code>Client has_many :cases Case belongs_to :client </code></pre> <p>Let say I have 2 clients c1 &amp; c2.<br/> c1 has 1 case, and c2 has 2 cases.<br/></p> <pre><code>c1 = Client.create(n...
<p>I have changed the column 'case_type' instead of 'type' because we can not use column type in our table.</p> <p>To sort the data by case type of last record of client cases please try this.</p> <p>For ASC </p> <pre><code>Client.includes(:cases).sort_by{|m| m.cases.last.case_type} </code></pre> <p>For DESC</p> <...
Calling from the same class, why is one treated as bound method while the other plain function? <p>I have the following code snippet in Python 3:</p> <pre><code>from sqlalchemy.ext.declarative import declared_attr from sqlalchemy import Column, Integer, String, Unicode, UnicodeText from sqlalchemy.ext.hybrid import hy...
<p>What you have is not a regular <code>property</code> here, you have a <a href="http://docs.sqlalchemy.org/en/latest/orm/extensions/hybrid.html" rel="nofollow">SQLAlchemy <code>@hybrid_property</code> object</a>. Quoting the documentation there:</p> <blockquote> <p>“hybrid” means the attribute has distinct beh...
grunt hang on Running "delta" task <p>I'm a newbie to node and grunt, all right, the Front-end technology. The grunt is hang on running "delta" task when i execute <code>grunt live</code> command:</p> <pre><code>... Running "index:build" (index) task Running "karma:continuous" (karma) task INFO [karma]: Karma v0.1...
<p>"Waiting..." usually means the server is up and running...<br> But I see right now watching your Gruntfile that the message "Started <strong>connect</strong> web server on localhost:9000" you see after <code>grunt live</code> means a <strong>connect</strong> web server was started (see <a href="https://github.com/gr...
Drupal 8 how to modify the response type menu name <p>I want to modify the name of menu by jQuery,But it does't work and It always change back to the original appearance when I refresh page</p> <p>Please help me ლ(╹◡╹ლ)</p> <p><a href="http://i.stack.imgur.com/Qb0mo.png" rel="nofollow">enter image descripti...
<p>You can add an administrative title when placing the menu block in your block layout.</p>
Phaser - Clean loadState and bootState cache DOM <p>I have a game make with <a href="http://phaser.io" rel="nofollow">Phaser.js</a>. I would like to clean all <code>loadState</code> and <code>bootState</code> cache DOM, for remove image link.</p> <p>I use actually <code>Phaser.Cache</code> for remove all cache in <cod...
<p>you need to clear each state </p> <pre><code>game.state.clearCurrentState(); </code></pre> <p>The phaser doc says :</p> <blockquote> <p>This method clears the current State, calling its shutdown callback. The process also removes any active tweens, resets the camera, resets input, clears physics, removes t...
Javascript function returns undefined <p>I am getting error. My Javascript function returns undefined while it alert correct within the function. On my 1st controller i am calling like this.</p> <pre><code> CustomerService.setName(data.name); </code></pre> <p>And on Service page like this</p> <pre><code> servi...
<p>There is no argument given in the following even though the function needs that.</p> <pre><code>$scope.name = CustomerService.setName(); </code></pre>
Way(Optimized) to Implement following Scenario : Split Object in a List<T> <p>Here, I need to split (clone) the original object based on the quantity. Whenever I am splitting an object, new BaseID is assigned to newly created Object. <strong>( Please Bear with me)</strong></p> <p><strong>What I would like to achieve:<...
<p>Approaches I tried</p> <p><strong>1) Allan S Approach- Insert an Object instead of adding.</strong></p> <ul> <li>It is a good approach for a smaller number of splits (up to 30,000), but as records are growing, it's started taking more time because of O(n) complexity.</li> </ul> <p><strong>I Tried New approach</st...
Laravel Blade - Pass Data to layout without using it in every Public Function <p>In my Laravel Blade Layout I created files for the header, navigation, footer, etc. Those Files have been <code>@include()</code>d into a layout file, which has a <code>yield('content')</code>.</p> <p>Now, I want to show for example a pro...
<p>read about <a href="https://laravel.com/docs/5.3/views#view-composers" rel="nofollow">View Composers</a>:</p> <blockquote> <p>View composers are callbacks or class methods that are called when a view is rendered. If you have data that you want to be bound to a view each time that view is rendered, a view comp...
how to submit both key and value in angularjs form <p>I develop some application using AngularJS (v1.5.8). For validation purposes, I need to submit both key and value from select input, I mean the selected option (key and value) in angular form.</p> <pre><code>&lt;select id="someId" ng-model="someModel" name="someNam...
<p>If you don't separate the key and the value you can provide them both to the model</p> <pre><code>&lt;option ng-repeat="element in someDictionary" value="{{element}}"&gt;{{element.value}}&lt;/option&gt; </code></pre> <p>I haven't tested it so it might need some adaptations.</p>
set viewport using meta viewport tag for desktop browsers <p>I have a client provided website of width 1440 pixels. The client has asked me to set the viewport to 1440 pixels using for desktop browsers so that for screens smaller than 1440 pixels do no show a scrollbar.</p> <p>It does work for mobile, ipad devices wh...
<p>No. </p> <p>When the first iPhone was released, it needed to be able to display webpages designed for viewing on computers with much larger displays. Since that was almost all websites, it defaulted to performing zoom tricks to fake having a display that size.</p> <p>Meta viewport was introduced so that authors co...
"2016-09-07T13:00:00.000Z" could not find date format <p>I have date in NSString as <code>2016-09-07T13:00:00.000Z</code></p> <p>I could not convert it to <code>NSDate</code>.</p> <p>I tried below <code>NSDateFormatter</code> code,</p> <pre><code> NSDateFormatter* dateFormatter = [[NSDateFormatter alloc] init]; ...
<p>Change your date formate to <code>yyyy-MM-dd'T'HH:mm:ss.SSS'Z'</code>.</p> <pre><code>NSDateFormatter* dateFormatter = [[NSDateFormatter alloc] init]; dateFormatter.dateFormat = @"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"; NSLog(@"Date: %@",[dateFormatter dateFromString:@"2016-09-07T13:00:00.000'Z'"]); </code></pre>
How to check if a target of an LLVM StoreInst is a function pointer <p>How to check if the store target of an LLVM <code>StoreInst</code> is a function pointer?</p>
<p>Given a LLVM load / store instruction, there are two separate pieces to compute. First, what is the type of the location. Second, does the type meet certain properties, et cetera.</p> <pre><code>if (StoreInst *si = dyn_cast&lt;StoreInst&gt;(&amp;*I)) { Value* v = si-&gt;getPointerOperand(); Type* ptrType ...
Error testing spring boot 1.4 application <p>I have very simple spring boot 1.4 application with one rest controller. When i tried to test the context loading of this i am getting error like below :-</p> <pre><code>13:29:03.623 [main] DEBUG o.s.t.c.j.SpringJUnit4ClassRunner - SpringJUnit4ClassRunner constructor called...
<p>It looks like Spring Boot cannot find your <code>@SpringBootApplication</code> class using classpath scanning.</p> <p>So give the following a try:</p> <pre class="lang-java prettyprint-override"><code>@RunWith(SpringRunner.class) @SpringBootTest( classes = FrontendServiceApplication.class, webEnvironment =...
How to get gziped xml files with retrofit? <p>I'm using retrofit to get the data from the web. now my problem is that I have to get a gziped file and retrofit needs some kind of headers that I dont know how to implement right, obviously. I did a research on this but nothing seems to help since most developers are using...
<p>You shouldn't specify any headers.</p> <p>I built a mini server that just responds the following XML gzipped:</p> <pre><code>&lt;task&gt; &lt;id link="http://url-to-link.com/task-id"&gt;1&lt;/id&gt; &lt;title&gt;Retrofit XML Converter Blog Post&lt;/title&gt; &lt;description&gt;Write blog post: XML Conv...
Implementing IDisposable in C# <p>I am trying to implement IDisposable in a sample program. If I use SqlConnection class inside a using block statement, it will automatically dispose it.</p> <pre><code>public int testCon() { using (SqlConnection conn = new SqlConnection("Conn string")) { using (SqlComm...
<p><code>Dispose</code> is being called, but it doesn't do anything to destroy the object itself (you'll note that a lot of <code>IDiposable</code> classes within the Framework additionally have a <code>IsDisposed</code> property to indicate whether the unmanaged resources have been released or not)</p>
how to add unicode in truetype0font on pdfbox 2.0.0? <p>I've been using the PDFBOX version 2.0.0 in a Java project to convert pdfs to text.</p> <p>several of my pdfs are missing the ToUnicode method, so they come out in Gibberish while I export them.</p> <p><code>2016-09-14 10:44:55 WARN org.apache.pdfbox.pdmodel.fo...
<p>Here's some code to add a ToUnicode CMap stream in a font. Obviously I can't do it with your file, so I used one of my test files, which can be found <a href="https://issues.apache.org/jira/secure/attachment/12659109/Kommunikationsbedingungen-Einlagen_FIDOR-Bank.pdf" rel="nofollow">here</a>. I had to work on each en...
PHP Ping tool second If or Else statement <p>Im quite new to web development and am making a php ping tool to see what sites we have up or down. as we have 115 sites I chose to only display the sites that are down. On the webpage when no sites are down or not replying to pings can I have it display a message saying som...
<p>As I said in comment:</p> <pre><code>$counter = ""; $has_down = false; // flag, no sites are down yet foreach ($host1 as $value1) { $counter = $counter + 1; echo "&lt;tr&gt;"; echo '&lt;body bgcolor="#FFFFFF" text="#000000"&gt;&lt;/body&gt;'; //check target IP or domain $pingreply = exec("ping ...
Resolve "No 'Access-Control-Allow-Origin' header is present" issue with Chrome Extension <p>I am developing a <strong>Chrome Extension</strong> that pre-populates fields then submits the form on an external website when I visit it.</p> <p>It works perfectly when the data is hard-coded into my <code>script.js</code> fi...
<p>There seem to be two issues here at once.</p> <blockquote> <p>No 'Access-Control-Allow-Origin' header is present on the requested resource.</p> </blockquote> <p>Doesn't look like you thoroughly searched for solutions, since it's a common problem. Anyway, there are 2 ways to solve this:</p> <ol> <li><p>On the ex...
Hibernate EntityManager is not injected to Stateless EJB <p>this was asked a lot of times I guess, but I just cant seem to get it right. I have a WAR application deployed on Webpshere 8.5.5.9 with some EJB components and trying to use JPA 2.0 and Hibernate 4.2.0 to do database work. These EJBs are called from other app...
<p>I am sorry, the issue was not that entity manager was null but em.createQuery() threw a NullpointerException.</p> <p>After googling soome similar problems, I found out that my persistence.xml was missing a needed property</p> <pre><code>&lt;property name="hibernate.transaction.jta.platform" value="org.hibernate.se...
what can i do to update a column multiple times in same update query? <p>I want to update a column multiple times in same update query. I have a table in ms SQL database I want to update a field than again update that field in the same update query. for example i have a column "col" in sample table what i want to do is...
<p>You CANNOT do it in one command. ONE Statement updates ONE Row, as many fields/values as you give.</p> <p>You CAN update in one statement as long as you add two commands:</p> <pre><code>UPDATE table SET value=1;UPDATE table SET value=2; </code></pre> <p>But i think, that is not what you want?</p>
MySQL MyISAM Difference in Count field between Two identical tables <p>I have the following 2 identical tables, using MySQL:</p> <pre><code>DROP TABLE IF EXISTS `DB`.`tblNew`; CREATE TABLE `DB`.`tblNew` ( `NumberPK` int(10) unsigned NOT NULL, `Count` int(10) unsigned NOT NULL, PRIMARY KEY (`NumberPK`) ) ENGINE=MyI...
<p>Using the <code>PRIMARY KEY</code> in MyISAM is the same as using any other index: Drill down the index BTree, then do a random lookup into the data.</p> <p>In your case you need to scan all rows of the <em>first</em> table since you cannot predict which 10 will be of interest. Then lookup <em>every</em> row in t...
Access SAP Hana monitoring data <p>I want to write a java program where I need to monitor the SAP HANA. </p> <p>Can someone please let me know is there any client library or Java SDK or REST API is available to get all the metrics data for all monitors provided by SAP HANA?</p>
<p>I did some googling for you but found nothing. However, I saw it in action somewhere in the system, so in case no one will be able to help you here, you will find an answer on SCN.</p> <p>As, I had an experience of doing exactly this, I would say that writing the stuff on your own with xsjs will not be a big issue...
“Uncaught SyntaxError: Unexpected token <” when adding callback to external feed call <p>I am trying to pull a password protected xml feed from another website, but I am getting the following error:</p> <blockquote> <p>"Uncaught SyntaxError: Unexpected token &lt;"</p> </blockquote> <p>I fixed the origin access ...
<p>You try to load an <code>xml</code> and use <code>dataType: 'jsonp'</code>. jQuery can't handle the response because you tell the <code>$.ajax</code> function to use the response as <code>JSONP</code>. So the first char of the response <code>&lt;</code> is unexpected.</p> <p>Use <code>dataType: 'xml'</code> instead...
Using Angular.js and php to display values from a database rows <p>I am in the process of building a interface where app info is displayed to the owner. This consists of a table showing stats like: </p> <p>Who created the channel on the app.</p> <p>When was it created.</p> <p>What is the status of the channel.</p> ...
<p>Angular consumes only <code>JSON</code> so, now you are not going to <code>echo</code> the data to create the html output.. instead you need to use PHP to create a <code>WEB API</code> responds with <code>JSON</code> data when requested. </p> <p>So, you Angular application will send request to PHP which in turn ret...
How to get the coordinates of the dot in Google Map? <p>I am currently working on my map where I can dynamically add routes and save it to the my mysql database. I already know how to get the coordinates of Marker A and B but I do know how to get the white dot`s coordinates. How to get its coordinates? or It is possibl...
<p>You could try the following event listener:</p> <pre><code>google.maps.event.addListener(marker, 'dragend', function (event) { document.getElementById("latbox").value = this.getPosition().lat(); document.getElementById("lngbox").value = this.getPosition().lng(); }); </code></pre>
HTML table from output <p>This may be very basic but I have searched for over a day trying various different things, all to no avail.</p> <p>I am trying to output more than 1 row if more than 1 row exists. So far it is only showing me the last row!</p> <p>My code is as follows:</p> <pre><code>$query = "SELECT CaseID...
<p>You have to store your <code>caseID</code> rows into an array and then loop over it : </p> <pre><code>&lt;?php $query = "SELECT CaseID FROM Cases WHERE ClientID='".$_GET['ClientID']."'"; $result = mysqli_query($con, $query); $CaseIDs = array(); while($row = mysqli_fetch_array($result)) { $CaseIDs[] = $row['Cas...
JAXB: Use @XmlIDREF on a Map <p><br/> I'm trying to marshall some data with JAXB. My problem is the following: I have a class Frame which contains a map of signals.</p> <pre><code>@XmlRootElement(name = "frame") @XmlAccessorType(XmlAccessType.FIELD) public class Frame extends V_Element { @XmlElementWrapper(name ...
<p>In order to get that kind of output your POJOs might look like</p> <pre><code>@XmlAccessorType(XmlAccessType.FIELD) public class Signal { @XmlAttribute(name = "pos", required=true) private Double pos; @XmlValue private String id; public String getId(){ return id; } public Doubl...
Openlayers3 mousewheelzoom and keyboardzoom doesnt seem to work <p>I want to disable mousewheelzoom and keyboardzoom on openlayers3 map.</p> <p>I am using it this way with map initialization.</p> <pre><code>interactions: ol.interaction.defaults({MouseWheelZoom:false, KeyboardZoom:false}), </code></pre> <p>However it...
<p>Keys are case sensitive, so <code>mouseWheelZoom</code> and <code>keyboard</code> see <a href="http://openlayers.org/en/latest/apidoc/ol.interaction.html#.defaults" rel="nofollow">http://openlayers.org/en/latest/apidoc/ol.interaction.html#.defaults</a></p>
In Codeigiter 2, how do I load a library into a global variable I can use in helper functions? <p>So I have the following files:</p> <p>libraries/foo_library.php</p> <p>helpers/foo_helper.php</p> <p>views/main.php</p> <p>Now my problem: The library I've created is going to be used hundreds of times on each page loa...
<p>You can autoload some elements on Codeigniter so you can access them globally</p> <blockquote> <p>The following items can be loaded automatically:</p> <p>Classes found in the libraries/ directory Helper files found in the helpers/ directory Custom config files found in the config/ directory Language file...
Angular-cli, RC5 material2: Unexpected Token import <p>I am trying to configure Material 2 with Angular-cli RC5. When I am trying to load material button component in app.module.ts I am getting following error.</p> <pre><code>zone.js:461 Unhandled Promise rejection: SyntaxError: Unexpected token import at Obje...
<p>My app.module.ts has an instruction for ripple module from core that prevents a bug of adding gaps to the page on button click</p> <pre><code>import { MdRippleModule } from '@angular2-material/core'; import { MdButtonModule } from '@angular2-material/button'; </code></pre> <p>To use that module, you'll need to add...
Getting insufficient memory error while running 270 MB script on SQL Server 2012 <p>I am using SQL Server 2012, I have a script to update the DB, that script is approx 270 MB in size and contains some about 22,00,000 lines.</p> <p>Error :</p> <p><a href="http://i.stack.imgur.com/4ROSS.png" rel="nofollow"><img src="ht...
<p>That's already quite big for SQL Management Studio, especially if the script contains long lines and anything too complex.</p> <p>Your best options are probably:</p> <ul> <li>Use <code>sqlcmd</code> instead of SQL Management Studio</li> <li>Break the script down into multiple files you can execute one after anothe...
Importing a CSV File in MongoDB <p>I am importing a large 9.5 million record file in MongoDB using MongoImport. The CSV file was created for SQL Server Import operations and because the data in SQL table contained quotes(") itself. So, it was generating error importing in SQL.That is why, it has pipe (|) as the text qu...
<p>You cannot. Since it is using <code>|</code> as delimiter it's not longer valid CSV. </p> <p>Your options are to export data to JSON, TSV or CSV and then use <code>mongoimport</code> or do it programmatically which will be pretty valid and fast option since mongo doesn't wait till it's inserted so it will be pretty...
Does SSAS faster if using InMemory Table SQL? <p>I want to change my tables into InMemory table, and also I created SSAS from that table. wheather OLAP could be faster if I change into InMemory tables ? Please advice.</p> <p>I am concern about my memory. I am using SQL 2014 and SSAS Tabular </p> <p>Thanks</p>
<p>If your SSAS is not in <a href="https://msdn.microsoft.com/en-us/library/hh230898(v=sql.120).aspx" rel="nofollow">DirectQuery</a> mode, I don't think it will get any faster since when processed it creates a copy of the data in the table. </p> <p>I also don't think the processing will get any faster if you are selec...
How to get all GET request query parameters into a structure in Go? <p>Hi I want to transform get query parameters into a structure in Go, for example I have this structure:</p> <pre><code>type Filter struct { Offset int64 `json:"offset"` Limit int64 `json:"limit"` SortBy string `json:"sortby"` Asc ...
<h2>Using gorilla's <code>schema</code> package</h2> <p>The <a href="http://www.gorillatoolkit.org/pkg/schema" rel="nofollow"><code>github.com/gorilla/schema</code></a> package was invented exactly for this.</p> <p>You can use <a href="http://stackoverflow.com/questions/10858787/what-are-the-uses-for-tags-in-go/30889...
Laravel Route::get directly from App folder <p>So in my project I have one class that is placed in <code>app</code> folder (not inside <code>app/http/controllers</code>) and has middleware just <code>App</code>.</p> <p>When I'm trying to get its method from <strong>routes.php</strong> it's not found because it's not i...
<p>First of all, for your <strong>API</strong> you should use something like <a href="https://lumen.laravel.com" rel="nofollow">Lumen</a>, or, if you want it inside your main project, make nested folder inside your <code>Controllers</code> folder, and access it from routes like <code>Api\MyApi@get</code>.</p> <p>If yo...
Xcode 8 - Some buttons border removed <p>I just updated my Xcode ver from 7.3 to 8.0 and some buttons borders disappeared.</p> <p>The code looks fine, so I really don't know what happened to the layers. btw - in some other controllers I can see the layers borders.</p> <pre><code>self.button.layer.borderColor = border...
<p>The reason is that XCode 8 introduces a new way to zoom in Storyboards.</p> <p>Before XCode 8, in the view controller life cycle, <code>frames</code> were not known in viewDidLoad (or in properties <code>didSet</code>). You had to wait until viewDidLayoutSubviews (which is when Autolayout had finished applying the ...
Why does itemClicked() function not work sometimes in ionic2 / angular2 <p><strong>The problem</strong></p> <p>A very common problem of the Angular (click) functionality is that when you're using <code>&lt;div&gt;</code> tags, then it may not work. </p> <p>In some cases you will need to click two or three times.</p...
<p>Ionic currently has a bug relating it's <code>navCtrl.push()</code> method and using a <code>selector: your-selector</code> tag on the page you're pushing to. </p> <p>This will cause the page to reload itself when you click the first time but loads good after you click the <code>div</code> for the second time, whic...
Loading from jenkins job to PHP <p>I am able to use the Jenkins API to get information about my build via the url <code>http://localhost:1111/job/api/json</code></p> <p>What is inside this jenkins doesn't matter.</p> <p>When I use json file on my PC I can get values for example in a way:</p> <pre><code>$string = fi...
<p>If this is the url of your Jenkins job <a href="http://localhost:1111/job/projectx" rel="nofollow">http://localhost:1111/job/projectx</a></p> <p>you should add the api/json add the end of the url.</p> <p>This wil do the trick </p> <pre><code>$string = file_get_contents('http://localhost:1111/job/projectx/api/jso...
How can I copy artifacts from a agent on teamcity to my local machine when the build runs on that agent <p>I am working to automate the deployment process of my product for which I need to <strong>copy .exe and .varfile to my local machine from an agent on TeamCity on which the build takes place</strong>.I am trying to...
<p>You could publish all the .exe etc as artefacts and bundle them as a .zip file. Then from TC interface you can download them to local machine (part of it is manual though)</p> <p>Other option would be to use ( add a build step) XCopy from CMD runner or PS script to copy the artifacts to any destination machine (rel...
javascript manual countdown timer (based on the user input) <p>i want to make a countdown timer for a project in which the countdown start when the user inputs some time in 00:00:00 h-m-s format, i have written some code which is half correct and i'm lost what to do next</p> <p><div class="snippet" data-lang="js" data...
<p>I have modified the function handler.You can try this. </p> <pre><code> function handler() { //taking user input var time1 = document.getElementById('hms').value; //splitting it to seperate variables var pieces = time1.split(":"); var hours = pieces[0]; var minutes = pieces[1]; var ...
ACF - Get the top level Category ID when in child category <p>I created a customfield to show a category image on every category.</p> <p>But i also want so that the category image is showing in the child categorys asweel. like this:</p> <p>Main category > Child Category 1 </p> <p>The code below works, but only for ...
<p>Try this:</p> <pre><code>&lt;?php $category_id = get_queried_object_id(); $category = get_category($category_id); if( $category-&gt;category_parent ) { $key = 'category_' . $category-&gt;category_parent; } else { $key = 'category_' . $category_id; } $field = get_field( 'kategoribild', $key );...
MatchCollection giving error C# <p>I am working with a string and want to capture two substrings between two caracters using MatchCollection and Regex in C#. It is giving some logical error "Specified argument was out of the range of valid values. Parameter name: i" Test String: "A quick #brown fox&amp; jumps over the+...
<p>The <code>$(.+?)+</code> regex makes no sense since it matches the end of string with <code>$</code> and then 1+ chars other than a newline, 1 or more times. That is an example of a regex that does not match any text, same as <code>$a</code>. </p> <p>There is no match, thus <code>mc1</code> is empty, hence an excep...
How to reload UITableView data after Firebase finishes dowload of user data? <p>so I have a problem with firebase since it's async and I don't know how to work with that properly. My application has feed of products for sale, which I'm getting from firebase database and firebase storage(pictures). The problem is that I...
<p>Once you created all your <code>salePosts</code> you should call <code>tableView.reloadData()</code>. So right after you loop to create where you append your <code>newSalePost</code> to your <code>salePosts</code>. Since this is an asynchronous call returning your salePosts at the end of your function is useless.</p...
ng-disabled overrides custom directive behavior <p>I'm developing the AngularJS client. I've got a custom directive used as an attribute. The directive checks the access level of the element and sets it to be disabled if the current user is not allowed to use it. </p> <p>The problem begins when the same element has <c...
<p>Does your example directive reflect how you applied your actual directive to the button element? I noticed that your example directive is not following the correct naming convention of making each upper case letter in the directive name a lower case letter with a leading hyphen. i.e. myCustomDirective should be appl...
How to detect bitmap picture contain muted or vibrant color? <p>I use <code>pallete</code> class to set random background color to <code>textview</code>, and some images cannot generate color and return color like gray. I find that some image file work with <code>getMutedColor</code> and some other work with <code>getV...
<p>I'd simply check for null.</p> <pre><code>public int getSwatch(Bitmap b){ Palette p = Palette.from(b).generate(); Palette.Swatch swatch; if((swatch = p.getVibrantSwatch()) != null){ return swatch.getRgb(); } if((swatch = p.getLightMutedSwatch()) != null){ return swatch.getRgb(); ...
C++ - Passing signals between threads of to functions of different classes? <p>Basic problem, but haven't been able to find solution. I need .notify_one() to be picked up by DERIVED_TWO, I've tested the code within the same class and it works fine?</p> <pre><code>#include &lt;mutex&gt; class BASE { public: std::m...
<p>Different instances of your classes will not share the same condition variable object unless you declare it static. And I also doubt that you would want them to. I would implement a separate message queue class that could be instantiated as communication channels as needed and passed to the instances of your other c...
Populating dropdown menu with JSON Data in Mvc views <p>i am a beginner when it comes to javascript(Json). i am trying to populate a dropdown box based on the selection of another dropdown. as you can see in the image below as an example i am trying to populate the " Rule Choice " dropdown based on the "Product templat...
<pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;&lt;/title&gt; &lt;meta charset="utf-8" /&gt; &lt;script src="https://code.jquery.com/jquery-3.1.0.slim.min.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;select id="main"&gt; &lt;option value="a"&gt;A&lt;/option&gt;...
How to post form data in a nodejs application with routes? <p>I tried to build a simple node application with routes, but it gives a 404 network error as it's unable to post. Can someone please point out my mistake and correct it? </p> <p>First I created a directory sampProj, then in it, I've a file - <strong>appl.js<...
<p>You access the form via the URL:</p> <pre><code>http://localhost:3000/Service/mainCode/server </code></pre> <p>right? In your <code>mainCode/server.js</code> you set the <code>get</code> as well as the <code>post</code> handling for the same URL. So why do you call the root directory in <code>mainCode/index.html<...
access a certain line from a file and change it using javascript <p><p>I have a XML File and I need to access that file in Javascript.<br> I need to get a certain line and change it.</p><p>Here is an example:</p></p> <pre><code>changeFileCode("data.xml", 12, "New Data"); // The first paramater is for the file we want...
<p>You should <strong>not</strong> rely on Line/Columns numbers in XML. because XML neglect white-spaces.</p> <p>But you can target a specific node and change its value using JQuery.</p> <p>Let's say you want to do that from a client-side, <em>because that's what javascript do</em>, you will have to get that XML file...
Add a custom controller entry in the Sonata menu <p>I'm trying to following <a href="https://sonata-project.org/bundles/admin/master/doc/cookbook/recipe_knp_menu.html#add-a-custom-controller-entry-in-the-menu" rel="nofollow">this section</a> on Sonata's official website to add a custom controller to my menu.</p> <p>Wh...
<p>You need to fix your config. In you example you are adding an admin service with the service id <code>app.hello_controller</code> to the menu.</p> <p>What you need to do is add the following config to add <strong>one specific route / action</strong> from the controller:</p> <p><strong>config.yml</strong></p> <pre...
Adding CSS class to form element in Moodle <p>I create forms in Moodle by extending the moodle <code>moodleform</code> class and calling the <code>addElement()</code> or <code>createElement()</code> methods. For example, I create a select element this way:</p> <pre><code>$mform-&gt;addElement('select', 'mySelect', 'S...
<p>Use the 5th addElement parameter - <a href="https://docs.moodle.org/dev/lib/formslib.php_Form_Definition#select" rel="nofollow">https://docs.moodle.org/dev/lib/formslib.php_Form_Definition#select</a></p> <pre><code>$mform-&gt;addElement('select', 'myselect', 'Select title', $list, ['class' =&gt; 'myclass']); </code...
Trigger 'drop' event while providing the file data <p><strong>Question</strong></p> <p>How could I, while providing the file, trigger a <code>drop</code> event of a field, on which <em>I do not have access at loading</em>.</p> <p><strong>Details</strong></p> <p>There is a page with a field on which is attached a <co...
<p>You can fake the <strong>drop</strong> event, and fake pretty much everything that's in there. What you'll have problem doing is triggering a default event, such as opening a file in a tab by dropping it. The reason isn't so much because of the <strong>dataTransfer</strong> object being protected, but the event not ...
What is socket variable in socket.io <p>I'm new to Node.js and socket.io.</p> <p>I go official site of socket.io, and try a tutorial. <a href="http://socket.io/get-started/chat/" rel="nofollow">http://socket.io/get-started/chat/</a></p> <p>It work correctly on my computer. But I can't understand essence of its code a...
<p>The <code>socket</code> variable is basically a socket to a client. The <code>io.on('conection')</code> will be called each time a new client connects and give a socket to subscribe to.</p> <p><code>socket.on('chat message'</code> will subscribe on events sent by client associated with that socket instance.</p> <p...
What is the best way to set time boundries for user to input data? (asp.net mvc) <p>I'm actually wrapping my head around the problem of time. I wish to allow the user to input data between Monday-Wednesday (Monday 00:00 to Wednesday 23:59) each week just once AND create a unique id that would represent each week. </p> ...
<p>Some concrete classes that represent the database would really help illustrate your question. </p> <p>How you implement the ultimate solution, be it an action filter, a check in the action method, or anywhere else does not really matter.</p> <p>When users can enter data once per week, then simply store the week nu...
Ruby on rails multi level route path <p>I have defined a route as per the below but I am getting some errors. Below is the code outlining what is happening</p> <pre><code>namespace :shopping do resources :merchants, only: [:index, :show] do </code></pre> <p>Which I was hoping I would be able to use <code>= link_to ...
<p>As onikron suggested you need to pass parameter to your <code>route</code></p> <pre><code>= link_to shopping_merchant_path(@merchant) </code></pre> <p>I think you are trying something like</p> <pre><code>= link_to shopping_merchant_path(locale: @merchant) </code></pre> <blockquote> <p>:locale=>#&lt; Merchant i...
Stripe checkout charge - passing amount <p>for charge credit card, i want to pass dinamically amount values to my php script with jquery. I choose to use a select with different options. But it's not safe because user could modify those values. Any ideas? Here are my scripts:</p> <p><strong>HTML + JS</strong></p> <pr...
<p>You have to create plans in your database or array of plans to secure payment. Think you have a plan like this :</p> <pre><code>["plan_name" =&gt; "basic", "plan_amount" =&gt; 4000]; </code></pre> <p>then you can check before checkout using <code>if</code> statement also check <code>in_array</code> php function.</...
Java Applet vs Application <p>I'm using Java for some time now, so I'm quite familiar with it, BUT for my Barchelor thesis I may be doing Java Applet, and that is something i have never worked with. I know that Applet runs from browser and that it has no access to user filesystem, etc... What i need to know is are ther...
<p>I don't think you'll need to "master" anything. You might have to override some methods like init() or paint(). All the code will be java of course, and you'll have to do some html configuration to load the applet and reference classes.</p>
OData : AddQueryOptions for POST operation <p>Is there anyway to do the same thing as AddQueryOptions but when doing a POST through a OData web service? For exemple:</p> <pre><code>var first = ctx.JobGLJournal.AddQueryOptions("tenant", "fr").First(); </code></pre> <p>The POST url also need this "tenant" but I can't f...
<p>sorted it out... need to add a BuildingRequest event</p> <pre><code> ctx.BuildingRequest += Ctx_BuildingRequest; </code></pre> <p>and in the Ctx_BuildingRequest, change the RequestUri</p> <pre><code> private static void Ctx_BuildingRequest(object sender, System.Data.Services.Client.BuildingRequestEventArgs ...
Moving an azure mounted vhd blob from one storage account to another <p>I have a 3 GB disk mounted to /var/www/ on the same storage account as the OS disk</p> <p>Because I cannot monitor the size of individual disks in Azure, rather I can only monitor the size of the blob data in a storage container. I now need to mov...
<p>Not sure what your monitoring concern is, but you'd need to:</p> <ul> <li>unmount the disk</li> <li>detach the disk from your VM</li> <li>copy the blob (using whatever tool or code you want)</li> <li>attach the disk to your VM</li> <li>remount the disk</li> </ul> <p>You cannot do anything with the page blob while ...
JAX-RS: Custom SecurityContext has unexpected type when injected into resource method <p>I have implemented a <code>ContainerRequestFilter</code> that performs JWT-based authentication:</p> <pre><code>@Provider @Priority(Priorities.AUTHENTICATION) public class AuthenticationFilter implements ContainerRequestFilter { ...
<p>You can inject the <code>ContainerRequestContext</code> (as mentioned in <a href="http://stackoverflow.com/a/27666797/2587435">this post</a>) and just get the <code>SecurityContext</code> from there.</p> <pre><code>public List&lt;SomeItem&gt; getItems(@Context ContainerRequestContext context) { JwtSecurityConte...
Put a div on top of an image exactly in position with object-fit <p>I want to put a div on top of this image(a cupcake). <a href="http://i.stack.imgur.com/7Mj25.jpg" rel="nofollow"><img src="http://i.stack.imgur.com/7Mj25.jpg" alt="enter image description here"></a></p> <p>For example, I want to put my div on top of t...
<p>You answered your own question. What you have to do is: use percent values for positioning, for example:</p> <pre><code>.my_cover_div { position: absolute; left: 60%; top: 5%; } </code></pre> <p>For centering at exact point, <a href="https://css-tricks.com/centering-percentage-widthheight-elements/" re...
how to push elements to an array in key value format dynamically <p>I was trying to create an array in JSON format so that it stores name mailId and password of the user dynamically each time a new user signs up.I was able to create for one user but i am stuck in creating a loop and also to push the element in the arra...
<p>Switch the array name and then just push the user into it.</p> <pre><code>var users = []; document.getElementById("sub").addEventListener("click",function store(){ var user = {}; user.name = document.getElementById("nme").value; user.emailId = document.getElementById("mail").value; user.password = d...
VSTS - SSH Not Working <p>I made a repo with VSTS and cloned it, and set up all the SSH credentials correctly, but it still asks me for my username and password every time. How come?</p>
<p>The problem was I had the repository origin as an <code>https</code> url. It needs to be SSH.</p> <p><code>git remote remove origin</code></p> <p><code>git remote add origin ssh://&lt;your-repo-location&gt;</code></p> <p>Or (shorter)</p> <pre><code>git remote set-url origin ssh://&lt;your-repo-location&gt; </cod...
Which component should be used to create Cards in iOS? <p>I would like to create an app in which users can scroll to see <strong><em>cards</em></strong>, dynamically created (like Facebook's app). Which component is more appropriate for this purpose?</p> <ul> <li>Reusable <strong>UIView</strong> inside <strong>UIScrol...
<p>If you want to create something similar to a News Feed like on Facebook, then using a UITableView is the way to go. Depending on how many different kinds of card layouts you want, you could create a different dynamic prototype UITableViewCell for each card layout. UITableViews are the most natural for this and are a...
PHP : Getting the sum of two arrays with same variable name <p>I know to get sum of two arrays but this one is different I can't take anymore, I have a loop and the values are came from database. The actual iteration of loop from my code is twice because it is nested, what i mean is it looping twice or but it depends o...
<p>This should work:</p> <pre><code>$i = 0; $sumArray = array(); while($row = mysql_fetch_assoc($query)) { //calculate the total and push it in the array. $total = $array[$i] + number_format((float)$row ['total'],2,'.',''); array_push($sumArray, $total); array_push($array , number_format((float)$row ['total'...
Object showing class variables with ToString methos <p>From what I gathered I need a constructor but where on Earth do I specify this variables data? and how this ToStringmethod suppose to work? moreover, I am using Visual studio and when I try to debug this code to see if anything works, I get browser forbidden error,...
<p>I am guessing you mean you want to know how a basic class is made? And how to override the <code>ToString</code> method?</p> <p>Here is a small example:</p> <pre><code>public class Person { protected string _name; public string Name { set { _name = value; } get { return _name; } } ...
How to change the CSS of the active toggle button using pseudo CSS transitions <p>I have multiple toggle buttons on my web page. I am using <code>checkbox</code> input control with some CSS to get a material toggle button design. When I change the state of any of the toggle buttons, the CSS effects are reflected on the...
<p>if you want to have multiple toggle buttons, you need to use IDs, but you have the same IDs in both toggles, which can't happen because IDs are unique, so change the ID and the <code>label for</code> to target those IDs.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="fa...
Can not load less files <p>I made a static website in my localhost using bootstrap less and it working fine, But i am getting errors after including it to codeigniter like below image.<a href="http://i.stack.imgur.com/yoxYx.jpg" rel="nofollow"><img src="http://i.stack.imgur.com/yoxYx.jpg" alt="enter image description h...
<p>You most likely left base url blank need to set your base url I can see it is showing IP in there </p> <pre><code>$config['base_url'] = 'http://localhost/yourproject/'; </code></pre> <p>Codeigniter 3 versions you must set that value.</p>
Replicating background-img properties in an image tag <p>I am working on a responsive page, and have a large background image that I wish to keep in proportion no matter what size device a user is on. When I use an <code>img</code> tag for this it stretches way beyond the bottom of the screen, so I am using the <code>b...
<p>You can do this with the <code>object-fit</code> CSS declaration. Please note the browser support which you can see from here <a href="http://caniuse.com/#search=object-fit" rel="nofollow">http://caniuse.com/#search=object-fit</a>. An example snippet below with both options one under another for demonstrating the ef...
PHP Clear "reply-to:" for mail <p>Example: </p> <pre><code>email 1 has email to reply to as `test@testing.co.uk` email 2 has email to reply to as `support@testing.co.uk` </code></pre> <p>My current code:</p> <pre><code>if($this-&gt;teacherEmail &amp;&amp; $this-&gt;teacher_reply_enable) $this-&gt;mail-&gt;AddRep...
<p>According to the documentation there is a method called <a href="http://phpmailer.github.io/PHPMailer/classes/PHPMailer.html#method_clearReplyTos" rel="nofollow">clearReplyTos</a>. You could try calling that first as below:</p> <pre><code>$this-&gt;mail-&gt;clearReplyTos(); if($this-&gt;teacherEmail &amp;&amp; $thi...
Is there an event that can catch changes in row data while user editing? <p>I want something like <a href="http://www.learn-angular.org/#!/lessons/watch" rel="nofollow">AngularJS 'watch' function</a>. While user edits a row, I want to fire an event. <a href="http://docs.telerik.com/kendo-ui/controls/data-management/gr...
<p>In the <a href="http://docs.telerik.com/kendo-ui/api/javascript/ui/grid#events-edit" rel="nofollow"><code>edit</code></a> event of the Grid, obtain reference to the edited data item (<code>e.model</code>) and <a href="http://docs.telerik.com/kendo-ui/intro/widget-basics/events-and-methods#event-binding-after-initial...
How to get everything within brackets in golang with regex <p>I am trying to get everything within the outside brackets of the following sql statement in golang regular expressions.</p> <pre><code>Categories (// = outside bracket PersonID int, LastName varchar(255), FirstName varchar(255), Address varchar(255), City v...
<p>All you need is to find the first <code>(</code>, then match any characters up to the last <code>)</code> with</p> <pre><code>`(?s)\((.*)\)` </code></pre> <p><strong>Details</strong>:</p> <ul> <li><code>(?s)</code> - allow <code>.</code> to match any character, including a newline</li> <li><code>\(</code> - a li...
NSURLSession dataTaskWithRequest only works first time <p>I'm currently developing a WS Call like always, but I don't know why this only works the first time that I call to it, data first time has value, but if I call it again It returns nil. If I look to the response, I can see that it returns me an 412 value when dat...
<p>Solved by Changing the cachePolicy</p> <pre><code>let request = NSMutableURLRequest(URL: NSURL(string: endPoint)!, cachePolicy: .ReloadIgnoringLocalAndRemoteCacheData, timeoutInterval: Constants.REQUEST.TIMEOUT) </code></pre>
pandas read_sql with parameters and wildcard operator <p>I am trying to retrieve data from sql through python with the code:</p> <pre><code>query = ("SELECT stuff FROM TABLE WHERE name like %%(this_name)s%") result = pd.read_sql(query,con=cnx,params={'this_name':some_name}) </code></pre> <p>The code above works perfe...
<p>Consider concatenating the wildcard operator, <code>%</code>, to passed in value:</p> <pre><code>query = ("SELECT stuff FROM TABLE WHERE name LIKE %(this_name)s") result = pd.read_sql(query,con=cnx, params={'this_name': '%'+ some_name +'%'}) </code></pre>
How to display an image larger than the screen using a scrollPane JavaFX <p>How would one use a scrollPane to display an image larger than the screen in an application that is full screen? I have an image that is about 8000x3800 pixels and I would like to be able to move and interact with the entire image without havin...
<p>You only set 2 of 4 anchors for the <code>ScrollPane</code>, which is why the <code>ScrollPane</code> is never resized and just resizes to a size that allows displaying the whole image.</p> <p>Therefore no scrollbars are neccessary and panning cannot be done.</p> <p>You could fix this by also setting the right and...
PHP & MySQL, Database Optimization <p>I have a database project in php and MySql. Where I am sotring students data according to the subject they have opted to learn. I have created Attendance Module where each subject daily attendance is saved in another subject wise table. Now I want to create a Score Board in which e...
<p>Correct way: By using data models, you can create such data in 4 tables: 1. User table - userid, username, userregno, classno 2. subjects table - subjectid, subjectname, subjectcode 3. testmarks table - testmarkid, userregno, subjectcode, testmark 4. score board table - scoreboardid, scoreboardcode, classno</p> <p>...
Vue JS 2.0 not rendering anything? <p>Using <strong>Vue (^2.0.0-rc.6)</strong> + Browserify, entry point is index.js:</p> <pre><code>import Vue from 'vue' import App from './containers/App.vue' new Vue({ // eslint-disable-line no-new el: '#root', render: (h) =&gt; h(App) }) </code></pre> <p>App.vue:</p> <pre><c...
<p>Just to make life easier for folks looking for the answer: </p> <pre><code>import Vue from 'vue/dist/vue.js' import App from './App.vue' new Vue({ el: '#app', render: h =&gt; h(App) }) </code></pre> <p>From the author -- 2.0 standalone build means (compiler + runtime). The default export of the NPM package wi...
PHP namespace containing word "Case" <p>When setting a namespace to "App\Case" I'm being thrown the following error:</p> <pre><code>syntax error, unexpected 'Case' (T_CASE), expecting identifier (T_STRING) </code></pre> <p>Code line in reference:</p> <pre><code>use App\Case; </code></pre> <p>Changing the word from...
<p>They're reserved for a reason because in the first scenario above, PHP wouldn't be able to tell the difference between you defining an array or initialising a class of the same name, so it throws an error. There's no way round this like in MySQL, for example, where you can escape reserved words with a backtick. So i...
Getting 200 status code with empty data in web api <p>i am working with web api and MVC application. When i run my application, able to see that my all services are running in my local iis</p> <p><a href="http://i.stack.imgur.com/etmou.png" rel="nofollow"><img src="http://i.stack.imgur.com/etmou.png" alt="enter image ...
<p>Finally i got the solution for this issue.</p> <p>Due to remote certificate issue my web is not returning response back.</p> <p><a href="https://blogs.msdn.microsoft.com/jpsanders/2009/09/16/troubleshooting-asp-net-the-remote-certificate-is-invalid-according-to-the-validation-procedure/" rel="nofollow">Remote cert...
Loopback ValidationError: The `Role` instance is not valid. Details: `name` already exists (value: "admin") <p>I`m too new to loopback, however i followed the steps to install and scaffold my folder (loopback-server), inside server/boot/ i created one file script.js and included the following code:</p> <pre><code> ...
<p>If you're <code>Role</code> entity is being stored in a database then this code would try to create that Role entity (with a name of <code>"admin"</code>) each time your application starts. However, after the first time, that Role would already exist, thus you get an error that you have a duplicate "name". What you ...
Passing data between components in Angular 2 with <router-outlet> <p>I am very new to Angular 2 and want to pass a bool from one component to another with <code>&lt;router-outlet&gt;</code></p> <p>I understood for this I have to use a service.</p> <p>Basically what I want is to set a bool in app.component.ts from ano...
<p>You shouldn't use <code>@Output()</code> or <code>EventEmitter</code> in a service. These are <strong>only</strong> for outputs on components and directives. <code>@Output()</code> in a service doesn't have any effect at all.</p> <p>Use instead</p> <pre><code>headerToggle = new Subject&lt;Boolean&gt;(); </code></p...
Comma separated list from checkbox values <p>I've been digging around to try and get a list of comma separated values from a set of checkboxes. There have been lots of useful answers here, but I can't work out a final kink. My code is behaving oddly depending on whether or not the first checkbox is checked and I can't ...
<p>I think your code is working fine ! </p> <p>Check this demo once : <a href="https://jsbin.com/vigixi/46/edit?html,js,output" rel="nofollow">https://jsbin.com/vigixi/46/edit?html,js,output</a></p> <p>And if this is not the desired output you want. Then let us know what exactly you want.</p>
Open any url in popup and redirect current page in ASP.net without any button click on page load <p>When someone opens my webpage I would like a popup to open, and then I would like the main page (not the popup) to redirect to another website.</p> <p>I have tried:</p> <pre><code>ClientScript.RegisterStartupScript( ...
<p>You can use below code:</p> <p><strong>Common function for open PopUp window:</strong></p> <p>put this function at your common master page</p> <pre><code>function PopupCenter(url, title, w, h) { var child; var timer; var guid; var dualScreenLeft = window.screenLeft != undefined ? window.screen...
Angular - Use form post values in controller <p>I'm writing my first application in AngularJS, and I'm new to javascript. I have a simple question: </p> <p>How do I use POST values from an html form in an angular controller? </p> <p>I have a form (i've stripped out the css and validation stuff for ease of reading): <...
<p>Three ways you can do </p> <p><strong>Type 1</strong> With individual params</p> <p>HTML</p> <pre><code> &lt;form name="signupForm" novalidate&gt; &lt;input type="text" placeholder="Name..." ng-model="name" name="name" required /&gt; &lt;input type="email" name="email" ng-model="email" placeholder="...
ASM ByteCode: prepending visitMethodInsn with another invocation <p>Suppose I want to call a (logging) method <strong>before</strong> the invocation of some method of interest. This means that when listening for visitMethodInsn the stack is already populated with the arguments for the method(s) of interest.</p> <p>Is ...
<p>There is no reason to store the stack anywhere, because, the stack is well, a stack. You can just push the log arguments, call the logging function, pop the result, and you'll have the original stack still in place.</p>
How to get GPS co-ordinates of particular place from HERE map <p>Actually I wanted to get GPS co-ordinates of a particular place when user long presses that place on map by using HERE Maps Android SDK. Is it possible?</p>
<p>Yes it is possible. Use Map#getSelectedObjects() to retrieve the list of POIs that the user has touched. If the object is an instance of MapCartoMarker, the gps coordinate of the object is stored in MapCartoMarker.</p>
HOw to fix typings WARN deprecated 9/9/2016: "registry:dt/... errors <p>When I run npm install</p> <p>I get dozens of these errors. </p> <pre><code>typings WARN deprecated 9/9/2016: "registry:dt/node#6.0.0+20160831021119" is deprecated (updated, replaced or removed) </code></pre> <p>I'm new to typescript and the w...
<p>Today you can actually <a href="https://blogs.msdn.microsoft.com/typescript/2016/06/15/the-future-of-declaration-files/" rel="nofollow">use TypeScript without Typings</a>.<br> To get the definitions listed above, just install them from <code>@types</code> user in NPM.</p> <p><code>npm install --save @types/core-js ...