_id
stringlengths
2
6
partition
stringclasses
3 values
text
stringlengths
4
46k
language
stringclasses
1 value
title
stringclasses
1 value
d3501
train
Add padding to the photographs. Padding (e.g. of 10px) will add a 10px white space on all sides (unless you specify padding-top or padding-bottom etc.. which you can do if you prefer. ) You could also add a margin to the container. A negative margin-top will shift the appearance of the position of the container upwards, likewise it can be applied to the photographs as well. (Positive or negative) Hope this helps Rachel
unknown
d3502
train
I am editing my response to see if maybe I can clarify. If you have a data directive, can you just allocate a static size block of memory with it? e.g. .DATA poolOfDwords DWORD 1000 Then, just initialize them to values that you know you cannot get (-1 maybe?). Then, when you need to "allocate" a DWORD, you can just iterate through the list for the first entry that is -1 (unallocated) and use it. You can return the offset to that location if you need to use it. Hopefully that helps clarify my idea.
unknown
d3503
train
You need to use MQ PCF via Java. request = new PCFMessage(CMQCFC.MQCMD_INQUIRE_CHANNEL_STATUS); request.addParameter(CMQCFC.MQCACH_CHANNEL_NAME, "TEST.CHL"); request.addParameter(CMQCFC.MQIACH_CHANNEL_INSTANCE_TYPE, CMQC.MQOT_CURRENT_CHANNEL); request.addParameter(CMQCFC.MQIACH_CHANNEL_INSTANCE_ATTRS, new int [] { CMQCFC.MQCACH_CHANNEL_NAME, CMQCFC.MQCACH_CONNECTION_NAME, CMQCFC.MQIACH_CHANNEL_STATUS, CMQCFC.MQIACH_CHANNEL_SUBSTATE, CMQCFC.MQIACH_MSGS, CMQCFC.MQCACH_LAST_MSG_DATE, CMQCFC.MQCACH_LAST_MSG_TIME, CMQCFC.MQCACH_CHANNEL_START_DATE, CMQCFC.MQCACH_CHANNEL_START_TIME, CMQCFC.MQIACH_BYTES_SENT, CMQCFC.MQIACH_BYTES_RECEIVED, CMQCFC.MQIACH_BUFFERS_SENT, CMQCFC.MQIACH_BUFFERS_RECEIVED, CMQCFC.MQIACH_MCA_STATUS, CMQCFC.MQCACH_MCA_JOB_NAME, CMQCFC.MQCACH_MCA_USER_ID } ); responses = agent.send(request);
unknown
d3504
train
response.raw().request().url()
unknown
d3505
train
You could use the grails session to store the current state of the user. Then, on login, check the grails session and determine whether to show your message or not.
unknown
d3506
train
Tomcat uses whatever port or ports and protocols you configure it to use. By default it listens for HTTP requests on tcp/8080, AJP requests on tcp/8009, and service management requests on tcp/8005. This is configured in Connector elements in $CATALINA_HOME/conf/server.xml: https://tomcat.apache.org/tomcat-7.0-doc/config/http.html You should reconfigure Tomcat to listen on standard ports like tcp/80 for HTTP and tcp/443 for HTTPS. Non-standard ports are a ready indication of a novice deployment. The AWS Security Group should be configured to allow HTTP, HTTPS, pr both depending on your need. I highly recommend using HTTPS unless the information being transferred is public domain or has no value. You can check what ports Tomcat is using on your EC2 instance with netstat -anpt. It will show all active and listen ports and the programs that have bound them (including java or tomcat for your Tomcat ports). Unless you really need root access to the OS, you might want to consider using Amazon Elastic Beanstalk as it manages all that cruft for you.
unknown
d3507
train
It is because of the limit of PHP integers on 32-bit platforms. 2147 (seconds) * 1000000 (microseconds in one second) ~= PHP_INT_MAX on 32-bit platforms. On 64-bit platforms the limit would be ~ 300k years. The strange thing is that React's React\EventLoop\StreamSelectLoop calls stream_select() only with microseconds parameter, while it also accepts seconds. Maybe they should fix this issue. As a workaround you could override StreamSelectLoop implementation so that it make use of $tv_sec parameter in stream_select(). I created a pull request, let's see if it will be accepted
unknown
d3508
train
error reading /var/lib/kubelet/pki/kubelet.key, certificate and key must be supplied as a pair Usually, this is a permission issue. Check permissions of the certificate file, it should be readable for Kubelet user. If it does not help you - please share the Kubelet logs, namely the logs of the daemon, do not start it manually in the console. Based on the update of the question: 192.168.190.159:6443: getsockopt: connection refused It means that Kubelet on the node cannot connect to the master. Check the network connection between your node and the master. The node should be able to connect to https://192.168.190.159:6443, which is your API server endpoint. A: OK, the problem was that both nodes (Master and Worker) had the same hostname :). I noticed it after I ran kubectl describe node and in the Addresses field I saw the IP address of the worker with the same Hostname of the master: Addresses: InternalIP: 192.168.190.162 Hostname: worker2node I run sudo kubeadm reset on both Master and Worker. On Master: sudo swapoff -a sudo kubeadm init --pod-network-cidr=10.244.0.0/16 --apiserver-advertise-address=192.168.190.159 mkdir -p $HOME/.kube sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config sudo chown $(id -u):$(id -g) $HOME/.kube/config kubectl apply -f kube-flannel.yml On Worker: Changed the hostname: hostnamectl set-hostname worker2node sudo vi /etc/hosts # (edit this file with the new name for 127.0.1.1) Restart the worker and join it again. I checked and now it was added.
unknown
d3509
train
EDIT 3: Only thing is you have to create multiple partitions, see these steps.First we make a config file for each of the brokers (on Windows use the copy command instead) > cp config/server.properties config/server-1.properties > cp config/server.properties config/server-2.properties Now edit these new files and set the following properties: config/server-1.properties: broker.id=1 listeners=PLAINTEXT://:9093 log.dir=/tmp/kafka-logs-1 config/server-2.properties: broker.id=2 listeners=PLAINTEXT://:9094 log.dir=/tmp/kafka-logs-2 We already have Zookeeper and our single node started, so we just need to start the two new nodes: > bin/kafka-server-start.sh config/server-1.properties & > bin/kafka-server-start.sh config/server-2.properties & Now create a new topic with a replication factor of three along with 3 partitions it would solve the issue: > bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 3 --partitions 3 --topic my-replicated-topic
unknown
d3510
train
Your answer lies in Jenkins ProcessTreeKiller. A more detailed explanation here. It's a design decision to kill any processes that are spawned by the build to maintain a clean environment. Unfortunately that means you can't leave a process (such as Tomcat) running after the build. You can disable this functionality globally (not recommended) by launching Jenkins like this: java -Dhudson.util.ProcessTree.disable=true -jar jenkins.war Or you can disable this on a per-case basis, by launching the process with a changed environment variable: BUILD_ID=dontKillMe ./catalina restart Some people report however that changing BUILD_ID is not enough. They recommend also unsetting: JENKINS_COOKIE JENKINS_SERVER_COOKIE Edit: Another issue that could be at play is that when you connect to remote shell, and start a process in that remote shell session, once you (Jenkins) disconnects, the session is killed and all processes spawned by the session are killed too. To get around that issue, you need to disassociate the process from the shell session. One way is: nohup ./catalina restart & A: This is how I am restarting Tomcat after deployment via jenkins. I am having two servers DEV and QA where I need to do the deployment and restart tomcat. I have Jenkins installed in DEV server. * *First you need to install Post build task Plugin in Jenkins. *Then create this script tomcat-restart.ksh in the server where you have tomcat installed.. #!/bin/bash echo "*********************Restarting Tomcat70.******************" sh /apps/apache/sss-tomcat70.ksh status echo "Trying to stop Tomcat." sh /apps/apache/sss-tomcat70.ksh stop echo "Getting Tomcat Status." sh /apps/apache/sss-tomcat70.ksh status echo "Trying to Start Tomcat" sh /apps/apache/sss-tomcat70.ksh start sleep 2 echo "Getting Tomcat Status" sh /apps/apache/sss-tomcat70.ksh status Restarting Tomcat on DEV server. Since Jenkins and Tomcat is installed in the same machine I am directly calling the script. In Jenkins go to Add post-build action and choose Post build task and in the Script textbox add the following : /apps/apache/tomcat-restart.ksh Restarting Tomcat in QA server. Since Jenkins is installed in different server, I am calling the script to restart Tomcat via Secure Shell. In Jenkins go to Add post-build action select Post build task and in the Script textbox add the following : sshpass -p 'myPassword' ssh -tt username@hostname sudo sh /apps/apache/tomcat-restart.ksh You need to install sshpass if its not already installed. If everything went fine, then you may see something like this in your Jenkins log. Running script : /apps/apache/tomcat-restart.ksh [workspace] $ /bin/sh -xe /tmp/hudson43653169595828207.sh + /apps/apache/tomcat-restart.ksh *********************Restarting Tomcat70.********************* Tomcat v7.0 is running as process ID 3552 *********************Trying to stop Tomcat.********************* Stopping Tomcat v7.0 running as process ID 3552... *********************Getting Tomcat Status.********************* Tomcat v7.0 is not running *********************Trying to Start Tomcat********************* Starting Tomcat v7.0 server... *********************Getting Tomcat Status********************* Tomcat v7.0 is running as process ID 17969 Hope this helps. A: In some version of Jenkins "JENKINS_SERVER_COOKIE" not working so in that case u can use "JENKINS_NODE_COOKIE". Ex: JENKINS_NODE_COOKIE=dontKillMe
unknown
d3511
train
You want the actual String constructor: julia> String(['a', 'b', 'c']) "abc"
unknown
d3512
train
I propose you to use an exponential distribution: for(i=0 ; i<nrWinners ; i++){ value = exp(-lambda*i); distribution[i] = value; sum += value; } for(i=0 ; i<nrWinners ; i++){ distribution[i] /= sum; } Lambda is a positive parameter which will permit you to choose the shape of the distribution: * *If lambda is high the first winners will have a big part of the pot; *On the contrary, the smaller lambda is, the more the distribution will aim towards a fair division of the pot. I hope it will help you! EDIT: When I say lambda is high, it is already high if it is equal to 1 for 5 winners.
unknown
d3513
train
Image elements don't have an innerText (maybe you mean innerHTML?) Easier maybe to check the alt attribute: If imgElm.getAttribute("alt") = "Select This Item" Then imgElm.Click Exit For End If A: Dim imgElm as IHTMLElement For Each imgElm In objIE.Document.getElementsByTagName("img") If imgElm.getAttribute("src") = "images/CheckMarkGreen.gif" Then imgElm.Click Exit For End If Next OR Dim imgElm as HTMLImg For Each imgElm In objIE.Document.getElementsByTagName("img") If imgElm.src = "images/CheckMarkGreen.gif" Then imgElm.Click Exit For End If Next
unknown
d3514
train
As I recall, the \ character is escaping the ". It's supposed to be there. How do you want to use the JSON data? It would be nice if you could provide sample code for what you are doing with it. In my application I do the following, BufferedReader reader = new BufferedReader(new InputStreamReader(response.getEntity().getContent(), "UTF-8")); String json = reader.readLine(); JSONTokener tokener = new JSONTokener(json); JSONObject JSONParams = new JSONObject(tokener); String param1 = eventParams.getString("param1"); ... If you use these objects they should take care of removing the escape characters for you. A: Flexjson is also a very convenient way if you are have POJOs to be converted to JSON representations. JSONSerializer will serialize and JSONDeserializer will do the reverse. I have used it by myself. Link to Flexjson Website - http://flexjson.sourceforge.net/ public String doSomething( Object arg1, ... ) { Person p = ...load a person...; JSONSerializer serializer = new JSONSerializer(); return serializer.serialize( p ); } { "class": "Person", "name": "William Shakespeare", "birthday": -12802392000000, "nickname": "Bill" }
unknown
d3515
train
From the documentation for nl2br: nl2br — Inserts HTML line breaks before all newlines in a string (emphasis mine). It doesn't replace the newlines, it just inserts linebreaks. So if you try to revert nl2br by replacing <br />, you will get two \n, the old one and the one you inserted when replacing the <br />. The easiest fix would be removing all \n in the string you get from nl2br, the right thing would be storing the text without the <br /> and convert when you display it.
unknown
d3516
train
You can make use of the min and max properties. Bind the max property to the current year like so: <ion-input [(ngModel)]="season.Year" type="number" [max]="{{(new Date()).getFullYear()}}"></ion-input>. The logic for getting the full year could be moved to the typescript file and could be stored in a variable like currentYear. In the template we can then bind to max like so: [max]="currentYear". A: You can do it simply by HTML only: <input type="number" oninput="if(value > (new Date()).getFullYear()) alert('Year exceeds current year')"> If you really want to do it by Angular only you have to create custom Validator which you can find in the link given below: Min / Max Validator in Angular 2 Final If you are using Angular 6 then you can use min and max validators which you can find in the link given below: https://angular.io/api/forms/Validators#min A: I suggest you simply to do a check in function save(). It can be like this: if((new Date()).getFullYear() < this.season.Year) { //display an error message, maybe using alert or toast }
unknown
d3517
train
If I am not wrong when you click on any line in the source code, the lines get highlighted but the caret indicator is not showing and the code is not editable. I have faced the same problem many times and tried After File -> Invalidate Caches/Restart the problem has been solved. A: The problem faced has been solved by reverting Android Studio to its default settings. A: I was facing this exact same problem. I solved it by pressing the Insert key once—apparently, I had inadvertently toggled Insert/Overwrite mode, and that was preventing me from editing code.
unknown
d3518
train
There is already good implementations in: * *fastapi_contrib *fastapi-users
unknown
d3519
train
If I understand you correctly, it's not bitwise you need, but a simple if conditional statement: if ($order['financial_status'] !== 'partially_refunded' || $order['financial_status'] !== 'refunded') { // Do something with $order['fulfillments'][0]['updated_at'] }
unknown
d3520
train
At this time, no, the only type of cross-account resource you can target in an EventBridge Rule is another EventBridge bus. This is not really clearly stated anywhere I found while investigating the same question, but you can infer it from the PutTargets docs (since Event bus is the only target listed as supported in another account), or if you try it through CloudFormation you'll get an error "Only EventBus targets are allowed on cross-account PutTargets calls"). So currently they intend for you to set up another EventBridge bus in Account-B, and then attach a rule on it to target your firehose. Since there's no charge to receive events (the sender pays), this seems perfectly reasonable. This could all change of course as AWS routinely enhances their services. There's a nice diagram of this sort of cross-account event forwarding on Simplifying cross-account access with Amazon EventBridge resource policies:
unknown
d3521
train
To the best of my knowledge, there is currently no software that would enable you to re-convert images into their nominal data. However, it's not that hard to write a piece of code that does it. Here are the steps (at a high level): * *extract the images from the pdf document (use iText) *separate out those images that look like a plot. You can train a neural network to do this, or you can simply look for images that contain a lot of white (assuming that's the background) and have some straight lines in black (assuming that's the foreground). Or do this step manually. *Once you have the image(s), extract axis information. I'll assume a simple lineplot. Extract the minimal x and y value, and the maximum x and y value. *separate out the colors of the lines in your lineplot, and get their exact pixel coordinates. Then, using the axis information, scale them back to their original datapoint. *apply some kind of smoothing algorithm. E.g. Savitzky-Golay *If you ever use this data in another paper, please mention that you gathered this data by approximation of their graph. Make it clear you did not use the original source data. Reading material: * *https://developers.itextpdf.com/examples *https://en.wikipedia.org/wiki/Savitzky%E2%80%93Golay_filter *https://docs.oracle.com/javase/tutorial/2d/images/index.html
unknown
d3522
train
Something like this if I understood correctly: array = ["/uploads/content/attachment/folder/file1.pdf/file2.pdf/file3.pdf"] base = "https://www.example.com/" #the first part of the link, that's same for all links links = array.first[1..-1].split("/").map{|a| base + a} puts links #=> "https://www.example.com/uploads", # "https://www.example.com/content", # "https://www.example.com/attachment", # "https://www.example.com/folder", # "https://www.example.com/file1.pdf", # "https://www.example.com/file2.pdf", # "https://www.example.com/file3.pdf" A: The question is not clear. I assume the array will be like this: array = [ "/uploads/content/attachment/folder/file1.pdf/file2.pdf/file3.pdf", "/uploads/content/attachment/folder/file12.pdf/file23.pdf/fildf34.pdf", "/foo/boo/folder/file1.doc/file2.docx/file11.pdf" ] It splits links for folder/ links = array.map{ |a| a.split('folder/') }.flat_map do |path, files| files.split('/').map{ |file| path + "folder/" + file } end p links #=> [ "/uploads/content/attachment/folder/file1.pdf", "/uploads/content/attachment/folder/file2.pdf", "/uploads/content/attachment/folder/file3.pdf", "/uploads/content/attachment/folder/file12.pdf", "/uploads/content/attachment/folder/file23.pdf", "/uploads/content/attachment/folder/fildf34.pdf", "/foo/boo/folder/file1.doc", "/foo/boo/folder/file2.docx", "/foo/boo/folder/file11.pdf" ]
unknown
d3523
train
I'll show you my code for CSRF prevention: config.php Configuration file should be auto-loaded in every page using require or include functions. Best practice would be to write a configuration class (I'll just write down functions in order to simplify my code). session_start(); if(empty($_SESSION['CSRF'])){ $_SESSION['CSRF'] = secureRandomToken(); } post.php This is just an example. In every "post" page you should check if CSRF token is set. Please submit your forms with POST method! I'd also recommend you to take a look at Slim Framework or Laravel Lumen, they provide an excellent routing system which is gonna let you to accept POST requests only on your "post.php" page very easily (they also will automatically add a CSRF token in every form). if (!empty($_POST['CSRF'])) { if (!hash_equals($_SESSION['CSRF'], $_POST['CSRF'])) { die('CSRF detected.'); } }else{ die('CSRF detected.'); } view.php Now you just have to put an hidden input with your CSRF session value in it. <input type="hidden" name="CSRF" value="<?= $_SESSION['CSRF'] ?>"> I hope that this quick explanation may help you :)
unknown
d3524
train
With some additional testing, it appears that using admin.firestore.FieldValue.serverTimestamp() counts as an extra 'write'. With the code as above, I'm limited to 249 items (i.e. when output.length >= 250, the code will fail with that error message. If I remove the reference to serverTimeStamp(), I can get up to 499 items per write. I can't find this documented anywhere, and perhaps it is a bug in the firebase library, so I will post an issue there and see what happens.
unknown
d3525
train
Looks like, your NewsObject isn't a JSON object but string. It could happen because JQuery can't guess the response type, so you, probably, need to specify dataType for your $.post request (documentation): $.post("server/news.php", null, function(e){ ... }, 'json'); P.S. Also your JSON not looks valid, i expect to see something like {'a':'b'}, but you have {'a':'b'} {'c':'d'}. Updated. Based on the comments below, i would suggest you to use next PHP code for your server/news.php: <?php require "../includes/config.php"; require "../includes/h.conn.php"; require "../includes/admin.id.php"; $strSQL = "select * from news where admin_id=" .$admin_id; $objRS = mysql_query($strSQL); $News_Obj = array(); while ($row = mysql_fetch_assoc($objRS)) { $record = array ( "news_id" => $row['news_id'], "news_title" => $row['news_title'], "news_date" => $row['news_date'] ); $News_Obj[] = $record; } // don't forget to clear after yourself: mysql_free_result, disconnect header("Content-type: application/json"); echo json_encode($News_Obj); ?> Also you can use Firebug to see what exactly returns the script and which HTTP or Javascript errors happen when you do a request.
unknown
d3526
train
You can capture video through grabbing Jpeg images from a canvas element. You could also capture the entire page(if numerous videos in the same page) through grabbing the page itself through chrome. For audio, recording remote audio with the Audio API is still an issue but locally grabbed audio is not an issue. * *RecordRTC and my Modified Version for recording streams either to file or through websockets respectively. *Capture a page to a stream on how to record or screenShare an entire page of Chrome. If you have multiple different videos not all in the same page but want to combine them all, I would suggest recording them as above and then combining and syncing them up server side(not in javascript but probably in C or C++). If you MUST record remote audio, then I would suggest that you have those particular pages send their audio data over websockets themselves so that you can sync them up with their video and with the other sessions.
unknown
d3527
train
In your previous example, you had a List<List<? extends Shape>>. Here you have a List<? extends Shape>. Completely different things. Given a MyArrayList<? extends Shape>, that is a REFERENCE (like a page in an address book, not like a house), and the 'page in the address book' (that'd be your variable) promises that the house you get to will be guaranteed to be one of a few different style. Specifically, it'll be a List<Shape>. Or it could be a List<Rectangle>. Or perhaps a List<Circle>. But it'll be either a list of all sorts of shapes, or a list of some sort of specific shape. This is different from just 'it's a list of all sorts of shapes' - that would be a List<Shape>, not a List<? extends Shape>. Given that it could be a list of circles, and it could also be a list of squares, everything you do with history needs to be a thing you could do to either one. .add(new Circle()) is not something that is valid for a List<Rectangle>. Hence, you can't do that, and history.add(new Circle()) is a compilation error. So why did the previous snippet work? Because that was about List<List<? extends Shape>> which is a completely different thing to a List<? extends Shape>. One stores shapes. One stores a list of shapes.
unknown
d3528
train
If you you install the PHP Internationalization Package, you can do the following: IntlTimeZone::createTimeZone('America/New_York')->getDisplayName() This will return the CLDR English standard-long form by default, which is "Eastern Standard Time" in this case. You can find the other options available here. For example: IntlTimeZone::createTimeZone('Europe/Paris')->getDisplayName(true, IntlTimeZone::DISPLAY_LONG, 'fr_FR') The above will return "heure avancée d’Europe centrale" which is French for Central European Summer Time. Be careful to pass the first parameter as true if DST is in effect for the date and time in question, or false otherwise. This is illustrated by the following technique: $tz = 'America/New_York'; $dt = new DateTime('2016-01-01 00:00:00', new DateTimeZone($tz)); $dst = $dt->format('I'); $text = IntlTimeZone::createTimeZone($tz)->getDisplayName($dst); echo($text); // "Eastern Standard Time" Working PHP Fiddle Here Please note that these strings are intended for display to an end user. If your intent is to use them for some programmatically purpose, such as calling into another API, then they are not appropriate - even if the English versions of some of the strings happen to align. For example, if you are sending the time zone to a Windows or .NET API, or to a Ruby on Rails API, these strings will not work. A: If you know the value from your list at (http://php.net/manual/en/timezones.america.php) you can do something like. <?php $dateTime = new DateTime(); $dateTime->setTimeZone(new DateTimeZone('America/New_York')); echo $dateTime->format('T'); ?>
unknown
d3529
train
I'd think the easiest way to achieve this would be to use some JavaScript. Using the example code below should do the trick: var aside = document.getElementsByTagName("aside")[0], parent = document.getElementsByClassName("body-content")[0]; aside.style.width = ((parent.offsetWidth / 10) * 3) + "px"; Using this code and having the position set to fixed should give the desired effect. A: So you want aside to be 30% of body-content which is also a percentage? With a bit of maths, you can do the following: You want 30% of 60%, which works out at 18%. 60 divided by (10/3) = 18 So change your aside to this (add position: fixed and change width to width: 18%): aside { width: 18%; background: black; height: calc(100vh - 50px); display: inline-block; float: left; margin-top: 45px; position: fixed; } And you will have the result you wanted. .body-header { background: blue; height: 50px; position: fixed; width: 100%; top: 0px; } .body-content { width: 60%; margin: auto; } article { width: 70%; display: inline-block; float: left; margin-top: 60px; } aside { width: 18%; background: black; height: calc(100vh - 50px); display: inline-block; float: left; margin-top: 45px; position: fixed; } <body> <header class="body-header"> header </header> <div class="body-content"> <article> <h1>Introduction t ththth tht</h1> <p>Etiam non nulla id risus finibus laoreet. Vestibulum vel placerat quam. Suspendisse risus, lacinia sit amet aliquet sit amet, ultricies nec ligula. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris scelerisque vestibulum facilisis. Curabitur hendrerit a libero id ullamcorper. Nam scelerisque felis non nunc tempus fringilla. Proin ullamcorper, massa vitae elementum aliquam, lectus velit imperdiet mauris, nec blandit justo leo ut nisl. Etiam sollicitudin, urna eget malesuada convallis, augue nunc molestie erat, fringilla fringilla augue purus ac lacus. Donec sagittis nisl quis rhoncus fermentum. Sed a velit sem. Suspendisse tempor tempus dolor, ac porta velit porta at. Integer mi est, commodo non aliquam et, venenatis id felis.Sed venenatis diam est, ut volutpat nisl laoreet sed. Sed ut quam sed nibh pharetra congue. Donec ullamcorper, arcu vel finibus dictum, urna purus congue libero, quis fringilla erat ante maximus mauris. Suspendisse odio sem, mollis ac mauris non, viverra bibendum elit. Phasellus malesuada augue nulla, vitae eleifend sapien vehicula et. Aliquam pharetra imperdiet mauris non scelerisque. Donec dictum fringilla ante ac accumsan. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Ut id tempus nisi, ut aliquet justo. Duis a pretium ligula. Morbi facilisis urna sed lacus feugiat, nec laoreet purus fermentum. Proin semper nisi nec sapien porta, quis dapibus tellus auctor Etiam non nulla id risus finibus laoreet. Vestibulum vel placerat quam. Suspendisse lacus risus, Etiam non nulla id risus finibus laoreet. Vestibulum vel placerat quam. Suspendisse lacus risus, Etiam non nulla id risus finibus laoreet. Vestibulum vel placerat quam. Suspendisse lacus risus, Etiam non nulla id risus finibus laoreet. Vestibulum vel placerat quam. Suspendisse lacus risus, Etiam non nulla id risus finibus laoreet. Vestibulum vel placerat quam. Suspendisse lacus risus, Etiam non nulla id risus finibus laoreet. Vestibulum vel placerat quam. Suspendisse lacus risus, Etiam non nulla id risus finibus laoreet. Vestibulum vel placerat quam. Suspendisse lacus risus, Etiam non nulla id risus finibus laoreet. Vestibulum vel placerat quam. Suspendisse lacus risus, Etiam non nulla id risus finibus laoreet. Vestibulum vel placerat quam. Suspendisse lacus risus.</p> </article> <aside> g </aside> </div> </body>
unknown
d3530
train
SET WORKING_COPY=//ip-address/users/myDirB can not work, since cmd.exe needs a plain path (drive letter, colon, relative path). It can not deal with other paths like UNC or ip addresses. It must have a drive letter. SET WORKING_COPY=H:/myDirB this however doesn't work because you mapped H: to something as the user you're logged on. But the hook script is running as the user your svn server is running, i.e. as the service account. And the service account does not have the H: drive mapped. A: I would recommend against using a post commit hook to do this. It's going to be forever brittle, and complicated - as you're finding out. You should setup a continuous integration build that monitors the svn repo and then deploys the code if needed. Separating these concerns will save you headache in the future, provide easy way to notify team (IM, email or dashboard), and will help you out when/if wish to do any automated testing. A: two issues I ran into were (1) paths and (2) permissions. Our old setup included collabnet subversion server 1.5.6 and apache 2.2 on Windows 2008 R2 (it's now wandisco 1.7.2 / apache2.2 on Win 2008 R2). initially, I had the path as a mapped drive and the subversion and apache services running as the Local System account. So, we had something like: SET WORKING_COPY=X:\the\path\to\theworkingcopy Running it via CLI was fine, but commiting and executing via subsequent hook resulted in log message like Error resolving case of 'X:\the\path\to\theworkingcopy' So, I changed WORKING_COPY to use a UNC path such as: \\servername\DRIVELETTER$\the\path\to\theworkingcopy Still same problem, but I figured the services (for both) needed to run with network privileges, so I changed the service "Log On As" to a domain account for the svn server and apache. One other issue I ran into was setting the domain for the services' "Log On As" user. I used a domain user, but used a wildcard for the domain, e.g. ".\theuser" Then it just worked. As far as this being a brittle solution, I'd agree that CI is a better way to go. Even though our svn update over UNC is (1) documented and (2) works now and (3) it's unlikely to change in the near future - as thekbb noted - it doesn't separate concerns.
unknown
d3531
train
To open a new window: Thread thread = new Thread(() => Application.Run(new MainForm())) { IsBackground = false }; thread.Start(); Obviously, this implies that if you access shared state from multiple threads, you need to properly synchronize that access. A: You can use MDI containers to support multiple windows. Your MainForm will contain all other forms. Other forms can work independent. Set your main form, MDI container property to true. When creating new form, set mdi parent to your main form.
unknown
d3532
train
The projects state is actually defined on the initial render cycle: const [ projects, setProjects ] = useState([]); So it's a defined prop when passed to ArtistList: <Route path="/artists" element={<ArtistList projects={projects} />} /> The issue starts when in ArtistList in the useEffect hook calling getArtists where it is incorrectly attempting to access a property of the first element of the projects array which is currently an undefined object. const getArtists = () => { const artists = []; let curArtist = projects[0].artist; // <-- error, access artist of undefined! let projectCount = 0; const now = new Date(); let firstAdded = now; for (const { artist, dateAdded } of projects) { if (artist !== curArtist) { artists.push({ name: curArtist, projectCount, firstAdded }); curArtist = artist; projectCount = 0; firstAdded = now; } projectCount++; const projectDate = new Date(dateAdded); if (projectDate < firstAdded) firstAdded = projectDate; } setArtists(artists); }; useEffect(getArtists, [projects, sortBy]); What you can do is to only run the logic in getArtists is the array is populated. const getArtists = () => { const artists = []; let curArtist = projects[0].artist; let projectCount = 0; const now = new Date(); let firstAdded = now; for (const { artist, dateAdded } of projects) { if (artist !== curArtist) { artists.push({ name: curArtist, projectCount, firstAdded }); curArtist = artist; projectCount = 0; firstAdded = now; } projectCount++; const projectDate = new Date(dateAdded); if (projectDate < firstAdded) firstAdded = projectDate; } setArtists(artists); }; useEffect(() => { if (projects.length) { getArtists(); } }, [projects, sortBy]); And to ensure that projects is at least always a defined value, provide an initial value when destructuring the prop. const ArtistList = ({ projects = [] }) => { ... }
unknown
d3533
train
If you put a subreport in a cell then you can't optionally display something else in that cell. However from your comment you're trying to display values from two different datasets based on a condition, and you should be able to do this with an expression. Assuming there is some field in the table that can be used to relate to either dataset, then you might be able to use the lookup() function to get the relevant value, e.g. a code outline for this: Iif(some_condition, lookup(value1 in datasetA), lookup(value1 in datasetB))
unknown
d3534
train
Use "" in place of "0". chklstDepartment.SelectedValue == ""
unknown
d3535
train
I think you are looking for enumerateMediaDevices it seems to be implemented on all recent browsers (Not IE).
unknown
d3536
train
One way is to store the connection strings in IIS and they will be applied to the web.config automatically. See this post http://forum.winhost.com/threads/setup-the-connection-string-in-web-config.7592/
unknown
d3537
train
Your problem may be related to doing render '/admin/map_include_scripts' twice in the same page, which triggers another load of the maps and overlay APIs. When you do that after the first one has loaded your render '/admin/map_scripts', markers: markers, map_div_id: 'map2' may be executing the map rendering JS before the libs are completely loaded. Try moving render '/admin/map_include_scripts' to a common snippet, outside each div map loop. This way the libs are loaded only once you don't need to wait a second load of the API. render '/admin/map_include_scripts' div id: 'map' do markers1 = DeliveryMarkersService.new(delivery1).orders_markers render '/admin/map_scripts', markers: markers1, map_div_id: 'map' end div id: 'map2' do markers2 = DeliveryMarkersService.new(delivery2).orders_markers render '/admin/map_scripts', markers: markers2, map_div_id: 'map2' end A: Could you specify what do you mean by 'the map does not render'? It's not visible on the page or the DOM? Have you checked the source code/DOM in developer tools? If you don't get the error maybe it renders but just isn't displayed correctly, e.g. it has width/height set to 0?
unknown
d3538
train
A range-based for loop (for a class-type range) looks up for begin and end functions. cbegin and cend are not considered at all: § 6.5.4 [stmt.ranged]/p1 *: [...] * *if _RangeT is a class type, the unqualified-ids begin and end are looked up in the scope of class _RangeT as if by class member access lookup (3.4.5), and if either (or both) finds at least one declaration, begin-expr and end-expr are __range.begin() and __range.end(), respectively; *otherwise, begin-expr and end-expr are begin(__range) and end(__range), respectively, where begin and end are looked up in the associated namespaces (3.4.2). [ Note: Ordinary unqualified lookup (3.4.1) is not performed. — end note ] For a const-qualified range the related member functions must be const-qualified as well (or should be callable with a const-qualified instance if the latter option is in use). You'd need to introduce additional overloads: typename std::list<T>::iterator begin() { return objects.begin(); } typename std::list<T>::const_iterator begin() const { // ~~~~^ return objects.begin(); } typename std::list<T>::const_iterator cbegin() const { return begin(); } typename std::list<T>::iterator end() { return objects.end(); } typename std::list<T>::const_iterator end() const { // ~~~~^ return objects.end(); } typename std::list<T>::const_iterator cend() const { return end(); } DEMO * the wording comes from C++14, but the differences are unrelated to the problem as it is stated
unknown
d3539
train
Alright, I read a bit deeper into capturing/answers over at https://mockk.io/#capturing and saw there is a capture function. So I captured the lambda function in a slot which enables me invoke the lambda and then the actual code continues in the class under test. I can mock the rest of the behavior from there. Here is my test function for this case (for anyone who gets stuck): @Test fun `launch foreground timer, not participating, not showing good popup`() { val slot = slot<(Context) -> Unit>() every { appRaterManagerHelperMock.launchActionInMillisWithBundle(Dispatchers.Main, TimeUnit.SECOND.toMillis(10), contextMock, capture(slot)) } answers { slot.captured.invoke(contextMock) timerJobMock } every { appRaterManagerHelperMock.isParticipating() } returns false val appRaterManager = AppRaterManager(appRaterManagerHelperMock) appRaterManager.launchForegroundTimer(contextMock) verify(exactly = 1) { appRaterManagerHelperMock.log("AppRate", "[AppRaterManager] Launching foreground count down [10 seconds]") } verify(exactly = 1) { appRaterManagerHelperMock.isParticipating() } verify(exactly = 0) { appRaterManagerHelperMock.showGoodPopup(contextMock, appRaterManager) } } So what's left now is how to test the coroutine actually invokes the lambda after the provided delay time is up.
unknown
d3540
train
That error is pretty clear: The text data type, which is deprecated as of SQL Server 2005, is not suitable for comparison so it is not possible to do sorting on it. The same goes for image data type. Read this for more details. In other words the database engine cannot do the sorting based on the column you have specified.
unknown
d3541
train
Per MDN's documentation on media queries, there are only a few features dedicated to size: width, height, device-width, and device-height. In the past, device-width and device-heigth was available for media queries, which could theoretically be sort of used for what you're attempting to do, but this has since been deprecated and must not be used in new code. That leaves width and height which takes a "length" value. Per MDN's documentation on "length", there is no length unit that corresponds to the screen/display. There are "absolute length units" which are matched to real-life lengths whenever possible, or close approximations when not. For example, 1px is 1/96th of an inch, or 1 device pixel on low-resolution screens. There are "font-relative lengths" which are relative to the size of a particular character or font attribute in the current font. For example, 1em is equal to the current font size of the element (or of the parent element when specified on the font-size property). Finally, there are "viewport-percentage lengths", which are relative to the size of the viewport. While this is sometimes confused with the size of the screen/display, this is actually the size of the visible portion of the document: the part of the browser dedicated to displaying the webpage. So, 1vw would be 1% of the width of the visible portion of the page, while 100vw would be the width of the visible portion of the page. With iframes, the "viewport" is the size of the iframe. You can see this demonstrated below: <code style="background: yellow; display: block; width: 50vw; height: 50vh"> background: yellow;<br> display: block;<br> width: 50vw;<br> height: 50vh </code> You can also use percentages in other places in CSS, but all these do are take the inherited value (parent's value) and multiply it by that percentage. That is, if the parent is 100px wide and the child sets its width to 50%, the child's width gets converted to 50px. In the case of (min|max)-(width|height) on media queries, there is no parent to compare it to, but if they faked one, it would likely be the viewport, like vw, vh, and percentages on html use. However, browsers actually just completely ignore percentages on (min|max)-(width|height) as can be seen here: @media (min-width: 1%) { * { background: yellow } } @media (max-width: 100%) { * { background: red } } <code style="display: block"> @media (min-width: 1%) { div { background: yellow } }<br> @media (max-width: 100%) { div { background: red } } </code> There are also resolution-related units you can use with media queries (with resolution), but these are limited to the number of dots per length like dpi for dots per inch, not the total number of dots on the screen. Media queries relating to the size of a screen wouldn't be all that helpful for the majority of use cases, however, as the biggest use case for (min|max)-(width|height) is for different screen sizes, such as phones, tablets, laptops, and large desktop displays. Having a max-width: 50% breakpoint on a 1920x1080 screen would mean the breakpoint would be around 960px. On an iPhone XS, that same breakpoint would be around 207px (CSS pixels, not device pixels). Most people won't be using browsers in split screen, and most (all?) phones don't support windowed mode or double split screen, so you would never hit breakpoints with both height and width set in percentages. And unless you were using percentages and items that could always wrap, you would have to specify additional information in each media query to be useful (eg, (max-width: 50%) and (min-width: 50px)). What this could be helpful for is an app that used multiple windows for a single application. Think Photoshop or GIMP in windowed mode, as opposed to all of the toolbars being in a single window. But even then, any effects are likely still achieveable with existing media queries. So, the answer to your question is we use non-percentage lengths because viewport breakpoints would never be triggered (viewport is always 100%) and resolution breakpoints (eg, percentage of screen size) don't exist. The one set of resolution breakpoint media queries available (device-width and device-height) are deprecated and must not be used in new code. Instead, we use length breakpoints to change the design when the visible portion of the page is a different size, regardless of how large or small the device is. Many libraries use absolute lengths (eg, px) instead of relative units (eg, em) due to the fact that most developers design based on pixels. Over time, there has been a shift toward relative units, but there hasn't been a tipping point. While 960px is pretty widespread, this desktop/tablet breakpoint has changed over time. For a long period of time, websites were designed to fit on a 1024x768 monitor. With the scrollbar and browser chrome (border around window) taken into account, websites were often designed at 1000px wide, and later 980px became common for reasons I can't remember, but I wouldn't be surprised if some operating system or browser came along that that had chrome and scrollbar width that added up to more than 24px, or it might be related to a popular framework at the time using it. Anyway, when mobile devices became more popular, designing sites to work in grids also did, which is why 960px is so common nowadays. A: the breakpoint values for the different display scales vary by a specific pixel depending to the fundamental that has been actually used like: Small display scales - ( min-width: 576px) and ( max-width: 575px), Medium screen scale - ( min-width: 768px) and ( max-width: 767px), Large size display dimension - ( min-width: 591px) and ( max-width: 992px), And Additional big display sizes - ( min-width: 1200px) and ( max-width: 1199px),
unknown
d3542
train
The main big problem is that you want to throw from the dtor. https://www.kolpackov.net/projects/c++/eh/dtor-1.xhtml has a nice explanation of why this does not play nicely with the language and its idioms. In general, if you expect that a device can fail at shutting down, then you should probably handle this part explicity, because it not something that happens "exceptionally". For example, you could have the destructor try to gracefully shut off the device, and in case of errors (or exceptions), apply a force shut off. then, if the user of your system wants to handle the case of a device that can't shut off, he can still call shutoff directly. Finally, modeling from real world objects is just a first draft of your class design. don't worry to notstick to what the real world object do, if it helps to get a more practical design and a better UX.
unknown
d3543
train
it seems that you might get that error if you have an whitespace before or after the link too. Can you check whether or not you have that white space in there? maybe that's it
unknown
d3544
train
'"sessionId":"(WC-\d+)"' that should work though i don't know jmeter A: Expected: Needs to Get the Session Id values Given formats: "sessionId":"WC-123" We need to create the following regex formats to extract the session Id values Regular Expression formats "sessionId":"(.+)"
unknown
d3545
train
Try: SELECT "I1" & "," & "I2" AS Item_set, Round(Sum([T1].Fuzzy_Value)/ttrans.Expr1,15) AS Support FROM (SELECT * FROM Prune AS t WHERE t.Trans_ID IN (SELECT t1.Trans_ID FROM ( SELECT *FROM Prune WHERE [Nama]="I1") AS t1 INNER JOIN (SELECT * FROM Prune WHERE [Nama]="I2") AS t2 ON t1.Trans_ID = t2.Trans_ID) AND t.Nama IN ("I1","I2")) AS T1, ttrans GROUP BY "I1" & "," & "I2" A: somehow i find the answer : i tried using SELECT "I1" & "," & "I2" AS Item_set, Round(Sum([T1].Fuzzy_Value)/sum(ttrans.Expr1),15) it worked wonder
unknown
d3546
train
You did not specify what kind of UI it is, but in general I would not use a textbox in case a user can choose between two things. It would make more sense to use a drop-down or combo box. As items in the boxes I would use the values of an enum: enum Type { PRODUCT_SUPPORT("Product support"), PRODUCT_LOCAL("Product local"); final String label; Type(String label) { this.label = label; } } class ProductService { void handle(Type type) { switch(type) { case PRODUCT_LOCAL: //do somethinf break; case PRODUCT_SUPPORT: //do something els3 } } }
unknown
d3547
train
Use a dictionary comprehension. The value lists or None are created by short-circuiting the list slice from index one with None using the or operator: dct = {lst[0]: lst[1:] or None for lst in my_list} pprint(dct) {'a': ['b'], 'b': ['c', 'd', 'e', 'f'], 'g': None, 'h': ['i', 'j'], 'k': ['l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't']} Complexity: The complexity of this dict. comp. is O(n*m), where n is the number of items in the list and m is the length of the largest slice. The gain here does not come in a reduction in time complexity but in CPU time. A: You can use dict comprehension : >>> { i[0]:i[1:] or None for i in my_list} {'a': ['b'], 'b': ['c', 'd', 'e', 'f'], 'g': None, 'h': ['i', 'j'], 'k': ['l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't']} A: You could do, { item[0]: item[1:] or None for item in my_list } A: This provides a O(n) solution. my_list = [['a', 'b'], ['b', 'c', 'd', 'e', 'f'], ['g'], ['h', 'i', 'j'], ['k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't']] print(my_list) my_dict={} for x in my_list: my_dict[x[0]]=x[1:] print(my_dict) But keep in mind that There should not be any duplicates in keys A: List slice has O(N) complexity, same if you are using tuples. I am afraid you can't get better than O(N*N) with given input data structure. A: Using dict cmprh {i[0]:i[1:] or None for i in my_list} Output : {'a': ['b'], 'h': ['i', 'j'], 'k': ['l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't'], 'b': ['c', 'd', 'e', 'f'], 'g': None}
unknown
d3548
train
If you know how to process one item (phones), then just generalize that into a function so you can run it to the whole list via lapply: process.one <- function(x) data.frame(xmin = x$xmin[-1,3], xmax = x$xmax[-1,3], text = x$text[3]) out <- lapply(tier.col, process.one) At this point, out is a list of data.frames. It is recommended you keep it that way, but if what you really wanted are data.frames to be added to an environment (e.g. the global environment) then you can do so with list2env: list2env(out, envir = .GlobalEnv)
unknown
d3549
train
Your code checks to see if internet explorer is less than internet explorer 9 and if so display one css. otherwise if internet explorer 7 then use the other css. If you are using internet explorer 10 then you likely do not have a css page (atleast from what we can see in the code that you posted. change that second line to be "if lt IE10" or add a line that uses greater than equal 8 "gte"
unknown
d3550
train
I haven't tested this, but looks like it'll do what you're looking for. =INDEX(B$2:M$2,MATCH(TRUE,INDEX(B2:M2<>"-",),0)) Modified from here As Dirk pointed out, this actually returns the first match. A: if there are no empty dates between the values then, then this formula will do: =INDEX(B2:M2,COUNTIF(B2:M2,"<>-")) and having empty dates inbetween then this array-formula will do =INDEX(B2:M2,MAX(ISNUMBER(B2:M2)*COLUMN(A:L))) Needs to be confirmed with Ctrl + Shift + Enter A: The first question would be if those are real dates across row 1 or text-that-look-like-dates. Let's say those are real dates formatted as mmm-yy because that is the better method. The second question is whether the inactive numbers in row 2 are showing hyphens because they are zeroes with an accounting style number format or if you have actually put hyphens in the cells. Let's say they are zeroes with an accounting style number format because that is the better way to do it. =INDEX(B2:M2, MATCH(AGGREGATE(14, 6, (B1:M1)/(B2:M2<>0), 1), B1:M1, 0)) ' for pre xl2010 systems w/o AGGREGATE =INDEX(B2:M2, MATCH(MAX(INDEX((B1:M1)+(B2:M2=0)*-1E+99, , )), B1:M1, 0))
unknown
d3551
train
There's two conventional ways to specify arguments, but these are not enforced at the shell level, they're just tradition: -v xxxx --value=xxxx Now it's sometimes possible to do: -vxxxx If you have a value with a dash and it's not being interpreted correctly, do this: --value=-value A: cmd -v '-string value with leading dash' edit $ cat ~/tmp/test.sh #!/bin/bash str= while getopts "v:" opt; do case "$opt" in v) str=$OPTARG;; esac done shift $(( OPTIND -1 )) echo "option was '$str'" simple test file, my bash is GNU bash, version 4.3.11(1)-release (x86_64-pc-linux-gnu) results: chris@druidstudio:~⟫ ~/tmp/test.sh -v string option was 'string' chris@druidstudio:~⟫ ~/tmp/test.sh -v -string option was '-string' chris@druidstudio:~⟫ ~/tmp/test.sh -v '-string' option was '-string' so, maybe, the bash script handling your options is not written correctly, or you have an early version of bash. As I answered in another of these silly questions earlier, clairvoyance is not one of my skills. So, be a good chap and possibly give us, the people you are asking for help from, the pertinent information (as you state, your script is failing at the bash level, not at the ruby level, so why bother to post a ruby script?)
unknown
d3552
train
in for example org.apache.poi.xssf.model.StylesTable.putStyle( XSSFCellStyle ) they try to find the xfs twice. It uses an ArrayList. The more cells, the slower this operation is. If you can, try to avoid a lot of dates.
unknown
d3553
train
Thanks for trying to solve the issue. I figured out what the problem was. WSName was set from code Directory.GetFiles(directory); so I can keep track of the properties to each CAD file. When the first class member used the value of WSName to create the worksheet. The value for WSName had "\". The actual name of the worksheet omitted the "\" even though I used the "@" symbol in front of the string. It must me a limitation of excel. When the second class member tried to write to the worksheet even though WSName was coded the same way as the first member it could not find it due to the missing "\".
unknown
d3554
train
This is because you are deleting all records from the table in every openAndQueryDatabase() finally { if (newDB != null) newDB.execSQL("DELETE FROM " + tableName); newDB.close(); } A: I guess your are again recreating the database again ..every time application starts A: Yes, because creating your db code is in onCreate method. public void onCreate(SQLiteDatabase db) { String CREATE_CONTACTS_TABLE = "CREATE TABLE " + TABLE_CONTACTS + "(" + KEY_ID + " INTEGER PRIMARY KEY," + KEY_NAME + " TEXT," + KEY_PH_NO + " TEXT" + ")"; db.execSQL(CREATE_CONTACTS_TABLE); }
unknown
d3555
train
As the very page you quote says, "The order in which the unary operator − (usually read "minus") acts is often problematical." -- it quotes Excel and bc as having the same priority for it as O'CAML, but also says "In written or printed mathematics" it works as in Python. So, essentially, there's no universal consensus on this specific issue. A: Operator precedence is syntax-directed in OCaml, which means that the first character of the function identifier (and whether it's unary or binary) determines the operator precedence according to a fixed sequence. Contrast this with languages like Haskell, where the operator precedence can be specified at function definition regardless of which characters are used to form the function identifier.
unknown
d3556
train
Use the document() function to load and leverage an external XML file within your XSLT. <xsl:variable name="Projects" select="document('http://some.url.to/file.xml')/DATA" />
unknown
d3557
train
The problem in the second example that when angular-formly is processing the options with the template, all angular-formly sees is: <plain-text> for the template. Hence, it doesn't know what element to place the required attribute on. angular-formly will only attach attributes like these to elements that have an ng-model on them because those are the only elements where that attribute makes sense. Again, the key here is what angular-formly sees when it's processing the template (before it's compiled). It doesn't matter what the directive compiles to. So yes, you can use your own directive, but if you want to leverage the features of angular-formly, it needs to utilize the ng-model controller (like directive used in this example). Good luck!
unknown
d3558
train
You can try the below - UPDATE c SET c.ProfidentFund = x.total from tblEmpInfo AS c INNER JOIN (SELECT EmpID, SUM(ProfidentFund) AS total FROM tblTransactions GROUP BY EmpID) AS x ON c.EmpID = x.EmpID
unknown
d3559
train
There is no guarantee which of independent ops is performed first, so you can get 13 or 14 in both cases. Your result is pure luck. Try this: with tf.Session() as sess: sess.run(tf.global_variables_initializer()) for i in range(100): val1, val2, val3 = sess.run([x, assign1, assign2]) print(val1, val2, val3) ... and you'll see 13 and 14 printed out. Update for the subsequent question: z = foo() (which is just list of x slices) does not depend on assign. Note that foo is called just once before the session is started. I think, the best to see it is to visualize the graph in tensorboard. If you say... sess.run(z) ... tensorflow won't run assign, because it doesn't run a python function, it evaluates tensors. And tensor x or x[i] does not depend on the op assign. Dependency is defined by operations that are performed with tensors. So if you had... y = x + 2 ... this is a dependency: in order to evaluate y, tensorflow must evaluate x. Hope this makes it more clear now.
unknown
d3560
train
In order for SFINAE to work you need to use a parameter that is being deduced. In your case TCreator is already known so you can't use it. You can instead get around the problem by adding your own parameter and defaulting it to TCreator like template<typename T = TCreator, std::enable_if_t<!std::is_same_v<T, std::nullptr_t>, bool> = true> void createFile(uint32_t handle) { return mCreator.create(handle); }
unknown
d3561
train
I believe on the Lambda, you can only write files on the /tmp directory as documented here. Try adjusting your code to do that and it should work.
unknown
d3562
train
* *I'd suggest moving this subject to https://superuser.com/ community. *It indeed sounds like a real conflict between Unified Functional Testing and Cortana. not sure that you, as an end-user, can solve it. * *First, I'd suggest the obvious - contact support of both companies, and update to the latest versions. *Second, try to collect as much information as you can: * *Process Monitor - filter by the relevant processes (Cortana process name is SearchUI.exe, but I don't know about UTF). *Microsoft Event Viewer - try to seek for events in the exact time of the issue.
unknown
d3563
train
One way to do this would be to put a SSL (TLS) client certificate on every computer you want to allow access, then have your HTTP server ask for a valid certificate before allowing the user to connect to your Rails app. With nginx, for example, the configuration could look a bit like this: server { listen 443; ssl on; server_name example.com; ssl_certificate /etc/nginx/certs/server.crt; ssl_certificate_key /etc/nginx/certs/server.key; ssl_client_certificate /etc/nginx/certs/ca.crt; ssl_verify_client optional; # $ssl_client_verify now contains the result of the certificate check, # so you could just do something like this somewhere in your config: if($ssl_client_verify != SUCCESS) { return 403; } # ... } The server.crt file is a regular SSL certificate you'd get from a SSL cert shop. The ca.crt (Certificate Authority) file is one you generate yourself. You'd then generate sign a number of client certificates with your CA certificate, and tell nginx to only accept certificates signed by your CA. Here's a helpful article that shows you how. This approach would require you to make and securely store a CA certificate, generate (ideally) one certificate per computer you want to allow, and add a client cert to every machine that needs access, so it's quite a bit of work. You also have to make very sure that your users can't just export the client cert and install it on their home PC.
unknown
d3564
train
One way of doing it would be by saving your JSON response to a state. You can do this by using the on attribute of the form to set the state on the event submit-success as follows: <form id="form123" action-xhr="/formHandle" method="POST" on="submit-success:AMP.setState({ msg : event.response.message })" > Now you can use this state to implement your control logic anywhere in your page by using it with an amp-bind expression. For example, <p class="" [text]=" 'Response is :' + msg"> If you just want to perform common actions like hide, show, toggling accordion, scroll, opening a ligthbox etc., you can do this by using the corresponding AMP action inside the on attribute against the submit-success event, without having to use amp-bind.
unknown
d3565
train
A for loop (or any other control structure, for that matter) without curly braces operates on one statement only. So the first snippet would loop over the TriNumber calculation, but only call printf once the loop is done. It's equivalent to writing for(n = 5; n <= 50; n += 5) { TriNumber = ((n + 1) * n) / 2; } printf("The trianglular number of %d is %d\n", n, TriNumber); In order to get it to work as you expected, you could add the curly braces yourself, around both statements: for(n = 5; n <= 50; n += 5) { TriNumber = ((n + 1) * n) / 2; printf("The trianglular number of %d is %d\n", n, TriNumber); } A: ● In your first case, the for loop computes the TriNumber till the condition satisfies and then moves onto the next statement; i.e, the printf: for(n = 5; n <= 50; n += 5) TriNumber = ((n + 1) * n) / 2; printf("The trianglular number of %d is %d\n", n, TriNumber); This is similar to (for better understanding): for(n = 5; n <= 50; n += 5) { TriNumber = ((n + 1) * n) / 2; } printf("The triangular number of %d is %d\n", n, TriNumber); That's why you get a single statement output stating: The triangular number of 55 is 1275 ● While in your second case, the for loop computes the TriNumber and prints it everytime as far as the loop condition is satisfied, since the printf here is the very next statement of the for loop that gets executed. for(n = 5; n <= 50; n += 5) printf("The trianglular number of %d is %d\n", n, TriNumber = (((n + 1) * n) / 2)); which is similar to the below code even without the braces {}: for(n = 5; n <= 50; n += 5) { printf("The trianglular number of %d is %d\n", n, TriNumber = (((n + 1) * n) / 2)); } This is valid for not only for loop but all other control structure like while, if;etc that operates on the very next statement without the {} braces as said by Mureinik. A: In the first case you print after last loop iteration and as result n get extra increment by 5 and you see 55. In the second case you print right from last iteration and loop counter is not extra increased yet and you see 50.
unknown
d3566
train
instead of converting image in to Gif apple provide UIImageView.animationImages proparty that you can Animation Number of images one by one like gif. like Bellow code:- UIImage *statusImage = [UIImage imageNamed:@"status1.png"]; YourImageView = [[UIImageView alloc] initWithImage:statusImage]; //Add more images which will be used for the animation YourImageView.animationImages = [NSArray arrayWithObjects: [UIImage imageNamed:@"status1.png"], [UIImage imageNamed:@"status2.png"], [UIImage imageNamed:@"status3.png"], [UIImage imageNamed:@"status4.png"], [UIImage imageNamed:@"status5.png"], [UIImage imageNamed:@"status6.png"], [UIImage imageNamed:@"status7.png"], [UIImage imageNamed:@"status8.png"], [UIImage imageNamed:@"status9.png"], nil]; //setFrame of postion on imageView YourImageView.frame = CGRectMake( self.view.frame.size.width/2 -statusImage.size.width/2, self.view.frame.size.height/2 -statusImage.size.height/2, statusImage.size.width, statusImage.size.height); YourImageView.center=CGPointMake(self.view.frame.size.width /2, (self.view.frame.size.height)/2); YourImageView.animationDuration = 1; [self.view addSubview:YourImageView]; A: First of all you should check for your problem in Apple Documentation. Everything is given there. What you need is to Research & Read. You should try the ImageIO framework. It can convert .png files into CGImageRef objects and then export the CGImageRefs to .gif files. To save Images to Photo Library :UIImageWriteToSavedPhotosAlbum(imageToSave, nil, nil, nil); Also Documented in UIKit.
unknown
d3567
train
Have a look at this thread: event.stopPropagation() not working in chrome with jQuery 1.7 I helped him solve this exact issue.
unknown
d3568
train
Please check if FTP 7.5 can be used on your Windows Vista machine, http://www.iis.net/expand/FTP If not, FileZilla is a free alternative, http://filezilla-project.org/download.php?type=server
unknown
d3569
train
Transitive components are the way to go. MS describes them here: http://msdn.microsoft.com/en-us/library/aa372462%28v=vs.85%29.aspx To follow up on what Chris said, playing with the reinstallmode can do some nasty things. This is particularly true if you're including any shared components. You can backlevel components that other applications are depending on, and you can find yourself prompted to stop seemingly unrelated applications based on files in the shared components being in use. It's a really good thing to avoid if you possibly can. A: As Cosmin suggested you cannot remove components during repair, but you can uninstall the previous versions before starting the install process for the new version. One way to go with InstallShiled 2008 is to create a major upgrade that will do this. Video Tutorial. Edit As Christopher said: There are ways to remove components in minor upgrades / repairs. Comment below.
unknown
d3570
train
SSO is currently available in the Preview API Requirement Set for Outlook Add-ins. A: It is available in Outlook add-ins (in preview). Please see SSO in Office Add-ins, Preview status.
unknown
d3571
train
I ultimately could not find a full solution to the above directly, but I did find a npm module called. import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view'; I then nested this inside a ScrollView and included the View and Form inside it. <ScrollView <KeyboardAwareScrollView> <View> <!-- stuff --> <View <KeyboardAwareScrollView> <ScrollView> The module can be found here; react-native-keyboard-aware-scroll-view At the time of writing appears a very popular module with ~30k downloads a week. I have no affiliation to this module, but it works for me. A: I had the same issue adding flex: 1 to KeyboardAvoidingView fixed my problem: <KeyboardAvoidingView style={{ flex: 1 }} behavior={"padding"} > <ScrollView > <Card> <CardItem header bordered> <Text>Personal Information</Text> </CardItem> <CardItem bordered> <Body> <Item floatingLabel style={styles.item}> <Label>Full Name</Label> <Input /> </Item> <Item floatingLabel style={styles.item}> <Label>Headline</Label> <Input /> </Item> <Item floatingLabel style={styles.item}> <Label>Location</Label> <Input /> </Item> <Item floatingLabel style={styles.item}> <Label>Email</Label> <Input /> </Item> <Item floatingLabel style={styles.item}> <Label>Phone Number</Label> <Input /> </Item> <Item floatingLabel style={styles.item}> <Label>Phone Number</Label> <Input /> </Item> <Item floatingLabel style={styles.item}> <Label>Phone Number</Label> <Input /> </Item> </Body> </CardItem> </Card> <ListItem> <Left> <Text>Make my Profile Public</Text> </Left> <Right> <Switch value={this.state.publicProfileRadioValue} onValueChange={(value) => this.setState({ publicProfileRadioValue: value })} /> </Right> </ListItem> </ScrollView> </KeyboardAvoidingView> A: Add minHeight property to the root view style. <KeyboardAvoidingView behavior={Platform.OS == 'ios' ? 'padding' : 'height'} style={styles.container}> {//content } </KeyboardAvoidingView> minHeight: Math.round(Dimensions.get('window').height), Do not forget to import Dimensions form react native import { Dimensions } from 'react-native'; A: for anyone else who ran into this when testing on Android, make sure the element you want to be keyboard avoided also has flex: 1. this will not work: <KeyboardAvoidingView behavior={Platform.OS == "ios" ? "padding" : "height"} style={{ flex: 1 }} > <TextInput style={{ height: 300 }} /> </KeyboardAvoidingView> this will: <KeyboardAvoidingView behavior={Platform.OS == "ios" ? "padding" : "height"} style={{ flex: 1 }} > <TextInput style={{ flex: 1 }} /> </KeyboardAvoidingView> without flex 1, the target element will not resize its height accordingly to avoid the keyboard A: I could achieve the right behavior with this implementation: * *Removed KeyboardAvoidingView component. *Added this to the app.json file: "android": { "softwareKeyboardLayoutMode": "pan" } Hope it works for you guys as well!
unknown
d3572
train
Vacuuming won't have any effect on COPYed rows, which are effectively inserts. Vacuum physically deletes rows previously deleted with an SQL delete statement, which only marks the rows as deleted, so they don't participate in subsequent queries but still consume disk space. Redshift is an eventually consistent database, so even if your COPY command had completed, the rows may not yet be visible to queries. Running vacuum is basically a defrag, which requires all rows to be reorganized. This (probably) causes the table to be brought into a consistent state, ie all rows are visible to queries.
unknown
d3573
train
You might try something like this: funcdecl: FUNC NAME OBRACKET arglist CBRACKET SEMI ; arglist: nonemptyarglist | ; nonemptyarglist: nonemptyarglist COMMA NAME | NAME ; I'd suggest using the grammar to build a syntax tree for your language and then doing whatever you need to the syntax tree after parsing has finished. Bison and yacc have features that make this rather simple; look up %union and %type in the info page. A: After a little experimentation, I found this to work quite well: int argCount; int args[128]; arglist: nonemptyarglist | ; nonemptyarglist: nonemptyarglist COMMA singleArgList | singleArgList { }; singleArgList: REGISTER { args[argCount++] = $1; };
unknown
d3574
train
Modded the code to remove properly. I'm assuming this is selecting the correct list based off the code above. Also, a fiddle for example: http://jsfiddle.net/Tkt2B/ $("#<%=ddlCatchword.ClientID %>").removeAttr("disabled"); $("#<%=ddlCatchword.ClientID %>").find("option").remove().end() $("#<%=ddlCatchword.ClientID %>").append("<option selected='selected' value='0'>Please select</option>"); var listItems = ""; for (var i = 0; i < xx.length; i++) { var val1 = xx[i]; var text1 = xx[i]; listItems += "<option value='" + val1+ "'>" + text1 + "</option>"; } $("#<%=ddlCatchword.ClientID%>").append(listItems); A: I have tried this method to test out data var h = ' <select name="test" id="ss" class="country" data-native-menu="false">'; h = h + listItems; var w = window.open(); $(w.document.body).html(h); And it opens new dropdwon with all json data in new window.. I dont know what strange thing is wrong ... please note im using jquery mobile using asp.net A: it solved by using following trick, $("#<%=ddlCatchword.ClientID%>").html(listItems); $("#<%=ddlCatchword.ClientID%>").selectmenu('refresh', true); Got it working with the help from http://ozkary.blogspot.no/2010/12/jquery-mobile-select-controls-populated.html Thanks!
unknown
d3575
train
With lxml and xpath you can parse xml much more easily than by rolling your own regex parser. Here's an example: import lxml import StringIO a =''' <att> <rt> <rts> <ip-address>1.1.1.1/16</ip-address> <bb> <cc> <protocol>ospf</protocol> </cc> </bb> <ee> <ff> <ll>4</ll> </ff> </ee> </rts> <rts> <ip-address>3.3.3.3/32</ip-address> <bb> <cc> <ip-addr>2.2.2.2</ip-addr> <ip-addr>8.8.8.8</ip-addr> </cc> </bb> <ee> <ff> <type>route</type> </ff> </ee> </rts> </rt> </att>''' f = StringIO.StringIO(a) tree = lxml.etree.parse(f) rts = tree.xpath('//rts') ipa = rts[0].xpath(".//ip-address")[0] print ipa.text This prints the first ip-address of the first rts tag, i.e. 1.1.1.1/16. Note: I needed to fix your xml, there was a / missing on the last rt tag.
unknown
d3576
train
I'll post what worked for me, thanks to @xavi-montero. Put your CSS in your bundle's Resource/public/css directory, and your images in say Resource/public/img. Change assetic paths to the form 'bundles/mybundle/css/*.css', in your layout. In config.yml, add rule css_rewrite to assetic: assetic: filters: cssrewrite: apply_to: "\.css$" Now install assets and compile with assetic: $ rm -r app/cache/* # just in case $ php app/console assets:install --symlink $ php app/console assetic:dump --env=prod This is good enough for the development box, and --symlink is useful, so you don't have to reinstall your assets (for example, you add a new image) when you enter through app_dev.php. For the production server, I just removed the '--symlink' option (in my deployment script), and added this command at the end: $ rm -r web/bundles/*/css web/bundles/*/js # all this is already compiled, we don't need the originals All is done. With this, you can use paths like this in your .css files: ../img/picture.jpeg A: I had the same problem and I just tried using the following as a workaround. Seems to work so far. You can even create a dummy template that just contains references to all those static assets. {% stylesheets output='assets/fonts/glyphicons-halflings-regular.ttf' 'bundles/bootstrap/fonts/glyphicons-halflings-regular.ttf' %}{% endstylesheets %} Notice the omission of any output which means nothing shows up on the template. When I run assetic:dump the files are copied over to the desired location and the css includes work as expected. A: If it can help someone, we have struggled a lot with Assetic, and we are now doing the following in development mode: * *Set up like in Dumping Asset Files in the dev Environmen so in config_dev.yml, we have commented: #assetic: # use_controller: true And in routing_dev.yml #_assetic: # resource: . # type: assetic *Specify the URL as absolute from the web root. For example, background-image: url("/bundles/core/dynatree/skins/skin/vline.gif"); Note: our vhost web root is pointing on web/. *No usage of cssrewrite filter A: I have came across the very-very-same problem. In short: * *Willing to have original CSS in an "internal" dir (Resources/assets/css/a.css) *Willing to have the images in the "public" dir (Resources/public/images/devil.png) *Willing that twig takes that CSS, recompiles it into web/css/a.css and make it point the image in /web/bundles/mynicebundle/images/devil.png I have made a test with ALL possible (sane) combinations of the following: * *@notation, relative notation *Parse with cssrewrite, without it *CSS image background vs direct <img> tag src= to the very same image than CSS *CSS parsed with assetic and also without parsing with assetic direct output *And all this multiplied by trying a "public dir" (as Resources/public/css) with the CSS and a "private" directory (as Resources/assets/css). This gave me a total of 14 combinations on the same twig, and this route was launched from * *"/app_dev.php/" *"/app.php/" *and "/" thus giving 14 x 3 = 42 tests. Additionally, all this has been tested working in a subdirectory, so there is no way to fool by giving absolute URLs because they would simply not work. The tests were two unnamed images and then divs named from 'a' to 'f' for the CSS built FROM the public folder and named 'g to 'l' for the ones built from the internal path. I observed the following: Only 3 of the 14 tests were shown adequately on the three URLs. And NONE was from the "internal" folder (Resources/assets). It was a pre-requisite to have the spare CSS PUBLIC and then build with assetic FROM there. These are the results: * *Result launched with /app_dev.php/ *Result launched with /app.php/ *Result launched with / So... ONLY - The second image - Div B - Div C are the allowed syntaxes. Here there is the TWIG code: <html> <head> {% stylesheets 'bundles/commondirty/css_original/container.css' filter="cssrewrite" %} <link href="{{ asset_url }}" rel="stylesheet" type="text/css" /> {% endstylesheets %} {# First Row: ABCDEF #} <link href="{{ '../bundles/commondirty/css_original/a.css' }}" rel="stylesheet" type="text/css" /> <link href="{{ asset( 'bundles/commondirty/css_original/b.css' ) }}" rel="stylesheet" type="text/css" /> {% stylesheets 'bundles/commondirty/css_original/c.css' filter="cssrewrite" %} <link href="{{ asset_url }}" rel="stylesheet" type="text/css" /> {% endstylesheets %} {% stylesheets 'bundles/commondirty/css_original/d.css' %} <link href="{{ asset_url }}" rel="stylesheet" type="text/css" /> {% endstylesheets %} {% stylesheets '@CommonDirtyBundle/Resources/public/css_original/e.css' filter="cssrewrite" %} <link href="{{ asset_url }}" rel="stylesheet" type="text/css" /> {% endstylesheets %} {% stylesheets '@CommonDirtyBundle/Resources/public/css_original/f.css' %} <link href="{{ asset_url }}" rel="stylesheet" type="text/css" /> {% endstylesheets %} {# First Row: GHIJKL #} <link href="{{ '../../src/Common/DirtyBundle/Resources/assets/css/g.css' }}" rel="stylesheet" type="text/css" /> <link href="{{ asset( '../src/Common/DirtyBundle/Resources/assets/css/h.css' ) }}" rel="stylesheet" type="text/css" /> {% stylesheets '../src/Common/DirtyBundle/Resources/assets/css/i.css' filter="cssrewrite" %} <link href="{{ asset_url }}" rel="stylesheet" type="text/css" /> {% endstylesheets %} {% stylesheets '../src/Common/DirtyBundle/Resources/assets/css/j.css' %} <link href="{{ asset_url }}" rel="stylesheet" type="text/css" /> {% endstylesheets %} {% stylesheets '@CommonDirtyBundle/Resources/assets/css/k.css' filter="cssrewrite" %} <link href="{{ asset_url }}" rel="stylesheet" type="text/css" /> {% endstylesheets %} {% stylesheets '@CommonDirtyBundle/Resources/assets/css/l.css' %} <link href="{{ asset_url }}" rel="stylesheet" type="text/css" /> {% endstylesheets %} </head> <body> <div class="container"> <p> <img alt="Devil" src="../bundles/commondirty/images/devil.png"> <img alt="Devil" src="{{ asset('bundles/commondirty/images/devil.png') }}"> </p> <p> <div class="a"> A </div> <div class="b"> B </div> <div class="c"> C </div> <div class="d"> D </div> <div class="e"> E </div> <div class="f"> F </div> </p> <p> <div class="g"> G </div> <div class="h"> H </div> <div class="i"> I </div> <div class="j"> J </div> <div class="k"> K </div> <div class="l"> L </div> </p> </div> </body> </html> The container.css: div.container { border: 1px solid red; padding: 0px; } div.container img, div.container div { border: 1px solid green; padding: 5px; margin: 5px; width: 64px; height: 64px; display: inline-block; vertical-align: top; } And a.css, b.css, c.css, etc: all identical, just changing the color and the CSS selector. .a { background: red url('../images/devil.png'); } The "directories" structure is: Directories All this came, because I did not want the individual original files exposed to the public, specially if I wanted to play with "less" filter or "sass" or similar... I did not want my "originals" published, only the compiled one. But there are good news. If you don't want to have the "spare CSS" in the public directories... install them not with --symlink, but really making a copy. Once "assetic" has built the compound CSS, and you can DELETE the original CSS from the filesystem, and leave the images: Compilation process Note I do this for the --env=prod environment. Just a few final thoughts: * *This desired behaviour can be achieved by having the images in "public" directory in Git or Mercurial and the "css" in the "assets" directory. That is, instead of having them in "public" as shown in the directories, imagine a, b, c... residing in the "assets" instead of "public", than have your installer/deployer (probably a Bash script) to put the CSS temporarily inside the "public" dir before assets:install is executed, then assets:install, then assetic:dump, and then automating the removal of CSS from the public directory after assetic:dump has been executed. This would achive EXACTLY the behaviour desired in the question. *Another (unknown if possible) solution would be to explore if "assets:install" can only take "public" as the source or could also take "assets" as a source to publish. That would help when installed with the --symlink option when developing. *Additionally, if we are going to script the removal from the "public" dir, then, the need of storing them in a separate directory ("assets") disappears. They can live inside "public" in our version-control system as there will be dropped upon deploy to the public. This allows also for the --symlink usage. BUT ANYWAY, CAUTION NOW: As now the originals are not there anymore (rm -Rf), there are only two solutions, not three. The working div "B" does not work anymore as it was an asset() call assuming there was the original asset. Only "C" (the compiled one) will work. So... there is ONLY a FINAL WINNER: Div "C" allows EXACTLY what it was asked in the topic: To be compiled, respect the path to the images and do not expose the original source to the public. The winner is C A: The cssrewrite filter is not compatible with the @bundle notation for now. So you have two choices: * *Reference the CSS files in the web folder (after: console assets:install --symlink web) {% stylesheets '/bundles/myCompany/css/*." filter="cssrewrite" %} *Use the cssembed filter to embed images in the CSS like this. {% stylesheets '@MyCompanyMyBundle/Resources/assets/css/*.css' filter="cssembed" %} A: I offen manage css/js plugin with composer which install it under vendor. I symlink those to the web/bundles directory, that's let composer update bundles as needed. exemple: 1 - symlink once at all (use command fromweb/bundles/ ln -sf vendor/select2/select2/dist/ select2 2 - use asset where needed, in twig template : {{ asset('bundles/select2/css/fileinput.css) }} Regards.
unknown
d3577
train
OK, Let's reproduce what you have said For this example I've used an Oracle Database. We have table t1 with let's say 4 columns (the ones that you mentioned) create table t1( main_product_number int, product_number int, product_title varchar2(20), product_version varchar2(40) ); Populate the table with some imaginary values insert into t1 values (NULL, 1,'Banana','Master Retail Price'); insert into t1 values (5, 2, 'Banana','Sale Price'); insert into t1 values (7, 3, 'Banana','Black Friday Price'); Do a simple select to see the data: select * from t1; MAIN_PRODUCT_NUMBER PRODUCT_NUMBER PRODUCT_TITLE PRODUCT_VERSION - 1 Banana Master Retail Price 5 2 Banana Sale Price 7 3 Banana Black Friday Price For all of the the products that are not 'Master Retail Price', I need to populate the Master Retail Price product number in to the Main Product Number Column. Hmmm... Let's use a correlated subquery for this task in a beautiful self join: update t1 a set a.main_product_number=( select product_number from t1 b where a.product_title = b.product_title and b.product_version='Master Retail Price' and b.main_product_number is null ) where a.product_version <> 'Master Retail Price'; Now all of the products that are not master retail price, their main product number will be populated with the master retail price product number, as you can see in the select bellow. MAIN_PRODUCT_NUMBER PRODUCT_NUMBER PRODUCT_TITLE PRODUCT_VERSION - 1 Banana Master Retail Price 1 2 Banana Sale Price 1 3 Banana Black Friday Price Hope it helps you.
unknown
d3578
train
They'll be the same. For example, <C> will match all of the following: c c c c c c c c c c c c c c c c c c c c c c c c c c c And <A> will match all of the following: a a a a a a a a a a a a a a a a a a a a a a a a a a a As a result, the EBNF for both will match. In general, if the left recursion is at the very beginning and the right recursion is at the very end, they will look similar: <A> -> a | a <A> <C> -> c | <L> c EBNF: <A> -> a | a a* <A> -> a+ <C> -> c | c* c <C> -> c+ What this EBNF grammar doesn't express is how the expression is parsed. In converting from BNF to EBNF, you lose the expressiveness. However, you can make it explicit by avoiding +: <A> -> a a* <C> -> c* c Of course, the fact that both reduce to E+ means you can parse them as left-recursive or right-recursive, and the result won't matter. That's not always true—(2-3)-4 ≠ 2-(3-4)—but you do have the option of converting <C> to a right-recursive production, and the result will be the same.
unknown
d3579
train
:dependent => :destroy will call the destroy method on the model not the controller. From the documentation: If set to :destroy all the associated objects are destroyed alongside this object by calling their destroy method. That is, if you want something custom to your note_categories before being destroyed, you'll have to either override the destroy method in your NoteCategory model, or use an after_destroy/before_destroy callback. Either way, using :dependent => :destroy will never execute code contained within your controller, which is why you're not seeing the output of the puts statement in the terminal.
unknown
d3580
train
Have you tried this? You can search the text using regular expressions. A: does not it help, if you take html page as text, strip html tags: String noHTMLString = htmlString.replaceAll("\\<.*?\\>", ""); and now count what you need in noHTMLString ? It could be helpful, if you have html page with markup like: this is <span>cool</span> and you need to look for text "is cool" (because prev html page will be transformed into "this is cool" string). To count you can use StringUtils from Apache Commons Lang, it has special method called countMatches. Everything together should work as: String htmlString = "this is <span>cool</span>"; String noHTMLString = htmlString.replaceAll("\\<.*?\\>", ""); int count = StringUtils.countMatches( noHTMLString, "is cool"); I would go with that approach, at least give it a try. It sounds better than parsing html, and then traversing it looking for words you need...
unknown
d3581
train
primitive placeholder can be found in @react-three/fiber, importing this module will resolve the error. So the final code looks like: import React, { Suspense } from 'react' import { Canvas } from '@react-three/fiber' import { useGLTF } from '@react-three/drei' const MagicRoom = () => { // Importing model const Model = () => { const gltf = useGLTF('./libs/the_magic_room/scene.gltf', true) return <primitive object={gltf.scene} dispose={null} scale={1} /> } return ( <Canvas> <Suspense fallback={null}> <Model /> </Suspense> </Canvas> ) } export default MagicRoom
unknown
d3582
train
I think this is probably because you are not using setState in the right way, you should do : this.setState({ noteArray: noteArray }) and not : this.setState({ noteArray }); hope I helped you ;)
unknown
d3583
train
The exact code depends on your math library (probably included in the same package as your C library). You can look at the glibc implementation if you want to see one implementation. This is the function that gets used in glibc (from sysdeps/ieee754/flt-32/e_fmodf.c). float __ieee754_fmodf (float x, float y) { int32_t n,hx,hy,hz,ix,iy,sx,i; GET_FLOAT_WORD(hx,x); GET_FLOAT_WORD(hy,y); sx = hx&0x80000000; /* sign of x */ hx ^=sx; /* |x| */ hy &= 0x7fffffff; /* |y| */ /* purge off exception values */ if(hy==0||(hx>=0x7f800000)|| /* y=0,or x not finite */ (hy>0x7f800000)) /* or y is NaN */ return (x*y)/(x*y); if(hx<hy) return x; /* |x|<|y| return x */ if(hx==hy) return Zero[(u_int32_t)sx>>31]; /* |x|=|y| return x*0*/ /* determine ix = ilogb(x) */ if(hx<0x00800000) { /* subnormal x */ for (ix = -126,i=(hx<<8); i>0; i<<=1) ix -=1; } else ix = (hx>>23)-127; /* determine iy = ilogb(y) */ if(hy<0x00800000) { /* subnormal y */ for (iy = -126,i=(hy<<8); i>=0; i<<=1) iy -=1; } else iy = (hy>>23)-127; /* set up {hx,lx}, {hy,ly} and align y to x */ if(ix >= -126) hx = 0x00800000|(0x007fffff&hx); else { /* subnormal x, shift x to normal */ n = -126-ix; hx = hx<<n; } if(iy >= -126) hy = 0x00800000|(0x007fffff&hy); else { /* subnormal y, shift y to normal */ n = -126-iy; hy = hy<<n; } /* fix point fmod */ n = ix - iy; while(n--) { hz=hx-hy; if(hz<0){hx = hx+hx;} else { if(hz==0) /* return sign(x)*0 */ return Zero[(u_int32_t)sx>>31]; hx = hz+hz; } } hz=hx-hy; if(hz>=0) {hx=hz;} /* convert back to floating value and restore the sign */ if(hx==0) /* return sign(x)*0 */ return Zero[(u_int32_t)sx>>31]; while(hx<0x00800000) { /* normalize x */ hx = hx+hx; iy -= 1; } if(iy>= -126) { /* normalize output */ hx = ((hx-0x00800000)|((iy+127)<<23)); SET_FLOAT_WORD(x,hx|sx); } else { /* subnormal output */ n = -126 - iy; hx >>= n; SET_FLOAT_WORD(x,hx|sx); x *= one; /* create necessary signal */ } return x; /* exact output */ }
unknown
d3584
train
You need to know a name for each tab and how many to create, so create an array with the names you want, that tells you how many are needed and the name that should be used in the javascript call. /* My try making the number of tabs dynamically: */ $tabs = ['Home', 'News', 'Contact', 'About']; foreach ($tabs as $tab){ ?> <button class="tablink" onclick="openPage('<?php echo $tab;?>', this, 'red')>Name</button> <div id="<?php echo $tab;?>" class="tabcontent"> <h3>Name</h3> <p> Some text...</p> </div> <?php } // endforeach A: Key Issue The reason your code doesn't work is because you've missed a $ symbol from the line: $current_tab_number = current_tab_number + 1; So, effectively, your while loop becomes infinite as you don't increment the $current_tab_number variable. Replace that line with: $current_tab_number = current_tab_number + 1; // OR $current_tab_number++; Which then becomes: while($current_tab_number < $end_number){ $current_tab_number++; // Print tabs here } Alternatively you could use a for loop like: for($i = 0; $i < $end_number; $i++){ // print tabs here } Additionally Using variables outside of PHP tags This line: <button class="tablink" onclick="openPage('$current_tab_number', this, 'red')">Name</button> Will literally print the string $current_tab_number what it should be is: <button class="tablink" onclick="openPage('<?php echo $current_tab_number; ?>', this, 'red')">Name</button> Same here: <div id="$current_tab_number" class="tabcontent"> <div id="<?php echo $current_tab_number; ?>" class="tabcontent"> We could easily get around this by just using echo to print the html instead. For example: echo <<<EOT <button class="tablink" onclick="openPage('{$current_tab_number}', this, 'red')">Name</button> <div id="{$current_tab_number}" class="tabcontent"> <h3>Name</h3> <p> Some text...</p> </div> EOT; This method doesn't add data to the divs The output of this code is expected to be: <button class="tablink" onclick="openPage('Home', this, 'red')" id="defaultOpen">Home</button> <button class="tablink" onclick="openPage('News', this, 'green')">News</button> <div id="Home" class="tabcontent"> <h3>Home</h3> <p> home... </p> </div> <div id="News" class="tabcontent"> <h3>News</h3> <p> news... </p> </div> But will actually be: <button class="tablink" onclick="openPage('<?php echo $current_tab_number; ?>', this, 'red')">Name</button> <div id="<?php echo $current_tab_number; ?>" class="tabcontent"> <h3>Name</h3> <p> Some text...</p> </div> <button class="tablink" onclick="openPage('<?php echo $current_tab_number; ?>', this, 'red')">Name</button> <div id="<?php echo $current_tab_number; ?>" class="tabcontent"> <h3>Name</h3> <p> Some text...</p> </div> To add data to the output we need to source it from somewhere, for example: $tab_list = [ 1 => [ "name" => "Home", "content" => "Some text for content..." ], 2 => [ "name" => "About", "content" => "Some text for about..." ] ]; foreach($tab_list as $tab_number => $tab){ echo " <button class=\"tablink\" onclick=\"openPage('{$tab_number}', this, 'red')\">Name</button> <div id=\"{$tab_number}\" class=\"tabcontent\"> <h3>{$tab["name"]}</h3> <p>{$tab["content"]}</p> </div> "; } A: You can iterate over the tab names and concatenate the string to generate the html code for tabs. For example: $tab_names = ['home', 'about', 'contact']; $resulting_html_code = ""; foreach ($tab_names as $tab){ $resulting_html_code .= "{$resulting_html_code} <div class='tab'>{$tab}</div>"; }
unknown
d3585
train
After having run the fit line in my code, I have realized that the input-shape number must be equal to the number of columns obtained after the data preprocessing. Otherwise, it will result in an error.
unknown
d3586
train
it is a 9992x8750 image Yes, you're in the danger zone for a 32-bit process. That image requires a big chunk of contiguous address space, 334 megabytes. You'll easily get that when you load the image early, right after your program starts. You can get about 650 megabytes at that point, give or take. But that goes down-hill from there as your program allocates and releases memory and loads a couple of assemblies. The address space gets fragmented, the holes between the allocations are getting smaller. Just loading a DLL with an awkward base address can suddenly cut the largest hole by more than a factor of two. The problem is not the total amount of virtual memory available, it can be a gigabyte or more, it is the size of the largest available chunk. After a while, having a 90 megabyte allocation fail is not entirely unusual. Just that one allocation can fail, you could still allocate a bunch of, say, 50 megabyte chunks. There is no cure for address space fragmentation and you can't fix the way that the Bitmap class stores the pixel data. But one, specify a 64-bit version of Windows as a requirement for your program. It provides gobs of virtual memory, fragmentation is a non-issue. If you want to chase it down then you can get insight in the VM layout with the SysInternals' VMMap utility. Beware of the information overload you may experience. A: I suspect that your main problem is that you've got a number of bitmap and graphics instances in use at the same time. It's probably worth trying to reorganise your code so that as few of these are present at any one time as possible, using .Dispose() to remove items you're finished with. A: Try to work on Windows 64-bit, That's the solution of most of memory problems.
unknown
d3587
train
Just use xcodebuild archive command
unknown
d3588
train
I used transform: translate(); to move object. Play with cubic-bezier here to achieve perfect animation. But I used the same which was on the website you posted in example. Also I removed opacity, visibility * { margin: 0; padding: 0; border: 0; } .img__wrap { position: relative; height: 200px; width: 257px; } .img__description { position: absolute; top: 0; bottom: 0; left: 0; right: 0; background: rgba(29, 106, 154, 0.72); color: #fff; transform: translateX(-100%); transition: all 600ms cubic-bezier(0.645, 0.045, 0.095, 1.08); } .img__wrap:hover .img__description { transform: translate(0); } <div class="img__wrap"> <img class="img__img" src="http://placehold.it/257x200.jpg" /> <p class="img__description">Teext.</p> </div> A: Ok, first, I would suggest using "all" for the transition element instead of defining the same values for all of the proprieties you want to transition. transition: all .2s; Second, let's get the bezier right. I think this is close enough: cubic-bezier(1.000, 0.215, 0.355, 0.990) So the transition propriety should look like this: transition: all .2s cubic-bezier(1.000, 0.215, 0.355, 0.990); For the text animation I suggest using animate.css and use fadeInLeft. A: To darken the image, you need to change the opacity of it. To zoom the image, use a scale transform and to move the caption text, you need a translateX transform. Apply those css styles and their respective transitions (you need a transition in the image as well as in the text) and you're left with the following: * { margin: 0; padding: 0; border: 0; } .img__wrap { position: relative; background: black; height: 200px; width: 257px; overflow: hidden; } .img__img { opacity: 1; transition: all 0.2s; } .img__description { position: absolute; color: #fff; transition: all .2s; left: 15px; right: 0; bottom: 15px; transform: translateX(-100%); } .img__wrap:hover .img__img { opacity: 0.5; transform: scale(1.2); } .img__wrap:hover .img__description { transform: translateX(0); } <div class="img__wrap"> <img class="img__img" src="http://placehold.it/257x200.jpg" /> <p class="img__description">Teext.</p> </div>
unknown
d3589
train
(Edit: see solution below using triggers) The problem: Default values don't override explicitly setting a column to NULL Per the SQLite docs: The DEFAULT clause specifies a default value to use for the column if no value is explicitly provided by the user when doing an INSERT. The issue is that when Persistent is doing the insert, it's specifying the createdAt and updatedAt columns as NULL: [Debug#SQL] INSERT INTO "user"("email","created_at","updated_at") VALUES(?,?,?); [PersistText "[email protected]",PersistNull,PersistNull] To reach this conclusion, I modified your snippet to add SQL logging (I just copied the source of runSqlite and changed it to log to STDOUT). I used a file instead of in-memory database just so I could open the database in a SQLite editor and verify that the default values were being set. -- Pragmas and imports are taken from a snippet in the Yesod book. Some of them may be superfluous. {-# LANGUAGE EmptyDataDecls #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} import Database.Persist import Database.Persist.Sqlite import Database.Persist.TH import Control.Monad.IO.Class (liftIO) import Data.Time import Control.Monad.Trans.Resource import Control.Monad.Logger import Control.Monad.IO.Class import Data.Text share [mkPersist sqlSettings, mkMigrate "migrateAll"] [persistLowerCase| User email String createdAt UTCTime Maybe default=CURRENT_TIME updatedAt UTCTime Maybe default=CURRENT_TIME deriving Show |] runSqlite2 :: (MonadBaseControl IO m, MonadIO m) => Text -- ^ connection string -> SqlPersistT (LoggingT (ResourceT m)) a -- ^ database action -> m a runSqlite2 connstr = runResourceT . runStdoutLoggingT . withSqliteConn connstr . runSqlConn main = runSqlite2 "bar.db" $ do runMigration migrateAll userId <- insert $ User "[email protected]" Nothing Nothing liftIO $ print userId user <- get userId case user of Nothing -> liftIO $ putStrLn ("coulnt find userId=" ++ (show userId)) Just u -> liftIO $ putStrLn ("user=" ++ (show user)) Here's the output I get: Max@maximilians-mbp /tmp> stack runghc sqlite.hs Run from outside a project, using implicit global project config Using resolver: lts-3.10 from implicit global project's config file: /Users/Max/.stack/global/stack.yaml Migrating: CREATE TABLE "user"("id" INTEGER PRIMARY KEY,"email" VARCHAR NOT NULL,"created_at" TIMESTAMP NULL DEFAULT CURRENT_TIME,"updated_at" TIMESTAMP NULL DEFAULT CURRENT_TIME) [Debug#SQL] CREATE TABLE "user"("id" INTEGER PRIMARY KEY,"email" VARCHAR NOT NULL,"created_at" TIMESTAMP NULL DEFAULT CURRENT_TIME,"updated_at" TIMESTAMP NULL DEFAULT CURRENT_TIME); [] [Debug#SQL] INSERT INTO "user"("email","created_at","updated_at") VALUES(?,?,?); [PersistText "[email protected]",PersistNull,PersistNull] [Debug#SQL] SELECT "id" FROM "user" WHERE _ROWID_=last_insert_rowid(); [] UserKey {unUserKey = SqlBackendKey {unSqlBackendKey = 1}} [Debug#SQL] SELECT "email","created_at","updated_at" FROM "user" WHERE "id"=? ; [PersistInt64 1] user=Just (User {userEmail = "[email protected]", userCreatedAt = Nothing, userUpdatedAt = Nothing}) Edit: Solution using triggers: You can implement created_at and updated_at columns with triggers. This approach has some nice advantages. Basically there's no way for updated_at to be enforced by a DEFAULT value anyway, so you need a trigger for that if you want the database (and not the application) to manage it. Triggers also solve for updated_at being set when executing raw SQL queries or batch updates. Here's what this solution looks like: CREATE TRIGGER set_created_and_updated_at AFTER INSERT ON user BEGIN UPDATE user SET created_at=CURRENT_TIMESTAMP, updated_at=CURRENT_TIMESTAMP WHERE user.id = NEW.id; END CREATE TRIGGER set_updated_at AFTER UPDATE ON user BEGIN UPDATE user SET updated_at=CURRENT_TIMESTAMP WHERE user.id = NEW.id; END Now the output is as expected: [Debug#SQL] INSERT INTO "user"("email","created_at","updated_at") VALUES(?,?,?); [PersistText "[email protected]",PersistNull,PersistNull] [Debug#SQL] SELECT "id" FROM "user" WHERE _ROWID_=last_insert_rowid(); [] UserKey {unUserKey = SqlBackendKey {unSqlBackendKey = 1}} [Debug#SQL] SELECT "email","created_at","updated_at" FROM "user" WHERE "id"=? ; [PersistInt64 1] user=Just (User {userEmail = "[email protected]", userCreatedAt = Just 2016-02-12 16:41:43 UTC, userUpdatedAt = Just 2016-02-12 16:41:43 UTC}) The main downside to the trigger solution is that it's a slight hassle to set up the triggers. Edit 2: Avoiding Maybe and Postgres support If you'd like to avoid having Maybe values for createdAt and updatedAt, you can set them on the server to some dummy value like so: -- | Use 'zeroTime' to get a 'UTCTime' without doing any IO. -- The main use case of this is providing a dummy-value for createdAt and updatedAt fields on our models. Those values are set by database triggers anyway. zeroTime :: UTCTime zeroTime = UTCTime (fromGregorian 1 0 0) (secondsToDiffTime 0) And then let the server set the values through triggers. Slightly hacky, but in practice works great. Postgresql triggers The OP asked for SQLite but I'm sure people are reading this for other databases as well. Here's the Postgresql version: CREATE OR REPLACE FUNCTION create_timestamps() RETURNS TRIGGER AS $$ BEGIN NEW.created_at = now(); NEW.updated_at = now(); RETURN NEW; END; $$ language 'plpgsql'; CREATE OR REPLACE FUNCTION update_timestamps() RETURNS TRIGGER AS $$ BEGIN NEW.updated_at = now(); RETURN NEW; END; $$ language 'plpgsql'; CREATE TRIGGER users_insert BEFORE INSERT ON users FOR EACH ROW EXECUTE PROCEDURE create_timestamps(); CREATE TRIGGER users_update BEFORE UPDATE ON users FOR EACH ROW EXECUTE PROCEDURE update_timestamps(); A: According to http://www.yesodweb.com/book/persistent The default attribute has absolutely no impact on the Haskell code itself; you still need to fill in all values. This will only affect the database schema and automatic migrations. do time <- liftIO getCurrentTime insert $ User "[email protected]" time time
unknown
d3590
train
For a complete list of mission commands, see the MAV_CMD section in this list at https://pixhawk.ethz.ch. Not every flight controller that speaks mavlink implements every mission command. You'll need to research your particular flight control software to see what it supports. You'll also need to learn what each command does and how it is used, which isn't always obvious. This page at the ArduPilot wiki is a good place to start, because it describes the commands implemented by a popular flight controller (ArduCopter), describes what the commands do, and exactly what the command parameters mean: http://copter.ardupilot.com/wiki/mission-planning-and-analysis/mission-command-list/ You will have to do a little translation because that page uses command names as they show up in a ground control station; For example Takeoff -> MAV_CMD_NAV_TAKEOFF, Condition-Delay -> MAV_CMD_CONDITION_DELAY. There are a lot of commands, and some of them are esoteric, but to fly a basic mission where the vehicle takes off, flies through some waypoints, and then lands, you only need a few commands: MAV_CMD_NAV_TAKEOFF MAV_CMD_NAV_LAND MAV_CMD_NAV_WAYPOINT A: The best list of mission commands for ArduPilot flight controller is MAVLink Mission Command Messages (MAV_CMD). This lists all the mission commands and parameters that are actually supported on all of the vehicle platforms (which is not quite the same thing as what information is listed in the MAVLink protocol definition. If you're working on Copter, the Copter Mission Command List is useful for working with Mission Planner. However it is not quite as useful for working with DroneKit as it doesn't map the actual command parameters. If you're working on any other flight controller then you'll have to work out what set of commands they support. A: Just started looking at DroneKit myself, so hopefully others will chime in to better answer your question. The DroneKit API documentation identifies the built in commands here: http://python.dronekit.io/automodule.html That said, it looks like the DroneKit function send_mavlink() should allow you to send any mavlink message to your vehicle, in the event that there is a specific mavlink command not available in DroneKit. I think this is where you can find the list of mavlink message types: https://pixhawk.ethz.ch/mavlink/ Good luck
unknown
d3591
train
We're looking into it. Meanwhile, one workaround is editing .idea/sbt.xml and change the jdk option line to <option name="jdk" value="1.8" /> (or whatever you named the SDK in your project structure) and then refreshing your project. Update: The latest Nightlies of the Scala plugin change how the project JDK is set, which should solve this. A: IntelliJ has a closed ticket for this issue: https://youtrack.jetbrains.com/issue/SCL-6823 I have created a new ticket: https://youtrack.jetbrains.com/issue/SCL-10631
unknown
d3592
train
Endianess also affects the way the compiler puts bit-field fields (the ":4" at the end means it's only 4 bits worth of the value) within bytes of the resulting structure. For big-endian, the bits populate from the most-significant. For little-endian, the bits populate from the least-significant.
unknown
d3593
train
Yes, you can use git to deploy your site content and manage it via version control. You can set your .gitignore to the following folders .DS_Store *.log /vendor /storage /plugins/october /modules/**/* /config /bootstrap /themes/demo artisan index.php .htaccess And it will upload the text/theme files you add/commit. After the git pull you might wish to do a cache refresh php artisan cache:clear or install the cache clear widget(https://octobercms.com/plugin/romanov-clearcachewidget)
unknown
d3594
train
Just thought id add my solution to this unanswered question - Most algorithms I tried out were just too computationally complex. I settled on an approximation of the maximum-coverage path which was quite efficiently computed using the reverse wavefront algorithm. Using this algorithm I was able to construct a maximum-coverage path of a 250x250 array of grid cells in around 5 seconds, which was certainly acceptable in my scenario.
unknown
d3595
train
Like the comment posted above says, there are two problems here: * *You're running the command in the parent, rather than the child. See the fork manual. *wait does not give you the return code. It gives you an integer that you need to decode. See the wait manual. Here's the corrected code: #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <sys/wait.h> int main() { int x ; int Status =-99; char* cmds[6]; cmds[1] = "who"; cmds[2] = "ls"; cmds[3] = "date"; cmds[4] = "kldsfjflskdjf"; int i=10; while (i--) { printf("\nMenu:\n"); printf("1)who \n"); printf("2)ls \n");printf("3)date\n"); printf("choice :"); scanf("%d", &x); int child = fork(); if (child == 0) { execlp(cmds[x], cmds[x], NULL); printf("\nERROR\n"); exit(99); } else { wait(&Status); printf("Status : %d", WEXITSTATUS(Status)); } } return 0; }
unknown
d3596
train
Change <form action="insert.php"> to <form action="insert.php" method="post"> The default HTTP method of a form is GET. You must specify POST since you are accessing it using $_POST. Then you should be able to get the value of the Data field in $Data. If it doesn't fix the errors, try the following: 1 Check the datatype of Data column in your MySQL table, and make sure that your $Data is in correct format. For example: If your Data column is a DATE column, $Data should be in YYYY-mm-dd format. Other Date - Time types and format is given here: Date and Time Types Description ----------------------------------------------------------------- DATE A date value in CCYY-MM-DD format ----------------------------------------------------------------- TIME A time value in hh:mm:ss format ----------------------------------------------------------------- DATETIME A date and time value inCCYY-MM-DD hh:mm:ss format ----------------------------------------------------------------- TIMESTAMP A timestamp value in CCYY-MM-DD hh:mm:ss format ----------------------------------------------------------------- YEAR A year value in CCYY or YY format ----------------------------------------------------------------- Extra Read: Methods GET and POST in HTML forms - what's the difference?http://jkorpela.fi/forms/methods.html A: In the database you need to set the date field to type date and in the input field of the form you need to capture the correct date format. Or alternatively use a date picker field <label><strong>Date </strong> </label></div> <input type="date" name="date"> A: If you need the current date just you the built-in date in php $now = date('Y-m-d'); Else check your sql date column and make sure it's Varchar then do this <form action="insert.php" method="post"> //in your insert try using '".$Data."' in place of '$Data'
unknown
d3597
train
Because the .net compiler doesn't know what type of delegate to turn the lambda into. It could be an Action, or it could be a void MyDelegate(). If you change it as follows, it should work: Foo(new Action(() => { Console.WriteLine("c"); })); A: Why should the compiler know how to two-step: from lambda -> Action -> Delegate? This compiles: class Test { private static void Foo(Delegate d) { } private static void Bar(Action a) { } static void Main() { Foo(new Action(() => { Console.WriteLine("world2"); })); // Action converts to Delegate implicitly Bar(() => { Console.WriteLine("world3"); }); // lambda converts to Action implicitly Foo((Action)(() => { Console.WriteLine("world3"); })); // This compiles } }
unknown
d3598
train
After a heated discussion, it has been suggested that you rewrite your getProducts method to be more Promise-like. Don't mix callbacks with promises, put your code inside the then methods. Chain promises where you can. Either of these solutions described here should suffice You have to write your getProducts inside a then fetchData().then((jsonResults)=> { // put the code surrounding getProducts here return { getProducts: jsonResults } }) Or, you could use await (see async functions): let products = await fetchData(); return { getProducts: products } Example > console.log(Promise.resolve([1,2,3])) Promise {<resolved>: Array(3)} __proto__: Promise [[PromiseStatus]]: "resolved" [[PromiseValue]]: Array(3) > Promise.resolve([1,2,3]).then((jsonResults) => { console.log(jsonResults); }) (3) [1, 2, 3] A: You can use await or you can return the promise and handle the callback reference : https://softwareengineering.stackexchange.com/questions/279898/how-do-i-make-a-javascript-promise-return-something-other-than-a-promise
unknown
d3599
train
If you would use FCKeditor it would allow to you get clean HTML or XHTML (editor.GetXHTML()) which you could then write into DB. Actually it's not that much important what you write into DB, because usially you write original HTML (you can always strip from it saspicious tags if needed). In order to prevent XSS attacks it is essential to properly encode content before displaying it on the web-page. For .NET there is AntiXSS library for that at CodePlex.com For PHP you may want to look at the following libraries: * *Zend_Filter *HTML Sanitizer *PHP Input Filter And also this article: * *Avoiding XSS security attacks to sites that use HTML editors
unknown
d3600
train
In case when values are the same, there are printed in the same place. But you can use http://api.highcharts.com/highcharts#plotOptions.series.pointPlacement to move serie. A: I have typically done this by adding a decimal to the x value of the points that need to 'stack', as it were. There isn't a great (easy) way to do it dynamically that I have found, but if your values are going to fall within a fairly controlled range, it works well. Example: * *http://jsfiddle.net/zew9dt8e/2/
unknown