query_id
stringlengths
4
64
query_authorID
stringlengths
6
40
query_text
stringlengths
66
72.1k
candidate_id
stringlengths
5
64
candidate_authorID
stringlengths
6
40
candidate_text
stringlengths
9
101k
fff6db255522635f13b13182e38828870c559c549e20f388730ffeab0609801c
['31c0a2720c9240a3ad6f17414808b948']
Installed bicon-git, this is written in .bashrc # hack to launch bicon if not launched if ! [[ "$(ps -p $(ps -p $(echo $$) -o ppid=) -o comm=)" =~ 'bicon'* ]]; then bicon.bin fi Launch ranger [~] -> ranger make Shift + s problem [dir] -> exit exit done [dir] -> exit [~] -> How to fix double input? p.s. <PERSON>, <PERSON>, st
106037c4903ca701ad91847ab5edaf4e76b4fb24abc89f58e6b2325bf8bc2dfc
['31c0a2720c9240a3ad6f17414808b948']
I currently run a headless server (Ubuntu server 12.10) with various applications running on the box accessed via web interfaces (transmission, plex etc). The box sits at a site with a quick and serves the purpose of being a central file repository, torrent box. I was wondering if there was any application I could install on it which I could access via a web interface, password protected, which allowed me to punch in a file URL and it could download that file to a predetermined folder? Something similar to the transmission client for ubuntu server but for files off the web?
7c4997c7e8eeb3f10a17bda628c6648bdeed0d4c9b6f1802e6fd40c8077d06f7
['31c3685d2b804db9a3076929f128c81c']
I'm still pretty new to XSLT and I have the following XML which I need to remove the namespace. I also found the following XSLT which almost gets the job done with the exception that it will not retain the xmlns declaration. XML: <?xml version="1.0" encoding="UTF-8"?> <etd_ms:thesis xmlns:etd_ms="http://www.ndltd.org/standards/metadata/etdms/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ndltd.org/standards/metadata/etdms/1.0/ http://www.ndltd.org/standards/metadata/etdms/1.0/etdms.xsd"> <etd_ms:title>Aspects of negritude in the works of two Harlem renaissance authors : <PERSON> and <PERSON>:title> <etd_ms:creator><PERSON>, Asselin</etd_ms:creator> <etd_ms:subject/> <etd_ms:publisher>Concordia University</etd_ms:publisher> <etd_ms:contributor role="advisor">Butovsky, M</etd_ms:contributor> <etd_ms:date>1980</etd_ms:date> <etd_ms:type>Electronic Thesis or Dissertation</etd_ms:type> <etd_ms:identifier>TC-QMG-1</etd_ms:identifier> <etd_ms:format>text</etd_ms:format> <etd_ms:identifier>https://spectrum.library.concordia.ca/1/1/MK49585.pdf</etd_ms:identifier> <etd_ms:language>en</etd_ms:language> <etd_ms:degree> <etd_ms:name>M.A.</etd_ms:name> <etd_ms:level>masters</etd_ms:level> <etd_ms:discipline>Dept. of English</etd_ms:discipline> <etd_ms:grantor>Concordia University</etd_ms:grantor> </etd_ms:degree> </etd_ms:thesis> and here's the XSLT: <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output indent="yes" method="xml" encoding="utf-8" omit-xml-declaration="no"/> <!-- Stylesheet to remove all namespaces from a document --> <!-- NOTE: this will lead to attribute name clash, if an element contains two attributes with same local name but different namespace prefix --> <!-- Nodes that cannot have a namespace are copied as such --> <!-- template to copy elements --> <xsl:template match="*"> <xsl:element name="{local-name()}"> <xsl:apply-templates select="@* | node()"/> </xsl:element> </xsl:template> <!-- template to copy attributes --> <xsl:template match="@*"> <xsl:attribute name="{local-name()}"> <xsl:value-of select="."/> </xsl:attribute> </xsl:template> <!-- template to copy the rest of the nodes --> <xsl:template match="comment() | text() | processing-instruction()"> <xsl:copy/> </xsl:template> </xsl:stylesheet> The results is the following: <?xml version="1.0" encoding="UTF-8"?> <thesis xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ndltd.org/standards/metadata/etdms/1.0/ http://www.ndltd.org/standards/metadata/etdms/1.0/etdms.xsd"> <title>Aspects of negritude in the works of two Harlem renaissance authors : <PERSON> and <PERSON>> <creator><PERSON>, Asselin</creator> <subject/> <publisher>Concordia University</publisher> <contributor role="advisor">Butovsky, M</contributor> <date>1980</date> <type>Electronic Thesis or Dissertation</type> <identifier>TC-QMG-1</identifier> <format>text</format> <identifier>https://spectrum.library.concordia.ca/1/1/MK49585.pdf</identifier> <language>en</language> <degree> <name>M.A.</name> <level>masters</level> <discipline>Dept. of English</discipline> <grantor>Concordia University</grantor> </degree> </thesis> It's almost there, with the exception that I need to keep the xmlns declaration, so ultimatly the root element should be something like: <thesis xmlns="http://www.ndltd.org/standards/metadata/etdms/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ndltd.org/standards/metadata/etdms/1.0/ http://www.ndltd.org/standards/metadata/etdms/1.0/etdms.xsd"> Can someone help me resolving this issue? Thanks.
b5d663d8822e3c1deb21a5a46677c49df0130efaba613837aa0088814b69781a
['31c3685d2b804db9a3076929f128c81c']
My XSLT is validating a language code, but for some reason it doesn't work. It does an include of another xsl file that contains all possible language codes. <xsl:include href="inc/iso639-2.xsl"/> This file looks like this. <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:variable name="iso639-2"> <xsl:text>aar</xsl:text> <xsl:text>abk</xsl:text> <xsl:text>ace</xsl:text> <xsl:text>ach</xsl:text> <xsl:text>ada</xsl:text> <xsl:text>ady</xsl:text> <xsl:text>afa</xsl:text> <xsl:text>afh</xsl:text> <xsl:text>afr</xsl:text> <xsl:text>ain</xsl:text> <xsl:text>aka</xsl:text> <xsl:text>akk</xsl:text> <xsl:text>alb</xsl:text> <xsl:text>ale</xsl:text> <xsl:text>alg</xsl:text> <xsl:text>alt</xsl:text> <xsl:text>amh</xsl:text> <xsl:text>ang</xsl:text> <xsl:text>anp</xsl:text> <xsl:text>apa</xsl:text> <xsl:text>ara</xsl:text> <xsl:text>arc</xsl:text> <xsl:text>arg</xsl:text> <xsl:text>arm</xsl:text> <xsl:text>arn</xsl:text> <xsl:text>arp</xsl:text> <xsl:text>art</xsl:text> <xsl:text>arw</xsl:text> ... Then I have this template match which gets executed, but the test is successfull even though a language code such as "zzz" is not in the above list. <xsl:template match="etdms10:language | etdms11:language"> <language> <xsl:choose> <xsl:when test="string-length(text()) = 3 and contains($iso639-2, lower-case(text())"> <languageTerm type="code" authority="iso639-2b"> <xsl:apply-templates/> </languageTerm> </xsl:when> <xsl:otherwise> ... Any idea why my xsl:when is successful with language codes such as "zzz" , when it should not be? I really ensured language codes such as "zzz" aren't part of this list. Thanks Thanks
f01994ced964340694e26d7b0986353f3eb0af98e543251967c694d2472a9dc4
['31c4a3cdb395451b97f0c294a85b1198']
I installed Ubuntu on a secondary HDD but installled the bootloader in the old HDD EFI partition (disk windows is on). Grub still presents me with a boot menu where I can select OS and everything seems to be working correctly. What is the downside to what I have done?
a0950a4ec56a564f30c6d4b34d4034d0600f53e39218fbd9444ce5abb5d983b1
['31c4a3cdb395451b97f0c294a85b1198']
So as the title states I am unable to add a Quorum Witness to my cluster with the two options that do not involve azure. I've tried several different commands for the disk witness as you can see it is disk number 9. PS C:\Windows\system32> Set-ClusterQuorum -NodeAndDiskMajority 'C:\ClusterStorage\Volume2' Set-ClusterQuorum : An error occurred opening resource 'C:\ClusterStorage\Volume2'. At line:1 char:1 + Set-ClusterQuorum -NodeAndDiskMajority 'C:\ClusterStorage\Volume2' + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (:) [Set-ClusterQuorum], ClusterCmdletException + FullyQualifiedErrorId : ClusterObjectNotFound,Microsoft.FailoverClusters.PowerShell.SetClusterQuorumCommand PS C:\Windows\system32> Set-ClusterQuorum -NodeAndDiskMajority 'pacQuorumVol' Set-ClusterQuorum : An error occurred opening resource 'pacQuorumVol'. At line:1 char:1 + Set-ClusterQuorum -NodeAndDiskMajority 'pacQuorumVol' + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (:) [Set-ClusterQuorum], ClusterCmdletException + FullyQualifiedErrorId : ClusterObjectNotFound,Microsoft.FailoverClusters.PowerShell.SetClusterQuorumCommand PS C:\Windows\system32> Set-ClusterQuorum -NodeAndDiskMajority 'Cluster Disk 9' Set-ClusterQuorum : An error occurred opening resource 'Cluster Disk 9'. At line:1 char:1 + Set-ClusterQuorum -NodeAndDiskMajority 'Cluster Disk 9' + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (:) [Set-ClusterQuorum], ClusterCmdletException + FullyQualifiedErrorId : ClusterObjectNotFound,Microsoft.FailoverClusters.PowerShell.SetClusterQuorumCommand PS C:\Windows\system32> Set-ClusterQuorum -NodeAndDiskMajority '\\?\Volume{17A6910F-44F6-4A28-BB2F-EA2CBADE25C4}\' Set-ClusterQuorum : An error occurred opening resource '\\?\Volume{17A6910F-44F6-4A28-BB2F-EA2CBADE25C4}\'. At line:1 char:1 + Set-ClusterQuorum -NodeAndDiskMajority '\\?\Volume{17A6910F-44F6-4A28 ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (:) [Set-ClusterQuorum], ClusterCmdletException + FullyQualifiedErrorId : ClusterObjectNotFound,Microsoft.FailoverClusters.PowerShell.SetClusterQuorumCommand Every time I get the error that it can not open the resource. So I moved on to a file share witness. I have a synology rackstation and created an SMB share on it. I gave this share every possible permission, but get a code 67 every time I try to add it. This is so frustrating :( PS C:\Windows\system32> Set-ClusterQuorum -NodeAndFileShareMajority "\\corpnas1\pacClusterQuorom" Set-ClusterQuorum : There was an error configuring the file share witness '\\corpnas1\pacClusterQuorom'. There was an error granting the cluster access to the selected file share '\\corpnas1\pacClusterQuorom' Method failed with unexpected error code 67. At line:1 char:1 + Set-ClusterQuorum -NodeAndFileShareMajority "\\hostname\pacClusterQuo ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [Set-ClusterQuorum], ClusterCmdletException + FullyQualifiedErrorId : InvalidOperation,Microsoft.FailoverClusters.PowerShell.SetClusterQuorumComman I thought I could add a physical disk in a machine and use that as the disk witness, but it seems like that isn't the case. If it is, I can't find any documentation on how to achieve this.
e46569a2301f4b85ced912ddcbb96183be032768f677b0ce287f6ee0b928710d
['31eeb10c98dd44e8afc05b8b66c52020']
How can I iterate through my arguments to print these lines out for each of the arguments in my function, instead of typing each of them out? def validate_user(surname, username, passwd, password, errors): errors = [] surname = surname.strip() # no digits if not surname: errors.append('Surname may not be empty, please enter surname') elif len(surname) > 20: errors.append('Please shorten surname to atmost 20 characters') username = username.strip() if not username: errors.append('Username may not be empty, please enter a username') elif len(surname) > 20: errors.append('Please shorten username to atmost 20 characters')
243754d87c711d66e370d34c55257987462510d073423d5287461b73b6f09dcb
['31eeb10c98dd44e8afc05b8b66c52020']
I'm creating a record system, where a student can be enrolled into a class. # MODEL class Association(Base): __tablename__ = 'association' class_id = Column(Integer, ForeignKey('classes.id'), primary_key=True) student_id = Column(Integer, ForeignKey('students.id'), primary_key=True) theClass = relationship("Class") class Student(Base): __tablename__ = 'students' id = Column(Integer, primary_key=True) name = Column(String(30)) classlist = relationship("Association", backref='student') class Class(Base): __tablename__ = 'classes' id = Column(Integer, primary_key=True) name = Column(String(20), nullable=False) teacher_id = Column(Integer, ForeignKey('teachers.id')) enrolled_students = relationship("Association") I want to display all of the students that are not yet enrolled in a class, so I've used the following code in my program and template, but it just displays all of the students on the page. currentClass = session.query(Class).filter_by(id=class_id).first() students = session.query(Student).all() # TEMPLATE % for st in students: % for assoc in currentClass.enrolled_students: % if st.id != assoc.student_id: <input type="checkbox" name="student_id" value="${ st.id }" >${ st.id } - ${ st.forename } ${ st.surname }</input><br/> % endif % endfor % endfor
d2392fa58a4d738435620a48484118200c47a87447e3862b8cf282c410567495
['31f2fe3c05514c1197ab71c6083651f7']
I'm not sure whether you can say, although I have some confidence in my English skills: I traveled the whole of Germany. (or just:) I traveled Germany. It sounds vaguely wrong to me. I guess the better way would be to say: I traveled all over Germany. But I don't think you can say: I traveled over Germany. Right?
b74574480e0521ddc8820210e3ec1fd648deb62ec20e6dc9f61fc8067acd85a7
['31f2fe3c05514c1197ab71c6083651f7']
I once attended a great talk by someone who said he was involved in coming up with the exception handling strategy for the BCL. Unfortunately I've forgotten his name and I can't find my notes. He described the strategy thus: Method names must be verbs that describe the action taken by the method. If the action described by the name does not take place for any reason, and exception must be thrown. Where possible, a way of testing for and avoiding an upcoming exception should be provided. E.g. calling File.Open(filename) will thrown an exception if the file doesn't exist, but calling File.Exists(filename) first will let you avoid that (most of the time). If there are demonstrable reasons (e.g. performance in a common case) an extra method can be added call TryXXX where XXX is the name of the original method. This method should be able to handle a single common failure mode and must return a boolean to indicate success or failure. The interesting point here was #4. I clearly remember him stating the single failure mode part of the guidelines. Other failures should still throw exceptions. Incidentally, he also said that the CLR team told him that the reason that .Net exceptions are slow is because they are implemented on top of SEH. They also said that there was no particular need for them to be implemented that way (apart from expediency), and if they ever got in to the top 10 of real performance problems for real customers, they'd think about re-implementing them to be faster!
fca753fd98ab3c073c2d76b346afb5db50b0c057047237c3e9a4ff1d7268611e
['32113302e0c14cfab9ac25d2cd247f90']
Всем привет, подскажите пожалуйста как правильно переопределить hashCode что б корректно работала такая запись: LinkedHashSet<Integer> uniqueValues = new LinkedHashSet<Integer>(); Random rnd = new Random(); while(uniqueValues.size() < 5){ number = 1 + rnd.nextInt(5 - 1 + 1); uniqueValues.add(number); } Необходимо что бы коллекции значения не сортировались по возрастанию, а находились в порядке добавления, я так понял для этого необходимо переопределить HashCode(), только чуть не понял где и как
d3426ac5dc49fa87b60d09952618b93ea2742f2e2f282c35d074e9aeb6dfccce
['32113302e0c14cfab9ac25d2cd247f90']
Given a continuous function $f(x)$ such that $\int_{a}^{b}f(t)dt=0$ , prove that there exists $c\in (a,b)$ such that $\int_{a}^{c}f(t)dt=f(c)$. I designated $F(x)=\int_{a}^{x}f(t)dt$ and the question becomes to show that $\exists c$, s.t $F(c)-F'(c)=0$ . If we set $G(x)=F(x)-F'(x)$, by the continuity of $G(x)$ and by the fact that $G(a)=-f(a)$ , $G(b)=-f(b)$, if the signs of $f(a)$ and $f(b)$ are opposite than there exists such $c$ as required. But How can I show that such $c$ also exist if the signs of $f(a)$ and $f(b)$ are not opposite? Alternatively, can we show that the signs must be opposite?
42e4a9387313c76b9bbd2847283c13217c1dfb7d29bf9034b8c0d9b51063a4da
['3219020edc5042618d3bd9e671ce244f']
i hv same code like this import json param1 = "xxxxxx" param2 = "anaaaahhhhhhhhhj" param3 = "333333333" with open('data/'+param1+'.json','a') as f: data = param2, json.dump(data, f, sort_keys=True, indent=1,ensure_ascii=False) when i executed this, the output like this, not real dictionary [ "anaaaahhhhhhhhhj" ][ "anaaaahhhhhhhhhj" ] i want [ "anaaaahhhhhhhhhj" ][ "anaaaahhhhhhhhhj" ] to [ "anaaaahhhhhhhhhj", "blablablabal" ] anyone can help me? ps: i new in python
df6bb425e74cc941c59b95dae6f8dba9e489b4161c72cf666dcb50a01acffb9b
['3219020edc5042618d3bd9e671ce244f']
I try to create multiple upload images with reactjs (client) and using flask (server), but I have some problems, the output file in my server is just [], I already tried using request.files.getlist("file[]") and request.get_json(force=True) but the results is same here is my code: client import React, { Component } from "react"; import axios from 'axios'; class Menfess extends Component { constructor(props) { super(props); this.state = { files: [], }; this._handleImageChange = this._handleImageChange.bind(this); this._handleSubmit = this._handleSubmit.bind(this); } _handleSubmit(e) { //Sumbit handler e.preventDefault(); const formData = new FormData(); formData.append('image', this.state.files,this.state.files.name); this.setState({files:FormData}) console.log(this.state) axios .post('http://<IP_ADDRESS>:5000/postjson', formData,{headers: { 'Content-Type': 'application/x-www-form-urlencoded'}}) .then(response => { console.log(response) }); this.setState({files:[]}) } _handleChange = (e)=>{ this.setState({ text: e.target.value }) } _handleImageChange(e) { e.preventDefault(); let files = Array.from(e.target.files); files.forEach((file) => { let reader = new FileReader(); reader.onloadend = () => { this.setState({ files:[...this.state.files, file] }); } reader.readAsDataURL(file); this.setState({files:[]}) }); } // <MDBInput name="text" label="Material input" value={this.state.text} onChange={this._handleChange}/> render() { return ( <div> <form onSubmit={this._handleSubmit} encType="multipart/form-data"> <input className="upload" type="file" accept='image/*' onChange={this._handleImageChange} multiple/> <button type="submit" onClick={this._handleSubmit}>Upload Image</button> </form> </div> ) } } export default Menfess; server: from flask import Flask from flask import request from flask_cors import CORS app = Flask(__name__) CORS(app) @app.route('/postjson', methods = ['POST']) def postJsonHandler(): #print (request.is_json) #content = request.get_json(force=True) files = request.files.getlist("file[]") print(files) return 'JSON posted' app.run() any ideas to fix it? thanks
d7fb31bb7165ba918293147209270ef583dcd7266ee0708d8369f145b54adc35
['321bd8095a7a42f697f2902b94af76b6']
<PERSON>, not sure how that's a good strategy or how it works. You're setting yourself up as a target, and if it worked, people could just make up offers and ask for more money. "Hey I turned down a 50% raise somewhere else to stay here, give me more money"
5897056d03ded0ad8fcb38fc1f9e6e4f6a9d07afac23f5404f00c30a134c355c
['321bd8095a7a42f697f2902b94af76b6']
There are studies and plenty of things written about the idea of a 40 hour work week not actually being as productive as it seems. It was originally pushed for by unions and became a standard after that. (Not all peer reviewed proper sources ) https://www.igda.org/page/crunchsixlessons https://www.inc.com/jessica-stillman/why-working-more-than-40-hours-a-week-is-useless.html https://www.thelocal.no/20170816/norway-most-productive-country-in-europe-research
5fd8c88a0eca84f0b5708515a3be8e1fb85c9015f956130808cbadc147bd99ae
['321d8a97da5f45719fd61174a23360ad']
Thank You for the answer <PERSON>. I have solved it using injection of JavaScript in the code for WebView in android. final WebView webview = (WebView)findViewById(R.id.browser); webview.getSettings().setJavaScriptEnabled(true); webview.setWebViewClient(new WebViewClient() { @Override public void onPageFinished(WebView view, String url) { webview.loadUrl("javascript:(function() { " + "document.getElementsByTagName('header')[0].style.display="none"; " + "})()"); } }); webview.loadUrl("http://code.google.com/android"); This solved my purpose and it is easy to use to.
6475e2374d6fc248767e6f7a1658500c3ad62161f759b62ee233f3adf8846515
['321d8a97da5f45719fd61174a23360ad']
I have been working on some JSON and XML parsing via URL. The URL which I'm using gives JSONObject and inside that I have XML. Here is my code what I have been doing for this: HttpClient hClient = new DefaultHttpClient(); HttpGet hGet = new HttpGet( "URL for getting results"); ResponseHandler<String> rHandler = new BasicResponseHandler(); data = hClient.execute(hGet, rHandler); JSONObject json = new JSONObject(data); // get xml string form jsonObject String str_xml = json.getString("output"); // now convert str_xml to xml document for xml parsing DocumentBuilderFactory factory = DocumentBuilderFactory .newInstance(); DocumentBuilder db = factory.newDocumentBuilder(); InputSource inStream = new InputSource(); inStream.setCharacterStream(new StringReader(str_xml)); Document doc = db.parse(inStream); // <<< getting xml Document here Here is the JSONObject from which I'm getting XML: { "output": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Results>\n <Feed prov=\"dmoz\">\n <ResultSet id=\"webListings\" source=\"DMOZ\">\n <Listing description=\" - A bike shop in Brisbane. Stocks mountain bikes, road bikes, and BMX bikes.\n \" rank=\"1\" siteHost=\"http://www.lifecycle.net.au/\" title=\"Lifecycle Bike Shop\">\n <ClickUrl type=\"body\">http://www.lifecycle.net.au/</ClickUrl>\n </Listing>\n <Listing description=\" - Videos and pictures taken of both sport bikes and dirt bikes.\n \" rank=\"2\" siteHost=\"http://roadanddirt.com/\" title=\"Road and Dirt\">\n <ClickUrl type=\"body\">http://roadanddirt.com/</ClickUrl>\n </Listing>\n</Results>" } Now, I have to parse XML and fix them in the listview. Here is the sample XML which I'm getting: <Results> <Feed prov="dmoz" > <ResultSet id="webListings" source="DMOZ" > <Listing description=" - A bike shop in Brisbane. Stocks mountain bikes, road bikes, and BMX bikes. " rank="1" siteHost="http://www.lifecycle.net.au/" title="Lifecycle Bike Shop" > <ClickUrl type="body" >http://www.lifecycle.net.au/</ClickUrl> </Listing> <Listing description=" - Videos and pictures taken of both sport bikes and dirt bikes. " rank="2" siteHost="http://roadanddirt.com/" title="Road and Dirt" > <ClickUrl type="body" >http://roadanddirt.com/</ClickUrl> </Listing> <Listing description=" - Resource dedicated to pocket bike enthusiasts both in Australia and overseas. " rank="4" siteHost="http://www.pocket-bike-racing.com.au/" title="Pocket Bike Racing" > <ClickUrl type="body" >http://www.pocket-bike-racing.com.au/</ClickUrl> </Listing> </ResultSet> </Feed> </Results> Can some one help me in fixing these things in the listview. Help will be appreciated.
82810fb7b93321ec4ae6bdacb5821392804431f985945b212e5168a9c5c65b03
['321ea8597a7446d284788dd96de4c0a5']
How can you generate small world or scale-free networks with a certain density, say .3? In the case of random networks it seems easy because an edge is drawn based on a certain probability. However, this doesn't seem to be so straightforward for the small world and scale-free architectures. I was thinking of starting with a dense network and randomly remove edges until a certain density is met. But I think this is not correct, because in the case of small world and scale-free architectures the edges are drawn iteratively using rewiring probability and preferential attachment. I am trying to do this in R, using igraph and any hints would be extremely helpful.
04d61150179124554f622df94a4bd525143aca68e75e1bea2549d9703cbdecfb
['321ea8597a7446d284788dd96de4c0a5']
Tengo un gridview que posee un checkbox, estoy intentando que el usuario solo pueda seleccionar una casilla a la vez, si hace clic en otra casilla pues que se desmarque la primera seleccionada. Estoy intentando hacerlo con javascript sin embargo no me funciona. ASP C# protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { try { if (e.Row.RowType == DataControlRowType.DataRow) { string strScript = "uncheckOthers(" + ((CheckBox)e.Row.Cells[0].FindControl("SelectCheckBox")).ClientID + ");"; ((CheckBox)e.Row.Cells[0].FindControl("SelectCheckBox")).Attributes.Add("onclick", strScript); } } catch (Exception Ex) { //report error } } javascript <script type="text/javascript" language="javascript"> function uncheckOthers(id) { var <PERSON> = document.getElementsByTagName('<%=SelectCheckBox.ClientID%>'); for (var i = 0; i < elm.length; i++) { if (elm.item(i).type == "checkbox" && elm.item(i) != id) elm.item(i).checked = false; } } </script> NOTA: No uso radio button porque no es funcional ya que cambia el ID y lo necesito para otro metodo.
a85e7df5722448c8ba2b3bad2ffb106b63daebf8bd21a0828dc4d33b412b0d3b
['322f169cca0a4cc881123b777db10bb3']
I currently have a hss guitar setup with a coil split and a five way blade selector. in 2st position with the coil split, it’s like a regular hss Strat with the middle single coil and the slug coil of the humbucker, but if I put the coil split switch off, the whole series humbucker is combined with the middle single coil. Is the screw coil and the middle single coil in this situation technically out of phase?
7d53271e321f9236050071e1d056387c81b3fe47fcc5cd0219dcc50559d7740f
['322f169cca0a4cc881123b777db10bb3']
I’ve been playing for almost 8 months now but I can not do a full bend on the e string. I’ve gotten used to doing full step bends on the other strings but I could never do it on the high e string. Tried it once and broke my string. After that I got a fear of bending the high e over a half step. I use 10s FYI. So is there a trick to doing these bends? Or am I just too afraid when it’s very much possible?
fdbb7e932e6f48d465bf7e34553b1c93464f3387382ec4694dec0f6a05c3ce57
['322f59b3df694587887f5165ea157ece']
From BAM 2.4.0 release onwards, the previous BAM activity monitoring components have been deprecated. They were replaced by a new implementation of activity search and monitoring with many more added features. The following artifacts will no longer be shipped: With BAM distribution: the activity monitoring sample and the activity monitoring toolboxes. With BAM data agents: activity monitoring data agent which has so far been available under 'Service Data Publishing' The newer activity search component has its own Jaggery app which can use to query data directly from Cassandra using indices rather than use Hive scripts for summarising data. It will also be shipped with the BAM distribution by default, thereby negating the need for installation of a dedicated toolbox. The message tracer will replace the activity data publisher for dumping SOAP payloads to BAM. It will also serve in correlating messages based on ID. Additional information can be found at: http://docs.wso2.org/display/BAM240/Activity+Monitoring+Dashboard
b86fbea45c68a8f028a57a0af332933267eddccbab7770063cf002a27d60ac74
['322f59b3df694587887f5165ea157ece']
Problem could be with the command you are using to connect to BAM_UTIL_KS keyspace. Keyspace name should be wrapped by quotations as follows. Following commands should work. $ ./cqlsh localhost 9160 -u admin -p admin Connected to Test Cluster at localhost:9160. [cqlsh 3.1.2 | Cassandra <IP_ADDRESS> | CQL spec 3.0.0 | Thrift protocol 19.36.0] Use HELP for help. cqlsh> use "BAM_UTIL_KS"; cqlsh:BAM_UTIL_KS> select * from bam_message_store;
f4e48a52dc70bb3a9db37c39751b8ff436f27098e676a60c24fc194c4197c4f7
['3230b9b08bae4f36bb0c3f7845c59942']
<PERSON> Thanks! Yes, I completely understood you, your comment was right, I shouldn't have written a short, shallow answer and I realized that soon and changed it for the better. However I think the way the pointing system works in SO could be improved, or maybe I took it too seriosuly. Anyways, thanks and hope I could contribute.
da629fc6fbf2c3b64b54a6427eabaa20bf43170d52048dbf8740d60ad2b28f6d
['3230b9b08bae4f36bb0c3f7845c59942']
I am building an app where the server needs to select rows based on some criteria/filters. One of them is the location of the user and the radius at which the user want's to see posts and other filters such date range and filter for a value of another column. This is going to be for an ad-hoc event discovery app. I have read about PostGIS, its geometry,geography types and I know there is a native point datatype. Based on this answer I understood that it is better to order from equality to range columns, even though I feel like geo point column should be the first. Suppose the following few rows of a simplified events table (disregard the validity position data): id event_title event_position event_type is_public start_date (varchar) (point lat/lon) (smallint) (boolean) (timestamptz) -- --------------------------- --------------- --------- --------- ---- 1 "John's Party" (122,35) 0 0 2020-07-05 2 "Revolution then Starbucks" (123,30) 1 1 2020-07-06 3 "Study for math exam" (120,36) 2 1 2020-07-07 4 "Party after exam" (120,36) 1 1 2020-07-08 5 "Hiking next to the city" (95,40) 3 1 2020-07-09 6 "Football match" (-42,31) 4 1 2020-07-10 Imagine the table contains several thousand records at least, obviously not only 6. So in this table a user would be able to query public events close to (122,34) by 100km (suppose first three rows fall into this area) and of event types 0, 1 or 2 falling between dates 2020-07-05 and 2020-07-07. The user would get the rows with ID 2 and 3. This is the query I want to optimize with an appropriate index. My question is, how is it possible to create such an index? I thought about GiST or GIN index but not sure how these could help. Thanks!
013e2d228a1b6f275b802c8d75056003d5a85ab6c6b793dbe753df7ba446aa9b
['323991caffc5405d913d843ffeba674a']
I am trying to figure out why Apache2 ignores "authorization result of : denied (no authenticated user yet)" and let random user to login. Apache vhost config is : <VirtualHost *:443> ServerName vmntopng01.mgmt.local ## Vhost docroot DocumentRoot "/var/www" ## Directories, there should at least be a declaration for /var/www <Directory "/var/www"> ## Options FollowSymlinks AllowOverride None Require all denied Require valid-user granted Require ldap-group CN=ACS-ntopng-admin,OU=Groups,OU=Company,DC=berlin-hq,DC=local granted AuthType Basic AuthName "ntopng" AuthBasicProvider ldap AuthLDAPURL "ldaps://ldap.coast.local/DC=berlin-hq,DC=local?sAMAccountName?sub?(objectClass=*)" AuthLDAPBindDN "CN=authldap.ntopng,OU=System-User,OU=Company,DC=berlin-hq,DC=local" AuthLDAPBindPassword "xxxxxxxxxxxxx" </Directory> ## Logging LogLevel debug ErrorLog "/var/log/apache2/ntopng_error_ssl.log" ServerSignature Off CustomLog "/var/log/apache2/ntopng_access_ssl.log" combined ## Server aliases ServerAlias ntopng.mgmt.local ServerAlias ntopng.coast.local ## SSL directives SSLEngine on SSLCertificateFile "/etc/apache2/certs/vmntopng01.mgmt.local.pem" SSLCertificateKeyFile "/etc/apache2/certs/vmntopng01.mgmt.local.key" SSLCertificateChainFile "/etc/apache2/certs/ca.pem" </VirtualHost> In the apache2 logs I see such events: ==> /var/log/apache2/ntopng_ssl_redirect_access.log.1 <== <IP_ADDRESS> - - [15/Aug/2019:11:35:34 +0200] "GET / HTTP/1.1" 301 242 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0" ==> /var/log/apache2/ntopng_error_ssl.log <== [Thu Aug 15 11:35:34.794789 2019] [ssl:info] [pid 14190:tid 140114248333056] [client <IP_ADDRESS>:51305] AH01964: Connection to child 65 established (server vmntopng01.mgmt.local:443) [Thu Aug 15 11:35:34.795183 2019] [socache_shmcb:debug] [pid 14190:tid 140114248333056] mod_socache_shmcb.c(532): AH00835: socache_shmcb_retrieve (0x7a -> subcache 26) [Thu Aug 15 11:35:34.795215 2019] [socache_shmcb:debug] [pid 14190:tid 140114248333056] mod_socache_shmcb.c(917): AH00851: shmcb_subcache_retrieve found no match [Thu Aug 15 11:35:34.795221 2019] [socache_shmcb:debug] [pid 14190:tid 140114248333056] mod_socache_shmcb.c(542): AH00836: leaving socache_shmcb_retrieve successfully [Thu Aug 15 11:35:34.795247 2019] [ssl:debug] [pid 14190:tid 140114248333056] ssl_engine_kernel.c(2115): [client <IP_ADDRESS>:51305] AH02043: SSL virtual host for servername vmntopng01.mgmt.local found [Thu Aug 15 11:35:34.795321 2019] [ssl:debug] [pid 14190:tid 140114248333056] ssl_engine_kernel.c(2115): [client <IP_ADDRESS>:51305] AH02043: SSL virtual host for servername vmntopng01.mgmt.local found [Thu Aug 15 11:35:34.795339 2019] [core:debug] [pid 14190:tid 140114248333056] protocol.c(2219): [client <IP_ADDRESS>:51305] AH03155: select protocol from , choices=h2,http/1.1 for server vmntopng01.mgmt.local [Thu Aug 15 11:35:34.804699 2019] [ssl:debug] [pid 14190:tid 140114248333056] ssl_engine_kernel.c(2042): [client <IP_ADDRESS>:51305] AH02041: Protocol: TLSv1.2, Cipher: ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits) [Thu Aug 15 11:35:34.805943 2019] [ssl:debug] [pid 14190:tid 140114248333056] ssl_engine_kernel.c(366): [client <IP_ADDRESS>:51305] AH02034: Initial (No.1) HTTPS request received for child 65 (server vmntopng01.mgmt.local:443) [Thu Aug 15 11:35:34.805993 2019] [authz_core:debug] [pid 14190:tid 140114248333056] mod_authz_core.c(809): [client <IP_ADDRESS>:51305] AH01626: authorization result of Require all denied: denied [Thu Aug 15 11:35:34.806008 2019] [authz_core:debug] [pid 14190:tid 140114248333056] mod_authz_core.c(809): [client <IP_ADDRESS>:51305] AH01626: authorization result of Require valid-user granted: denied (no authenticated user yet) [Thu Aug 15 11:35:34.806015 2019] [authz_core:debug] [pid 14190:tid 140114248333056] mod_authz_core.c(809): [client <IP_ADDRESS>:51305] AH01626: authorization result of Require ldap-group CN=ACS-ntopng-admin,OU=Groups,OU=Company,DC=berlin-hq,DC=local granted: denied (no authenticated user yet) [Thu Aug 15 11:35:34.806020 2019] [authz_core:debug] [pid 14190:tid 140114248333056] mod_authz_core.c(809): [client <IP_ADDRESS>:51305] AH01626: authorization result of <RequireAny>: denied (no authenticated user yet) ==> /var/log/apache2/ntopng_access_ssl.log <== <IP_ADDRESS> - - [15/Aug/2019:11:35:34 +0200] "GET / HTTP/1.1" 401 381 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0" ==> /var/log/apache2/ntopng_error_ssl.log <== [Thu Aug 15 11:35:34.806174 2019] [ssl:debug] [pid 14190:tid 140114248333056] ssl_engine_io.c(1044): [client <IP_ADDRESS>:51305] AH02001: Connection closed to child 65 with standard shutdown (server vmntopng01.mgmt.local:443) ==> /var/log/apache2/ntopng_access_ssl.log.1 <== <IP_ADDRESS> - - [15/Aug/2019:11:35:46 +0200] "GET / HTTP/1.1" 200 626 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0" <IP_ADDRESS><PHONE_NUMBER>] [ssl:info] [pid 14190:tid 140114248333056] [client 10.128.130.151:51305] AH01964: Connection to child 65 established (server vmntopng01.mgmt.local:443) [Thu Aug 15 11:35:34.<PHONE_NUMBER>] [socache_shmcb:debug] [pid 14190:tid 140114248333056] mod_socache_shmcb.c(532): AH00835: socache_shmcb_retrieve (0x7a -> subcache 26) [Thu Aug 15 11:35:34.<PHONE_NUMBER>] [socache_shmcb:debug] [pid 14190:tid 140114248333056] mod_socache_shmcb.c(917): AH00851: shmcb_subcache_retrieve found no match [Thu Aug 15 11:35:34.<PHONE_NUMBER>] [socache_shmcb:debug] [pid 14190:tid 140114248333056] mod_socache_shmcb.c(542): AH00836: leaving socache_shmcb_retrieve successfully [Thu Aug 15 11:35:34.<PHONE_NUMBER>] [ssl:debug] [pid 14190:tid 140114248333056] ssl_engine_kernel.c(2115): [client 10.128.130.151:51305] AH02043: SSL virtual host for servername vmntopng01.mgmt.local found [Thu Aug 15 11:35:34.<PHONE_NUMBER>] [ssl:debug] [pid 14190:tid 140114248333056] ssl_engine_kernel.c(2115): [client 10.128.130.151:51305] AH02043: SSL virtual host for servername vmntopng01.mgmt.local found [Thu Aug 15 11:35:34.<PHONE_NUMBER>] [core:debug] [pid 14190:tid 140114248333056] protocol.c(2219): [client 10.128.130.151:51305] AH03155: select protocol from , choices=h2,http/1.1 for server vmntopng01.mgmt.local [Thu Aug 15 11:35:34.<PHONE_NUMBER>] [ssl:debug] [pid 14190:tid 140114248333056] ssl_engine_kernel.c(2042): [client 10.128.130.151:51305] AH02041: Protocol: TLSv1.2, Cipher: ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits) [Thu Aug 15 11:35:34.<PHONE_NUMBER>] [ssl:debug] [pid 14190:tid 140114248333056] ssl_engine_kernel.c(366): [client 10.128.130.151:51305] AH02034: Initial (No.1) HTTPS request received for child 65 (server vmntopng01.mgmt.local:443) [Thu Aug 15 11:35:34.<PHONE_NUMBER>] [authz_core:debug] [pid 14190:tid 140114248333056] mod_authz_core.c(809): [client 10.128.130.151:51305] AH01626: authorization result of Require all denied: denied [Thu Aug 15 11:35:34.<PHONE_NUMBER>] [authz_core:debug] [pid 14190:tid 140114248333056] mod_authz_core.c(809): [client 10.128.130.151:51305] AH01626: authorization result of Require valid-user granted: denied (no authenticated user yet) [Thu Aug 15 11:35:34.<PHONE_NUMBER>] [authz_core:debug] [pid 14190:tid 140114248333056] mod_authz_core.c(809): [client 10.128.130.151:51305] AH01626: authorization result of Require ldap-group CN=ACS-ntopng-admin,OU=Groups,OU=Company,DC=berlin-hq,DC=local granted: denied (no authenticated user yet) [Thu Aug 15 11:35:34.<PHONE_NUMBER>] [authz_core:debug] [pid 14190:tid 140114248333056] mod_authz_core.c(809): [client 10.128.130.151:51305] AH01626: authorization result of <RequireAny>: denied (no authenticated user yet) ==> /var/log/apache2/ntopng_access_ssl.log <== 10.128.130.151 - - [15/Aug/2019:11:35:34 +0200] "GET / HTTP/1.1" 401 381 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0" ==> /var/log/apache2/ntopng_error_ssl.log <== [Thu Aug 15 11:35:34.<PHONE_NUMBER>] [ssl:debug] [pid 14190:tid 140114248333056] ssl_engine_io.c(1044): [client 10.128.130.151:51305] AH02001: Connection closed to child 65 with standard shutdown (server vmntopng01.mgmt.local:443) ==> /var/log/apache2/ntopng_access_ssl.log.1 <== 10.128.130.151 - - [15/Aug/2019:11:35:46 +0200] "GET / HTTP/1.1" 200 626 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0" 10.128.130.151 - - [15/Aug/2019:11:35:46 +0200] "GET /favicon.ico HTTP/1.1" 200 2937 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0" So you could see successful "GET / HTTP/1.1" 200" follows the ": denied (no authenticated user yet)". Any advises are appreciated.
276f77dad8c20c49d2537d4671c7fce6bf03436fd646589e8c9131f64d4e1378
['323991caffc5405d913d843ffeba674a']
Not sure if it is possible at all, but I am trying to find solution for such setup: BIND9 server, managed by Puppet(https://github.com/ajjahn/puppet-dns), Puppet populates zone files for all static hosts except Puppet we have set of network devices, managed by Ansible, and there we would like to generate DNS records dynamically, and update DNS with nsupdate_module I've find out what it is possible to update DDNS enabled zones using rndc freeze/rndc thaw, but my problem is, at the thaw step BIND9 doesn't want to use journal, it just shows such error: journal file is out of date: removing journal file I've found another option, ixfr-from-differences, but with that one, after rndc thaw, all dynamic changes disappears. i.e. looks like such freeze/amend/thaw approach is working fine with manual changes, but doesn't fit with configuration-management pattern, as at the amend step, Puppet is recreating all static dns records from the catalog and trowing away ddns hosts. So, maybe anyone see some more tricks, how to workaround such problem, or maybe I am missing something?
d5736c3dc80172292b9ef01289f5bff709880a7a594798e546fc0e8600bd4a56
['3244b1bcbbd04641906952cd0beab3a4']
Hi, I really appreciate the time and effort you have given in writing this awesome answer. After reading your answer i am no longer creating sorted vector for each query but instead i am just counting the numbers greater than k in the left and right queries. Moreover i have used fast input and output methods, but still i am getting TLE. Link to my new solution is [link](http://ideone.com/YQIaM1)
405de3328a22ec380a3fa385820236a0d44241609e26b42b7530188c62b53c08
['3244b1bcbbd04641906952cd0beab3a4']
You should. That is the short answer. In the longer answer, you would be surprised to know how many times security vulnerabilities happen from internal users of an organisation. e.g, If your test environment has admin credentials, then a unprotected transport layer mean someone from your organisation (who is not an authorised admin) can potentially sniff and get the admin credentials - which you don't want. If certificate cost is an issue, you can always have self signed certificate issued. But you should make sure this signing authority (whoever is generating this internal certificate for you) is installed as trusted CA on the testing desktops. Otherwise your browser might throw error that this certificate is signed by someone untrusted. If you run 'certmgr.msc' in windows, you can see the trusted CAs for any particular machine.
f903e97fae28c0b9ca8cc2c1b333231f5ab6cb6b18bf04d6730d720dc2f8dcac
['3245a97e2ee94f7786df9ebf2b9a40ff']
I'm trying to write a method that will take a string like "abcd" and then print out each character twice so that the output will be "aabbccdd". So far, this is the code I have: String abcd = "abcd"; String t = ""; for (int i = 0; i < abcd.length(); i++){ t = t + (abcd.charAt(i) + abcd.charAt(i)); } for (int j = 0; j < abcd.length(); j++){ System.out.printf("%s\n",t); } The code above prints out numbers and I don't understand why. Shouldn't it print out the letters since all the variables are strings?
c41ba5bcdd824759309aac80561966a98aa73fe90b49ff2c939500eb061c60cf
['3245a97e2ee94f7786df9ebf2b9a40ff']
I've gone over the code and re-written it several times already and each time I get 0s when printing the array and the mean. I'm using codeblocks as the ide. Below is statlib.c // Calculates the mean of the array double calculateMean(int totnum, double data[ ]) { double sum = 0.0; double average = 0.0; int i; // adds elements in the array one by one for(i = 0; i < totnum; i++ ) sum += data[i]; average = (sum/totnum); return average; }// end function calculateMean Below is the other file #include "statlib.c" #include <stdio.h> int main (void){ int i; // counter used in printing unsorted array double mean = 0.0; double data[10] = {30.0,90.0,100.0,84.0,72.0,40.0,34.0,91.0,80.0,62.0}; // test data given in assignment int totnum = 10; // total numbers in array //Print the unsorted array printf("The unsorted array is: {"); for ( i = 0; i < totnum; i++){ printf(" %lf",data[i]); printf(","); } printf("}\n"); //Get and display the mean of the array mean = calculateMean(totnum,data); printf("The mean is: %lf\n",mean); return 0; }
5b50d75e14a2716009d835b4ed20a439e765ddf90da2f50195fc372223772684
['32495c7c3b07417086f77833d07baa1b']
I want to make a room in OpenGl with Visual Studio 2010 and add some objects like a chair, carpet etc. I designed the walls only by using textures. I have some problems when I try to import objects from 3DS Max. I see the object, but it's all white. I should be able to see its colour.What did I do wrong? Thanks. <-My object on 3ds MAx <-OpenGL #include "stdafx.h" #include "tga.h" #include "glut.h" #include <gl/gl.h> #include "glm.h" int screen_width=1040; int screen_height=580; GLuint skyboxTexture[6];//skybox GLfloat fSkyboxSizeX, fSkyboxSizeY, fSkyboxSizeZ; //box size on X, Y and Z axes GLMmodel *3dsobj; GLfloat fGlobalAngleX, fGlobalAngleY, fGlobalAngleZ; //global rotation angles void initOpenGL() { glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glShadeModel(GL_SMOOTH); glViewport(0, 0, screen_width, screen_height); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective(45.0f, (GLfloat)screen_width/(GLfloat)screen_height, 1.0f, 1000.0f); glEnable(GL_DEPTH_TEST); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); glMatrixMode(GL_MODELVIEW); glGenTextures(6,skyboxTexture); loadTGA("Textures\\greywall.tga",skyboxTexture[0]); loadTGA("Textures\\carpet2.tga",skyboxTexture[1]); loadTGA("Textures\\wallpaper.tga",skyboxTexture[2]); loadTGA("Textures\\wallpaper.tga",skyboxTexture[3]); loadTGA("Textures\\green.tga",skyboxTexture[4]); loadTGA("Textures\\wallpaper.tga",skyboxTexture[5]); //set skybox size fSkyboxSizeX =60.0; fSkyboxSizeY =9.0; fSkyboxSizeZ =60.0; } //////////////////////////////////////// // function used to create the skybox // //////////////////////////////////////// void DrawSkybox (GLfloat sizeX, GLfloat sizeY, GLfloat sizeZ) { glEnable(GL_TEXTURE_2D); //enable 2D texturing ////////////////////////////////////////////////////////////////// // please consult the orientation convention for this skybox // // ("orientation_convention.png" file in the "Textures" folder) // ////////////////////////////////////////////////////////////////// //negative x plane glBindTexture(GL_TEXTURE_2D, skyboxTexture[0]); //select the current texture glBegin(GL_QUADS); glTexCoord2f(6, 6);glVertex3f(-sizeX, sizeY, -sizeZ); //assign each corner of the texture to a 3D vertex in the OpenGL scene glTexCoord2f(0, 6);glVertex3f(-sizeX, sizeY, sizeZ); //(0,0) is the left lower corner, while (1,1) is the right upper corner of the texture glTexCoord2f(0, 0);glVertex3f(-sizeX, -sizeY, sizeZ); glTexCoord2f(6, 0);glVertex3f(-sizeX, -sizeY, -sizeZ); glEnd(); //negative y plane glBindTexture(GL_TEXTURE_2D, skyboxTexture[1]); glBegin(GL_QUADS); glTexCoord2f(6, 6);glVertex3f(sizeX, -sizeY, -sizeZ); glTexCoord2f(0, 6);glVertex3f(-sizeX, -sizeY, -sizeZ); glTexCoord2f(0, 0);glVertex3f(-sizeX, -sizeY, sizeZ); glTexCoord2f(6, 0);glVertex3f(sizeX, -sizeY, sizeZ); glEnd(); //negative z plane glBindTexture(GL_TEXTURE_2D, skyboxTexture[2]); glBegin(GL_QUADS); glTexCoord2f(6, 6);glVertex3f(-sizeX, sizeY, sizeZ); glTexCoord2f(0, 6);glVertex3f(sizeX, sizeY, sizeZ); glTexCoord2f(0, 0);glVertex3f(sizeX, -sizeY, sizeZ); glTexCoord2f(6, 0);glVertex3f(-sizeX, -sizeY, sizeZ); glEnd(); //positive x plane glBindTexture(GL_TEXTURE_2D, skyboxTexture[3]); glBegin(GL_QUADS); glTexCoord2f(6, 6);glVertex3f(sizeX, sizeY, sizeZ); glTexCoord2f(0, 6);glVertex3f(sizeX, sizeY, -sizeZ); glTexCoord2f(0, 0);glVertex3f(sizeX, -sizeY, -sizeZ); glTexCoord2f(6, 0);glVertex3f(sizeX, -sizeY, sizeZ); glEnd(); //positive y plane glBindTexture(GL_TEXTURE_2D, skyboxTexture[4]); glBegin(GL_QUADS); glTexCoord2f(6, 6);glVertex3f(sizeX, sizeY, sizeZ); glTexCoord2f(0, 6);glVertex3f(-sizeX, sizeY, sizeZ); glTexCoord2f(0, 0);glVertex3f(-sizeX, sizeY, -sizeZ); glTexCoord2f(6, 0);glVertex3f(sizeX, sizeY, -sizeZ); glEnd(); //positive z plane glBindTexture(GL_TEXTURE_2D, skyboxTexture[5]); glBegin(GL_QUADS); glTexCoord2f(6, 6);glVertex3f(sizeX, sizeY, -sizeZ); glTexCoord2f(0, 6);glVertex3f(-sizeX, sizeY, -sizeZ); glTexCoord2f(0, 0);glVertex3f(-sizeX, -sizeY, -sizeZ); glTexCoord2f(6, 0);glVertex3f(sizeX, -sizeY, -sizeZ); glEnd(); glDisable(GL_TEXTURE_2D); //disable 2D texuring } ////////////////////////////////////////////// ///DrawModel /// ////////////////////////////////////////////// void drawModel(GLMmodel *pmodel,char*filename,GLuint mode) { if(!pmodel) { pmodel=glmReadOBJ(filename); //printf("read the model\n"); if(!pmodel) { exit(0); } } //generate facet normal vectors for model glmFacetNormals(pmodel); //generate vertex normal vectors (called after generating facet normals) glmVertexNormals(pmodel,90.0); glmDraw(pmodel,mode); } void renderScene(void) { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glLoadIdentity(); //place the camera 1.2 units above the negative Y plane of the skybox gluLookAt(0.0, -fSkyboxSizeY + 1.2 , 3.0, 0.0, -fSkyboxSizeY + 1.2, -10.0, 0.0, 1.0, 0.0); //set global rotation on the X,Y and Z axes glRotatef(fGlobalAngleX, 1.0, 0.0, 0.0); glRotatef(fGlobalAngleY, 0.0, 1.0, 0.0); glRotatef(fGlobalAngleZ, 0.0, 0.0, 1.0); //draw skybox glPushMatrix(); DrawSkybox(fSkyboxSizeX, fSkyboxSizeY, fSkyboxSizeZ); glPopMatrix(); glTranslatef(0.0, -fSkyboxSizeY + fTreeSize, 0.0); //draw the tree slice /*glPushMatrix(); DrawSingleTreeTexture(fTreeSize); glPopMatrix();*/ glPushMatrix(); // glTranslatef(-30,0 ,0); glRotatef(30, 0, 1, 0); // glTranslatef(3, -20,-200); //place the tree on the negative Y plane of the skybox glTranslatef(19, -fSkyboxSizeY + fTreeSize+10, -6); glScalef(0.1,0.1,0.1); drawModel(3dsobj,"myObj.obj",GLM_NONE|GLM_FLAT); glPopMatrix(); glutSwapBuffers(); //swap the buffers used in the double-buffering technique } void changeSize(int w, int h) { screen_width=w; screen_height=h; if(h == 0) h = 1; float ratio = 1.0*w/h; glMatrixMode(GL_PROJECTION); glLoadIdentity(); glViewport(0, 0, w, h); gluPerspective(45.0f, ratio, 1.0f, 1000.0f); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); gluLookAt(0.0f, 0.0f, 50.0f, 0.0f, 0.0f, -1.0f, 0.0f, 1.0f, 0.0f); } void processNormalKeys(unsigned char key, int x, int y) { switch(key) { case 't': //process glutPostRedisplay(); break; case 27: //esc exit(1); break; //control the global Y rotation angle using 'a' and 'd' case 'a': fGlobalAngleY += 1; if (fGlobalAngleY >= 360) //clamp the rotation angle in the [0,360) interval fGlobalAngleY = (GLint)fGlobalAngleY % 360; break; case 'd': fGlobalAngleY -= 1; if (fGlobalAngleY <= -360) //clamp the rotation angle in the [0,360) interval fGlobalAngleY = (GLint)fGlobalAngleY % 360; break; //control the global X rotation angle using 'w' and 's' case 'w': fGlobalAngleX += 1; if (fGlobalAngleX >= 360) //clamp the rotation angle in the [0,360) interval fGlobalAngleX = (GLint)fGlobalAngleX % 360; break; case 's': fGlobalAngleX -= 1; if (fGlobalAngleX <= -360) //clamp the rotation angle in the [0,360) interval fGlobalAngleX = (GLint)fGlobalAngleX % 360; break; //control the global Z rotation angle using 'q' and 'e' case 'q': fGlobalAngleZ += 1; if (fGlobalAngleZ >= 360) //clamp the rotation angle in the [0,360) interval fGlobalAngleZ = (GLint)fGlobalAngleZ % 360; break; case 'e': fGlobalAngleZ -= 1; if (fGlobalAngleZ <= -360) //clamp the rotation angle in the [0,360) interval fGlobalAngleZ = (GLint)fGlobalAngleZ % 360; break; } } int main(int argc, char* argv[]) { //Initialize the GLUT library glutInit(&argc, argv); //Set the display mode glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA); //Set the initial position and dimensions of the window glutInitWindowPosition(100, 100); glutInitWindowSize(screen_width, screen_height); //creates the window glutCreateWindow("First OpenGL Application"); //Specifies the function to call when the window needs to be redisplayed glutDisplayFunc(renderScene); //Sets the idle callback function glutIdleFunc(renderScene); //Sets the reshape callback function glutReshapeFunc(changeSize); //Keyboard callback function glutKeyboardFunc(processNormalKeys); //Initialize some OpenGL parameters initOpenGL(); //Starts the GLUT infinite loop glutMainLoop(); return 0; }
83f2be547c0607d8bc5a383cccf78ccb1cc9c9e79ffe870ebc90b5dd9c3afd45
['32495c7c3b07417086f77833d07baa1b']
I have a problem. I draw something using a loop and I use Sleep to pause the execution. In the meantime, I want to be able to see what's in a textArea, which has a lot of lines and I have to scroll down to see them.But I can't.Using Sleep it's not possible. Any suggestions? Thanks.
659704dbc577625d4536bae5b3816f5ff01b417dc793a388b32d8b6b784a756d
['324ad26fb20844a9a5697ea5b39696d6']
Image source: wikipedia The above wave is generated by PWM. As you see from above image the analog wave have lot of whipsaw blade like pattern, in simple terms as you increase the frequency the whipsaw pattern will get shorter, which in turn smooth the wave form, based on the frequency and filter technique used to smooth the waveform we can achieve almost near perfect waveform Pulse-width modulation
7e32ee208def66a6c23d557d8151a0ae02d1e743564fb568b53a108f058852a0
['324ad26fb20844a9a5697ea5b39696d6']
Though the transistor act as a switch it collector current is restricted by the base current and ESR of the capacitor With rough calculation the base current is approximately 120 mA, 2N3055 has a DC gain of 20 - 70, taking the maximum gain the max collector current can be 120mA X 70 = 8.4 Amps, the peak current of 2N3055 is 15Amps, so the transistor seems operating with in the safe limit
809544fbcff58aebecaeeee6f6f473fe1ef83e3f9b0c7800b92ce6b04b8a0829
['3250eecdc1bc4729ad20c6b4db773132']
So I am making a tetris game and one of the problems I am running into is piece rotation. I know I can just hard code it but thats not the right way to do it. The way the system works is I have a 2d array of an object 'Tile' the 'Tile' object has x, y coords, boolean isActive, and color. The boolean isActive basically tells the computer which tiles are actually being used (Since tetris shapes are not perfect quadrilaterals). Here is how I would make a shape in my system: public static Tile[][] shapeJ() { Tile[][] tile = new Tile[3][2]; for (int x = 0; x < 3; x++) { for (int y = 0; y < 2; y++) { tile[x][y] = new Tile(false, Color.blue); } } tile[0][0].setActive(true); tile[0][0].setX(0); tile[0][0].setY(0); tile[1][0].setActive(true); tile[1][0].setX(50); tile[1][0].setY(0); tile[2][0].setActive(true); tile[2][0].setX(100); tile[2][0].setY(0); tile[2][1].setActive(true); tile[2][1].setX(100); tile[2][1].setY(50); return tile; } Now I need to rotate this object, I do not know how to do that without hard coding the positions. There has to be an algorithm for it. Can anyone offer some help?
174b5afa12f8c3c9ec2d01496714e2b1a49e563a04ef833250438a0d91a3ddb3
['3250eecdc1bc4729ad20c6b4db773132']
Ok, well I made a simple 3D cube using VBO, and I wanted to load textures onto it. Only problem is that the textures are all messed up, here is my code: public void create() { setup(); render(); } private void makeCube(float x, float y, float z) { int cube = glGenBuffers(); int texture = glGenBuffers(); FloatBuffer cubeBuffer; FloatBuffer textureBuffer; float highX = x + tileSize; float highY = y + tileSize; float highZ = z + tileSize; float[] textureData = new float[]{ 0,0, 1,0, 1,1, 0,1 }; textureBuffer = asFloatBuffer(textureData); glBindBuffer(GL_ARRAY_BUFFER, texture); glBufferData(GL_ARRAY_BUFFER, textureBuffer, GL_DYNAMIC_DRAW); glBindBuffer(GL_ARRAY_BUFFER, 0); float[] cubeData = new float[]{ /*Front Face*/ x, y, z, highX, y, z, highX, highY, z, x, highY, z, /*Back Face*/ x, y, highZ, highX, y, highZ, highX, highY, highZ, x, highY, highZ, /*Left Face*/ x, y, z, x, y, highZ, x, highY, highZ, x, highY, z, /*Right Face*/ highX, y, z, highX, y, highZ, highX, highY, highZ, highX, highY, z, /*Bottom Face*/ x, y, z, x, y, highZ, highX, y, highZ, highX, y, z, /*Top Face*/ x, highY, z, x, highY, highZ, highX, highY, highZ, highX, highY, z,}; cubeBuffer = asFloatBuffer(cubeData); glBindBuffer(GL_ARRAY_BUFFER, cube); glBufferData(GL_ARRAY_BUFFER, cubeBuffer, GL_STATIC_DRAW); glBindBuffer(GL_ARRAY_BUFFER, 0); glBindBuffer(GL_ARRAY_BUFFER, cube); } private void renderCube() { textures.get(0).bind(); glEnableClientState(GL_VERTEX_ARRAY); glEnableClientState(GL_TEXTURE_COORD_ARRAY); glVertexPointer(3, GL_FLOAT, 0, 0); glTexCoordPointer(2, GL_FLOAT, 0, 0); glDrawArrays(GL_QUADS, 0, 22); glDisableClientState(GL_VERTEX_ARRAY); glDisableClientState(GL_TEXTURE_COORD_ARRAY); } private void render() { while (!Display.isCloseRequested()) { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glLoadIdentity(); camera(); renderCube(); Display.update(); Display.sync(30); } Display.destroy(); System.exit(0); } private void setup() { try { Display.setDisplayMode(new DisplayMode(frameWidth, frameHeight)); Display.setTitle("3D Project"); Display.setVSyncEnabled(vSync); Display.create(); } catch (LWJGLException ex) { Logger.getLogger(Camera.class.getName()).log(Level.SEVERE, null, ex); } glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective(fov, (float) Display.getWidth() / (float) Display.getHeight(), zNear, zFar); //glOrtho(0, Display.getWidth(), Display.getHeight(), 0, -1, 1); glMatrixMode(GL_MODELVIEW); glEnable(GL_DEPTH_TEST); glEnable(GL_TEXTURE_2D); glLoadIdentity(); loadTextures(); makeCube(0, 0, -1); } The only thing I think is wrong with this is my texture coordinate array, if so, can anyone give me a correct order? Yes I flip my buffers, and yes my images are powers of 2.
97472ba5447d6728626093d4d1ad87776d6a6676495824b664cfcaa62823bae6
['3253b47f9faf45e185cc1462ae664e37']
I seem to be unable to get the COM3 port to work on my Dell Vostro 3500 laptop. I am trying to work with the Arduino application, which requires COM3 to work. The laptop has recently had a clean Windows 7 install, so I've suspected a driver issue so far. However, I have now installed several drivers from the Dell web site and none resolve the issue. Windows seems to think that the best driver is installed already - "Windows has determined the driver software for your device is up to date", so maybe drivers are not the problem. All USB ports are enabled in BIOS, nothing so far as I can see is disabled. What can I do to resolve this issue? Device manager just shows a warning triangle. Is there a specific driver I'm missing?
b162a94d7d60690ae03b5d870e45b34f71638964fc15b112abf5d6b29ad05190
['3253b47f9faf45e185cc1462ae664e37']
I wrote a sample script based on bash dialog, in order to change my laptop brightness until they fix that in 13.10. Here above is the link to the source on github: https://github.com/kjpopov/Ubuntu-Useful-Scripts/blob/master/choose_brightness You can edit it to add more values, and also you can change the line 33 to make it work for your video adapter. I am using Asus X55U laptop with Radeon HD 6290 Make sure you execute the script as super user (root) privileges. Best Regards!
e3efd59a6bab512b6ecf08a9f25734dd32e68a9e66ec27a3ee456fdf670fb98a
['3254fb69a5e94510a921d63426d84650']
just to know, I am not a system admin (I mean this is not my job), and I try to configure my apache just to produce my projects. My system is Ubuntu 15.04 and I have installed Apache2 Apache/2.4.10 (Ubuntu) with PHP 5.6.4-4ubuntu6.2. The problem that I have, is that my files getting cached, whitout using any cache plugin for my site or any server side caching. I don't know if the Apache comes with any default caching, and I don't even know how to search for it. To give an example of my problem: Lets say I create a file called index.php with the following content: echo "Hello"; then, if I browse the file I will see of cource the word hello on my browser. Now let's say I modify the code inside the file index.php into the following content : echo "Hello World"; and then go to browse the file. This time, continue to display the hello. I totally clean the browser cache, I refresh with Ctrl + R many times, and still the same result. Finally when I do in my console : sudo service apache2 restart and then refresh my browser the content is the Hello World. I don't know how to debug this problem, and if you need any further information about it, please tell me to provide you with what ever is required to help you. So, can someone help me please ? UPDATE 1 Here you can find my phpinfo(); export : http://jsfiddle.net/xebeou4n/
aeb77b0bf58160517078bd7d649289e591ba7d0c0c57e8de97eb10c335113ccb
['3254fb69a5e94510a921d63426d84650']
I have a Windows 7 installation and because I run an Apache web server with Virtual Hosts, I have assign a static IP in my network interface. The given IP is <IP_ADDRESS><PHONE_NUMBER>. Suddenly, today, my computer cannot get connected on the internet because of the static IP. If I change the static IP to dynamic IP then i am getting connected to the internet. Also note, that I run the Windows Network Diagnostics and I am getting the following message when I am with static IP: Problems found Your computer appears to be correctly configures, but the device or resource (primary DNS server) is not responding. Can somebody to help me ? Is crucial to me the static IP, because without static IP I cannot run my local based projects. Kind regards
fc47e855a57c4637780c9b52ee8055b918ad4975a9d9d7ab919833d875b69769
['3258daba89a74b76932cb1c2886ec5be']
if your input file contains one url per line you can use a script to read each line, then try to ping the url, if ping success then the url is valid #!/bin/bash INPUT="Urls.txt" OUTPUT="result.txt" while read line ; do if ping -c 1 $line &> /dev/null then echo "$line valid" >> $OUTPUT else echo "$line not valid " >> $OUTPUT fi done < $INPUT exit ping options : -c count Stop after sending count ECHO_REQUEST packets. With deadline option, ping waits for count ECHO_REPLY packets, until the timeout expires. you can use this option as well to limit waiting time -W timeout Time to wait for a response, in seconds. The option affects only timeout in absense of any responses, otherwise ping waits for two RTTs.
9158e0a7172798a0c60515439705561b1c8706c043f8a1c63f0bfd4b46a01815
['3258daba89a74b76932cb1c2886ec5be']
first thank you for editing your code (it's more clear like this :) I have 2 or 3 advices : 1- when you want to store a value in variable dont use "$" symbole, this symbole is used to get the variable's value ex: MYVAR=3 echo MYVAR "this will print MYVAR" echo $MYVAR "this will print 3" 2- always quote your values, specially if the value is comming from another command 3- To fix your script you need to quote the command executed on the remote machine, then redirect the output to your file ex: ssh user@MachineA "ls > file.txt" "file.txt is created on machineA" ssh user@machineA "ls" > file.txt "file.txt is created on YOUR machine" so simply you can replace your last line by ssh $i "ps -ef | grep ops" > $results try to use -ne in your test bash classictest good luck
24491185e62b3282c46ecbd84189cd7f0b8d27aab6ef86b6c95b85c340f967fa
['32679b157e464a34ab8d761179aaa71d']
@vinaya If you view the log on the Linux server it's presumably running on, `less logfilename.log` + an in-file search for around the date and time you believe everything began would be your best bet. `less` doesn't load the entire file into memory at once, which makes it good for viewing and searching very large files.
36c8f9698b3c5ed5a73476be09ae08925f8fad34ccb58123a5888a3bda5de20a
['32679b157e464a34ab8d761179aaa71d']
If the network does not require a password (an open network), then actually you can sniff all of the traffic without even connecting to the network, which is an added bonus for the attacker. None of the traffic is encrypted, so the attacker can simply see all of the plaintext data in the air. This means they do not even have to be a MITM or perform any sort of MITM attack (ARP spoofing or otherwise), unless they wish to modify in-transit data. That is one of many reasons why open networks are not secure.
b1e3d0b645c908c134712ce1b0d528c40aaaa0481ff5eaa4b5490f2a89c3f8a5
['326c0558f2134e238890b20111a27d87']
I have the following code, what I'am trying to do is that when it receives the input from text_to_search, it finds if it is an instruction, it is any word that is not an instruction (ID) or it is an operator, so far it prints me if it founds an instruction but in the ID part it also prints me Set, instead of for example jaja, so how can I achieve this? text_to_search="Set Sets UnionShowSets jaja:={hi};" import re t=re.search(r'Sets?|ShowSet|ShowSets|Union|Intersect|SetUnion|SetIntersect',text_to_search) s=re.search(r':=|{|}|;',text_to_search) d=t=re.search(r'[a-zA-Z0-9]+',text_to_search) if t: print("Instruction: ") print(t) else: print("ID: ") print(d) if s: print("Operator: ") print(s) Print result: Instruction: <_sre.SRE_Match object; span=(0, 3), match='Set'> Operator: <_sre.SRE_Match object; span=(27, 29), match=':='> Desired print result: Instruction: <_sre.SRE_Match object; span=(0, 3), match='Set'> Instruction: <_sre.SRE_Match object; span=(0, 3), match='Sets'> Instruction: <_sre.SRE_Match object; span=(0, 3), match='Union'> Instruction: <_sre.SRE_Match object; span=(0, 3), match='ShowSets'> ID: <_sre.SRE_Match object; span=(0, 3), match='jaja'> ID: <_sre.SRE_Match object; span=(0, 3), match='hi'> Operator: <_sre.SRE_Match object; span=(0, 3), match='{'> Operator: <_sre.SRE_Match object; span=(0, 3), match='}'> Operator: <_sre.SRE_Match object; span=(27, 29), match=':='> Operator: <_sre.SRE_Match object; span=(27, 29), match=';'>
46fa76bf8cb888fcaf06dffaddd526e4a256f783e2450f17ebd41eb7932e4fbf
['326c0558f2134e238890b20111a27d87']
In the documentation they show this example to build a tree: def p_expression_binop(p): '''expression : expression PLUS expression | expression MINUS expression | expression TIMES expression | expression DIVIDE expression''' p[0] = ('binary-expression',p[2],p[1],p[3]) def p_expression_group(p): 'expression : LPAREN expression RPAREN' p[0] = ('group-expression',p[2]) def p_expression_number(p): 'expression : NUMBER' p[0] = ('number-expression',p[1]) But my question is, once the tree is created, where does those nodes goes? or how do I access them from p[0]?
2433933e1f017878882e06ed841f724fcb0011167ee666ccad0ce63a618cfbd7
['326caf00d6794484aa3bd96e326904ce']
A circle $O$ is circumscribed around a triangle $ABC$, and its radius is $r$. The angles of the triangle are $\angle CAB = a, \angle ABC = b$ and $\angle ACB = c$. The area $\triangle ABC$ is expressed by $a, b, c$ and $r$ as: $\Large r^2 \over\Large2$$\Bigg(\sin(x)+\sin(y)+\sin(z)\Bigg)$ find $x, y$ and $z$: My approach: Firstly, to make it clear, I set $\overline {AB} = A$, $\overline {BC} = B$ and $\overline {CA} = C$. $\triangle ABC= \Large{Bh \over 2}$ where $h$ is the height $\triangle ABC = \Large{BA\sin(c) \over2}$ then, using the law of sine: $r= \Large{A\over 2 \sin(a)} = \Large{B\over 2 \sin(b)}$ $A = 2r\sin(a)$ $B = 2r\sin(b)$ replacing on the formula of area: $\triangle ABC = 2r^2\sin(a)\sin(b)\sin(c)$ But that doesn't help to answer the question. Is my approach correct, or else, what am I missing?
02c8a89120e56c64b84ae001239e463e84ef4989971cd427efb1d5e67f61ed63
['326caf00d6794484aa3bd96e326904ce']
There are two circles that go through the coordinates (1,3) and (2,4) and are tangent to the y-axis. Let $a$ and $b$ be the radius of those circles, what is the value of $a\cdot b$? My approach: The question already tells that there are only two circles that attend to these demands. I made a system of 2 equations using the circle equations: $(x-x_0)^2+(y-y_0)^2=r^2$ Putting those coordinates from the question, it becomes a system: $(1-x_0)^2+(3-y_0)^2=r^2$ $(2-x_0)^2+(4-y_0)^2=r^2$ Resolving this system by computating the squares and subtracting one from another, I get: $x_0+y_0=5$ But this gives all the origins that go through those coordinates including the ones that pass through the y-axis. I would like to know if the approach is correct, or else what am I missing. By trial and error, I could find that those 2 circles are centered at $(1,4)$ and $(5,0)$, which give the respective radius of $1$ and $5$, thus the answer is $a\cdot b = 5$. However, is there another method of solving this?
c2fbd1f681df4b2506e9dccbcdd708f5720058e2f5cfcc442afad321c937350f
['327dd88b324b4d3cb4637d3cf575c0fb']
The first thing to ask yourself is: is agile the right fit for what we're doing? If your requirements and tasks change daily since you're constantly uncovering new information, then you may need a different approach. "Force through a week and finish what we started": don't do that. PM methodologies are there to help you, and you take and use what works for you. They aren't rule books that dictate how you work. Agile says you should plan some work up front (user stories). If you're not sure your user stories actually need to be completed, why are you going with agile?
1402174943b21e0d269a38ec4fb88b4a94d0fc8413c394b44af3ce6a5f8b94aa
['327dd88b324b4d3cb4637d3cf575c0fb']
Generally, I'd say its the same way as finding your "best" feature list, pre-processing methods and algorithm - you'd find most answers starting with "give it a try and compare", "check which combination gives you a better cross-validation?" etc.. More specifically, when there is no farther documentation (and its an open source project) I usually take a look at the code for more intuitions. In this case concat, dot, average and the like where strait forward implemented as it sounds (concatenating date, averaging, etc..), but it does imply about the amount of processing needed: some of the merging functions adds to the input needed to be processed (concat, add) and some reduces it like an aggregation function (average, min, max) Beyond that the resulted tensor object will perform a bit different for different datasets. Please give it a try and let us know what merging combination worked best for you, and the dataset type :)
6c88c0218b43fd7d606fbab0558600b60abcb6a77b075b45f20fdbe19170c708
['32894f29af9049ff8809324465e7b55d']
All i am trying to do is to set the selected value of drop down menu according to the particular value returned from the database like if person saved his gender as 'Male' and he wants to update his profile then the selected option shown on the Gender's dropdown llist should be shown as Male cause if this doesn't happen 'Poor guy becomes a female due to this small problem in my code' KINDLY HELP!!!!!!! MY Current Code: <select name="Gender" id="Gender"> <option selected="selected"><?php echo $row_Recordset1['Gender']; ?></option> <option value="Male">Male</option> <option value="Female">Female</option> </select> The above code work fine but causes repitition of values in dropdown like Male Male Female
bbc531dafdfa0b48d44c8581d6893928c9174ffda4bb612d9011cc77549caa63
['32894f29af9049ff8809324465e7b55d']
I have this code and its working awsomely fine if i provide a direct link of an image. Just and just only one problem i am not able to pass my uploaded image to facebook->api (whether its valid or not) and the following always echo echo 'Only jpg, png and gif image types are supported!'; i even remove the check on image type and try to get the image from $img = realpath($_FILES["pic"]["tmp_name"]); but $img gets nothing in it and uploads a by default empty image on facebook as my page Kindly check my following code and let me know what is wrong with my code and what should i do instead to upload images Online link of the following CODE: http://radiations3.com/facebook/1.php <? require 'src/facebook.php'; $app_id = "364900470214655"; $app_secret = "xxxxxxxx"; $facebook = new Facebook(array( 'appId' => $app_id, 'secret' => $app_secret, 'cookie' => true, 'fileUpload' => true, )); $user = $facebook->getUser(); //echo $user; if(($facebook->getUser())==0) { header("Location:{$facebook->getLoginUrl(array('req_perms' => 'user_status,publish_stream,user_photos,offline_access,manage_pages'))}"); exit; } else { $accounts_list = $facebook->api('/me/accounts'); echo "i am connected"; } $valid_files = array('image/jpeg', 'image/png', 'image/gif'); //to get the page access token to post as a page foreach($accounts_list['data'] as $account){ if($account['id'] == 194458563914948){ // my page id =123456789 $access_token = $account['access_token']; echo "<p>Page Access Token: $access_token</p>"; } } //posting to the page wall if (isset($_FILES) && !empty($_FILES)) { if( !in_array($_FILES['pic']['type'], $valid_files ) ) { echo 'Only jpg, png and gif image types are supported!'; } else{ #Upload photo here $img = realpath($_FILES["pic"]["tmp_name"]); $attachment = array('message' => 'this is my message', 'access_token' => $access_token, 'name' => 'This is my demo Facebook application!', 'caption' => "Caption of the Post", 'link' => 'example.org', 'description' => 'this is a description', 'picture' => '@' . $img, 'actions' => array(array('name' => 'Get Search', 'link' => 'http://www.google.com')) ); $status = $facebook->api('/194458563914948/feed', 'POST', $attachment); // my page id =123456789 var_dump($status); } } ?> <body> <!-- Form for uploading the photo --> <div class="main"> <p>Select a photo to upload on Facebook Fan Page</p> <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" enctype="multipart/form-data"> <p>Select the image: <input type="file" name="pic" /></p> <p><input class="post_but" type="submit" value="Upload to my album" /></p> </form> </div> </body>
409792ce78637db86587ba8e69733bfbc482f2e6c74528567561175ee4d182ac
['3290ddf04d504dca871c5fd5d1df4aa5']
I'm using ConEmu with Windows Subsystem for Linux and I'm trying to figure out how to allow mouse clicks to be sent to programs like tmux and vim. I have set mouse-select-pane in tmux (1.8) and mouse=a in Vim just like I had in iTerm (I'm a recent OSX convert). I also have Send mouse clicks to console enabled in ConEmu, but it doesn't seem that the click events are being sent to the programs. Is it possible?
bcadb735d6a563b06f372c5765930d93d6177d00614a54dac27914665f9c4a58
['3290ddf04d504dca871c5fd5d1df4aa5']
I can't find a way to use the source server tools from the Debugging Tools for Windows on a static library project, which is built separately from the solutions actually using that library: The output of "ssindex.cmd" always displays "zero source files found" for the PDB file generated for the library (using compiler options /ZI and /Fd). Running "srctool.exe -r" on this PDB displays nothing, which probably means that the PDB file does not contain any source file information. Running the same command on the PDB file of a test application which is also build as part of the the same solution yields a list of all expected source files. Is there a way to use source indexing for a static library project when it should be built seperately from the solutions using it? Thanks for any suggestions!
cd9fcd9fd571ccbc84871323868209a379c93169293dbeb26e17aac5bb181fb3
['32913ad1550b44ac893589675197f65e']
I have created 2 pandas DataFrames with data pulled from Yahoo Finance, and I need to make sure they are the same length in so much that they both cover the same dates - and if one is shorter than the other, drop any excess data from the longer one. start_date = '2005/01/01' end_date = '2016/03/31' o=data.DataReader('EWC', "yahoo", start=start_date,end=end_date) g=data.DataReader('ARGT', "yahoo", start=start_date,end=end_date) So say, for example that the 'g' DataFrame only contains data from 2012 onwards, but the 'o' DataFrame contains data all the way from the start date in 2005. How do I compare the two and drop any excess information from the longer one, so that they both start on the same date in 2012? I have looked at joining, merging, concatenating etc - but I dont want to actually combine the two DataFrames in any way, I just want to strip one so they are the same length and contain the same dates on their index. I can't seem to find any simple way to do this. Could someone suggest a simple way to do this?
30eaa4cd683ccd1f5848abd7b12f7e33e572ac5ef54c4c729308e69a1d4cf321
['32913ad1550b44ac893589675197f65e']
I am currently attempting to iterate through some data contained in an SQL request cursor, alter the type of some of the data into "datetime.time" and then combine that with another variable into a new variable named "datetime_db". I have two variables named "date" and "nextDay" which have been previously defined earlier in my code. The previously mentioned "datetime.time" will be combined with either "date" or "nextDay" depending on certain conditions. My code is as follows: for (date_db,time_db,price) in cursor: time_db = datetime.datetime.strptime(time_db,"%H:%M:%S").time() price = float(price) if (date_db == date): datetime_db = datetime.datetime.combine(datetime.date(date), datetime.time(time_db)) else: datetime_db = datetime.datetime.combine(datetime.date(nextDay), datetime.time(time_db)) This throws up the following error: File "C:/Users/Stuart/PycharmProjects/untitled/Apache - Copy.py", line 82, in <module> datetime_db = datetime.datetime.combine(datetime.date(date), datetime.time(time_db)) TypeError: an integer is required When I print out the "type()" for the 3 variables involved I get the following: time_db = <type 'datetime.time'> date = <type 'datetime.datetime'> nextDay = <type 'datetime.datetime'> Is there any obvious reason why this is not working? I have tried changing the type of "date" and "nextDay" to a "datetime.date" but that makes no difference. Could someone suggest how I may combine these two variables successfully?
30682336d2a306d209dcb782dbb469ee39ed89c668ad179ad83183c08b713226
['32af0cd7f6b04a2fa99cd25607994f10']
Your solution is not bad, but can be simplified. You don't have to split the strings and flatMap then. You can just flatten the List of Strings. A.map(x => if(x.contains(y)) {x} else {""}).filter(_!="") It would be better to write: A.flatMap(x => if(x.contains(y)) Some(x) else None) or A.filter(_.contains(y)) But you can use partition and count to express it, here is my solution: val a = List("bf", "dc", "ab", "af") val b = a.flatten.distinct.sorted b.partition(x => a.count(_.contains(x)) > 1)
305c5f3dd7d0e340d0bc959cf9e4d791adb3b40b0eff326393cadf665588dbab
['32af0cd7f6b04a2fa99cd25607994f10']
You can solve it with a single foldLeft, iterating the input list only once. Use a Map to aggregate the result. listInput1.map(_.split(",")).foldLeft(Map.empty[String, Int]) { (acc: Map[String, Int], curr: Array[String]) => val label: String = curr(0) val oldValue: Int = acc.getOrElse(label, 0) val newValue: Int = oldValue + curr(2).toInt + curr(3).toInt acc.updated(label, newValue) } result: Map(itemA -> 10, itemB -> 19, itemC -> 15)
5b296ae14fc71ea2058fe8fab7caf844a9dfc07e915adb8e344c56c7819382ca
['32b514ff4d5745f69cf2bb3572823118']
@Parfait has a good use of lapply that I would keep, so I won't recreate it for my answer. For your question of only looking to refer to one spatial polygon dataframe in your call to addPolygon you can use rbind once they are created. Note this only uses one colorFactor set. #Create Isochrone points <PERSON> <- osrmIsochrone(loc = c(-2.3827439,53.425705), breaks = seq(from = 0, to = 60, by = 5)) iso2 <- osrmIsochrone(loc = c<PHONE_NUMBER>,51.325871), breaks = seq(from = 0, to = 60, by = 5)) iso3 <- osrmIsochrone(loc = c(-2.939367,51.570344), breaks = seq(from = 0, to = 60, by = 5)) iso4 <- osrmIsochrone(loc = c(-3.9868026,55.823102), breaks = seq(from = 0, to = 60, by = 5)) iso5 <- osrmIsochrone(loc = c<PHONE_NUMBER>,53.709006), breaks = seq(from = 0, to = 60, by = 5)) iso <- rbind(iso1, iso2,iso3,iso4,iso5) #Create Drive Time Interval descriptions iso@data$drive_times <- factor(paste(iso@data$min, "to", iso@data$max, "mins")) #Create Colour Palette for each time interval factPal <- colorFactor(rev(heat.colors(12)), iso@data$drive_times) #Draw Map leaflet()%>% addProviderTiles("CartoDB.Positron", group="Greyscale")%>% # addMarkers(data=spatialdf,lng=spatialdf$Longitude, lat=spatialdf$Latitude, popup = htmlEscape(~`Locate`))%>% addPolygons(fill = TRUE, stroke = TRUE, color = "black",fillColor = ~factPal(iso@data$drive_times), weight = 0.5, fillOpacity = 0.2, data=iso, popup = iso@data$drive_times, group = "Drive Time") %>% addLegend("bottomright", pal = factPal, values = iso@data$drive_times, title = "Drive Time")
339c14e2d0b93f5df7e20e7f9285dfebeea09c4411b6f23cdf82bd6503e3a695
['32b514ff4d5745f69cf2bb3572823118']
Not sure if this is exactly what you are looking for, but I replaced the da.repeat with using np.repeat, along with explicity casting dd_test.index and dd_test['units'] to numpy arrays, and finally adding dd_test['transaction_dt'].astype('M8[us]') to your timedelta calculation. df_test = pd.read_csv(StringIO(test_data), sep=',') dd_test = dd.from_pandas(df_test, npartitions=3) dd_test['helper'] = 1 dd_test = dd_test.loc[np.repeat(np.array(dd_test.index), np.array(dd_test['units']))] dd_test['transaction_dt'] = dd_test['transaction_dt'].astype('M8[us]') + (dd_test.groupby('id')['helper'].cumsum()).astype('timedelta64[D]') dd_test = dd_test.reset_index(drop=True) df_expected = dd_test.compute()
db99210c4793045c818a7adb804bd1f2a2872a07b0ee3493a7c73cdecee2ed04
['32cf5bcf932e4b94ad2794da38bfdef9']
Is there a way for an iPhone app to receive a URL callback without using the colon? The iOS Custom URL Schema requires a colon : in the URL . Unfortunately the API I'm communicating with only accepts domain names not URL's. Colons, forward slashes etc are not accepted. Maybe there there are other options other than the Custom URL Schema. I need a callback like "myapp" or com.mycompany.myapp. Thanks
cf9cb883e5d3ee061f0458e0162dff7a9ececf9b2c1fb2b7e6d34641326b7a56
['32cf5bcf932e4b94ad2794da38bfdef9']
I just can't get Xcode and SVN to play ball when it comes to committing new files in new folders. Has anyone worked out the process to do this within the Xcode IDE or do I need to use a third party client? I don't want to become a Terminal expert and before anyone says use GIT, I want to use SVN because our project management(code review/browsing etc) is integrated with SVN. SVN also works extremely well with Microsoft and Android development. Background: I like to separate my files into various folders (Data, Model, View etc). Currently I create the new folder in Finder, then add the folder in Xcode and start creating files and cutting code. When it comes to committing, all hell breaks loose. I'll go into Organizer and import the folder. At this point things look good but it goes pear-shaped after that. I've tried many things, sometimes getting an "A" symbol but at the end of the day, the integration just isn't there. Thanks
7be5697e00c7e9e1a07ce8ee1723e2f7c82f97b481f3d552b74d4b55c20ed85d
['32d27e0e02f043a1be41aa020d36f95f']
Actually you can pass send action method from parent to child, call it in child component like this.props.someMethodToDispatch() and do something with it in parent component before you dispatch action. For example: const dispatch = (action) => console.info("Action dispatched", action); class Parent extends React.Component { constructor(props) { super(props); this._handleChildClick = this._handleChildClick.bind(this); } _handleChildClick(action) { // You can do something here console.info("Child pass action", action); // And after that dispatch action dispatch(action); } render() { return ( <div> <h2>Simulate handle action from child</h2> <Child handleClick={this._handleChildClick} /> </div> ); } } class Child extends React.Component { _generateAction() { // This is action creator mock return {type: "SOME_ACTION", payload: "someting"}; } render() { return (<button onClick={() => this.props.handleClick(this._generateAction())}>Click me</button>); } } ReactDOM.render(<Parent />, document.getElementById("root")); <script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react-dom.min.js"></script> <div id="root"></div>
e17d8d195e0581c0d7874ef6dc6389492e58f0b2de619c6fede030718f43536e
['32d27e0e02f043a1be41aa020d36f95f']
You can create HOC to handle form changes. For instance import React from 'react'; import PropTypes from 'prop-types'; import {formValues} from 'redux-form'; export const withSyncFormValues = (WrappedElement) => { class WithSyncFormValues extends React.PureComponent { propTypes = { autofill: PropTypes.func.isRequired, exampleFormValue: PropTypes.any } componentWillReceiveProps(nextProps) { // Sync logic like // Autofill props provided by ReduxForm // https://redux-form.com/7.2.1/docs/api/props.md/#-code-autofill-field-string-value-any-function-code- if (nextProps.exampleFormValue !== this.props.exampleFormValue) { this.props.autofill('relatedFormValue', 'newValue'); } } render() { // Also you can omit exampleFormValue from props there return ( <WrappedElement {...this.props} /> ); } } // https://redux-form.com/7.2.1/docs/api/formvalues.md/ return formValues('exampleFormValue')(WithSyncFormValues); } and use it like reduxForm(formProperties)(withSyncFormValues(YourFormComponent)) or with decorators @reduxForm(formProperties) @withSyncFormValues class YourFormComponent extends React.PureComponent { ..... } It's important to keep in mind that withSyncFromValues has to be after reduxForm
41afe87faf3ca7fb69885f017f67eeb3f1f035e9c909369228fb9af4d1d6190c
['32d66e7345e848278830f1c6fa9e13d0']
How do I build a tree which has a depth that i want? For example i want to create a decision tree which has a only 3 depth. load ionosphere treeModel = fitctree(X,Y) view(treeModel) view(treeModel,'mode','graph') This code create 7 depth tree. I use same data set but i want to create tree which has 3 or 2 depth. How can I do on matlab?
9637def941fe728d3d5a15dcb03d140d12f2a14a0eb4a364f546ad60b29ee00c
['32d66e7345e848278830f1c6fa9e13d0']
It is very interesting bug. I use a image which is "Screen Shot 2017-05-12 at <PHONE_NUMBER>.png" on xcassets. So this image causes random crashes on iOS 9.2.1 and lower iOS 9 I should not have use image name which is contain point. I lost my weekend :(
be82eeeff03174c61dd05476f5f82db11b07633e6442278163f396be603e91b6
['3321f1c29a6d4feb8db9f0500bc31f4d']
In IE 8, I have form elements. When the page is zoomed in (ctrl +) in <select>s alone not getting zoomed in properly.It looks like hidden half way and stays in same size (as in 100% zoom). If I re- render the page it zooms in but it stays in the same size even after zooming out. In IE9 it works fine. I need to support from IE8. Any help!! PS:As the page should be accessible, we are meant to support various zoom levels.
4d8588a48528d8bb449cb52dc87d0395aa7f16c823715c8a6bb4cc91e13161f3
['3321f1c29a6d4feb8db9f0500bc31f4d']
I have a table of contents which is shown with 3 rows by default and on clicking more it shows all the rows. But the there is a jerk. here is the link to jsfiddle I need some smooth effect so i use slideUp and slideDown instead of show or hide. show or hide is working fine. I tried setting height of table in script but it did not help. Any help on this jerk.. var numShown = 3; // Initial rows shown & index var $table = $('table').find('tbody'); // tbody containing all the rows var numRows = $table.find('tr').length; // Total # rows $(function () { // Hide rows and add clickable div if (numRows > numShown){ $table.find('tr:gt(' + (numShown - 1) + ')').hide().end(); $('#more-less a').show(); $('#more-less a').click(function() { $('table').css('height',$(this).height); if (numRows > numShown){ numShown = numRows; $('#more-less a').html("Show less"); $('#more-less a').attr('class','less'); $table.find('tr:lt(' + numShown + ')').slideDown(); } else{ numShown = 3; $table.find('tr:gt(' + (numShown - 1) + ')').slideUp().end(); $('#more-less a').html("Show more"); $('#more-less a').attr('class','more'); } }); } else{ $('#more-less a').hide() } });
6d69c7f92f160197be327f5434b7a2bb249bfcecf293955492287294a39408af
['332443c5b00344c8a27345c6286aa2a0']
I am using Firestore in a React App and I see this error whenever there are two parallel request. What does this error mean exactly? Firestore (4.5.0) 2017-11-05T16:39:32.783Z: RPC "commit" failed with status: 400 response text: { "error": { "code": 400, "message": "the stored version (1509899972098969) does not match the required base version (1509899938109577)", "status": "FAILED_PRECONDITION" This is my code. It is a like system. await getUserVotesRef().set({ userVotes }, { merge: true }); await fs.runTransaction(t => t.get(coinVoteRef).then(doc => { // Add one person to the city population let coinIdCount = (doc.exists && doc.data()[coinId]) || 0; coinIdCount = !currVote ? coinIdCount + 1 : coinIdCount - 1; coinIdCount = coinIdCount >= 0 ? coinIdCount : 0; t.set(coinVoteRef, { [coinId]: coinIdCount }, { merge: true }); }) );
7957235a6141e92267c7e7ee99f5511869f229c03b37e60015d0e20681036052
['332443c5b00344c8a27345c6286aa2a0']
try this, .img-wrapper{ width: 100vw; height: 300px; overflow-y: auto; overflow-x: hidden; display: flex; align-items: center; } .img-wrapper img{ width: auto; height: 250px: margin: 20px 25px; } Search for css attribute overflow-y: scroll, that will allow the div to be constrained within the defined height and width.
8dd0901a33c6e78688935e54c1b8e45fa61689c35203b3bf7d1456e0c0494213
['332818a5e45c44cc9c4bc6bc40e5b852']
I want to be able to have a window listener that when the window is opened, some graphics appear. This comes with some problem though, because you can't set a window listener while the window is set to visible (or at least that's what I've found), but if you wait to set the window to visible until after you set the listener you can't set the Graphics. This is the code with the window set to visible at the start: public class FrameTest { static Frame myFrame; static Graphics myGraphics; public static void main(String[] args) { //Initializing Window myFrame = new Frame(); myFrame.setTitle("Frame Test"); myFrame.setSize(570, 570); myFrame.setVisible(true); myGraphics = myFrame.getGraphics(); myFrame.requestFocus(); //Close Button myFrame.addWindowListener(new WindowAdapter() { public void windowOpened(WindowEvent e) { System.out.println("opened"); myGraphics.setColor(Color.red); } public void windowClosing(WindowEvent e) { System.exit(0); } }); } }
2f816072a2d0686f85d6fba041d0c822b4147278f95cd02416925a3c99a82f00
['332818a5e45c44cc9c4bc6bc40e5b852']
When I try and import the AWT package in eclipse by doing "import java.awt.*;" at the beginning of my code it comes up with an error that "The package java.awt is not accessible." java.util seems to work fine, but the awt package doesn't. I'm not sure what I need to do to make it "accessible".
31a2d332e8f54857a2b0ec13e7c89748e1955a4ea4aaa94560727451b049cc99
['3343b3d5f359453d892b69ad4310ce6a']
I am using a #define in one header that is defined in another header. Sometimes Visual Studio decides that #define exists and it colors my code as if it will be compiled in. Sometimes it decides that it doesn't know what the #define is and it colors my code such that it will be compiled out. The only problem here is ONLY how Visual Studio presents my code, the code works as intended. Is there a way to tell Visual Studio to assume this #define exists (and is 1)? I know I can turn off this coloring option entirely, but I like the way it normally works. I can also quickly define it at the top of my file to change the coloring, but then I need to remember to remove it before committing my code. I did try checking if it was undefined and, if so, defining it. I was thinking that it would always be 1 or 0 and so never undefined. This solved my coloring issue, but actually found places where it was undefined and resulted in compile errors.
a49b6598f4507f0d7432be68dcc60b10a30db65312c55ceaac322e5ea9c4cf42
['3343b3d5f359453d892b69ad4310ce6a']
This appears to me to be one summation divided by another. Here is my attempt at a straight-forward answer. My results were definitely averages that were more heavily weighted toward the earlier entries in the list, but I don't claim to know if they were correct. double[] m_prices; public double Rema(int k, double lambda) { // Simple parameter validation if(lambda == 0.0 || k == 0) return 0.0; // Ensure the iteration will not be larger than the number of entries int t = m_prices.Length - 1; k = Math.Min(t, k); double numerator = 0; double denominator = 0; for (int j = 0; j <= k; j++) { // Preform the 2 sigma operations from the formula numerator += Math.Pow(lambda, k-j) * m_prices[t - j]; denominator += Math.Pow(lambda, k-j); } // Simple error check if (denominator == 0.0) return 0.0; return numerator / denominator; }
71db95b8aeacecc5ae8c77b6f42a58e98152bcea433506a338c4ca9a291782e3
['3349b804ceb648b3848b26dd5f312008']
You haven't called the load_home() function. If you call you will see preventDefault error then remove (e || window.event).preventDefault(); this line. Then you will have this error Access to XMLHttpRequest at 'https://facebook.com/' from origin 'some origine' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Facebook blocked this request. Fetch Jquery Load Ajax get All uses XMLHttpRequest Technnology. You can not load fb with this.
315e922f68d3072ce5e87fb5a042a6bd1c8c7a60d864b512d00527ca7f20072e
['3349b804ceb648b3848b26dd5f312008']
This is the proper way with your thoughts <!DOCTYPE html> <html> <head> <style> button { height:40px; width:160px; border: 4px; border-radius: 20px 20px 20px 20px; border-color:red; color: yellow; padding: 12px 15px; text-align: center; font-size: 16px; cursor: pointer; } .button1 { background: red } .button1:hover { background-color: green; } </style> </head> <body onload="beginfase()" style="background-color:#E3CEF6;" > <button id="bGeneral" onclick="" class="button1" name= "bGeneral" ><b>General</b></button> <!-- Create extra space --> <p><br></p> <!-- The Next Button Plates --> <button id = "buttonP" onclick="" class="button1" name= "buttonP" ><b>Plates</b></button> <script type="text/javascript"> //we are creating an array var button = []; button = document.querySelectorAll("button"); //we are binding the function to all the elements of the array for(i=0;i<button.length;i++){ button[i].onclick = function(){ // this represent the elemement which is being clicked if(this.style.backgroundColor === "red"){ this.style.backgroundColor = "green" } else{ this.style.backgroundColor = "red" } } } </script> </body>
d14cf4bd4dd8ce4e256d35d4ca3381e520dd78f0d148661a309af85c0d608dff
['3350251ba56f4c869185c26a2178b1e8']
Recurring billing API call from Recurly to PayPal is failing and the error code returned is 11451 (Billing Agreement Id or transaction Id is not valid). However, the Billing Agreement Id is still in ACTIVE status in PayPal. Any idea, what API call is made by Recurly to PayPal ? How can I get the logs for the same?
cd045fa1bddb204440db09f2a89c3c0ebc469dd969a8cc96b6cd188af0904aef
['3350251ba56f4c869185c26a2178b1e8']
The root cause of this issue was due to type of Billing Agreement created. Recurly needs a Billing Agreement ID which supports reference transactions, for them to process the future payments. However the REST API SDK supported billing agreement is not a Reference Transaction type, it is just a recurring payment type. To solve this issue, we used the PayPal Merchant SDK (which refers NVP/SOAP APIs) for creating the reference transaction, instead of PayPal SDK (which refers REST APIs).
e06fdd19536e755281214c07bb1e1d009f98d6a78daa29204f33761eccb8f052
['3353af5f06e348a689fd74df231f3243']
I have such code in AspNetCore 1.1.2 [ApiVersion(Versioning.V2)] [Route("api/v{version:apiVersion}/[controller]")] public abstract class ApiController : Controller { } public sealed class AwesomeController : ApiController { [Route(""), HttpGet] public string Get() { return "Hello from 2.0"; } } When running the application I obviously receive UnsupportedVersion because ApiVersionAttribute is not inherited. I understand that if I move [ApiVersion(Versioning.V2)] to AwesomeController everything will work, but I have a pretty big structure of my controllers per version (let say 15) and would like to inherit them from single controller of specific version to have a single place to add my service bus imports and etc. Is there any gentle way to achieve such requested behavior? p.s. I strongly don't wan't to adjust IActionSelector.
80df232e5e4d829d9146957876e0c95b8a156d71b6afa6e061a3956ac5bee407
['3353af5f06e348a689fd74df231f3243']
I'm running Windows 10 with the latest updates installed. I'm trying to set up a swarm using multiple physical hosts running docker Linux containers on windows host. When I'm running docker swarm init --advertise-addr <IP_ADDRESS> --listen-addr <IP_ADDRESS>:2377 Where <IP_ADDRESS> stands for physical address of my current machine (future swarm manager) I obviously receive Error response from daemon: manager stopped: failed to listen on remote API address: listen tcp <IP_ADDRESS>:2377 bind: cannot assign requested address because docker for Windows running Linux containers uses hyper-v vm and doesn't know anything about address I'm trying to specify. So here is a question if there is any small possibility to run swarm mode in this situation so that my other hosts will be able to join new swarm over physical network.
8b91ddf249304cffe8d1d180ea8d9f95de79471a14085d9a0ca6b32a6f332151
['335c0c05458f4e6c9ab916c576d4d4b6']
According to my experiments, any wifi card can (naturally) connect to a access point as a client and act as a server (most of them in ad-hoc mode). Why can not a wifi card behave as both a client and a server at the same time? Is there a hardware restriction that can not be worked around by a software? Can't switching between the modes be an option if we accept performance impact?
4350178a8f8e2903545075232cda50dedc05ba4f8ae3f1627ce5359112af45ce
['335c0c05458f4e6c9ab916c576d4d4b6']
<PERSON> We are discussing only the charging phase here, cut off phase is out of the scope of this question. As mentioned in the answers, charger (the device or the human being) should stop charging when the current drops below 0.1C (C is the Ah value of the battery, not the CC value. CC is only an upper limit of charging current value declared by the manufacturer)
cb7f41960fa4a3f3bc2e098544670d9844357dfb39282a8d9b19225622bcacc7
['33652b97ac324d6c9f9b876df3fbf8b5']
I have the same problem sometimes, but i notice it always happen when i create the project outside the AndroidStudioProjects Folder. Sometimes when it happen, i will locate the file in the project folder then open it with another editor(Noteoad++) then i copy and paste back the code, and you can try clear cache and restart android studio, it also work for it.
6b73c2ca1b94a3974440a1e7cb5d983b55a7a7b5d942528ea219c425a0d5e9b9
['33652b97ac324d6c9f9b876df3fbf8b5']
Try this Create your interface method in your adapter class public interface ItemClickListener { void onItemClick(String text, int position); } Then create a variable of ItemClickListener in your adapter class ItemClickListener mItemClickListener; create an onClickListener Method in your adapter class public void onClickListener(YourAdapterName.ItemClickListener listener) { mItemClickListener = listener; } Then in the item onclicklistener in the adapter add this if (mItemClickListener != null) { mItemClickListener.onItemClick(mData.get(position).getText(), position); } Then make your activity class implements YourAdapteName.ItemClickListener And set your adapter on OnclickListener like this yourAdapterName.onClickListener(this); When you have implemented The ItemClickListener you will have to override the onItemClick then you do whatever you want there.
b496b76fb9e21923023132d3e0d80e57c31459b0261df4f52543561aa8f472eb
['3371fcf9c1ba4dceaca4e25f60502a8a']
malloc and realloc required the size of the space to reserve(allocate) in the memory, so if you want to make an array you must allocate the size of 1 element multiplied by the number of elements in the array, I suggest you make a variable to hold the size of the array. BTW "Segmentation fault" as far as I know, means you are using space that you did not allocate for.
d833eda041fd65425116dade3f87a2b0d085ff5943c388d858c0a0c9558e43a9
['3371fcf9c1ba4dceaca4e25f60502a8a']
From my personal experience that is how facebook posts data to its server for login verification (you can check it yourself when you login with the developper tools opn on network tab, look for a POST request to login/) To decode it we need to know how it is generated and from a first look it looks like linux password storage method So the :5: part means it is hashed with SHA256 :<PHONE_NUMBER>: is mostly the salt and the rest is the hash result encoded with base64 One final note you can't decode hashs you can just bruteforce them.
afe225bd603cf9d1136b5d4444b1da42bf95b1b17057c394950078d200f7d969
['33739c7fd6774325a655ea0c8eb37d29']
I had the latest eclipse and also the latest junit 4.12 jar but still I use to get this problem. I finally fixed it. Follow these steps: Close your maven project created in eclipse and close eclipse or STS tool. Go to Maven repository: C:\Users\.m2\repository\org\springframework\ and delete everything inside springframework folder. Now open eclipse/STS tool and then open your project. The project will build automatically and the error disappears. If it doesn't then right click on project -> Maven -> Update Project.. -> check the Force Update and click OK
e80bdf67edbe732777f0237bec89a2f2e7d7df2d4523a09cc7834b70f0ab5328
['33739c7fd6774325a655ea0c8eb37d29']
I have implemented the spring security with LDAP using Spring Boot. I'm able to successfully bind with my company LDAP server but with hard-coded values. This is the only way I can bind with my company LDAP server and proceed further since I do not know the Administrator/Generic UserDN or Password to make a successful bind. The company does not provide me the Admin credentials due to some confidential reasons. I would like to set the UserDn and Password of the ContextSource with the username and password entered by the user in the login form. But the problem here is the SecurityConfig class is scanned at the time the Tomcat server is started and later after the login process the control does not come to the SecurityConfig class at all. How can I solve this problem? Need some assistance. This is my SecurityConfig class: @EnableWebSecurity @Configuration public class SecurityConfig extends WebSecurityConfigurerAdapter { @Autowired private CustomAuthenticationFailureHandler customAuthFailureHandler; @Autowired private CustomAuthenticationSuccessHandler customAuthSuccessHandler; @Override protected void configure(HttpSecurity httpSecurity) throws Exception { httpSecurity .authorizeRequests() .anyRequest().fullyAuthenticated() .and() .formLogin() .loginPage("/login").permitAll() .loginProcessingUrl("/sign-in") .usernameParameter("userid") .passwordParameter("password") .successHandler(customAuthSuccessHandler) .failureHandler(customAuthFailureHandler) .permitAll() .and() .logout() .logoutSuccessUrl("/logout") .permitAll() .and() .csrf().disable(); } @Override protected void configure(AuthenticationManagerBuilder auth) throws Exception { auth.authenticationProvider(ldapAuthProvider()); } @Bean public BCryptPasswordEncoder bCryptPasswordEncoder() { return new BCryptPasswordEncoder(); } @Bean public AuthenticationProvider ldapAuthProvider() throws Exception { DefaultSpringSecurityContextSource contextSource = new DefaultSpringSecurityContextSource("ldaps://some.domain.com:3269/"); contextSource.setUserDn("<EMAIL_ADDRESS>"); // Here I want to set the username from Login screen contextSource.setPassword("password"); // also password from login screen contextSource.afterPropertiesSet(); String userSearchFilter = "(sAMAccountName=username)"; // Here too I need to set username from login screen LdapUserSearch ldapUserSearch = new FilterBasedLdapUserSearch("dc=domain,dc=com", userSearchFilter, contextSource); BindAuthenticator bindAuth = new BindAuthenticator(contextSource); bindAuth.setUserSearch(ldapUserSearch); LdapAuthenticationProvider ldapAuthProvider = new LdapAuthenticationProvider(bindAuth); return ldapAuthProvider; } } I have created an AuthenticationProvider bean method and I'm setting it in the AuthenticationManagerBuilder. I also tried creating a CustomAuthenticationProvider but there again I had to check with the hard-coded username and password :(
50114d01a05cedcfe2dce8cc3c10bb962ee9be445eaa6762a9efedb33cb21bde
['33831686a0cf4ed38a248391ada5894e']
Can you pass it as an arguments to the StatefulWidget? You can then access it from the initState method of the State object using widget: class Foo extends StatefulWidget { final var data; Foo(this.data); @override _FooState createState() => _FooState(); } class _FooState extends State<Foo> { @override void initState() { super.initState(); _somefunction(widget.data); } }
0416bffb6b804d7160f2baf5852b56e5f3eb22e878b942f9bdfd84f9b9348324
['33831686a0cf4ed38a248391ada5894e']
Flutter's Icons class gets its icons from MaterialFonts like this: IconData icon = IconData(0xea00, fontFamily: 'MaterialIcons') That hex number is the Unicode codepoint for the glyph in the font. You could use a Map<String,Int> to map your json icon String value to the codepoint int you want it to represent. For example: Map<String, Int> iconCodepoint = { 'credit_card': 0xe06c, 'gift_card' : 0xe020, //etc. } //String iconName holds your icon String value ('credit_card') studentFeeButtonMenu(context, 'Hello World', IconData(iconCodepoint[iconName], fontFamily: 'MaterialIcons'); The .codepoint files here contain the glyph codepoint numbers: Material-Design-icons on Github
7d740efa4549ca30ad95c790708506c25fe33a93d0b500a54bf99b7faa97fb73
['338daa7126ab4a73bfc9d88fb337093e']
I have a primefaces datatable which has some editable columns. I want to make one of cell in one of the editable columns as non-editable based on some condition, e.g, If that column is color, user should be able to enter different colors. But if the row contains another column with a particular id('*), user should not be able to update that cell. I tried adding disabled based on the condition in the inputText as below. <p:column headerText="Color Choice" > <p:cellEditor> <f:facet name="output"><h:outputText value="#{row.color}" /></f:facet> <f:facet name="input"><p:inputText id="colorchoice" value="#{row.color}" disabled ="#{row.id.contains('*')}"/></f:facet> </p:cellEditor> </p:column> This actually restricts the user from changing that particular cell, but the user still can click and select the cell. I want the user not able to click and select it to have a better UI experience,
e6f77f77180c7d609d41b7b37fa3a933d11a1ac2a5ebfb15eb4d3f0b839ef549
['338daa7126ab4a73bfc9d88fb337093e']
I have a web application where the UI and services are running on different tomcat servers. I have to integrate my application with Keycloak which I could do and I am now able to login. I want the password entered by the user for logging into the keycloak in the UI application. Is this possible?
4eb8367ba06b2cc2a3aa0375a190c2d21243248d8053f89b0e75976fedc9b619
['33906173e6114ce9a5ab53856f244ad9']
The $message variable is used twice... once to receive data from the form, and then you overwrite it? You may want to use a different variable for that. I changed to $msg. Also, you have a lot of needless php tags. Maybe try something a little cleaner like this to start: <?php $to = "<EMAIL_ADDRESS>"; $subject = "Contact Page from "; $headers = "From: A T L <<EMAIL_ADDRESS>>\r\n"; $headers .= "Reply-To: <EMAIL_ADDRESS>\r\n"; $headers .= "Return-Path: <EMAIL_ADDRESS>\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset: utf8\r\n"; $name = filter_input(INPUT_POST, 'form-name'); $email = filter_input(INPUT_POST, 'form-email'); $address = filter_input(INPUT_POST, 'form-address'); $telephone = filter_input(INPUT_POST, 'form-phone'); $theirSub = filter_input(INPUT_POST, 'form-subject'); $msg = filter_input(INPUT_POST, 'form-message'); $message = "<span style='font-weight: bold;'>Name: </span>"."<br />".$name."<br />"."<br />". "<span style='font-weight: bold;'>Email: </span>"."<br />".$email."<br />"."<br />". "<span style='font-weight: bold;'>Address: </span>"."<br />".$address."<br />"."<br />". "<span style='font-weight: bold;'>Telephone: </span>"."<br />".$telephone."<br />"."<br />". "<span style='font-weight: bold;'>Email: </span>"."<br />".$email."<br />"."<br />". "<span style='font-weight: bold;'>Subject: </span>"."<br />".$theirSub."<br />"."<br />". "<span style='font-weight: bold;'>Message: </span>"."<br />".$msg."<br />"."<br />"; mail($to, $subject,"We have received a message via the online form at www.blank.co.uk<br /><br />" . $message, $headers); echo "Your message was successfully sent. Please <a href='contact.php'>click here</a> to return to the site."; ?>
1b6e9fce37acd3f68937cbd3340a4199bc00d04e2af72d18927d1e2a87a3c117
['33906173e6114ce9a5ab53856f244ad9']
I'm not mad at <PERSON> at all... Just wanted the post back on there so I can find a solution to my problem. It looks like the question was reinstated... It's a very weird issue... I'm going to talk with my hosting providers - may even have to pay them for help with it. I'll let you guys know what I find out...
7ac93a38e8936f7eb3b6e6c8bef551e30252415f6b89e757efb37ce8cc1699f1
['33997861d04d4081b3359726d4f7f39c']
I have a question. I'm able to rotate a rectangle by a certain angle, but through this rotation the starting X and Y coordinates didn't change of the rectangle but just the view on the rectangle. So how is it possible to find out the rotated starting, ending X and Y coordinates of a rotating rectangle during a rotation ( sorry for the too many rotations inside this sentence :P) I hope anyone can help me. Thanks.
c4b72aeb1d0640e27dd7d264fda1da5ea62aed86c0ab8823d7bfc595bbebdb04
['33997861d04d4081b3359726d4f7f39c']
I'm asking because I heard about some issues for some users which are using my Application. I was already thinking about what it could be but didn't found a pattern behind the error to fix it afterwards. So I thought about asking you maybe someone could help me to figure it out. The application is about taking information from a server and retrieving this back in a JSON format. This JSON is then parsed inside the Android application and the extracted information are visualised on the Google Map. The extracted information are latitude/longitude/marker description ... For some markers typically the same, I heard until now that 2 out of 20 markers, are not visualised for a few users. Does anyone know why this is happening? The users have either a Smartphone: Wiko Rainbow Version 8 / Version: 4.4.2 Smartphone: Xperia Z1 Compact (D5503) / Version: 5.1 Smartphone: Galaxy S6 Edge+ / Version: 6.0 Smartphone: Xperia Z3 (D6603) / Version: 5.1 Best Regards, <PERSON>
e9acab57c294d605e7b570529733a9f3d31e1353e6eab902bda8d0d086ef7548
['339c2cd763fe459c885a162a7711ce75']
This appears to work to find value and update it. I've updated it so I can find any value for a particular value. //search for all nodes with <DBSimulatorConfiguration> element string xml = "<path>.DBConfig.xml"; XDocument xdoc = XDocument.Load(xml); var elements = xdoc.Root.Elements().Elements().Where(x => x.Name == "DBSimulatorConfiguration"); //iterate through all those eleemnt foreach (var element in elements) { //Console.WriteLine("Empty {0}", element.Value); //now find it's child named Submit var configKey = element.Elements().FirstOrDefault(x => x.Name == "Key"); var configSubmit = element.Elements().FirstOrDefault(x => x.Name == "Submit"); var configAmend = element.Elements().FirstOrDefault(x => x.Name == "Amend"); var configUpdate = element.Elements().FirstOrDefault(x => x.Name == "Update"); var configDelete = element.Elements().FirstOrDefault(x => x.Name == "Delete"); //if such element is found if (configSubmit != null) { if (configKey.ElementsBeforeSelf().Any(x => x.Name == "Key" && x.Value == "Test1")) { Console.WriteLine("Found Key for Test1 {0}", configKey.Value); } if (configSubmit.ElementsBeforeSelf().Any(x => x.Name == "Key" && x.Value == "Test1")) { configSubmit.Value = "1"; Console.WriteLine("Submit value is updated to {0}", configSubmit.Value); } if (configAmend.ElementsBeforeSelf().Any(x => x.Name == "Key" && x.Value == "Test1")) { Console.WriteLine("Amend value is: {0}", configAmend.Value); } if (configUpdate.ElementsBeforeSelf().Any(x => x.Name == "Key" && x.Value == "Test1")) { Console.WriteLine("Update value is: {0}", configUpdate.Value); } } } xdoc.Save("<path>.DBConfig.xml"); Is this the most efficient way of doing this?
c6212c15ee080a8cba8b3ea7f9fbfa78ea7c581d8c08c3b7a038afb88ed71e4d
['339c2cd763fe459c885a162a7711ce75']
I have a python GUI written with Qt using Python 3.4 as the current python version with two buttons. One launches a python script and the other launches a perl script. The Perl button launches this: subprocess.Popen(["ipy64.exe", "qadriver.py", arg1, arg2], stdin=subprocess.PIPE, shell=True) Python button launches this: subprocess.Popen(["perl.exe", "update.pl", arg], stdin=subprocess.PIPE, shell=True) I'd like to click both buttons at the same time and see the output in different command windows. Currently the output from both programs is combined in the one window. Is it possible to get subprocess to open separate windows? Thanks, <PERSON>.
f27bce1d23e891990f735ba2a0ae3286ea24df7cc14a4f342af271d4f4ce9fb5
['33a489f8da87491796d5fe43abc88639']
library(purrr) map(split(test_list, ceiling(seq_along(test_list)/3)), ~reduce(.x , `+`)) $`1` [,1] [,2] [,3] [1,] 11 14 17 [2,] 12 15 18 [3,] 13 16 19 $`2` [,1] [,2] [,3] [1,] 3 12 21 [2,] 6 15 24 [3,] 9 18 27 Credit to this answer for the neat splitting code.
bf8b53d6a477cd0f3d17b4fee888475aafa1c725ff5b63dcd365edc403817252
['33a489f8da87491796d5fe43abc88639']
I'm not entirely sure why I'm getting the funky formatting for life, but I think this gets at your need for a count of the meal types. df %>% group_by(name) %>% summarise(count=n(), medianDate=median(date), life=(max(date)-min(date)), wins=sum(num.wins), chicken = sum(meal == "chicken"), beef = sum(meal == "beef"), fish = sum(meal == "fish")) # A tibble: 3 x 8 name count medianDate life wins chicken beef fish <chr> <int> <date> <time> <int> <int> <int> <int> 1 dinah 2 1999-01-13 " 25 days" 19 1 1 0 2 lucy 4 1999-03-29 " 75 days" 69 1 1 2 3 sora <PHONE_NUMBER> days 101 3 3 3
df32e93ac7060ef34ab75f26da545fcaaf990ab8f9ebd98d3ceb5c9c06d73072
['33a5ea171c5b4525a960e67ff25f487f']
Lets say I use a black key jpg image as my layout in Java Code. Is there an easy way to get the region out of an image so I can use region.Contains() for my onTouchListener? I've looked for them and there isn't any. I ask this because Im making a piano app and would like to get the regions of the images I use for the black/white keys.
40dd42cd9cb82cfef23340e0e560d7a20b5cef2612dae2b48a47e71e39a5d221
['33a5ea171c5b4525a960e67ff25f487f']
Hello guys I am basically doing a piano app. After much thought I think I've figured how most piano apps are done and I'm stuck here and this seems to be very crucial to get all the other functionality such as the slide,multitouch,adding keys,etc. Is it possible to know the dimensions of my drawable button before Hand? Say I have basically two drawable key button, piano keys C and D: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="horizontal" android:gravity="bottom" > <Button android:id="@+id/ckey" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/keybutton" /> <Button android:id="@+id/dkey" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/keybutton" /> For a piano app(white keys), they both use the same selector: <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/key" android:state_pressed="true"/> <item android:drawable="@drawable/key_pressed"/> </selector> But I would like to know the dimensions OR the location BEFOREHAND of the Button created so that I can draw a region on Top of that button and use that region for onTouchListener. I need that region so that I can use onTouch. @Override public boolean onTouch(View v, MotionEvent event) { int numberOfKeys = 2; Region[] keyBoard = new Region[2]; //for 2 White Piano Keys Integer pointerIndex = event.getActionIndex(); Float x = event.getX(pointerIndex); Float y = event.getY(pointerIndex); for(int j=0;j<1;j++){ if(this.keyBoard[j].contains(x.intValue(),y.intValue())){ //play corresponding sound } } So knowing the dimensions of my images: key.png and key_pressed.png and the screen width and height and maybe other parameters I don't know. is It possible to know beforehand the dimensions or COORDINATES or Location of my buttons before the app is launched? Otherwise, how can I get the coordinates? it seems getTop() and getLeft() are not good options because they return 0 since the images take time to load therefore the code cannot retrieve it. Thanks guys. I'm super noob by the way. I apologize if I missed something.
7fbd76c405d5d66082eee1792ed0c0e925b6a92616a00e8913c0a7d81028ca32
['33a823e1b2794beeb14b56f40b3530f4']
Tenho projeto de capturar caixas eletrônicos próximos de uma coordenada no formulário do site da Mastercard. Eu consigo trazer o resultado mas não em json. Pelo Content-Type ser text.XML, não deveria permitir trazer resultado no json? Ou resultado será sempre HTML e precisaria aplicar BeautifulSoap na resposta? Fonte https://www.mastercard.pt/pt-pt/consumers/get-support/locate-an-atm.html import requests params = {'latitude': -23.4887194, 'longitude': -46.6701079, 'radius': 5, 'distanceUnit': 1, 'locationType': 'atm', 'maxLocations': "", 'instName': "", 'supportEMV': "", 'customAttr1': "", 'locationTypeId': ""} r = requests.get('https://www.mastercard.pt/locator/NearestLocationsService/', params=params) r.json() ERRO ssss --------------------------------------------------------------------------- JSONDecodeError Traceback (most recent call last) <ipython-input-41-52b7ec8d97cc> in <module> ----> 1 r.json() ~\Anaconda3\lib\site-packages\requests\models.py in json(self, **kwargs) 896 # used. 897 pass 898 return complexjson.loads(self.text, **kwargs) 899 900 @property ~\Anaconda3\lib\json\__init__.py in loads(s, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw) K 355 parse_int is None and parse_float is None and 356 parse_constant is None and object_pairs_hook is None and not kw): 357 return _default_decoder.decode(s) 358 if cls is None: 359 cls = JSONDecoder ~\Anaconda3\lib\json\decoder.py in decode(self, s, _w) 335 336 337 obj, end = self.raw_decode(s, idx=_w(s, 0).end()) 338 end = _w(s, end).end() 339 if end != len(s): ~\Anaconda3\lib\json\decoder.py in raw_decode(self, s, idx) 353 obj, end = self.scan_once(s, idx) 354 except StopIteration as err: 355 raise JSONDecodeError("Expecting value", s, err.value) from None 356 return obj, end JSONDecodeError: Expecting value: line 1 column 1 (char 0)
c6fc56de072b4dcbcc086d34adafcf978f6426cfcdbb4ba622ed0e1367ba71c2
['33a823e1b2794beeb14b56f40b3530f4']
Assuming you want a SOLID code and keep the single responsibility principle, you would need to inject window and document separately. A clean way is to provide each of them using the useValue property of your provider: @NgModule({ declarations: [...], imports: [...], providers: [ { provide: "windowObject", useValue: window} ] }) as already answered on SO: same stuff for the document provider.
d871613b80ce09a4d4d7c7aba610ea3ec668b7786628a60c8d7ffe9f425c290c
['33bb60ea902c41e99a42a56417ce8a28']
My application brings up a different view each time it is built in Xcode. This is exactly what I want it to do. However, if I simply press the back to menu button in the simulator and then reopen it the view does not change. I am changing the view by overwriting the viewDidLoad function in a Custom View Controller. Why is it that ViewDidLoad is not called every time I click on the icon? Will that mean that on a real iphone it also will not be? Thanks, <PERSON>
499663a51df7c2617ea106bb5e37645ec192a10a7b75ad37706776c3650c4e47
['33bb60ea902c41e99a42a56417ce8a28']
I have a UITableView subclass which initially holds nothing, however by pressing a button I want to be able to add a string to the data and have it show up in the view. How can I do this? I have been trying to simply modify listdata, but this only seems to work once as after that the Table view does not reload, even though I can see more things are being added to list data. Am I missing something? Any help would be greatly appreciated!
c2878d4c0fbc5a9dfb98cfa43291e564598306c66b51c29c6bbd67b516bdc89f
['33e2a433add64935b9983dc3522405ee']
I have a label that changes often, so I've put it in a function. But when I call the function, the label is not displayed. If I set the textvarible to text, then it's working as expected. What am I doing wrong? text = "Now visible to others as {}".format(SERVER_NAME) self.updateSearchLabel(text) def updateSearchLabel(self, textVar): text = StringVar() text.set(textVar) self.lblSearch = Label(self.gpBt, textvariable=text) self.lblSearch.grid(row=0, column=0, sticky=W, padx=(10,0), pady=(5,0))
d240a5aca329c423043fcbda409a01474f6d350cc9220de8fca0cd93f4a3bf0d
['33e2a433add64935b9983dc3522405ee']
I'm trying to send an email to the website admin, but it isn't working as expected. I did this before, where the exact same code is working.. I'm using my gmail account to send emails with my Laravel application. So my setup is as follows 'driver' => 'smtp', 'host' => 'smtp.gmail.com', 'port' => 587, 'from' => array('address' => '<EMAIL_ADDRESS>', 'name' => 'Postmaster'), 'encryption' => 'tls', 'username' => '<EMAIL_ADDRESS>', 'password' => 'xxx', 'sendmail' => '/usr/sbin/sendmail -bs', 'pretend' => false, The next thing I do is fill in a (test) form {{ Form<IP_ADDRESS>open(array('id'=>'mail-form', 'url'=>'en/mail', 'method' => 'post')) }} {{ Form<IP_ADDRESS>text('first_name', null , array('placeholder'=>Lang<IP_ADDRESS>get('quotation.first_name'), 'class'=>'text-input')) }} {{ Form<IP_ADDRESS>text('name', null , array('placeholder'=>Lang<IP_ADDRESS>get('quotation.name'), 'class'=>'text-input')) }} {{ Form<IP_ADDRESS>text('email', null , array('placeholder'=>Lang<IP_ADDRESS>get('quotation.email'), 'class'=>'text-input')) }} {{ Form<IP_ADDRESS>submit(Lang<IP_ADDRESS>get('quotation.send'), array('class'=>'submit-mail')) }} {{ Form<IP_ADDRESS>close() }} This gets processed in my HomeController public function postMail(){ $input = Input<IP_ADDRESS>all(); $data = array( 'first_name' => $input['first_name'], 'name' => $input['name'], 'email' => $input['email'], ); Mail<IP_ADDRESS>send('_emails.quotation', $data, function($message){ $message->to($input['email'], $input['name'].' '.$input['first_name'])->subject('Test'); }); return Redirect<IP_ADDRESS>back(); } When I submit the form I get a 302 found HTTP code, which then directly redirects me to the homepage..
aa86ecfb03a05495f9e5d35ff95a3c9caff46f6482abae09384f9b5ae122bd1d
['33ee8b8255e146cabeeaf922b64a1406']
Hi i want to refresh the page after any of the ID time expire <script type="text/javascript"> setInterval("divID();",1000); function divID(){ $('#btime').load(location.href + ' #bitime'); $('#rtime').load(location.href + ' #retime'); $('#stime').load(location.href + ' #shtime'); } </script> <div id="btime"><div id="bitime"></div></div> <div id="rtime"><div id="retime"></div></div> <div id="stime"><div id="shtime"></div></div> After any of the div ID when time expire i want to refresh the page once, please how can i do that continuing using my actual script ?
f43a1009c556da2a730b93ea8b4a5f5adfcb23fcf084f77e9ac13b10c529798e
['33ee8b8255e146cabeeaf922b64a1406']
<!-- TemplateLib.php --> private function gameHeader($metatags = '') { $page = str_replace(array('/', 'game.php', '?page='), '', $_SERVER['REQUEST_URI']); $page = $page ? $page : 'overview'; $parse['bodyID'] = $page; return $this->parseTemplate($this->getTemplate('general/simple_header'), $parse); } <!-- simple_header.php --> <body id="{bodyID}"> and is a working solution for me now i will adjust the REQUEST_URI function only if is not secure i must read the web more thanks in advance, can't belive i have managed this myself with info from the web without knowledge :)
fe3483b0883249f61e6000c379f94559b888f089553a7cffb98159aca2cd43e3
['340031e4b5634c00a84fcda5aebaed44']
I just had the same issue with Worksattion 7 and Ubuntu 12.04. I tried the suggested solutions, however they did not work. What worked for me was Creating the VM first by choosing the option "I will install the OS later" then mount the iso on the CDROM through the settings window and boot it up. Worked 1st time. also once its finished copying the files disconnect the cd rom at reboot
c7dcf3b2895eba5307f4947bedb13fa80a657405e2b23c002d84383b5e0bee28
['340031e4b5634c00a84fcda5aebaed44']
I found the problem and posting solution in case somebody gets stuck like me. In my case I am only returning one result and I assumed it will return one object. This is not the case as indicated by the "ResultList" error. Even if you return 1 result the function will still return a list with 1 result.
274bfc3f30135457f7ac7a6d264eb42ca3effad0e5cefb41124ce6f45d7b3823
['34008cc30cb94b928cf7da11d15df0e1']
I have an xml like this : <name> <class> </class> </name> then i want to add the tag like this <tia:Demographic><Age/><DOB/></tia:Demographic> in between <class> How can we do that . i am using following code. XDoc.LoadXml(@"<name><class></class></name>"); XmlDocumentFragment xfrag = XDoc.CreateDocumentFragment(); xfrag.InnerXml = @"<tia:Demographic><Age/><DOB/></tia:Demographic>"; XDoc.DocumentElement.FirstChild.AppendChild(xfrag); XDoc.Save(@"D:\test.xml"); but it throws an error that tia: not a registered namespace
ee738659a31895849697bb3adc4c21d3a1909ea3a2fd4f01b353ce561403bf18
['34008cc30cb94b928cf7da11d15df0e1']
Using core java script you can find like this: var jsonData = {"data": [ { "id": 1, "title": "Category title", "products": [ { "id": 1, "title": "product title", "volume": "40" }, { "id": 2, "title": "product title", "volume": "30" } ] }, { "id": 2, "title": "Another Category title", "products": [ { "id": 3, "title": "product title", "volume": "40" }, { "id": 3, "title": "product title", "volume": "30" } ] } ] }; var uniqueArr = []; var jsonData = jsonData["data"]; var fullObjectLength = Object.keys(jsonData).length for(var i=0; i<fullObjectLength;i++) { //console.log(jsonData[i]["products"]); var jsonProductsLength = jsonData[i]["products"].length; for(var j=0; j<jsonProductsLength; j++) { var volumeKeyValue = jsonData[i]["products"][j]["volume"]; var itemTobePushedInArray = uniqueArr.indexOf(volumeKeyValue) == -1; if(itemTobePushedInArray) { uniqueArr.push(volumeKeyValue); console.log(uniqueArr); } } }
d964eaa2474d65dfd6e66d6a6a830ff40091c358f10faa406f1c98d76855727a
['3415a23937104cc5b4ff0cc83abf38c5']
I am trying to do the following in python: Splitting a file of para of statements into sentences. Splitting these sentences with contractions into words. Trying to remove stopwords from the set of words. When I do the 2nd step I get the result [['Hello','World'], and so on. I understand ( if I am not wrong) I have got a list or a nested list so the probable error. But have got no idea to solve the error. import nltk from nltk.tokenize import WhitespaceTokenizer from nltk.tokenize import word_tokenize from nltk.corpus import stopwords file = open('C:/temp1/1.txt','r') text = file.read() # read the contents of the text file into a variable result1 = nltk.sent_tokenize(text)#split para into sentences print "Split sentences are " print result1 tokenizer=WhitespaceTokenizer() result2 = [tokenizer.tokenize(sent) for sent in result1]#obtains the splitted sentences with contractions print "Split words in each sentences are " print result2 english_stops=set(stopwords.words('english')) result3=[word for word in result2 if word not in english_stops] print result3 Error: Split sentences are ['Hello World.', "It's good to see you.", 'Thanks for buying this book.', "Can't is a contraction."] Split words in each sentences are [['Hello', 'World.'], ["It's", 'good', 'to', 'see', 'yTraceback (most recent call last): File "D:\Learn NLTK\import nltk.py", line 34, in <module> result3=[word for word in result2 if word not in english_stops] TypeError: unhashable type: 'list' ou.'], ['Thanks', 'for', 'buying', 'this', 'book.'], ["Can't", 'is', 'a', 'contraction.']] Do I need to use a nested for loop so as to obtain the stopwords filtering? I have checked the related questions which had the same error but I am new to python so I am unable to grasp any idea from those related questions. Any help would be appreciable. Arc.
d17da77485f3a991de0cb68fb519bfedfed0350d9a30b3fbfaa03b9974572b18
['3415a23937104cc5b4ff0cc83abf38c5']
I have installed Maven 3.0.5 on my windows 8 64 bit machine by the following steps: Downloaded apache-maven-3.0.5.bin.zip and the archive is stored in C:\Program Files\Apache Software Foundation. I changed the environment variables as follows: M2_HOME with value C:\Program Files\Apache Software Foundation\apache-maven-3.0.5 M2 with value %M2_HOME%\bin JAVE_HOME with value C:\Program Files\Java\jdk1.8.0_25 PATH with value %M2%;%JAVA_HOME%\bin after this when i type mvn --version i get Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 19:21: 28+0530) Maven home: C:\Program Files\Apache Software Foundation\apache-maven-3.0.5 Java version: 1.8.0_25, vendor: Oracle Corporation Java home: C:\Program Files\Java\jdk1.8.0_25\jre Default locale: en_US, platform encoding: Cp1252 OS name: "windows 8", version: "6.2", arch: "amd64", family: "dos" I have downloaded JDK and JRE in the folders under C:\Program Files\Java\jdk1.8.0_25 C:\Program Files\Java\jre1.8.0_25 Now for Karma to install I downloaded the Web-Karma-Master zip and the archive is placed under C:\Program Files\Web-Karma-master\Web-Karma-master Now when I type mvn clean install in this directory I get the following: .. ... ... [INFO] karma-mr .......................................... SKIPPED [INFO] karma-storm ....................................... SKIPPED [INFO] karma-web-services ................................ SKIPPED [INFO] web-services-rdf .................................. SKIPPED [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 24.285s [INFO] Finished at: Wed Oct 29 13:21:14 IST 2014 [INFO] Final Memory: 8M/109M [INFO] ------------------------------------------------------------------------ [ERROR] Plugin org.codehaus.mojo:exec-maven-plugin:1.1 or one of its dependencie s could not be resolved: Failed to read artifact descriptor for org.codehaus.mojo: exec-maven-plugin:jar:1.1: Could not transfer artifact org.codehaus.mojo:exec-maven-plugin:pom:1.1 from/to central Connection to http://repo.maven.apache.org refused: Connection timed out: connect -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException. Please help. I have done all the above in the same order as mentioned. But I am not able to resolve this problem. Archana.
9ee1592ff59b9b6dbd82c6ed553306e8f073285a8fe6c9e085ead12001bbf1e2
['341f4ff6b5e746408a3af4f955545a86']
Thanks everyone for your quick response! I just figured out a solution which works for me: function() { var items = {{dl_products_checkout}}; var itemsValue = []; var sumValue = 0; var i, len; for (i = 0, len = items.length; i < len; i++) { itemsValue.push(items[i].price); for (i = 0; i < itemsValue.length; i++){ sumValue = sumValue + parseFloat(itemsValue[i]) } } return sumValue; } Have a nice day!
02cc5ae128322ebc1ecced36291c26baa7c7009cb38a74edcc488b49cc452a23
['341f4ff6b5e746408a3af4f955545a86']
i'm trying to get the innerHTML out of two different ids to count words. Therefore i used querySelectorAll with two id matches. I only get the first match back. Is this method even possible? function() { var wordCounts; var wordCountTemp = document.querySelectorAll("#text-block-10, #text-block-12"); var i; for(i = 0; i < wordCountTemp.length; i++){ wordCounts = wordCountTemp[i].innerHTML; wordCounts.replace(/(^\s*)|(\s*$)/gi,""); wordCounts.replace(/[ ]{2,}/gi," "); wordCounts.replace(/\n /,"\n"); return wordCounts.split(" ").length; } } Thanks a lot for your help! Best regards, <PERSON>
20d38ed732f8e60245fcf2bc7bd23e3321700d1ed86d1578b75803af42574557
['34487b8774c244a08587a5195dc81319']
If you want to make it generic enough and suitable for real-world application, it's a bit more complicated. First, you probably want to get rid of the content between <script> and </script> tags. Second, you cannot assume that opening tag always contains the same text, e.g. text in <span class="myclass"> is not quite the same as in </span>. I would suggest getting rid of all <something> tags, regardless of what kind of tag was that, and also removing the <script> tag. You probably can't get away with just one super-smart regexp, you'd rather use multiple regexps to do the job. Here is a little script I've put together, works fine on cnn.com (as a sample of non-trivial input). I tried to preserve the line breaks, just to print it nicely, and removed the empty lines -- but obviously, all this might not be necessary. I also did some dirty trick here, by hiding \n with a dummy \\\\NN string (replacing <script> globally wouldn't work otherwise). my $text = ""; foreach my $line (@res) { chomp $line; $text .= $line . "\\\\NN"; # Hiding the \n's } $text =~ s/(<script(\s[^<]*)?>.*?<\/script>)//gi; $text =~ s/<.*?>/ /g; # Beautify it... :) $text =~ s/\s{2,}/ /g; $text =~ s/\s*\\\\NN\s*/\\\\NN/g; $text =~ s/(\\\\NN){2,}/\\\\NN/g; $text =~ s/\\\\NN/\n/g; print $text."\n";
fc2d99fc6ef50b878a6dc186867adbe2699361ca5b8ad4205963cd38e52e212b
['34487b8774c244a08587a5195dc81319']
Styne666 gave the right regex. Here is a little Perl script which is trying to match its first argument with this regex: #!/usr/bin/env perl use strict; use warnings; my $arg = shift; if ($arg =~ m/(#(?=\d*[a-zA-Z])[a-zA-Z\d]{2,})/) { print "$1 MATCHES THE PATTERN!\n"; } else { print "NO MATCH\n"; } Perl is always great to quickly test your regular expressions. Now, your question is a bit different. You want to find all the substrings in your text string, and you want to do it in C++/Qt. Here is what I could come up with in couple of minutes: #include <QtCore/QCoreApplication> #include <QRegExp> #include <iostream> using namespace std; int main(int argc, char *argv[]) { QString str = argv[1]; QRegExp rx("[\\s]?(\\#(?=\\d*[a-zA-Z])[a-zA-Z\\d]{2,})\\b"); int pos = 0; while ((pos = rx.indexIn(str, pos)) != -1) { QString token = rx.cap(1); cout << token.toStdString().c_str() << endl; pos += rx.matchedLength(); } return 0; } To make my test I feed it an input like this (making a long string just one command line argument): peter@ubuntu01$ qt-regexp "#hjhj 4324 fdsafdsa #33e #22" And it matches only two words: #hjhj and #33e. Hope it helps.
d2dd55411f5467967e5e8daa96e98a7b6d2449737151c7f6c873b8e85ce3173a
['344a0e74eaee46d5a461fbf14749b8f9']
WOuld strongly recommend refactoring the code, you have nearly identical blocks of code repeating three times and makes the code extreamly difficult to read. Break out the identical parts and put only the differing parts in if clauses. As to solving the actual issue, something like this should work: setDateTimerPickerValueIfExists(dateTimePicker1, myReader["Born"]); setDateTimerPickerValueIfExists(dateTimePicker2, myReader["Died"]); //.. private void setDateTimerPickerValueIfExists(DateTimePicker dateTimePicker, xxxxxxxReader reader) { if (reader != null) { dateTimePicker.Value = Convert.ToDateTime(reader.ToString()); } }
808dc9ec7b0377a1cc09b51d756a10f8d89e57aa74fd723e7fd73f5bd1d8b1c8
['344a0e74eaee46d5a461fbf14749b8f9']
In JavaScript, functions are just another type of object. Calling a function without arguments is done as follows. This will always execute the function and return the function's return value. var returnValue = b(); Removing the parenthesis will instead treat the function itself as a variable, that can be passed around in other variables, arguments etc. var myFunction = b; At any point such adding parenthesis to the "function variable" will execute the function it refers to and return the return value. var returnValue = myFunction(); var sameReturnValue = b(); So map() accepts one argument, which is of type function (no parenthesis). It will then call this function (parenthesis) for each element in the array.
814036bdff860adacd4e7023650b2462c05661824476126aee2923e48f408eab
['344cb4fca69344b99dfd89e812d94636']
Your actual Code create a list for each row and an list for each cell, this don't fits together. Following script search the table (it is the only one that has the attribute summary) and loops over each row (tr). Than it gets from the Week column (td class B6) the first part before the " to " and convert it to an datetime. For each cell (td class B3) it get the price (or empty string), set the date and increments the date. from urllib.error import HTTPError from urllib.error import URLError from bs4 import BeautifulSoup from pandas import DataFrame import csv import pandas as pd from urllib.request import urlopen import datetime try: html = urlopen("https://www.eia.gov/dnav/ng/hist/rngwhhdD.htm") except HTTPError as e: print(e) except URLError: print("Server down or incorrect domain") else: res = BeautifulSoup(html.read(),"html5lib") table = None for t in res.findAll("table"): table = t if "summary" in t.attrs else table if table == None: exit() # stop_date = datetime.datetime(year = 2018, month = 7, day = 12) # today = datetime.datetime.now() # abort = False price_list = [] date_list = [] rows = table.findAll("tr")[1:] for row in rows: date = None cells = row.findAll("td") if cells[0].get("class") == None: continue # placeholder.. if "B6" in cells[0].get("class"): d = cells[0].getText().split(" to ")[0].strip().replace(" ", "") date = datetime.datetime.strptime(d,"%Y%b-%d") for cell in cells: if "B3" in cell.get("class"): # and abort == False: price = cell.getText().strip() if price == "" or price == "NA": price = "" else: price = float(price) price_list.append(price) date_list.append(date) date = date + datetime.timedelta(days=1) #if date > today: abort = True #if abort == True: break d1 = pd.DataFrame({'Date': date_list}) d2 = pd.DataFrame({'Price': price_list}) df = pd.concat([d1,d2], axis=1) print(df) df.to_csv(r"Gas Price.csv", index=False, header=True)
5c31e68c44e2d2963f5551512d84cf298e869cea17333200e2040637fbf37be4
['344cb4fca69344b99dfd89e812d94636']
In addition to the previous post, if i use this HTML: <html> <head></head> <body> <div class="specs__group col-12 col-lg-6" style="min-height: 39px;"> <div class="col-6 specs__cell specs__cell--label">Blade Length (in.)</div> <div class="col-6 specs__cell">16 in</div> </div> <div class="specs__group col-12 col-lg-6" style="min-height: 39px;"> <div class="col-6 specs__cell specs__cell--label">Blade Width (in.)</div> <div class="col-6 specs__cell">4.5</div> </div> <div class="specs__group col-12 col-lg-6" style="min-height: 39px;"> <div class="col-6 specs__cell specs__cell--label">Product Height (in.)</div> <div class="col-6 specs__cell">3.63 in</div> </div> <div class="specs__group col-12 col-lg-6" style="min-height: 39px;"> <div class="col-6 specs__cell specs__cell--label">Product Length (in.)</div> <div class="col-6 specs__cell">16 in</div> </div> <div class="specs__group col-12 col-lg-6" style="min-height: 39px;"> <div class="col-6 specs__cell specs__cell--label">Product Width (in.)</div> <div class="col-6 specs__cell">4.5 in</div> <div class="specs__group placeholder" style="min-height: 39px;"> ?? </div> </body> You can create an dict or dataframe: from bs4 import BeautifulSoup import pandas as pd from selenium import webdriver from selenium.common.exceptions import NoSuchElementException, NoSuchFrameException base_url = "file:///C:/Users/.../blade.html" driver = webdriver.Chrome() driver.get(base_url) groups = driver.find_elements_by_class_name("specs__group") data = {} for group in groups: if "placeholder" not in group.get_attribute("class"): specs = group.find_elements_by_class_name("specs__cell") dimension = specs[0].text.strip() value = float(specs[1].text.replace("in","").strip()) #print(dimension,":",value) if dimension not in data: data[dimension] = [] data[dimension].append(value) print(data) data_frame = pd.DataFrame(data=data) print(data_frame)
27e880663a35e2fe6dc502ed298411f9495debfb0003a212ea9b3810da548922
['345e41d2556d409393e918ea2e9e2c5c']
I have a big zip with 300.000+ files in with all directories and subdirectories On the other hand, I have a list of 1200 files I need to extract from the zip. This list has the dir path and file name in it as one (see exp) Exp: /var/db/bla/file.ext At this moment, I use the following code to search and extract the files from the zip (with keeping the timestamp). It works, but it's really slow. Is there a better way? Now it's reading all the files from the zip, and if it's a match, it extracts it. Is there maybe a way to give the file location (thru the list) directly and extract it without making a list of all the files in it? files = df2.drop_duplicates().drop_duplicates().values.tolist() pbar_max = (len(files)) pbar = tqdm(total=int(pbar_max)) ## for count, i in enumerate(files): for item in (f for f in zip_file.filelist if i in f.filename): e = item.date_time gettime = "%s/%s/%s %s:%s" % (e[0], e[1], e[2], e[3], e[4]) #print(item.filename) zip_file.extract(item.filename, directory) filep = directory + item.filename timearry = time.mktime(time.strptime(gettime, '%Y/%m/%d %H:%M')) os.utime(filep, (<PERSON>, <PERSON>)) pbar.update(1) pbar.close() Hope somebody has a clever Idea, thanks
13edcdb7f5b61a14e2df0fc7124f2e569be5d0ea62c18754c1e022c900b4262e
['345e41d2556d409393e918ea2e9e2c5c']
Hi iam trying t merge a couple of databases with each other. I have the following code to search for the databases, and then combine them. import os import glob import sqlite3 con3 = sqlite3.connect("./combine.SQL") #Empty DB directory_with_databases = "./unpacked/" #folder with "full" *.sql dbs databases = glob.glob(os.path.join(directory_with_databases, "*.SQL")) for filename in databases: con3.execute("ATTACH ? as dba", (filename,)) for row in con3.execute ("SELECT * FROM dba.sqlite_master WHERE type='table'") : combine = "INSERT INTO " + row[1] + " SELECT * FROM dba." + row[1] print (combine) con3.execute (combine) con3.commit () con3.execute("detach database dba") When executing the code i get the follwing error: con3.execute (combine) sqlite3.IntegrityError: UNIQUE constraint failed: PLschemaVersions.ID Can somebody help me to complete the code
aec17fdcef987e3aabb09fc93f3a5a0a610268d147dc8395af52fc1b9fbf00f8
['3475c9c3fb634d5ea995437451d06daf']
I solved it a little bit different. Solution for my problem is kind of as Draco18s says...How I solved it is, that I have specified on which position I want to see my value of series. So I have made as first indexof my item in a list. and then I used this index in series data. So solution looks like this $.ajax({ url: 'my/rest/get_devices_usage.php', type: 'POST', data: {}, success: function(data, textStatus, jqXHR) { series = []; var months = []; var device_names = []; var usages = []; for(var i = 0; i<data.length; i++) { months.push(data[i].month); device_names.push(data[i].device_name); usages.push(parseFloat(data[i].usage_sum)); } var data = []; data = generateData(months, device_names, usages); $('#panel-body').highcharts({ title: { text: '' }, chart: { title: '', type: 'column' }, xAxis: { categories: months }, series: data }); function generateData(cats, names, points) { var ret = {}, ps = [], series = [], len = cats.length; for (var i = 0; i < len; i++) { ps[i] = { x: cats[i], y: points[i], n: names[i] }; } //populate the graph for (i = 0; i < len; i++) { var p = ps[i]; ///Solution var month = 0; //find position of the actual month month = months.indexOf(p.x); series.push({ name: p.n, data: [[month, p.y]] }); } ///Solution return series; } }, error: function(jqXHR, textStatus, errorThrown) { } }); So just count on which category is your value, and put it on that category data:[[category_position, value]] ...that's it :) Thank you guys for help.
fc3737cdf02f6677c678a4fc8d3a46d1b3fc988f8218b4e6c327749ace9caa28
['3475c9c3fb634d5ea995437451d06daf']
I am working on a "schema" search, where you can write some part of the xpath and after that, system should show you what are the further possibilities of the node (so what other node can be accessed after specific node). However, I am looking for some solution which would create me a list of possible parents and childs based on the schema.
e8fb15cbbd5af30c14d2211cc3a5c8625af4ab2a1b4fe954552604c362a2a69e
['347ea95e19e64931880884af5d71a396']
I'm trying to make a push-notification-settings page in my Flutter app. The page should allow the user to configure which push notification he/she wants to receive. For example one wants to receive a notification for a friend request, but doesn't want to be notified when another user accepts a friend request. I wasn't able to find anything related to such a feature, although I think this is a common feature that almost every app provides. I have already implemented the sending of push notifications for several events in my Node.js (Express.js) backend with Firebase. The push notification is being received using the Firebase cloud messaging plugin for Flutter. I want to implement it using basic toggles or checkboxes like this (example from the app Trello): Does anyone know how to do that or where I can retrieve information regarding this topic?
cd34b4e68f14c842883b9a368a2da1c6974c32b92e3eda745408bdf6cba416eb
['347ea95e19e64931880884af5d71a396']
Before I had the version v1.12.13+hotfix.5, then I switched to version v1.14.4 and it worked. The error says that you should add WidgetsFlutterBinding.ensureInitialized();, but since that didn't work for me I switched to the other version. One thing to keep in mind though is that you still have to add WidgetsFlutterBinding.ensureInitialized(); as the very first line in your main!
82cef077437623bae990decee8a0ee112870a7ad527a5062fcc6b6fbb525f015
['34808958b3fe404899de0821082f02da']
Let $S=\{x_1,x_2,\dots,x_n\}$ be the set. Since $S$ is a set then $\forall i,j\in\mathbb{N}, 1\le i,j\le n$ if $i\ne j\Rightarrow x_i\ne x_j$. Suppose we have a subset $S'\subset S$ such that $S'$ has not adjacent numbers, then $S'$ has a unique way to "put" its numbers such that $S'=\{y_1,y_2,\dots,y_k\}$ and $y_1<y_2<\cdots<y_k$. So we have a bijection here, if we have a subset $S'\subset S$ and it hasn't adjacent numbers then we have one valid subset. All we need is how calculate the subset $S'\subset S$. Then if $|S'|=k$ and $|S|=n$, all we need is to peek $k$ elements from a set of $n$ and any pair of them are adjacent numbers in $S$, then $2k\le n+1$. Let's do this: Given a sequence $s$ of $n$ bits then $s$ define a subset $S'\subseteq S$ such that the $i$-th bit define if the $i$-th element of $S$ has been chosen to "take part" in $S'$, if $i$-th bit is turned on $0$ then $x_i\notin S'$ and otherwise $x_i\in S'$. Also, all possible subsequence $s$ of $n$ bits define all possible subset of $S$. So we have another bijection here, $S'$ hasn't adjacent numbers if and only if $s$ hasn't $2$ adjacent bits turned on $1$. If we want to find a valid subset $S'$ with $k$ elements then we could do this: Let define the sequence $s'$ of $n-k$ bits turned on $0$, then we will "put" $k$ bits turned on $1$ in $s'$ and we will take care that $s'$ hasn't $2$ adjacent bits turned on $1$. So $s'$ has $n-k+1$ possible position to "put" a bit turned on $1$, so we have $\binom{n-k+1}{k}$ possible ways to "make" a "new" sequence $s'$ of $n$ bits such that $s'$ hasn't $2$ adjacent bits turned on $1$. So we will have $\binom{n-k+1}{k},~2k\le n+1$ subsets $S'\subset S$ of length $k$ and $S'$ hasn't $2$ adjacent numbers of the set $S$. If you want to calculate the number $n$ of all possible subset $S'$ then: $\displaystyle n=\sum^{t}_{k=1}\binom{n-k+1}{k},$ $t=\lfloor\frac{n+1}{2}\rfloor$ Note: If you include the empty subset just take $k$ from $0$ to $t$.
d4c4376d594a30fe5919807ea85b0742fcf5c82c13e3ec75867a6680a9fbd8bf
['34808958b3fe404899de0821082f02da']
This is my solution: Lemma 1: $\forall a,b\in\mathbb{Z}$, if $\gcd(a,b)=1\Rightarrow\gcd(a+b,a)=\gcd(a+b,b)=1$. Lemma 2: $\forall a,b,c\in\mathbb{Z}$, if $\gcd(a,b)=1\Rightarrow\gcd(a,bc)=\gcd(a,c)$. Proving lemma 1: Let $d=\gcd(a+b,a)\Rightarrow d\mid(a+b)~\wedge~d\mid a\Rightarrow d\mid b$, but $\gcd(a,b)=1\Rightarrow d=1$. Let $d=\gcd(a+b,b)\Rightarrow d\mid(a+b)~\wedge~d\mid b\Rightarrow d\mid a$, but $\gcd(a,b)=1\Rightarrow d=1$. Proving lemma 2: Let $d=\gcd(a,bc)\Rightarrow d\mid a~\wedge~d\mid bc\Rightarrow d\mid ac~\wedge~d\mid bc\Rightarrow d\mid\gcd(ac,bc)\Rightarrow d\mid c\cdot\gcd(a,b)\Rightarrow d\mid c$. Then $d\mid a~\wedge~d\mid c\Rightarrow d\mid\gcd(a,c)\Rightarrow d\le\gcd(a,c)$. Let $d'=\gcd(a,c)\Rightarrow d'\mid a~\wedge~d'\mid c\Rightarrow d'\mid a~\wedge~d'\mid bc\Rightarrow d'\mid\gcd(a,bc)\Rightarrow d'\le\gcd(a,bc)$. Then $\gcd(a,bc)\le\gcd(a,c)~\wedge~\gcd(a,c)\le\gcd(a,bc)\Rightarrow\gcd(a,bc)=\gcd(a,c)$. Proving the exercise: Let's prove this: $\forall a,b\in\mathbb{Z},~\gcd(a,b)=1\Rightarrow\gcd(a+b,a^2+b^2-nab)\mid(n+2)$ Let $d=\gcd(a+b,a^2+b^2-nab)$ $\Rightarrow d\mid(a+b)~\wedge~d\mid(a^2+b^2-nab)$ $\Rightarrow d\mid(a+b)^2~\wedge~d\mid(a^2+b^2-nab)$ $\Rightarrow d\mid\Big((a+b)^2-(a^2+b^2-nab)\Big)$ $\Rightarrow d\mid(a^2+b^2+2ab-a^2-b^2+nab)$ $\Rightarrow d\mid ab(n+2)$ Suppose $d\mid a~\vee~d\mid b\Rightarrow d\mid ab\Rightarrow d\mid(a+b)~\wedge~d\mid ab\Rightarrow d\mid\gcd(a+b,ab)$ $\gcd(a+b,a)=1$ (Lemma 1) $\gcd(a+b,ab)=\gcd(a+b,b)=1$ (Lemma 2, Lemma 1) Then $d\mid1\Rightarrow d=1\Rightarrow d\mid(n+2)$. If $d\nmid ab\Rightarrow d\mid(n+2)$ Then the value of $d$ doesn't matter, $d\mid(n+2)$. In this case; $d=\gcd(a+b,a^2+b^2-ab),~n=1\Rightarrow d\mid(1+2)\Rightarrow d\mid3\Rightarrow d=1~\vee~d=3.$
f25964fe1436a568bbd2e249ac9f52f6db480c332f621cecb24c547edf8a2114
['3494716ffcfb466992b23ac5fca993eb']
As you can see here, the formula to standardize is: z = (x-x')/S, where x is a point, x' is the sample mean and S is the stdev of the sample. This means that x' should be the mean of all the lists in a column (for example F1), and S should be the stdev of all the lists in a column. Then this computation z should be applied to each point. What is the correct approach to standardize this kind of data? Are the methods mentioned above correct? Method 1 is not a good approach, because the mean of list 1 will differ from the mean of list 2, and since they are part of the same sample the centering mean value should be the same. Method 2 is ok in the mean calculation, but I am not sure in the calculation of the stdev. Calculating the stdev of all the lists together is definitely correct.
ea5ee2e9fd6783c187120376c610ca4a2e9c63ce53420f6ea343808b928b6456
['3494716ffcfb466992b23ac5fca993eb']
Let me explain one of my approaches, I know it's time-consuming, but if you need something simple-stupid, here it is: When I try to find the optimal number of clusters, I just do a for loop between 2 to n, using a different number of centroids in each iteration, fit the model and print the silhouette score. I select the model with the best score or one of the best scores if there is some specific number of clusters that match with groups in a feature. Example code: for i in range(2, 30): model = MiniBatchKMeans(n_clusters=i) model.fit(vectors_) score = silhouette_score(vectors_, model.labels_) print("Number clusters: {}, Silhouette score is {})".format(i, score)) It could output something like: Number clusters: 2, Silhouette score is <PHONE_NUMBER>) Number clusters: 3, Silhouette score is 0.6105084877652616) Number clusters: 4, Silhouette score is 0.6177814923806652) Number clusters: 5, Silhouette score is <PHONE_NUMBER>) Number clusters: 6, Silhouette score is 0.6454444674454114) Number clusters: 7, Silhouette score is 0.5614716290406436) Number clusters: 8, Silhouette score is 0.5585556926568208) Number clusters: 9, Silhouette score is <PHONE_NUMBER>) ...... So I would pick 6 clusters.
a2bf3b5925e23b01fd67ee9c367c6b3bb07d93230c3b79fb96bce8c4cfbcbd65
['34a4b918064749ae82d9ac645b83530b']
Find the condition on the real numbers $a,b$ and $c$ such that the following system of equations has a solution: $2x+y+3z=a$ $x+z=b$ $y+z=c$ After calculation I get $a-2b-c=0$ will be the answer. Can anybody please confirm me please that I am correct or not.
77515277cc597c3177b4ef32454692b328a9fb110571fd3c0f30ec88c72f053d
['34a4b918064749ae82d9ac645b83530b']
Note that if you get a tooltip at the top of your Chrome browser saying "Apps, extensions, and user scripts cannot be added from this website" after clicking the install link, you can simply go to `chrome://extensions` and drag and drop the `.js` file that is linked to above.
418a3217326a013ee5782264314482facede39b65893ab5037762dd4d315268e
['34b10528f93c4b5bb15c9d52af13a401']
I would like to load a webpage on an iframe and then change some styles from the parent page through javascript. The webpage to load on an iframe isn't on my domain. I mean, it can be some random page on the web. Is this possible? If so, how?
bfbd358aac2844565e9944c1980db519ab85404bc8317c9ea4dc8bbb26e75f68
['34b10528f93c4b5bb15c9d52af13a401']
The SBS Servers tend to gather a lot of backup data, in hidden directories that happens to get the quotas over the limit. You should check for such as at times the servers might have been set up to back up each of the clients in a small SBS environment. Once you do find these then you can proceed to un-hide and delete those files that you feel are no longer needed or not important to say the least. I had a similar scenario with a newer SBS Server and I just made a good back up of it and then merged it into a 2012 R2 Standard as it gives you more features than the depricated server you need to upgrade anyway. You may be able to use that server as a BDC once you move to a more current OS. You got to realize that is a 13 year old OS.
3fa1f6563ff41ae8b9b5f5b5874c55857f487c64127db11caa7c0ca9f01d8866
['34b636351fce490bbc32cae37b763d05']
I installed SuSE 64 bit version, and i saw it has libraries (Samba), installed with both 32 and 64 bit versions. We used to upgrade only the 64 bit version of libraries of Samba in our software package, leaving 32 bit untouched. We are now thinking to totally remove the 32 bit version of libraries from the OS. Will it have any functional impact? Please suggest.
81578a36dc2f5e574527ed523e35f116b73f91bdce739d9c08f72f76f819e6dc
['34b636351fce490bbc32cae37b763d05']
I am using SUSE Linux 11, in Zenworks distro and i can see. kernel version is: 3.0.13-0.27-default. I can see that when the distro is loaded, the e1000 driver is loaded and not e1000e although e1000e is also present. I have some questions: 1) Why the e1000e driver is not loaded automatically like e1000 ? Does the driver load, based on the compatibility with a particular version of kernel? If yes, how to determine the compatibility (any command)? 2) What is the basic difference between e1000 and e1000e? 3) When is e1000 required to use and e1000e? modinfo of e1000 filename: /lib/modules/3.0.13-0.27-default/initrd/e1000.ko version: 7.3.21-k8-NAPI license: GPL description: Intel(R) PRO/1000 Network Driver author: Intel Corporation, <<EMAIL_ADDRESS>> srcversion: 9156F163ACCABEA3C50ACF0 alias: pci:v00008086d00002E6Esv*sd*bc*sc*i* alias: pci:v00008086d000010B5sv*sd*bc*sc*i* alias: pci:v00008086d00001099sv*sd*bc*sc*i* alias: pci:v00008086d0000108Asv*sd*bc*sc*i* alias: pci:v00008086d0000107Csv*sd*bc*sc*i* alias: pci:v00008086d0000107Bsv*sd*bc*sc*i* alias: pci:v00008086d0000107Asv*sd*bc*sc*i* alias: pci:v00008086d00001079sv*sd*bc*sc*i* alias: pci:v00008086d00001078sv*sd*bc*sc*i* alias: pci:v00008086d00001077sv*sd*bc*sc*i* alias: pci:v00008086d00001076sv*sd*bc*sc*i* alias: pci:v00008086d00001075sv*sd*bc*sc*i* alias: pci:v00008086d00001028sv*sd*bc*sc*i* alias: pci:v00008086d00001027sv*sd*bc*sc*i* alias: pci:v00008086d00001026sv*sd*bc*sc*i* alias: pci:v00008086d0000101Esv*sd*bc*sc*i* alias: pci:v00008086d0000101Dsv*sd*bc*sc*i* alias: pci:v00008086d0000101Asv*sd*bc*sc*i* alias: pci:v00008086d00001019sv*sd*bc*sc*i* alias: pci:v00008086d00001018sv*sd*bc*sc*i* alias: pci:v00008086d00001017sv*sd*bc*sc*i* alias: pci:v00008086d00001016sv*sd*bc*sc*i* alias: pci:v00008086d00001015sv*sd*bc*sc*i* alias: pci:v00008086d00001014sv*sd*bc*sc*i* alias: pci:v00008086d00001013sv*sd*bc*sc*i* alias: pci:v00008086d00001012sv*sd*bc*sc*i* alias: pci:v00008086d00001011sv*sd*bc*sc*i* alias: pci:v00008086d00001010sv*sd*bc*sc*i* alias: pci:v00008086d0000100Fsv*sd*bc*sc*i* alias: pci:v00008086d0000100Esv*sd*bc*sc*i* alias: pci:v00008086d0000100Dsv*sd*bc*sc*i* alias: pci:v00008086d0000100Csv*sd*bc*sc*i* alias: pci:v00008086d00001009sv*sd*bc*sc*i* alias: pci:v00008086d00001008sv*sd*bc*sc*i* alias: pci:v00008086d00001004sv*sd*bc*sc*i* alias: pci:v00008086d00001001sv*sd*bc*sc*i* alias: pci:v00008086d00001000sv*sd*bc*sc*i* depends: supported: yes vermagic: 3.0.13-0.27-default SMP mod_unload modversions 586TSC parm: TxDescriptors:Number of transmit descriptors (array of int) parm: RxDescriptors:Number of receive descriptors (array of int) parm: Speed:Speed setting (array of int) parm: Duplex:Duplex setting (array of int) parm: AutoNeg:Advertised auto-negotiation setting (array of int) parm: FlowControl:Flow Control setting (array of int) parm: XsumRX:Disable or enable Receive Checksum offload (array of int) parm: TxIntDelay:Transmit Interrupt Delay (array of int) parm: TxAbsIntDelay:Transmit Absolute Interrupt Delay (array of int) parm: RxIntDelay:Receive Interrupt Delay (array of int) parm: RxAbsIntDelay:Receive Absolute Interrupt Delay (array of int) parm: InterruptThrottleRate:Interrupt Throttling Rate (array of int) parm: SmartPowerDownEnable:Enable PHY smart power down (array of int) parm: copybreak:Maximum size of packet that is copied to a new buffer on receive (uint) parm: debug:Debug level (0=none,...,16=all) (int) parm: entropy:Allow e1000 to populate the /dev/random entropy pool (int) modinfo of e1000e filename: /lib/modules/3.0.13-0.27-default/initrd/e1000e.ko version: 1.10.6-NAPI license: GPL description: Intel(R) PRO/1000 Network Driver author: Intel Corporation, <<EMAIL_ADDRESS>> srcversion: D1F1E8DCB1431A5ED03735A alias: pci:v00008086d00001503sv*sd*bc*sc*i* alias: pci:v00008086d00001502sv*sd*bc*sc*i* alias: pci:v00008086d000010F0sv*sd*bc*sc*i* alias: pci:v00008086d000010EFsv*sd*bc*sc*i* alias: pci:v00008086d000010EBsv*sd*bc*sc*i* alias: pci:v00008086d000010EAsv*sd*bc*sc*i* alias: pci:v00008086d00001525sv*sd*bc*sc*i* alias: pci:v00008086d000010DFsv*sd*bc*sc*i* alias: pci:v00008086d000010DEsv*sd*bc*sc*i* alias: pci:v00008086d000010CEsv*sd*bc*sc*i* alias: pci:v00008086d000010CDsv*sd*bc*sc*i* alias: pci:v00008086d000010CCsv*sd*bc*sc*i* alias: pci:v00008086d000010CBsv*sd*bc*sc*i* alias: pci:v00008086d000010F5sv*sd*bc*sc*i* alias: pci:v00008086d000010BFsv*sd*bc*sc*i* alias: pci:v00008086d000010E5sv*sd*bc*sc*i* alias: pci:v00008086d0000294Csv*sd*bc*sc*i* alias: pci:v00008086d000010BDsv*sd*bc*sc*i* alias: pci:v00008086d000010C3sv*sd*bc*sc*i* alias: pci:v00008086d000010C2sv*sd*bc*sc*i* alias: pci:v00008086d000010C0sv*sd*bc*sc*i* alias: pci:v00008086d00001501sv*sd*bc*sc*i* alias: pci:v00008086d00001049sv*sd*bc*sc*i* alias: pci:v00008086d0000104Dsv*sd*bc*sc*i* alias: pci:v00008086d0000104Bsv*sd*bc*sc*i* alias: pci:v00008086d0000104Asv*sd*bc*sc*i* alias: pci:v00008086d000010C4sv*sd*bc*sc*i* alias: pci:v00008086d000010C5sv*sd*bc*sc*i* alias: pci:v00008086d0000104Csv*sd*bc*sc*i* alias: pci:v00008086d000010BBsv*sd*bc*sc*i* alias: pci:v00008086d00001098sv*sd*bc*sc*i* alias: pci:v00008086d000010BAsv*sd*bc*sc*i* alias: pci:v00008086d00001096sv*sd*bc*sc*i* alias: pci:v00008086d0000150Csv*sd*bc*sc*i* alias: pci:v00008086d000010F6sv*sd*bc*sc*i* alias: pci:v00008086d000010D3sv*sd*bc*sc*i* alias: pci:v00008086d0000109Asv*sd*bc*sc*i* alias: pci:v00008086d0000108Csv*sd*bc*sc*i* alias: pci:v00008086d0000108Bsv*sd*bc*sc*i* alias: pci:v00008086d0000107Fsv*sd*bc*sc*i* alias: pci:v00008086d0000107Esv*sd*bc*sc*i* alias: pci:v00008086d0000107Dsv*sd*bc*sc*i* alias: pci:v00008086d000010B9sv*sd*bc*sc*i* alias: pci:v00008086d000010D5sv*sd*bc*sc*i* alias: pci:v00008086d000010DAsv*sd*bc*sc*i* alias: pci:v00008086d000010D9sv*sd*bc*sc*i* alias: pci:v00008086d00001060sv*sd*bc*sc*i* alias: pci:v00008086d000010A5sv*sd*bc*sc*i* alias: pci:v00008086d000010BCsv*sd*bc*sc*i* alias: pci:v00008086d000010A4sv*sd*bc*sc*i* alias: pci:v00008086d0000105Fsv*sd*bc*sc*i* alias: pci:v00008086d0000105Esv*sd*bc*sc*i* depends: supported: external vermagic: 3.0.13-0.27-default SMP mod_unload modversions 586TSC parm: copybreak:Maximum size of packet that is copied to a new buffer on receive (uint) parm: TxIntDelay:Transmit Interrupt Delay (array of int) parm: TxAbsIntDelay:Transmit Absolute Interrupt Delay (array of int) parm: RxIntDelay:Receive Interrupt Delay (array of int) parm: RxAbsIntDelay:Receive Absolute Interrupt Delay (array of int) parm: InterruptThrottleRate:Interrupt Throttling Rate (array of int) parm: IntMode:Interrupt Mode (array of int) parm: SmartPowerDownEnable:Enable PHY smart power down (array of int) parm: KumeranLockLoss:Enable Kumeran lock loss workaround (array of int) parm: CrcStripping:Enable CRC Stripping, disable if your BMC needs the CRC (array of int) parm: EEE:Enable/disable on parts that support the feature (array of int) parm: Node:[ROUTING] Node to allocate memory on, default -1 (array of int)
0c4e44f97e33a04156382d69723625c05bbdcda0f21042c5990e334301b3eda1
['34bffb30db1c43e29f0cc79ab6f1e6d0']
I also came across this issue and soleved it using the getMultiCapabilities() function in your conf.js const _ = require('lodash'); let capabilities = { chrome: { browserName: 'chrome', platform: 'MAC', 'max-duration': '1800', }, chromeHeadless : { browserName: 'chrome', chromeOptions: { args: [ "--headless", "--disable-gpu", "--window-size=800,600" ] } } } getMultiCapabilities() { const browsers = this.params.browserToUse.split(',');//if you pass more than one browser e.g chrome,chromeHeadless const cap = _(capabilities).pick(browsers).values().value(); //this uses the lodash npm module return cap; },
67edd695368a01eecb184746ef3509038123d1a2d688e110d6ead4860a3afcbd
['34bffb30db1c43e29f0cc79ab6f1e6d0']
You would need to separate your spec files (so data row 1 gets an individual spec file and data row 2 gets an individual spec file etc) then and add the shardTestFiles:true and maxInstances: 3 capability which will run test files in parallel. As far as I am aware running different tests in the same spec file in parallel is not possible unless I am mistaken.
1ff216c44d6c9103c22ae11eda34927d40fa85005cc7db41755963cd3b6f0b2f
['34c0529aaa2341ecb2d257451d6688a4']
In my program a user can log in to a website in webbrowser1. but when I try to log out the logout button is buried beneath a drop down menu. The button has no ID or I would .Invokemember. I have tried clicking and opening the drop down with that method then tried to look for innertext and invoke but failed. can some help? here is the html stuff: HTML for the logout button Most recent attempt was: Dim allelements As HtmlElementCollection = WebBrowser1.Document.All For Each webpageelement As HtmlElement In allelements If webpageelement.InnerText = "Logout" Then webpageelement.InvokeMember("click") End If Next
aac4e88ceacdb4fe326a39fb4d4570ddbba42809069adac6883d518566ca4428
['34c0529aaa2341ecb2d257451d6688a4']
Pardon my lack of knowledge, that is why I am here- I am trying to verify the first 2 bytes of a .bin file with button2. The .bin is loaded via OpenFileDialog1 into Text1.text when button1 is clicked. I want to make sure the first 2 bytes of the .bin are "ff 4f" which is what they are when I open the file in a hex editor. I have tried a couple of different ways of doing this and have had no luck. Below is the most recent attempt. Feel free to suggest a new way. And thank you for your guidance. Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim data = New Byte(9) {} Dim actualRead As Integer Using fs As New FileStream(Text1.Text, FileMode.Open) fs.Position = 0 actualRead = 2 Do actualRead += fs.Read(data, actualRead, 10 - actualRead) Loop While actualRead <> 10 AndAlso fs.Position < fs.Length TextBox2.Text = (actualRead) End Using End Sub
2ac6d140c95eddc31221b66b86e909f141774503c24ec3b3efbf38c9c1837cbb
['34c0a224ca1b492a8891e89b9ebc1dc7']
Okay, so I've started making a game using Qt so that I can learn both Qt and C++ at the same time :D However, I'm stuck with an issue at the moment. I'm trying to make a textbox using a QGraphicsRectItem as a container (parent), and a QGraphicsTextItem as the text itself (child). The problem I'm facing is the child's relative position to the parent. If I set a font on the QGraphicsTextItem, the positioning will be completely wrong, and it will flow outside of the container for that matter. TextBox.h: #ifndef TEXTBOX_H #define TEXTBOX_H #include <QGraphicsTextItem> #include <QGraphicsRectItem> #include <QTextCursor> #include <QObject> #include <qDebug> class TextBox: public QObject, public QGraphicsRectItem { Q_OBJECT public: TextBox(QString text, QGraphicsItem* parent=NULL); void mousePressEvent(QGraphicsSceneMouseEvent *event); QString getText(); QGraphicsTextItem* playerText; }; #endif // TEXTBOX_H TextBox.cpp #include "TextBox.h" TextBox<IP_ADDRESS>TextBox(QString text, QGraphicsItem* parent): QGraphicsRectItem(parent) { // Draw the textbox setRect(0,0,400,100); QBrush brush; brush.setStyle(Qt<IP_ADDRESS>SolidPattern); brush.setColor(QColor(157, 116, 86, 255)); setBrush(brush); // Draw the text playerText = new QGraphicsTextItem(text, this); int xPos = rect().width() / 2 - playerText->boundingRect().width() / 2; int yPos = rect().height() / 2 - playerText->boundingRect().height() / 2; playerText->setPos(xPos,yPos); } void TextBox<IP_ADDRESS>mousePressEvent(QGraphicsSceneMouseEvent *event) { this->playerText->setTextInteractionFlags(Qt<IP_ADDRESS>TextEditorInteraction); } Game.cpp (where the code for creating the object and such is located - only included the relevant part): // Create the playername textbox for(int i = 0; i < players; i++) { TextBox* textBox = new TextBox("Player 1"); textBox->playerText->setFont(QFont("Times", 20)); textBox->playerText->setFlags(QGraphicsItem<IP_ADDRESS>ItemIgnoresTransformations); scene->addItem(textBox); } Using the default font & size for the QGraphicsTextItem: Setting a font & size for the QGraphicsTextItem: The problem, as you may see, is that when I set a font and a size, the text is no longer in the center of the parent element. (Please do not unleash hell on me for bad code, I'm very new to both Qt and C++, and I'm doing this for learning purposes only).
bb9bd00a6b885e72d12b9c5e03f788386749cb7ac7cc968439e1f154a14f957e
['34c0a224ca1b492a8891e89b9ebc1dc7']
I've recently started to learn C++ and I'm trying to compile and run a very simple program. #include <iostream> using namespace std; int main() { cout << "Hello World!" << endl; cout << "Hello Again!"; return 0; } The program itself compiles as it should without any errors, however, when the program runs, it seems to stop after cout << "Hello World!" << endl;. I find this very strange, as my friend is sitting right beside me, doing the exact same thing and it works for him. The same thing happens when I try to use the sizeof();; it does not return any value, however, when my friend does this, it works. When I ran it in NetBeans, it first generated the error RUN FAILED (exit value 255, total time: 2s) And another time I ran it, it generated the same error, but with a different exit value. Although it is now back to 255. When running debugger in NetBeans it produces SIGILL (Illegal instruction) a few times before it stops working. I have installed the MinGW compiler at the default directory (C:\MinGW), and this is the compiler that NetBeans and any other program is using. I have also added the path to the System Environment Variables at the end of the "Path" variable: ;C:\MinGW\bin;C:\MinGW\msys\1.0\bin Trying to run and compile the same code in Atom results in Hello World!Press any key to continue . . . I have tried reinstalling the compiler, and restarted my computer. None of which seems to work. I've also tried \n, which works. My question is, is there anything wrong with my compiler or computer, or am I missing something obvious? And is it possible to fix this? (Sorry if this is a duplicate, I've searched for a few hours, not able to find anything useful)
525b6f89d1940eb7b36590fed53d0ed069de1472d894412d09bcbdb6d74cc714
['34cea832270d4bf9abcf0685ae4c2343']
For whatever reason, the height was being set to 0 somewhere. It worked outside of the HTML5 tabs and I checked the HTML5 tab css and it wasn't being set there so not sure where it was being set. I added this to the RSS feed css to fix it: .rssBody { overflow: hidden; position: relative; height: 748px; } .rssBody li.rssRow{ margin:0px; padding:0px; height:187px; }
107049c26eea27b753a750313b13885320194f73b0442d599576c78d401ce973
['34cea832270d4bf9abcf0685ae4c2343']
I'm trying to have multiple Kendo Edit commands on a single row. The total number of Edit buttons will be 6, along with 6 Kendo switches. Each command will have separate emailSubject, emailBody, and emailAddress, which are associated with each switch. I need each command to open a Kendo popup window and be able to update the associated emailSubject, emailBody, and emailAddress. This is what I have so far: JS file DailyLimits.Methods.KendoInit = function () { DailyLimits.Controls.RenderedGrid = DailyLimits.Controls.DailyLimitsGrid.kendoGrid({ dataSource: { data: emailAlerts, schema: { model: { id: "Id", fields: { Id: { type: "number", validation: { required: true } }, AccountNumber: { type: "string" }, CustomerName: { type: "string" }, Limit: { type: "number" }, CurrentUsage: { type: "number" }, EmailSubject: { type: "string" }, EmailBody: { type: "string" }, FromAddress: { type: "string" }, Alert1: { type: "boolean" }, Alert2: { type: "boolean" }, Alert3: { type: "boolean" }, Alert4: { type: "boolean" }, Alert5: { type: "boolean" }, Alert6: { type: "boolean" } } } }, }, filterable:true, height: "800px", groupable: true, sortable: true, scrollable: true, resizable: true, columnResizeHandleWidth: 5, columnMenu: true, toolbar: kendo.template($("#ToolbarTemplate").html()), columns: [ { field: "AccountNumber", title: "Account Number", filterable: true, hidden: false, width: 100 }, { field: "CustomerName", title: "Customer Name", filterable: true, hidden: false, width: 100 }, { field: "Limit", title: "Daily Credit Limit", format: "{0:c}", filterable: true, hidden: false, width: 100 }, { field: "CurrentUsage", title: "Current Usage", format: "{0:c}", filterable: true, hidden: false, width: 100 }, { field: "Alert1", title: "75%", filterable: true, hidden: false, width: 100, "template": "<input type= \"checkbox\" class=\"mobileSwitch\" id=\"alert1-switch\" # if(Alert1) {# checked=\"checked\" #} # />" }, { command: [{ name: "Edit1", title: "Alert 1 Email", width: "180px", click: function (e) { // prevent page scroll position change e.preventDefault(); // e.target is the DOM element representing the button var tr = $(e.target).closest("tr"); // get the current table row (tr) // get the data bound to the current table row var data = this.dataItem(tr); console.log("Details for: " + data.AccountNumber); } }], }, { field: "Alert2", title: "80%", filterable: true, hidden: false, width: 100, "template": "<input type= \"checkbox\" class=\"mobileSwitch\" id=\"alert2-switch\" # if(Alert2) {# checked=\"checked\" #} # />" }, { command: [{ name: "Edit2", title: "Alert 2 Email", width: "180px", click: function (e) { // prevent page scroll position change e.preventDefault(); // e.target is the DOM element representing the button var tr = $(e.target).closest("tr"); // get the current table row (tr) // get the data bound to the current table row var data = this.dataItem(tr); console.log("Details for: " + data.AccountNumber); } }], }, { field: "Alert3", title: "85%", filterable: true, hidden: false, width: 100, "template": "<input type= \"checkbox\" class=\"mobileSwitch\" id=\"alert3-switch\" # if(Alert3) {# checked=\"checked\" #} # />" }, { command: [{ name: "Edit3", title: "Alert 3 Email", width: "180px", click: function (e) { // prevent page scroll position change e.preventDefault(); // e.target is the DOM element representing the button var tr = $(e.target).closest("tr"); // get the current table row (tr) // get the data bound to the current table row var data = this.dataItem(tr); console.log("Details for: " + data.AccountNumber); } }], }, { field: "Alert4", title: "90%", filterable: true, hidden: false, width: 100, "template": "<input type= \"checkbox\" class=\"mobileSwitch\" id=\"alert4-switch\" # if(Alert4) {# checked=\"checked\" #} # />" }, { command: [{ name: "Edit4", title: "Alert 4 Email", width: "180px", click: function (e) { // prevent page scroll position change e.preventDefault(); // e.target is the DOM element representing the button var tr = $(e.target).closest("tr"); // get the current table row (tr) // get the data bound to the current table row var data = this.dataItem(tr); console.log("Details for: " + data.AccountNumber); } }], }, { field: "Alert5", title: "95%", filterable: true, hidden: false, width: 100, "template": "<input type= \"checkbox\" class=\"mobileSwitch\" id=\"alert5-switch\" # if(Alert5) {# checked=\"checked\" #} # />" }, { command: [{ name: "Edit5", title: "Alert 5 Email", width: "180px", click: function (e) { // prevent page scroll position change e.preventDefault(); // e.target is the DOM element representing the button var tr = $(e.target).closest("tr"); // get the current table row (tr) // get the data bound to the current table row var data = this.dataItem(tr); console.log("Details for: " + data.AccountNumber); } }], }, { field: "Alert6", title: "100%", filterable: true, hidden: false, width: 100, "template": "<input type= \"checkbox\" class=\"mobileSwitch\" id=\"alert6-switch\" # if(Alert6) {# checked=\"checked\" #} # />" }, { command: [{ name: "Edit6", title: "Alert 6 Email", width: "180px", click: function (e) { // prevent page scroll position change e.preventDefault(); // e.target is the DOM element representing the button var tr = $(e.target).closest("tr"); // get the current table row (tr) // get the data bound to the current table row var data = this.dataItem(tr); console.log("Details for: " + data.AccountNumber); } }], }, ], editable: "popup", }); Here's what I have in my DailyLimits.aspx file, where I need the popup to happen: <script id="alert1_popup" type="text/x-kendo-template"> <div class="SearchParam"> <label class="control-label" for="txtEmailSubject" style="width:200px">Email Subject</label> <input name="txtEmailSubject" id="txtEmailSubject" class="k-textbox" style="width:430px" data-bind="value:Alert1EmailSubject" /> </div> <div class="SearchParam"> <label class="control-label" for="txtEmailBody" style="width:200px">Email Body</label> <textarea name="txtEmailBody" id="txtEmailBody" style="width:350px" data-bind="value:Alert1EmailBody" data-role="kendo.ui.Editor" ></textarea> </div> <div class="SearchParam"> <label class="control-label" for="txtFromAddress" style="width:200px">From Address</label> <input name="txtFromAddress" id="txtFromAddress" class="k-textbox" style="width:430px" data-bind="value:Alert1FromAddress" /> </div> </script>
b4c6199401d42db434ec38005736c203ba0fa86a20c6954ec849bedd8e959c65
['34ee9305d165433bb7cc1d23fd9d55e5']
Are you thinking of the dto going into the action, or the one(s) coming out? The one going in will be used directly against a repository, a service or some other collaborator. I would mock those instead and place my expectations there. Your test code will also have full control on creating the ingoing dto. If you like to use the outgoing dto, I would just grab that one from the ViewResult and verify it is the expected one. How you do that is up to you: You could mock the repository or talk to your persistence storage of choice.
75473c36c454b02a14efd655ffbeb64c2d4a11f732a1007cb57fec87554d0f2a
['34ee9305d165433bb7cc1d23fd9d55e5']
I don't think the database schema ever changes so drastically that the versions of wordpress on box 2 + 3 would be prevented from reading from the DB after you've updated on box 1, however it depends what version you are upgrading from. Why not set a similar environment locally and test upgrading site 1, while still trying to visit site 2.
a355fb6b8b02f8a33c7c858a20140dd93698b49562dcae6bbaa5b3a8b8bb8e7b
['34fa758c32324688bd52bdc1d59978be']
Trying to override callback function in BluetoothGattCallback mGattCallback = new BluetoothGattCallback(){ //something callback function like: @Override public void onConnectionStateChange(BluetoothGatt gatt, int status, int newState) { //do something read/write } You need to figure out how BLE callback function work!!! Check this out. Because BLE write/read can only be done in one time. It's mean that if I read a data from characteristic. I can only do another write/read action after previous one done.
ef471033b1ba15c93836d6e3444da4089dad6757503ecb936efdd9d0fcad85a7
['34fa758c32324688bd52bdc1d59978be']
Here is my opinion: You need to figure out what kind of characteristic you are going to get data? Some of them need to set indication or notify first! Like: a. Get the descriptor of the characteristic BluetoothGattDescriptor descriptor = gattCharacteristic.getDescriptors().get(0); //Usually is Client_Characteristic_Configuration b. According to the characteristic, set the property() of descriptor true. if ((gattCharacteristic.PROPERTY_NOTIFY)> 0 ){ if (descriptor != null) { descriptor.setValue((BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE)); } } else if((gattCharacteristic.PROPERTY_INDICATE) >0 ){ if(descriptor != null){ descriptor.setValue(BluetoothGattDescriptor.ENABLE_INDICATION_VALUE); } } c. Send the value to the remote BLE device. gatt.writeDescriptor(descriptor); After that, you may get the data in callback function: onCharacteristicChanged At least above work for me! Hope can help someone~
14c554442dd002f3320b265a5bf7c330f29296d916167bf5a4da1ae9cade6377
['35001a7ac2244a16948c70f882c527f9']
When I ran: SP_Spaceused TEST. I got this output which is very strange for 20918 rows. Output: name rows reserved data index_size unused TEST 20918 6240816 KB 6235480 KB 2304 KB 3032 KB I Try to gess The reason. I copy These new records to another table. select * into TEST1 from TEST But The result was more strange : on new table the size of these record was name rows reserved data index_size unused TEST1 20918 5704 KB 5456 KB 8 KB 240 KB I tried rebuilding the Index on TEST table, but it was not helpful. Can someone please explain what could be the reason for this?
e08d6f764db4a123eded0e7535ee2195cbafb02620181ce489818832e6d80dc0
['35001a7ac2244a16948c70f882c527f9']
The problem is that your form is using a route that points to the show page, instead of pointing it to the POST /admin/countries endpoint. You have two options: change the url to admin_countries_path or simplifying the route by using only <%= form_tag [:admin, @country] do %>; the :admin refers to the endpoint, so Rails can correctly infer the whole route for your resource.
10b4b596a60ce35840c5ce8ff480bb8dfb6203f987ef7703a9d627aa1dcd2774
['351119b4d0d946a49c73cef4001367e0']
I have solved this problem by adding linking with additional libraries for FFMPEG: vpx, vorbis, lame. And it is very important to keep the order of linked libraries. ..... ... TARGET = client INC_DIR := inc include $(NACL_SDK_ROOT)/tools/common.mk DEPS = ppapi_simple nacl_io LIBS = ppapi_simple nacl_io ppapi pthread \ avformat vpx vorbisenc vorbis ogg theoraenc \ theoradec mp3lame m avcodec swresample avutil \ avdevice avfilter OTHERDIR = src CFLAGS = -Wall # -I$(INC_DIR) SOURCES = $(OTHERDIR)/client.cc # Build rules generated by macros from common.mk: $(foreach dep,$(DEPS),$(eval $(call DEPEND_RULE,$(dep)))) $(foreach src,$(SOURCES),$(eval $(call COMPILE_RULE,$(src),$(CFLAGS)))) .... ...
8ec2de58cd63e7150b788a52fbb6c5608fbea8b8113772ba7aa00cbab9c3b4fa
['351119b4d0d946a49c73cef4001367e0']
T writing code using ExtJS4.0.1, MVC architecture. And when I develop main form I meet problem with search extension for web site. When I was trying to create new widget in controller, I need render result in subpanel. and so when I write sample code I meet following problem: **Uncaught TypeError: Object [object Object] has no method 'setSortState'** I cannot understand why it gives that error message. I need some help to resolve that problem. Below I want to show my code: //Panel which is showing to user Ext.define('Semantics.view.main.menuView', { extend: 'Ext.panel.Panel', layout: 'fit', alias: 'widget.Menu', title: "", tbar: [ { //search field name:'mainSearchText', id:'mainSearchText', xtype: 'textfield', defaultValue: 'Search', height: 20 }, { name:'mainSearchButton', id:'mainSearchButton', xtype: 'button', text: 'Find', height: 20 } ] }); //controller for search request Ext.define('Semantics.controller.main.mainController', { extend: 'Ext.app.Controller', views: ['main.menuView','mainSearch.MainSearchResultForm'], refs: [ { ref: 'menuPanel', selector: 'Menu' }, { ref:'mainSearchText',selector:'#mainSearchText'}, {ref: 'mainSearchForm',selector:'#mainSearchForm'}, {ref:'MainSearchGrid',selector:'#MainSearchGrid'} ], init: function () { this.control({ 'Menu': { render: this.onPanelRendered }, 'Menu button[name="mainSearchButton"]': { click: this.onButtonClick } }); }, onButtonClick: function (button) { var me = this; if(button.name=="mainSearchButton") { var mtextFiled = me.getMainSearchText().getValue(); console.log(mtextFiled); Ext.Ajax.request({ scope: this, url: 'app/mainSearchT/findText/', method: 'POST', params: { text: me.getMainSearchText().getValue() }, success: function (result) { mainPanel = me.getMenuPanel(); mainPanel.removeAll(true); loadingMask = new Ext.LoadMask(mainPanel, { msg: "Loading" }); loadingMask.show(); var mname = 'MainSearchResultForm'; var start_info_panel = Ext.widget(mname); mainPanel.items.add(start_info_panel); loadingMask.hide(); mainPanel.doLayout(); //that line gives that error }, failure: function (result) { console.log(result); } }); } }, onPanelRendered: function () { } });
158a59b2a73f0c3b178a17027a70f66e00b0bd1f2336ee6efe03a67b10b3e180
['35177041f60a43a99fb92309ae3ecd81']
I had this problem: How to do unit test with a "socket.io-client" if you don't know how long the server take to respond?. I've solved so using mocha and chai: var os = require('os'); var should = require("chai").should(); var socketio_client = require('socket.io-client'); var end_point = 'http://' + os.hostname() + ':8081'; var opts = {forceNew: true}; describe("async test with socket.io", function () { this.timeout(10000); it('Response should be an object', function (done) { setTimeout(function () { var socket_client = socketio_client(end_point, opts); socket_client.emit('event', 'ABCDEF'); socket_client.on('event response', function (data) { data.should.be.an('object'); socket_client.disconnect(); done(); }); socket_client.on('event response error', function (data) { console.error(data); socket_client.disconnect(); done(); }); }, 4000); }); });
53c7c75c7288a77239aec8ab275dd4fb85d69db1f1c01b2a66ad461d64d70ba1
['35177041f60a43a99fb92309ae3ecd81']
I have a WAR application with two servlets deployed into a Tomcat7 server. One of these servlets is to all catch RESTfull web service. When I try to upload a file (with multipart mode); the server throws the follwing exception: org.springframework.web.multipart.MultipartException: Could not parse multipart servlet request; nested exception is java.lang.IllegalStateException: org.apache.tomcat.util.http.fileupload.FileUploadBase$SizeLimitExceededException: the request was rejected because its size (2539037) exceeds the configured maximum (2097152) at org.springframework.web.multipart.support.StandardMultipartHttpServletRequest.parseRequest(StandardMultipartHttpServletRequest.java:99) at org.springframework.web.multipart.support.StandardMultipartHttpServletRequest.<init>(StandardMultipartHttpServletRequest.java:77) at org.springframework.web.multipart.support.StandardServletMultipartResolver.resolveMultipart(StandardServletMultipartResolver.java:76) at org.springframework.web.multipart.support.MultipartFilter.doFilterInternal(MultipartFilter.java:110)
6565bf179f90af4f6c0aace6012ebb363b5f8feb85c8ec8c4655dbed71aa2b5d
['351773ba31e445079d2c63a8d722de00']
to test if a string is empty: String someString; //... if(someString != null && !someString.isEmpty()) { //do what you want with the valid string } in your code it will look like this: .setPositiveButton("Add", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { String task = String.valueOf(taskEditText.getText()); if(task != null && !task.isEmpty()) { SQLiteDatabase db = mHelper.getWritableDatabase(); ContentValues values = new ContentValues(); values.put(TaskContract.TaskEntry.COL_TASK_TITLE, task); db.insertWithOnConflict(TaskContract.TaskEntry.TABLE, null, values, SQLiteDatabase.CONFLICT_REPLACE); updateUI(); db.close(); } else { //should notify user that cannot enter empty task } } }) .setNegativeButton("Cancel", null) Also you should not do long operations like opening, manipulating and closing your DB on the UI thread. long operations should be diverted from the UI thread to a background thread.
e344083f7f4d241ca664fc7ac5aa42ce374d9fe80efdb0b0b696218b77fd55bc
['351773ba31e445079d2c63a8d722de00']
your while loop is actually an endless loop on the main thread. that is why the alert dialog is never shown. How can I use this alertDialog in the while? you shouldn't stall the main thread. replace the while statement to an if statement and continue your code execution after dialog finishes its work: public void getValues() { alertDialog = new AlertDialog.Builder(MainActivity.this); LayoutInflater inflater = this.getLayoutInflater(); alertDialog.setView(inflater.inflate(R.layout.custom_layout, null)); alertDialog.setCancelable(false); alertDialog.setPositiveButton("Ok", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { field1 = (EditText)((Dialog) dialog).findViewById(R.id.field1); field2 = (EditText)((Dialog) dialog).findViewById(R.id.field2); errorMsg = (TextView)((Dialog) dialog).findViewById(R.id.login_error); insert(); continueWhereLeftOff(); } }); /* When negative (No/cancel) button is clicked*/ alertDialog.setNegativeButton("Back", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { dialog.cancel(); // Your custom code continueWhereLeftOff(); } }); alertDialog.show(); } MyClass object = createObject(); if(!checkDB(object)){ getValues();//Alert Dialog } else{ continueWhereLeftOff(); } //remove all code below this line to the continueWhereLeftOff()
c36f3ffe046a0864fd5e240ba67b525f746103b53e324ea7b3d369ab02ca216c
['3523c0be6908485d9653dc6da8cca6c6']
@Keshav solution will update everytime you finish editing the text area If you want to update it directly when you press the key, you can use jQuery and with this code: <!DOCTYPE html> <html> <head> <meta charset='utf-8' /> <title>Test</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> </head> <body> <textarea class="textarea-1" rows="4" cols="50"> test </textarea> <textarea class="textarea-2" rows="4" cols="50"> test </textarea> </body> <script type="text/javascript"> var textarea1 = $('.textarea-1'); var textarea2 = $('.textarea-2'); textarea1.keyup(function() { textarea2.val(textarea1.val()); }); textarea2.keyup(function() { textarea1.val(textarea2.val()); }); </script> </html>
b7059dc5c8b6bdcb1653f99724e40b3fe85b8c3ee4f00a119187b0d7e8d6614e
['3523c0be6908485d9653dc6da8cca6c6']
Sorry guys, looks like the error comes from the state of roleCategory student. Let me explain what is my mistake (if you are already familiar with redux, you might think it is a stupid mistake): I used combineReducers functions from redux module. combineReducers will separate the state according to every reducers (correct me if I am wrong). So if you have 2 reducers, let's say A and B. your state tree will be an object consist of : { A : <state-A>, B : <state-B> } and this state cannot interfere each other (from what I observer). That is why I got errors because I put my B state to be like { B : { B: <state-of-my-B> } } above code happen at my roleCategory reducer when I return the new state.
a59f2164b2cbfe60d4edee7c1f33acd50d303f1ef0d0f5ed85047b7e291eb11c
['352d2dccd27a4760b77b852196952e1a']
If you use a jQuery selector for the mega panel width option in the mega panel theme page, the mega panel will expand to the width of that element. So on a site where I was using the Headway theme, I used #whitewrap in that field. That caused my mega panel to expand the full width of #whitewrap, which is the full width of the page in this case.
094b9f2dc4b348b088239eb9483fb0481f269fdc2ab9c7b128511870cb9ee67f
['352d2dccd27a4760b77b852196952e1a']
I've been ask to troubleshoot a problem on a very, very old html website which I did not build. There are two html forms which each call their own php scripts to process them. They have been getting empty form submissions. I put code in place to make three of the fields mandatory as well as added a captcha form. When you go through the normal process, these measures work to stop empty form submissions. However, they are still getting empty form submissions. I discovered that if you enter the script url directly in a browser, for example form-process.php, it does submit the empty form without the mandatory fields nor the captcha. Any suggestions on keeping this script from running on it's own? Thank you in advance. PS, I am a php novice, so the php for dummies version would be appreciated.
65cf2c3e02c4d103ff08f8b86ce1c17a281a9f11de5572b5675e238caef28f78
['352e30fd102a4c189a826624afcf208e']
I m working on c# .net web application.I m using Facebook API for retrieving data from Facebook account. Now i want to delete wall post or inbox messages through API. i saw that it can be done by graph api,through deleting object. i try this string token1 = api.Auth.CreateToken(); string sURL = "https://graph.facebook.com/Post_id?token=" + token + "&method=delete"; WebRequest request = WebRequest.Create(sURL); request.Method = "POST"; HttpWebResponse response = (HttpWebResponse)request.GetResponse(); but it gives an error in fourth line "The remote server returned an error: (400) Bad Request." , Please reply how to solve this thank u.
76d272725b04a6476075b266a86cd32e61b5b2d1dccc6573ced9f910ef37dcab
['352e30fd102a4c189a826624afcf208e']
Стоит следующая задача, менять цвет сайта в зависимости от категории. Без возможности менять цвет в админке. Есть идея генерить для категории класс типо, category1-class. И заранее в css чтоб мы имели такое: category1-class { .bg-primary{ background: black; } .bg-secondary{ background: white; } } category2-class { .bg-primary{ background: green; } .bg-secondary{ background: gray; } } и т.д. Второй вариант хранить primary, secondary цвет в базе в отдельных столбцах для каждой категории. И при выводе страницы на беке вставлять вот так (соответственно вместо цвета будет подставляться значение из базы). Какой вариант по-вашему лучше? Спасибо.
857927079d8caa9d66aaef558a4d5a864540b0028a1a8c065945a82993e18861
['35301f75522744a88603721ff67c3933']
Created a drawing thread for the surface view that listens to the camera preview callback with OnPreviewFrame. Inside the thread's drawing loop: c.drawColor(0, PorterDuff.Mode.CLEAR); c.drawColor(0x1000000); // magical color that removes everything (like transparency) if (currentFrame == null) return; c.clipPath(circleSurfaceView.path); c.drawBitmap(currentFrame, 0, 0, paint); I have no idea what the magical color is. I came across it by luck. Everything else I tried would just draw black or fuzzy noise.
d904edd2fbd406f7b0867014d726bf77c152c27df123ea3c13d4b911fcf67345
['35301f75522744a88603721ff67c3933']
I have a Unity project and am building for iPhone. When the app starts, it is open for about 1 second before it crashes and GetCloudProjectId() is highlighted in the Xcode debug window. The project uses Unity Services In-App Purchasing so it needs a cloud project id. I can see in the Services settings that is set correctly. I have tried: Unlinking and linking the project again - using this guide Copied the project settings into an empty unity project - also crashed at GetCloudProjectId() Is there some configuration I forgot to do?
a0a729dfb673fa2e687666d42e21b8924b6dde26f329f4aed518832f338e712b
['353a9596d80447dcaa5d4b058742733e']
I think the offline aspect of the codes is the most important part of this answer. Just because your computer has internet access doesn't mean your phone does; for example, you could be traveling abroad and not have cell service, and be accessing your account at a public computer terminal with wired internet access and no available WiFi.
9c27b0b95df7d177dd27c081ab96db09d27511aa76d47001b30c1ac61bb4439c
['353a9596d80447dcaa5d4b058742733e']
For reference, our users are aware the camera may be recording (it's stated in our signed agreements with them, and also in a short-form FAQ we have too, just to ensure they're aware), but the light would be incredibly annoying and distracting to them so we shut it off.
185f48e87b4f310ccc9057bee1c1cf3e47fe6652a1fd404fe5da35fc157f2d41
['3547a7712070472b97092d336cd37129']
I'm trying to search off the contents of a sub-document referenced by ObjectId, like so: Model.Idea.findOne('_key.code':code).populate('_key').exec (err,idea) -> return done err if err should.exist idea The schema looks like this: Key = new mongoose.Schema( type: type: String enum: types index: true code: type: String index: unique: true ) Model.Key = ... Idea = new mongoose.Schema( text: String name: String _key: type: mongoose.Schema.Types.ObjectId ref: 'Key' ) Model.Idea = ... The reason that I'm doing it like this is that I want to pre-allocate a bunch of keys across a variety of key types and then allocated them out as needed. For some reason I thought this was possible but the query doesn't seem to be returning any results. Is there a way to do it without looking up the key first and then referencing the Id? I think I may have got the impression you can do this from embedded subdocuments though...
5c1792462555dd4cec32e48ba8dc19cb23ca4ce1a3b5a668cb29216716743a21
['3547a7712070472b97092d336cd37129']
It looks like this is a result of a bug with Caja and will be fixed when an updated version is merged into Apps Script. The ES6 Error object inheritance implementation in Chrome 44 (as <PERSON> found) is causing SES initialization to fail: Caja Issue 1966 This is being tracked as Apps Script Issue 5084 so if you're affected by this, please star the issue to let them know that it's affecting people. In the meantime you need to be on Chrome 43, where we will be for now.
a65c6b9d54ef36bb328886abd1ca1552ee4e3f644e64d48caafe05c390abed79
['35572c63cfdf4e18a0b1b56ec233d555']
If you have created model by following proper naming convention then you can try the code below. public function delete($id = null) { $this->User->id = $id; if (!$this->User->exists()) { throw new NotFoundException(__('Invalid user')); } if ($this->User->saveField('status', 0);) { $this->Flash->success(__('User deleted')); return $this->redirect(array('action' => 'index')); } $this->Flash->error(__('User was not deleted')); return $this->redirect(array('action' => 'index')); }
35801547dec317d5f103048a370a11667299ff42bef91d46c6377d7364b97a13
['35572c63cfdf4e18a0b1b56ec233d555']
I have a table named 'companies'. I want to join this table with 'plans'. I have written following model relation. Company: public $hasAndBelongsToMany = array( 'Plan' => array( 'className' => 'Plan', 'joinTable' => 'companies_plans', 'foreignKey' => 'company_id', 'associationForeignKey' => 'plan_id', 'unique' => 'keepExisting', 'conditions' => '', 'fields' => '', 'order' => '', 'limit' => '', 'offset' => '', 'finderQuery' => '', ) ); Plan: public $hasAndBelongsToMany = array( 'Company' => array( 'className' => 'Company', 'joinTable' => 'companies_plans', 'foreignKey' => 'plan_id', 'associationForeignKey' => 'company_id', 'unique' => 'keepExisting', 'conditions' => '', 'fields' => '', 'order' => '', 'limit' => '', 'offset' => '', 'finderQuery' => '', ) ); CompaniesPlan: public $belongsTo = array( 'Company' => array( 'className' => 'Company', 'foreignKey' => 'company_id', 'conditions' => '', 'fields' => '', 'order' => '' ), 'Plan' => array( 'className' => 'Plan', 'foreignKey' => 'plan_id', 'conditions' => '', 'fields' => '', 'order' => '' ) ); Now I want to find from the Company model with join... for that I have written the following code... $companiesWithPlan = $this->find('all', array('joins' => array( array( 'table' => 'companies_plans', 'alias' => 'CompaniesPlan', 'type' => 'inner', 'foreignKey' => false, 'conditions'=> array('CompaniesPlan.company_id = Company.id') ), array( 'table' => 'plans', 'alias' => 'Plan', 'type' => 'inner', 'foreignKey' => false, 'conditions'=> array( 'Plan.id = CompaniesPlan.Plan_id', ) ) ))); Then I get only company table data.. I am not sure why it's not working....
d721dbc7eba5fcb247190043d6c32e5d6a3467de1c83e09fe6483f8efbf2116d
['355f6d84c4344609bcb3b43a4c88f6dc']
I installed lightdm to take a look,but I didnt like it...so just removed.But now I have a lot of new stuff(apps) on my gnome dash that I dont want,like "clipter","users and groups","xarchiver",etc,etc...how can I remove all of that,please?? I'm in pop_os(ubuntu based)
745ce8f862494ed7547e3cca5cadee0438e789fae0d8d665fdedb867c1d44877
['355f6d84c4344609bcb3b43a4c88f6dc']
Так попробуйте (особо не проверял, только как путь решения): l = [('Главное меню',), ('О нас',), ('Фотографии',), ('Информация',)] d = {'one_time': False, 'buttons': [[ {'action': {'type': 'text', 'payload': '{"button": "1"}', 'label': label[0]}, 'color': 'primary'} for label in l]]} print(d) {'one_time': False, 'buttons': [[{'action': {'type': 'text', 'payload': '{"button": "1"}', 'label': 'Главное меню'}, 'color': 'primary'}, {'action': {'type': 'text', 'payload': '{"button": "1"}', 'label': 'О нас'}, 'color': 'primary'}, {'action': {'type': 'text', 'payload': '{"button": "1"}', 'label': 'Фотографии'}, 'color': 'primary'}, {'action': {'type': 'text', 'payload': '{"button": "1"}', 'label': 'Информация'}, 'color': 'primary'}]]}
91cf375f80810dffc7356480fb8ad18c4a869311868f893a6d7c9701fe93a766
['35690171d1e14732b05d05ccbb60c353']
I'm currently trying to capitalize the very first letter from an input. Here's what I tryed : fieldset input { text-transform:capitalize; } But it doesn't work the way I want, as every word is capitalized. I also tryed this : fieldset input:first-letter { text-transform:uppercase; } But it seems <input /> doesn't work at all with first-letter... Anyway, do you have any idea of how to achieve this without javascript (or as little as possible) ?
82a6f213f9ffda5990f8650d75b8fb6fa490b25326bd6a79563056cd3d314aad
['35690171d1e14732b05d05ccbb60c353']
Here my situation : The user click on a LinkButton, and the page does a PostBack. But I also need to prompt a file download to the user at the same time. In order to do that, I did this on the LinkButton lnkPrint.Attributes.Add("onclick", "window.open('Download.ashx?type=x')"); The Download.ashx Http Handler generates the file (Content-Type : application/pdf), and if I click on my LinkButton, it does PostBack and download the file after showing a popup... But I can't manage to close this popup automatically. I tried some methods settimeout('self.close()',1000) after the download Setting a RegisterStartupScript on the LinkButton.Command, to trigger the download after the postback, but IE6 prompts a warning that disturbs my users So, none of these methods seems to work fine. So, my question is : Is there a way to make the popup instantly disappear, or is there a means to make the page download the file AND postback at the same time ? PS : I thought of the Your download will begin shortly method, but I'm afraid I'll have the same issues as before with the RegisterStartupScript...
8ac31772781b4bfe0e69d60eae7130878c69dbebe45e9a4a0d556b52e936dded
['356b267cbd8b4a589dda8b05b2f1259a']
Working with a laravel 5 app and have a problem with phpspec. Why does my Phpspec unit test below fail or more precisely how can I get the stdClass Object keys to match so that it wouldn't fail? My spec file: function it_checks_add_starting_date_to_flow() { $dealflows = new \stdClass (); this->add_starting_date_to_flow($dealflows)->shouldReturn((object)[]); } And my helper function that I am testing: public static function add_starting_date_to_flow($dealflows) { $dealflows= new \stdClass(); return $dealflows; } From phpspec I get the following response: App/libraries/Mmdealhelpers 65 - it checks add starting date to flow expected [obj:stdClass], but got [obj:stdClass]. @@ -1,1 +1,1 @@ -stdClass Object &000000001d025295000000007dd68060 () +stdClass Object &000000001d02529a000000007dd68060 () 80 // ] 81 // )); 82 $this->add_starting_date_to_flow($dealflows)->shouldReturn((object)[]); 83 84 } 85 0 vendor/phpspec/phpspec/src/PhpSpec/Matcher/IdentityMatcher.php:78 throw new PhpSpec\Exception\Example\NotEqualException("Expected [obj:stdC...") 1 [internal] spec\App\libraries\MmdealhelpersSpec->it_checks_add_starting_date_to_flow()
b99401db7e1a7e2028da9598b6d2813174885a6f6cd4d8864e11dee41d6910ae
['356b267cbd8b4a589dda8b05b2f1259a']
I have a problem. Was trying to implement ajax post in laravel and now all my buttons with type submit post to the same route even if they didn't have any functionality before. Also, I had a cancel button that redirected to previous screen also with type submit that now also post to the same route as all other buttons... If I change the type the button just doesn't work. Removing the script doesn't impact. Anyone got any ideas on what's might be going on or how to fix this?
926ff86a922ccc721cfa88654b70c557640edce9eedea6c1b2d99bc32a8c7174
['357125cd3624444a939f79f05af0346f']
following the documentation for SQL String composition, I want to execute a DELETE statement in my postgresql database: db_cursor.execute(sql.SQL("DELETE FROM {}".format(sql.Identifier(table_name)))) This results in the error: File "try_pandas.py", line 189, in _store_in_table db_cursor.execute(sql.SQL("DELETE FROM {}".format(sql.Identifier(table_name)))) psycopg2.ProgrammingError: syntax error at or near "(" LINE 1: DELETE FROM Identifier('fixture_identification') Another, similar execute is working fine: db_cursor.copy_expert(sql.SQL("COPY {} FROM STDIN WITH CSV HEADER").format(sql.Identifier(table_name)), table_file) I really don't see the difference...
311eb39c8441d7c2265c116ee49ecbb4de1514c28fd528d1c3fe90e6925b695b
['357125cd3624444a939f79f05af0346f']
The function that I want to cache is something like: def a(x, time='last'): I have deterministic behaviour for every a(x,y), except when y=='last'. So when a(x, 'last') is called, I would like to call the "real thing" and an lru_cached function for everything else. I imagine this could be possible with my own decorator: def my_lru_cache(func): def function_wrapper(*args, **kwargs): if kwargs is not None: if 'time' in kwargs: return func(*args, **kwargs) else: return what?!? return function_wrapper Am I completely wrong? How could this be done?
39de8f2ddaf07106e56ccf3bcb698ed67979c3031205fb72d0587ca3e89db510
['357a00f9ebfe4011ada261d64db158a4']
i can't seem to use UIViewContentModeScaleAspectFit property to scale my imageView within my scrollview to fit the scrollview size. - (void)loadView { UIImage* image = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://www.moilum.com/images/atomicongallery/setmenu/setmenu1.jpg"]]]; imageView = [[UIImageView alloc]initWithImage:image]; imageView.contentMode = UIViewContentModeScaleAspectFit; CGRect applicationFrame = [[UIScreen mainScreen] applicationFrame]; UIScrollView* scrollView = [[UIScrollView alloc]initWithFrame:applicationFrame]; [scrollView addSubview:imageView]; scrollView.contentSize = image.size; scrollView.minimumZoomScale = 0.3; scrollView.maximumZoomScale = 3.0; scrollView.clipsToBounds = NO; scrollView.delegate = self; self.view = scrollView; } i have tried imageView.contentMode = UIViewContentModeScaleAspectFill as well. scrollView.contentmode = UIViewContentModeScaleAspectFill as well. All dont seem to work :( any way out!? Cheers!
0172ce40088b4181eb55bf494b6e90a662ba7e8d3112c58a5fb050f2b14bef3e
['357a00f9ebfe4011ada261d64db158a4']
Hi my delegate isn't passing an image and some strings to my second navigation controller. Can anyone see whats wrong? I've created ImageAndTextDelegate.h , PhotoEditViewController.h/.m and PreviewFrameViewController.h/.m . Basically after selecting some images and typing some text in photoedit. i wanna send the data through to previewframe using my delegate methods. //ImageAndTextDelegate.h @protocol ImageAndTextDelegate -(void)passImage:(UIImage*)image; -(void)passMainText:(NSString*)maintext withSubText:(NSString*)subtext; @end //PhotoEditViewController.h #import "ImageAndTextDelegate.h" @interface PhotoEditViewController : UIViewController<UINavigationControllerDelegate, UIImagePickerControllerDelegate>{ IBOutlet UITextField *mainText; IBOutlet UITextField *subText; IBOutlet UIImageView *imageView; IBOutlet UIButton *previewPictureButton; } @property (nonatomic,retain) UITextField *mainText; @property (nonatomic,retain) UITextField *subText; @property (nonatomic,retain) UIImageView *imageView; @property (nonatomic,retain) UIButton *previewPictureButton; @property (nonatomic,assign) IBOutlet id<ImageAndTextDelegate> delegate; -(IBAction)previewPicture:(id)sender; @end //PhotoEditViewController.m #import "PhotoEditViewController.h" #import "PreviewFrameViewController.h" @implementation PhotoEditViewController @synthesize delegate; -(IBAction)previewPicture:(id)sender{ PreviewFrameViewController* prvc = [[PreviewFrameViewController alloc]init]; [delegate passImage:imageView.image]; [delegate passMainText:mainText.text withSubText:subText.text]; [self.navigationController pushViewController:prvc animated:YES]; } - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view from its nib. } //PreviewFrameViewController.h #import <UIKit/UIKit.h> #import "ImageAndTextDelegate.h" @interface PreviewFrameViewController : UIViewController<ImageAndTextDelegate>{ IBOutlet UIImageView *myImage; IBOutlet UILabel *main; IBOutlet UILabel *sub; } @property (nonatomic,retain) UIImageView *myImage; @property (nonatomic,retain) UILabel *main; @property (nonatomic,retain) UILabel *sub; @end //PreviewFrameViewController.m #import "PreviewFrameViewController.h" #import "PhotoEditViewController.h" @implementation PreviewFrameViewController @synthesize myImage,main,sub; -(void)passImage:(UIImage *)image{ myImage.image = image; } -(void)passMainText:(NSString *)maintext withSubText:(NSString *)subtext{ main.text = maintext; sub.text = subtext; } -(IBAction)goBack:(id)sender{ [self dismissModalViewControllerAnimated:YES]; } - (void)viewDidLoad { [super viewDidLoad]; PhotoEditViewController* pvc = [[PhotoEditViewController alloc]init]; pvc.delegate = self; }
41f79018ed214a33a1c8be31c4575fcf82249c53b2628a8970aa415275ba7e04
['357a419d508c47c9889834d1c7c0b7f2']
I think it's OK to shrink the text size, of course you should see if it harms the visual consistency with the other buttons. If it's an option, you can shrink the text on the other buttons in this screen. My answer is based on the Translation app of google that can translate signs in real time. They adjust the translated text according to the sign it's written on.
d39c4039e0240cc4b1d0423aaa54f89cdd0a32e16c7b5aa4df1fc3621cb78749
['357a419d508c47c9889834d1c7c0b7f2']
I'm following this tutorial on how to import stuff from Source to Blender. https://www.youtube.com/watch?v=XX5mzUeZJDo But when I try to import a map (bsp) I get this error. I get this error when importing from SFM and TF2. I don't know what I can do. Everywhere else I go I get ignored so I'm trying my luck here.
abc0e53f550b2b7dd333049b43115528933f9530b5616c59d585b71997a7f139
['358abe14176444a18782bf01ec0e4bfa']
I had the same problem with OpenJDK 8. The font called "Monospaced" was correctly mapped to "DejaVu Sans Mono" for the "regular"/"plain" style, but something else (probably automatically bolded) for "bold", even if using "DejaVu Sans Mono" directly does the correct thing. The solution is to fix ~/.java/fonts/*/fcinfo*.properties. It did contain (among many others): monospaced.1.0.file=/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf monospaced.3.0.file=/usr/share/fonts/truetype/dejavu/DejaVuSansMono-Oblique.ttf Everything was fine after changing those to: monospaced.1.0.file=/usr/share/fonts/truetype/dejavu/DejaVuSansMono-Bold.ttf monospaced.3.0.file=/usr/share/fonts/truetype/dejavu/DejaVuSansMono-BoldOblique.ttf
f43141008d93b5d40f54b2b9931bbca5eadd7525a869e652ff58f5a866164d43
['358abe14176444a18782bf01ec0e4bfa']
Using Fluent NHibernate, I have succeeded in setting up a global Filter on my NHibernate session, and using it in ClassMap classes. The Filter WHERE clause is appended to queries using that map automagically as it should - as described in other posts on this forum. Fluent NHibernate does not implement ApplyFilter<> of SubclassMap, it is only implemented for ClassMap. It was easy to do a test by adding a filter through the back door, by passing a MappingProviderStore to the SubclassMap Constructor, and adding the filter to that. Inspecting the resulting classes in the debugger shows that everything is populated identically to a ClassMap. However, not surprisingly, this didn't work. Can someone tell me if Filters SHOULD work with SubclassMap in NHibernate itself? Is this therefore something that might eventually be supported (e.g. by implementing SubclassMap.ApplyFilter<>) in Fluent NHibernate? Using Fluent NHibernate 2.1, with NHibernate 3.1
2278580172ab43423db2c0ad0667d36e6e36e534a518f57c927158446fde3312
['3592a207fc63452a8b9452ac88fd353c']
First of all, I'm a relative newbie to coding. My goal is to scrape at least the last decade of Billboard Hot 100 charts using the Python code below with billboard.py. My hiccup is I have tried a few variants of while loop statements and none have seemed to work to get me to the previous chart. I have an idea of how it should look from the billboard.py documentation but for whatever reason my code terminates prematurely or outputs an AttributeError: 'ChartEntry' object has no attribute 'previousDate' Any advice on debugging this and/or corrective code is appreciated. Thank you. import billboard import csv chart = billboard.ChartData('hot-100') #chart = billboard.ChartData('hot-100', date=None, fetch=True, max_retries=5, timeout=25) f = open('Hot100.csv', 'w') headers = 'title, artist, peakPos, lastPos, weeks, rank, date\n' f.write(headers) while chart.previousDate: date = chart.date for chart in chart: title = chart.title artist = chart.artist peakPos = str(chart.peakPos) lastPos = str(chart.lastPos) weeks = str(chart.weeks) rank = str(chart.rank) f.write('\"' + title + '\",\"' + artist.replace('Featuring', 'Feat.') + '\",' + peakPos + ',' + lastPos + ',' + weeks + ',' + rank + ',' + date + '\n') chart = billboard.ChartData('hot-100', chart.previousDate) f.close()
80b02279184fdc23ba963732bdea3b583b92ad9812b379d1fa60ce47ca2b40e7
['3592a207fc63452a8b9452ac88fd353c']
I figured it out. I had to change how my script was comprehending the for loop. My revised code below import billboard import csv chart = billboard.ChartData('hot-100') #chart = billboard.ChartData('hot-100', date=None, fetch=True, max_retries=5, timeout=25) f = open('hot-100.csv', 'w') headers = 'title, artist, peakPos, lastPos, weeks, rank, date\n' f.write(headers) date = chart.date while chart.previousDate: date = chart.date for song in chart: title = song.title artist = song.artist peakPos = str(song.peakPos) lastPos = str(song.lastPos) weeks = str(song.weeks) rank = str(song.rank) f.write('\"' + title + '\",\"' + artist.replace('Featuring', 'Feat.') + '\",' + peakPos + ',' + lastPos + ',' + weeks + ',' + rank + ',' + date + '\n') chart = billboard.ChartData('hot-100', chart.previousDate) f.close()
a8af40f0ff2b6284d09b63d9d7768edc521160926f979f48f285ab03a1e7de42
['359f6620d7d341bfb5bf6a6e5aa95f69']
You can create two buttons, Something like this. <button onclick="showImage(-1)">&#10094;</button> <button conclick="showImage(+1)">&#10095;</button> and write the javascript function something like this to select the images function(showImage(n){ var y; var x = document.getElementsByClassName("mySlides"); if (n > x.length) {slideIndex = 1} if (n < 1) {slideIndex = x.length} ; for (y= 0; y < x.length; y++) { x[y].style.display = "none"; } x[slideIndex-1].style.display = "block"; } Hope it helps
818d613651454180208826ceeafebd04f6aeb123c04c3f925692fa404124c14a
['359f6620d7d341bfb5bf6a6e5aa95f69']
XML File: <item> <item_price>56</item_price> <gst>10</gst> </item> <item> <item_price>75</item_price> <gst>10</gst> </item> <item> <item_price>99</item_price> <gst>10</gst> </item> I need to sum of each (item_price*gst) using XSLT I have managed to get the output individual by using for each loop: <xsl:for-each select="/item"> <xsl:value-of select="item_price*gst"/> </xsl:for-each> My assumption would be somewhere along the lines of but it dosent seem to be working: Thanks for your help :)
e71ca2cfec5a1d3b066e9f84af8184545158f7f5d879cf52f44f51b4731ff8cc
['35a723fa8b074ebd82a43ac66cb6e267']
Is a function a "special kind of relation", or, does it "describe a specific relation"? My text on discrete mathematics explains: A relation is a subset of a Cartesian product and a function is a special kind of relation. But it would make more sense to me if a function described a relation as a subset of the Cartesian product. My thoughts being: Given a function, f(x) = y, we can compute a set of (x,y) coordinates within the Cartesian plain. And this set of coordinates would be the relation that is the subset of the Cartesian product. Am I confused? Could anyone help explain how a function IS a relation?
5fd1237cb75c9ee5cab00183e23e94a591fcd101f8e4e98a8cf9c67166f6051d
['35a723fa8b074ebd82a43ac66cb6e267']
It would be easier if you provided your config, however, it seems all you want is redirect a specific URL to another URL. You can achieve this with the "redirect" keyword. There are multiple ways you could achieve what you want, using different "redirect" keyword combination, so here's one solution: frontend http acl is_health url_reg ^/health redirect prefix http://www.example.com/appname code 301 if is_health and here's another: frontend http acl is_health url /health redirect location http://www.example.com/appname/health code 301 if is_health
d229cd105d0f2191241ed8a9774eccec30bc66d2d3115038f9968f349d9208a9
['35ae1dce50b741c1b080e94fe4e6e5e3']
My program is supposed to basically output the sum 1+2+3+4+5 and get 15 and then stop. However, it stops at 6 rather than 15. I know my while is a<6 and not 15. Im trying to accomplish it going through 1+2+3+4+5 and stopping at 6 that way. a=1 s=0 while a<6: s+=a a+=1 print (a)
eb4098dcd12cb1c1c99525cb6f938496e4ad9ebb11989cb490d17f8486e2fc9c
['35ae1dce50b741c1b080e94fe4e6e5e3']
My program is supposed to take an input and output powers of 2. For example input 8, and output 1,2,4,8,16,32,65,128. However, instead of doing the 8 integers and outputting each *2, it only goes up to when it hits the number 8 and stops. I do not want to use the ** operator. limit=input('Enter a value for limit') limit =int(limit) ctr=1 while ctr <= (limit): print(ctr, end=' ') ctr=ctr*2 print("limit=", limit)
af7ee9f6e757242b6a146d08c277da1ef02b46cc9212740ce7b40ffd127a2cf4
['35b47984400b46f8b01937e2afdcce2e']
I was following this guide to set up jabbed on cluster http://chadillac.github.io/2012/11/17/easy-ejabberd-clustering-guide-mnesia-mysql/ I am using two was instances having ip Master -> 111.222.333.444 Slave -> 222.333.444.555 But since I do not have DNS configured so I am using ip addresses like 111.222.333.444 etc instead of ‘master.domain.com’ . I haven’t been successful at seeing up the cluster yet but before that I am having a problem at my master node . I start the server with /tmp/ej1809/sbin/ejabberdctl start Then I get no output but I see in the logs that that the server started. then I check the status using /tmp/ej1809/sbin/ejabberdctl status But I get the error as Failed RPC connection to the node 'ejabberd@111.222.333.444’: nodedown And even when I try to stop the node using /tmp/ej1809/sbin/ejabberdctl stop then also I get Failed RPC connection to the node 'ejabberd@111.222.333.444’: nodedown But I cannot understand the reason behind it. Can anyone help me solve it please?
7b8db879fe49661ec4e02c264267ced28c079a3b1a98af32ec3958e1938cfe6d
['35b47984400b46f8b01937e2afdcce2e']
I was working on mapbox and on the basis of my current latlong, a random distance of 226mt and a random degree of 179 degrees, I calculated another latlong as follows. function findpos(){ var ptt = new mapboxgl.LngLat(latitude,longitude); var ptt2 = destinationPoint(179.85, 0.226, ptt); return ptt2; } Number.prototype.toRad = function() { return this * Math.PI / 180; } Number.prototype.toDeg = function() { return this * 180 / Math.PI; } function destinationPoint(brng, dist, pointA) { dist = dist / 6378.1; brng = brng.toRad(); var lat1 = pointA.lat.toRad(), lon1 = pointA.lng.toRad(); var lat2 = Math.asin(Math.sin(lat1) * Math.cos(dist) + Math.cos(lat1) * Math.sin(dist) * Math.cos(brng)); var lon2 = lon1 + Math.atan2(Math.sin(brng) * Math.sin(dist) * Math.cos(lat1), Math.cos(dist) - Math.sin(lat1) * Math.sin(lat2)); if (isNaN(lat2) || isNaN(lon2)) return null; console.log("des ",lon2,lat2); return new mapboxgl.LngLat(lat2.toDeg(), lon2.toDeg()); } It was okay till this point.But Now I wanted to find the angle or bearing between two latlongs and found this // Converts from degrees to radians. function toRadians(degrees) { return degrees * Math.PI / 180; }; // Converts from radians to degrees. function toDegrees(radians) { return radians * 180 / Math.PI; } function bearing(startLat, startLng, destLat, destLng){ startLat = toRadians(startLat); startLng = toRadians(startLng); destLat = toRadians(destLat); destLng = toRadians(destLng); y = Math.sin(destLng - startLng) * Math.cos(destLat); x = Math.cos(startLat) * Math.sin(destLat) - Math.sin(startLat) * Math.cos(destLat) * Math.cos(destLng - startLng); brng = Math.atan2(y, x); brng = toDegrees(brng); return (brng + 360) % 360; // return brng; } It calculates a degree and gives a result. But when i decided to double check this function by putting the already calculated latlongs by the function findpos() above, i should have got the answer as 179.85 degrees, but instead I get the angle as 270 degree. Which part of the code is correct? I have created a working example here, and have logged the values in the console. Can anyone help me out here please?