JSON parsing of finance.google.com result - json

I'm not getting how to parse finance.google.com results, i.e. I got
[
{
"id":"787381",
"t":"HDFC",
"e":"NSE",
"l":"1,424.00",
"l_fix":"1424.00",
"l_cur":"₹1,424.00",
"s":"0",
"ltt":"3:46PM GMT+5:30",
"lt":"Sep 23, 3:46PM GMT+5:30",
"lt_dts":"2016-09-23T15:46:54Z",
"c":"+10.75",
"c_fix":"10.75",
"cp":"0.76",
"cp_fix":"0.76",
"ccol":"chg",
"pcls_fix":"1413.25"
}
]
when I made call to this endpoint using httpopenConnection method, I didn't get anything returned because I couldn't find the JSON object name and i am going to use the result in my android app.

Assuming js is your tool of choice, and you since you don't say what you're trying to do with the array, just assign to a var named obj and you can access it - loop as required...
<!DOCTYPE HTML>
<html>
<body>
<h2>Manage a JSON Object in JavaScript</h2>
<p id="demo"></p>
<script>
var obj = [{"id":"787381","t":"HDFC","e":"NSE","l":"1,424.00","l_fix":"1424.00","l_cur":"₹1,424.00","s":"0","ltt":"3:46PM GMT+5:30","lt":"Sep 23, 3:46PM GMT+5:30","lt_dts":"2016-09-23T15:46:54Z","c":"+10.75","c_fix":"10.75","cp":"0.76","cp_fix":"0.76","ccol":"chg","pcls_fix":"1413.25"}];
document.getElementById("demo").innerHTML =
obj[0].id + "<br>" +
obj[0].t + "<br>" +
obj[0].e + "<br>" +
obj[0].l + "<br>" +
obj[0].l_fix + "<br>" +
obj[0].l_cur + "<br>" +
obj[0].s + "<br>" +
obj[0].ltt + "<br>" +
obj[0].lt + "<br>" +
obj[0].lt_dts + "<br>" +
obj[0].c + "<br>" +
obj[0].c_fix + "<br>" +
obj[0].cp + "<br>" +
obj[0].cp_fix + "<br>" +
obj[0].ccol + "<br>" +
obj[0].pcls_fix + "<br>";
</script>
</body>
</html>
Resulting output to browser is:
Accessing a JSON Object in JavaScript
787381
HDFC
NSE
1,424.00
1424.00
₹1,424.00
0
3:46PM GMT+5:30
Sep 23, 3:46PM GMT+5:30
2016-09-23T15:46:54Z
+10.75
10.75
0.76
0.76
chg
1413.25

Related

sending Strategy data using Webhooks for Pinescript 4.0

I am using Tradingview Pinescript 4.0.
This message was made with reference to :
https://stackoverflow.com/questions/66926863/combining-data-from-different-tradingview-4-0-indicators-for-the-purpose-of-crea
Basically, what I would like to do is use Tradingview 4.0 Pinescript Strategies with the Tradingview Webhook Alert system.
The closest I have seen that provides a hint a to how one can do this is found in this particular video (for a different product):
https://support.mudrex.com/hc/en-us/articles/360050211072-Automating-an-alert-from-a-Strategy-on-TradingView
It would use something like the "comment" below:
// strategy.entry(id=tostring(randomNumber), long=false,
comment="{"id" : " + tostring(randomNumber) + ", "action" :
"reverse_short_to_long"}")
I need to send JSON from the Strategy as part of the Web alert. According to the video, one would use something like:
{{ strategy.comment }}
Are there any solid examples as to how this could be done?
Tradingview sends the alert as JSON if the string is formatted as JSON. I suggest using the alert() function instead of alertcondition. It's then easy to construct a string in a JSON format however you want. Here's a nasty function I use to generate alerts.
customalert(_name, _symbol, _type, _asset_type, _action, _risk_value, _risk_percent, _sl, _tp1,_tp1_percent, _tp2, _tp2_percent, _message) =>
alert_array = array.new_string()
if _name != ''
array.push(alert_array, '"Name": "' + _name + '"')
if _symbol != ''
array.push(alert_array, '"Symbol": "' + _symbol + '"')
if _type != ''
array.push(alert_array, '"Type": "' + _type + '"')
if _asset_type != ''
array.push(alert_array, '"Asset Type": "' + _asset_type + '"')
if _action != ''
array.push(alert_array, '"Action": "' + _action + '"')
if _risk_value != 0
array.push(alert_array, '"Risk Value": "' + tostring(_risk_value) + '"')
if _risk_percent != 0
array.push(alert_array, '"Risk Percentage": "' + tostring(_risk_percent) + '"')
if _tp1 != 0
array.push(alert_array, '"Take Profit 1 Level": "' + tostring(_tp1) + '"')
if _tp1_percent != 0
array.push(alert_array, '"Take Profit 1 Percent": "' + tostring(_tp1_percent) + '"')
if _tp2 != 0
array.push(alert_array, '"Take Profit 2 Level": "' + tostring(_tp2) + '"')
if _tp2_percent != 0
array.push(alert_array, '"Take Profit 2 Percent": "' + tostring(_tp2_percent) + '"')
if _sl != 0
array.push(alert_array, '"Stop Loss Level": "' + tostring(_sl) + '"')
if _message != ''
array.push(alert_array, '"Message": "' + _message + '"')
alertstring = '{' + array.join(alert_array,', ') + '}'
alert(alertstring, alert.freq_once_per_bar_close)
You don't need to do anything complex though, the most important line is the alertstring = '{' + array.join(alert_array,', ') + '}'
You just need to make sure the string starts and ends with curly braces and is properly formatted JSON.
Could just as easily:
alert('{"Symbol": "' + syminfo.ticker + '", "Action": "Entry"}', alert.freq_once_per_bar_close)
You just need to be careful with your double and single quotes.
Also, this is explained if you go to set up an alert and click the option to learn more about alerts, at least the fact that formatting as JSON is what determines whether the alert is sent as text or JSON. As for the {{}}s, those are used to send a limited set of values for use with the alertcondition() function, and I don't really see an advantage to using them vs tostring() with alert().
Another thing to keep in mind is that this necessitates sending your data as strings, so you will need to make sure to convert back to ints and floats as necessary on the server side.

Display text as html in Razor page

I've just started using Blazor and Razor pages.. it's a lot better than my old plain html pages I was building. But I'm having a problem converting my strings of html I build into actual HTML. Now, this works if I copy and paste my string and save that as an html page. It displays as html no problem. However, when I try to get my Razor page to display it, it displays as plain text. Even trying the trick:
<div>
#(new HtmlString(htmlString))
</div>
displays plain text. This is going to be painful as it's kind of long, but here is the string I'm trying to convert:
"<pre><br><b>STATION INFO</b><br><br> Extension: 34263 Lock Messages? n BCC: 0 <br> Type: 9630 Security Code: 12345 TN: 1<br> Port: S17746 Coverage Path 1: 132 COR: 44<br> Name: Lastname, Firstname Coverage Path 2: COS: 1<br><br><b>STATION OPTIONS</b><br> Time of Day Lock Table: <br> Loss Group: 19 Personalized Ringing Pattern: 1<br> Message Lamp Ext: 34263<br> Speakerphone: 2-way Mute Button Enabled? y<br> Display Language: english Expansion Module? <br> Survivable GK Node Name: <br> Survivable COR: internal Media Complex Ext: <br> Survivable Trunk Dest? IP SoftPhone? y<br><br> IP Video Softphone? n<br><br> Customizable Labels? y<br><br><br> <b>FEATURE OPTIONS</b><br><br> LWC Reception: spe Auto Select Any Idle Appearance? n<br> LWC Activation? y Coverage Msg Retrieval? y<br> LWC Log External Calls? n Auto Answer: none<br> CDR Privacy? n Data Restriction? n<br> Redirect Notification? y Idle Appearance Preference? n<br> Per Button Ring Control? n Bridged Idle Line Preference? n<br> Bridged Call Alerting? n Restrict Last Appearance? y<br> Active Station Ringing: continuous<br> EMU Login Allowed? n<br> H.320 Conversion? n Per Station CPN - Send Calling Number? y<br> Service Link Mode: as-needed EC500 State: unknown<br> Multimedia Mode: enhanced Audible Message Waiting? n<br> MWI Served User Type: sip-adjunct Display Client Redirection? n</pre><br>"
it's being built by my method that returns a string. For fun, here is my method:
public static string CreateStationString(List<StarfishStation> html)
{
var myHTML1 =
"<pre>" + "<br>" +
"<b>STATION INFO</b>" + "<br>" +
"" + "<br>" +
" Extension: " + html[0].DeftyExtension.PadRight(29, ' ') + "Lock Messages? " + html[0].DeftyMessagelock.PadRight(9, ' ') + "BCC: 0 <br>" +
" Type: " + html[0].DeftyDisplaysettype.PadRight(29, ' ') + "Security Code: " + html[0].DeftySecuritycode.PadRight(10, ' ') + "TN: " + html[0].DeftyTenantpartitionnumber + "<br>" +
" Port: " + html[0].DeftyPort.PadRight(27, ' ') + "Coverage Path 1: " + html[0].DeftyCoveragepath.PadRight(9, ' ') + "COR: " + html[0].DeftyCor + "<br>" +
" Name: " + html[0].DeftyName.PadRight(27, ' ') + "Coverage Path 2: " + html[0].DeftyCoverage2path.PadRight(9, ' ') + "COS: " + html[0].DeftyCos + "<br><br>" +
"<b>STATION OPTIONS</b>" + "<br>" +
" Time of Day Lock Table: <br>" +
" Loss Group: " + html[0].DeftyLossgroup + " Personalized Ringing Pattern: " + html[0].DeftyPersonalizedringpattern + "<br>" +
" Message Lamp Ext: " + html[0].DeftyMessagewaitlamplextension + "<br>" +
" Speakerphone: " + html[0].DeftySpeakerphone + " Mute Button Enabled? " + html[0].DeftyMutebutton + "<br>" +
" Display Language: " + html[0].DeftyLanguage.PadRight(32, ' ') + "Expansion Module? " + html[0].DeftyExpansionmodule + "<br>" +
" Survivable GK Node Name: <br>" +
" Survivable COR: internal Media Complex Ext: <br>" +
" Survivable Trunk Dest? IP SoftPhone? " + html[0].DeftyIpsoftphone + "<br>" +
"" + "<br>" +
" IP Video Softphone? n<br>" +
"<br>" +
" Customizable Labels? y<br><br>" +
"<br>" +
" <b>FEATURE OPTIONS</b><br><br>" +
" LWC Reception: " + html[0].DeftyLwcreception.PadRight(20, ' ') + "Auto Select Any Idle Appearance? " + html[0].DeftyIdleappearancepreference + "<br>" +
" LWC Activation? " + html[0].DeftyLwcactivation.PadRight(29, ' ') + "Coverage Msg Retrieval? " + html[0].DeftyCoveragemessageretrieval + "<br>" +
" LWC Log External Calls? " + html[0].DeftyLwclogexterncall.PadRight(40, ' ') + "Auto Answer: " + html[0].DeftyAutoanswer + "<br>" +
" CDR Privacy? " + html[0].DeftyCdrprivacy.PadRight(35, ' ') + "Data Restriction? " + html[0].DeftyDatarestriction + "<br>" +
" Redirect Notification? " + html[0].DeftyRedirectnotification.PadRight(25, ' ') + "Idle Appearance Preference? " + html[0].DeftyIdleappearancepreference + "<br>" +
" Per Button Ring Control? " + html[0].DeftyPerbuttonnringcontrol.PadRight(23, ' ') + "Bridged Idle Line Preference? n" + "<br>" +
" Bridged Call Alerting? " + html[0].DeftyBridgecallalerting.PadRight(27, ' ') + "Restrict Last Appearance? " + html[0].DeftyRestrictlastappearance + "<br>" +
" Active Station Ringing: " + html[0].DeftyActivestationringing + "<br>" +
" EMU Login Allowed? " + html[0].DeftyEMULoginAllowed + "<br>" +
" H.320 Conversion? " + html[0].DeftyH320conv.PadRight(14, ' ') + "Per Station CPN - Send Calling Number? " + html[0].DeftyCpnrestriction + "<br>" +
" Service Link Mode: " + html[0].DeftyServicelinkmode.PadRight(31, ' ') + "EC500 State: unknown<br>" + //check ec500
" Multimedia Mode: " + html[0].DeftyMultimediamode.PadRight(28, ' ') + "Audible Message Waiting? " + html[0].DeftyAudiblemessagewaiting + "<br>" +
" MWI Served User Type: " + html[0].DeftyMessagewaitindicatortype.PadRight(25, ' ') + "Display Client Redirection? n</pre><br>";
return myHTML1;
}
When I look at the frame source, here's what I see:
<div>
<pre><br><b>STATION INFO</b><br><br> Extension: 34263 Lock Messages? n BCC: 0 <br> Type: 9630 Security Code: 12345 TN: 1<br> Port: S17746 Coverage Path 1: 132 COR: 44<br> Name: Lastname Firstname Coverage Path 2: COS: 1<br><br><b>STATION OPTIONS</b><br> Time of Day Lock Table: <br> Loss Group: 19 Personalized Ringing Pattern: 1<br> Message Lamp Ext: 34263<br> Speakerphone: 2-way Mute Button Enabled? y<br> Display Language: english Expansion Module? <br> Survivable GK Node Name: <br> Survivable COR: internal Media Complex Ext: <br> Survivable Trunk Dest? IP SoftPhone? y<br><br> IP Video Softphone? n<br><br> Customizable Labels? y<br><br><br> <b>FEATURE OPTIONS</b><br><br> LWC Reception: spe Auto Select Any Idle Appearance? n<br> LWC Activation? y Coverage Msg Retrieval? y<br> LWC Log External Calls? n Auto Answer: none<br> CDR Privacy? n Data Restriction? n<br> Redirect Notification? y Idle Appearance Preference? n<br> Per Button Ring Control? n Bridged Idle Line Preference? n<br> Bridged Call Alerting? n Restrict Last Appearance? y<br> Active Station Ringing: continuous<br> EMU Login Allowed? n<br> H.320 Conversion? n Per Station CPN - Send Calling Number? y<br> Service Link Mode: as-needed EC500 State: unknown<br> Multimedia Mode: enhanced Audible Message Waiting? n<br> MWI Served User Type: sip-adjunct Display Client Redirection? n</pre><br>
</div>
Sorry this is so long.. but can anyone please help me out?
Thanks!
Dave M.
Wow ok.. so stumbled upon the answer:
<div>
#((MarkupString)htmlString)
</div>
instead of:
<div>
#(new HtmlString(htmlString))
</div>
found the answer here: Convert plain text with html tags to html string and render it in Blazor

Promise.all to update the data in mysql by using GET request, but it doesn't update all of the data

I am currently trying to update some data using fetch in mysql, whenever i click a button, the Promise.all triggers, and fetches all the data from my function, then, i fetch all the data from the jsons that I get from my promise.all and i make a GET request to update all the data, but it doesnt seem to update all the data in my database, only a few.
const previousMonthcompanyInfos = this.state.addDataOnce == 'true' && this.state.airlinesPreviousMonth && this.state.airlinesPreviousMonth.filter(t=> t.airlineName != 'Generic').map((airline, idx) => {
Promise.all([
fetch(`http://ca-fpscfb2:4000/totalOpenBugsPreviousMonth?airline=${airline.airlineName}&product=${airline.product}&M=${differenceBetweenCurrentMonthAndPreviousMonth}`),
fetch(`http://ca-fpscfb2:4000/totalOpenEnhancementsPreviousMonth?airline=${airline.airlineName}&product=${airline.product}&M=${differenceBetweenCurrentMonthAndPreviousMonth}`),
fetch(`http://ca-fpscfb2:4000/totalOpenQuestionsPreviousMonth?airline=${airline.airlineName}&product=${airline.product}&M=${differenceBetweenCurrentMonthAndPreviousMonth}`),
fetch(`http://ca-fpscfb2:4000/P1OpenedPreviousMonth?airline=${airline.airlineName}&product=${airline.product}&M=${differenceBetweenCurrentMonthAndPreviousMonth}`),
fetch(`http://ca-fpscfb2:4000/P2OpenedPreviousMonth?airline=${airline.airlineName}&product=${airline.product}&M=${differenceBetweenCurrentMonthAndPreviousMonth}`),
fetch(`http://ca-fpscfb2:4000/ticketsThisCyclePreviousMonth?airline=${airline.airlineName}&product=${airline.product}&M=${differenceBetweenCurrentMonthAndPreviousMonth}`),
fetch(`http://ca-fpscfb2:4000/ticketsOneToThreeMonthsPreviousMonth?airline=${airline.airlineName}&product=${airline.product}&M=${differenceBetweenCurrentMonthAndPreviousMonth}`),
fetch(`http://ca-fpscfb2:4000/ticketsThreeToSixMonthsPreviousMonth?airline=${airline.airlineName}&product=${airline.product}&M=${differenceBetweenCurrentMonthAndPreviousMonth}`),
fetch(`http://ca-fpscfb2:4000/ticketsSixToTwelveMonthsPreviousMonth?airline=${airline.airlineName}&product=${airline.product}&M=${differenceBetweenCurrentMonthAndPreviousMonth}`),
fetch(`http://ca-fpscfb2:4000/ticketsMoreThanOneYearPreviousMonth?airline=${airline.airlineName}&product=${airline.product}&M=${differenceBetweenCurrentMonthAndPreviousMonth}`),
fetch(`http://ca-fpscfb2:4000/1stMonthOpenedEnhancementsPreviousMonth?airline=${airline.airlineName}&product=${airline.product}&M=${differenceBetweenCurrentMonthAndPreviousMonth}`),
fetch(`http://ca-fpscfb2:4000/2ndMonthOpenedEnhancementsPreviousMonth?airline=${airline.airlineName}&product=${airline.product}&M=${differenceBetweenCurrentMonthAndPreviousMonth}`),
fetch(`http://ca-fpscfb2:4000/3rdMonthOpenedEnhancementsPreviousMonth?airline=${airline.airlineName}&product=${airline.product}&M=${differenceBetweenCurrentMonthAndPreviousMonth}`),
fetch(`http://ca-fpscfb2:4000/4thMonthOpenedEnhancementsPreviousMonth?airline=${airline.airlineName}&product=${airline.product}&M=${differenceBetweenCurrentMonthAndPreviousMonth}`),
fetch(`http://ca-fpscfb2:4000/1stMonthOpenedBugsPreviousMonth?airline=${airline.airlineName}&product=${airline.product}&M=${differenceBetweenCurrentMonthAndPreviousMonth}`),
fetch(`http://ca-fpscfb2:4000/2ndMonthOpenedBugsPreviousMonth?airline=${airline.airlineName}&product=${airline.product}&M=${differenceBetweenCurrentMonthAndPreviousMonth}`),
fetch(`http://ca-fpscfb2:4000/3rdMonthOpenedBugsPreviousMonth?airline=${airline.airlineName}&product=${airline.product}&M=${differenceBetweenCurrentMonthAndPreviousMonth}`),
fetch(`http://ca-fpscfb2:4000/4thMonthOpenedBugsPreviousMonth?airline=${airline.airlineName}&product=${airline.product}&M=${differenceBetweenCurrentMonthAndPreviousMonth}`),
fetch(`http://ca-fpscfb2:4000/1stMonthOpenedQuestionsPreviousMonth?airline=${airline.airlineName}&product=${airline.product}&M=${differenceBetweenCurrentMonthAndPreviousMonth}`),
fetch(`http://ca-fpscfb2:4000/2ndMonthOpenedQuestionsPreviousMonth?airline=${airline.airlineName}&product=${airline.product}&M=${differenceBetweenCurrentMonthAndPreviousMonth}`),
fetch(`http://ca-fpscfb2:4000/3rdMonthOpenedQuestionsPreviousMonth?airline=${airline.airlineName}&product=${airline.product}&M=${differenceBetweenCurrentMonthAndPreviousMonth}`),
fetch(`http://ca-fpscfb2:4000/4thMonthOpenedQuestionsPreviousMonth?airline=${airline.airlineName}&product=${airline.product}&M=${differenceBetweenCurrentMonthAndPreviousMonth}`),
fetch(`http://ca-fpscfb2:4000/1stMonthClosedEnhancementsPreviousMonth?airline=${airline.airlineName}&product=${airline.product}&M=${differenceBetweenCurrentMonthAndPreviousMonth}`),
fetch(`http://ca-fpscfb2:4000/2ndMonthClosedEnhancementsPreviousMonth?airline=${airline.airlineName}&product=${airline.product}&M=${differenceBetweenCurrentMonthAndPreviousMonth}`),
fetch(`http://ca-fpscfb2:4000/3rdMonthClosedEnhancementsPreviousMonth?airline=${airline.airlineName}&product=${airline.product}&M=${differenceBetweenCurrentMonthAndPreviousMonth}`),
fetch(`http://ca-fpscfb2:4000/4thMonthClosedEnhancementsPreviousMonth?airline=${airline.airlineName}&product=${airline.product}&M=${differenceBetweenCurrentMonthAndPreviousMonth}`),
fetch(`http://ca-fpscfb2:4000/1stMonthClosedBugsPreviousMonth?airline=${airline.airlineName}&product=${airline.product}&M=${differenceBetweenCurrentMonthAndPreviousMonth}`),
fetch(`http://ca-fpscfb2:4000/2ndMonthClosedBugsPreviousMonth?airline=${airline.airlineName}&product=${airline.product}&M=${differenceBetweenCurrentMonthAndPreviousMonth}`),
fetch(`http://ca-fpscfb2:4000/3rdMonthClosedBugsPreviousMonth?airline=${airline.airlineName}&product=${airline.product}&M=${differenceBetweenCurrentMonthAndPreviousMonth}`),
fetch(`http://ca-fpscfb2:4000/4thMonthClosedBugsPreviousMonth?airline=${airline.airlineName}&product=${airline.product}&M=${differenceBetweenCurrentMonthAndPreviousMonth}`),
fetch(`http://ca-fpscfb2:4000/1stMonthClosedQuestionsPreviousMonth?airline=${airline.airlineName}&product=${airline.product}&M=${differenceBetweenCurrentMonthAndPreviousMonth}`),
fetch(`http://ca-fpscfb2:4000/2ndMonthClosedQuestionsPreviousMonth?airline=${airline.airlineName}&product=${airline.product}&M=${differenceBetweenCurrentMonthAndPreviousMonth}`),
fetch(`http://ca-fpscfb2:4000/3rdMonthClosedQuestionsPreviousMonth?airline=${airline.airlineName}&product=${airline.product}&M=${differenceBetweenCurrentMonthAndPreviousMonth}`),
fetch(`http://ca-fpscfb2:4000/4thMonthClosedQuestionsPreviousMonth?airline=${airline.airlineName}&product=${airline.product}&M=${differenceBetweenCurrentMonthAndPreviousMonth}`),
fetch(`http://ca-fpscfb2:4000/LineValuePreviousMonth?airline=${airline.airlineName}&product=${airline.product}&M=${differenceBetweenCurrentMonthAndPreviousMonth}`),
fetch(`http://ca-fpscfb2:4000/CRsDataPerAirlinePreviousMonth?airline=${airline.airlineName}&product=${airline.product}`),
fetch(`http://ca-fpscfb2:4000/HLEsDataPerAirlinePreviousMonth?airline=${airline.airlineName}&product=${airline.product}`)
])
.then(([totalBugs, totalEnhancements, totalQuestions, P1, P2, ticketCreationThisCycle, ticketCreationOneToThree,
ticketsCreationThreeToSix, ticketsCreationSixToTwelve, ticketsCreationOneYear,
monthOneOpenEnhancements, monthTwoOpenEnhancements, monthThreeOpenEnhancements, monthFourOpenEnhancements,
monthOneOpenBugs, monthTwoOpenBugs, monthThreeOpenBugs, monthFourOpenBugs,
monthOneOpenQuestions, monthTwoOpenQuestions, monthThreeOpenQuestions, monthFourOpenQuestions,
monthOneClosedEnhancements, monthTwoClosedEnhancements, monthThreeClosedEnhancements, monthFourClosedEnhancements,
monthOneClosedBugs, monthTwoClosedBugs, monthThreeClosedBugs, monthFourClosedBugs,
monthOneClosedQuestions, monthTwoCloseQuestions, monthThreeClosedQuestions, monthFourClosedQuestions, lineValue, JSONCR, JSONHLE]) => Promise.all([totalBugs.json(), totalEnhancements.json(), totalQuestions.json(), P1.json(), P2.json(),
ticketCreationThisCycle.json(), ticketCreationOneToThree.json(),ticketsCreationThreeToSix.json(), ticketsCreationSixToTwelve.json(), ticketsCreationOneYear.json(),
monthOneOpenEnhancements.json(), monthTwoOpenEnhancements.json(), monthThreeOpenEnhancements.json(), monthFourOpenEnhancements.json(),
monthOneOpenBugs.json(), monthTwoOpenBugs.json(), monthThreeOpenBugs.json(), monthFourOpenBugs.json(),
monthOneOpenQuestions.json(), monthTwoOpenQuestions.json(), monthThreeOpenQuestions.json(), monthFourOpenQuestions.json(),
monthOneClosedEnhancements.json(), monthTwoClosedEnhancements.json(), monthThreeClosedEnhancements.json(), monthFourClosedEnhancements.json(),
monthOneClosedBugs.json(), monthTwoClosedBugs.json(), monthThreeClosedBugs.json(), monthFourClosedBugs.json(),
monthOneClosedQuestions.json(), monthTwoCloseQuestions.json(), monthThreeClosedQuestions.json(), monthFourClosedQuestions.json(), lineValue.json(),
JSONCR.json(), JSONHLE.json()
]))
.then(([totalBugs, totalEnhancements, totalQuestions, P1, P2, ticketCreationThisCycle, ticketCreationOneToThree,
ticketsCreationThreeToSix, ticketsCreationSixToTwelve, ticketsCreationOneYear,
monthOneOpenEnhancements, monthTwoOpenEnhancements, monthThreeOpenEnhancements, monthFourOpenEnhancements,
monthOneOpenBugs, monthTwoOpenBugs, monthThreeOpenBugs, monthFourOpenBugs,
monthOneOpenQuestions, monthTwoOpenQuestions, monthThreeOpenQuestions, monthFourOpenQuestions,
monthOneClosedEnhancements, monthTwoClosedEnhancements, monthThreeClosedEnhancements, monthFourClosedEnhancements,
monthOneClosedBugs, monthTwoClosedBugs, monthThreeClosedBugs, monthFourClosedBugs,
monthOneClosedQuestions, monthTwoCloseQuestions, monthThreeClosedQuestions, monthFourClosedQuestions, lineValue, JSONCR, JSONHLE
]) => {
this.setState({ addDataOnce: 'true' }, () => {
fetch(`http://ca-fpscfb2:4000/SavePreviousMonthlyValuesForPreviousMonth?previous_dashboardID=${this.state.lastInsertedDashboardID-1}
&airlineID=${airline.airlineID}&totalBugs=${totalBugs.data.total}&totalQuestions=${totalQuestions.data.total}&totalEnhancements=${totalEnhancements.data.total}
&totalOpen=${totalBugs.data.total+totalQuestions.data.total+totalEnhancements.data.total}&P1=${P1.data.total}&P2=${P2.data.total}&ticketCreationThisCycle=${ticketCreationThisCycle.data.total}&
&ticketCreationOneToThree=${ticketCreationOneToThree.data.total}&ticketsCreationThreeToSix=${ticketsCreationThreeToSix.data.total}&ticketsCreationSixToTwelve=${ticketsCreationSixToTwelve.data.total}
&ticketsCreationOneYear=${ticketsCreationOneYear.data.total}&monthOneOpenEnhancements=${monthOneOpenEnhancements.data.total}&monthTwoOpenEnhancements=${monthTwoOpenEnhancements.data.total}
&monthThreeOpenEnhancements=${monthThreeOpenEnhancements.data.total}&monthFourOpenEnhancements=${monthFourOpenEnhancements.data.total}&monthOneOpenBugs=${monthOneOpenBugs.data.total}&monthTwoOpenBugs=${monthTwoOpenBugs.data.total}
&monthThreeOpenBugs=${monthThreeOpenBugs.data.total}&monthFourOpenBugs=${monthFourOpenBugs.data.total}&monthOneOpenQuestions=${monthOneOpenQuestions.data.total}&monthTwoOpenQuestions=${monthTwoOpenQuestions.data.total}
&monthThreeOpenQuestions=${monthThreeOpenQuestions.data.total}&monthFourOpenQuestions=${monthFourOpenQuestions.data.total}&monthOneClosedEnhancements=${monthOneClosedEnhancements.data.total}&monthTwoClosedEnhancements=${monthTwoClosedEnhancements.data.total}
&monthThreeClosedEnhancements=${monthThreeClosedEnhancements.data.total}&monthFourClosedEnhancements=${monthFourClosedEnhancements.data.total}&monthOneClosedBugs=${monthOneClosedBugs.data.total}&monthTwoClosedBugs=${monthTwoClosedBugs.data.total}
&monthThreeClosedBugs=${monthThreeClosedBugs.data.total}&monthFourClosedBugs=${monthFourClosedBugs.data.total}&monthOneClosedQuestions=${monthOneClosedQuestions.data.total}&monthTwoCloseQuestions=${monthTwoCloseQuestions.data.total}
&monthThreeClosedQuestions=${monthThreeClosedQuestions.data.total}&monthFourClosedQuestions=${monthFourClosedQuestions.data.total}&monthOneLine=${lineValue.data.total + (monthOneOpenEnhancements.data.total + monthOneOpenBugs.data.total + monthOneOpenQuestions.data.total) - (monthOneClosedBugs.data.total + monthOneClosedEnhancements.data.total + monthOneClosedQuestions.data.total)}
&monthTwoLine=${lineValue.data.total + (monthOneOpenEnhancements.data.total + monthOneOpenBugs.data.total + monthOneOpenQuestions.data.total) - (monthOneClosedBugs.data.total + monthOneClosedEnhancements.data.total + monthOneClosedQuestions.data.total)
+ (monthTwoOpenBugs.data.total + monthTwoOpenEnhancements.data.total + monthTwoOpenQuestions.data.total) - (monthTwoCloseQuestions.data.total + monthTwoClosedBugs.data.total + monthTwoClosedEnhancements.data.total)}
&monthThreeLine=${lineValue.data.total + (monthOneOpenEnhancements.data.total + monthOneOpenBugs.data.total + monthOneOpenQuestions.data.total) - (monthOneClosedBugs.data.total + monthOneClosedEnhancements.data.total + monthOneClosedQuestions.data.total)
+ (monthTwoOpenBugs.data.total + monthTwoOpenEnhancements.data.total + monthTwoOpenQuestions.data.total) - (monthTwoCloseQuestions.data.total + monthTwoClosedBugs.data.total + monthTwoClosedEnhancements.data.total)
+ (monthThreeOpenBugs.data.total + monthThreeOpenEnhancements.data.total + monthThreeOpenQuestions.data.total) - (monthThreeClosedBugs.data.total + monthThreeClosedEnhancements.data.total + monthThreeClosedQuestions.data.total)}
&monthFourLine=${lineValue.data.total + (monthOneOpenEnhancements.data.total + monthOneOpenBugs.data.total + monthOneOpenQuestions.data.total) - (monthOneClosedBugs.data.total + monthOneClosedEnhancements.data.total + monthOneClosedQuestions.data.total)
+ (monthTwoOpenBugs.data.total + monthTwoOpenEnhancements.data.total + monthTwoOpenQuestions.data.total) - (monthTwoCloseQuestions.data.total + monthTwoClosedBugs.data.total + monthTwoClosedEnhancements.data.total)
+ (monthThreeOpenBugs.data.total + monthThreeOpenEnhancements.data.total + monthThreeOpenQuestions.data.total) - (monthThreeClosedBugs.data.total + monthThreeClosedEnhancements.data.total + monthThreeClosedQuestions.data.total)
+ (monthFourOpenBugs.data.total+ monthFourOpenEnhancements.data.total + monthFourOpenQuestions.data.total) - (monthFourClosedBugs.data.total + monthFourClosedEnhancements.data.total + monthFourClosedQuestions.data.total)}
&openedLastCycle=${monthFourOpenBugs.data.total + monthFourOpenEnhancements.data.total+ monthFourOpenQuestions.data.total}
&resolvedLastCycle=${monthFourClosedBugs.data.total + monthFourClosedEnhancements.data.total + monthFourClosedQuestions.data.total}&JSONCR=${Base64.encode(JSON.stringify(JSONCR.data))}&JSONHLE=${Base64.encode(JSON.stringify(JSONHLE.data))}
`)
}
)
})
}
)
{previousMonthcompanyInfos}

Why CurrentApp::AppId take so long in Windows Phone 10?

I have a windows 8 universal project and have a function to get APP ID,
The following function works well in Windows Phone 8.1
Platform::Guid appId = Windows::ApplicationModel::Store::CurrentApp::AppId;
however, it spent around 40s in Windows Phone 10.
From MSDN, only the Metadata is different,
May I know is it caused by the metadata? And how to solve it?
To instead of using AppID, you might use the following code,
Windows::ApplicationModel::Package^ package = Windows::ApplicationModel::Package::Current;
Windows::ApplicationModel::PackageId^ packageId = package->Id;
Windows::ApplicationModel::PackageVersion version = packageId->Version;
Platform::String^ output =
"Name: \"" + packageId->Name + "\"\n" +
"Version: " + version.Major.ToString() + "."
+ version.Minor.ToString() + "."
+ version.Revision.ToString() + "."
+ version.Build.ToString() + "\n" +
"Architecture: " + packageId->Architecture.ToString() + "\n" +
"ResourceId: \"" + packageId->ResourceId + "\"\n" +
"Publisher: \"" + packageId->Publisher + "\"\n" +
"PublisherId: \"" + packageId->PublisherId + "\"\n" +
"FullName: \"" + packageId->FullName + "\"\n" +
"FamilyName: \"" + packageId->FamilyName + "\"\n" +
"IsFramework: " + package->IsFramework.ToString();
Sample output from device
Output:
Name: "f3e02737-ddfa-47a0-a837-37ee53459898"
Version: 1.0.0.0
Architecture: Arm
ResourceId: ""
Publisher: "CN=heefan"
PublisherId: "gsbawe9kfjm1p"
FullName: "f3e02737-ddfa-47a0-a837-37ee53459898_1.0.0.0_arm__gsbawe9kfjm1p"
FamilyName: "f3e02737-ddfa-47a0-a837-37ee53459898_gsbawe9kfjm1p"
IsFramework: false
I also have no idea why AppID take long time to compute.

Is there command line to deploy chrome extension for faster development?

http://developer.chrome.com/extensions/getstarted.html
In the docs,
it instructs we have to open the chrome:extesion page every time and load our own extension
is there any way to use command line such that i can do faster?
(mac OS or linux)
Thanks
Check out chrome.runtime.reload(). I haven't used it myself, but I suppose you could put a button somewhere convenient and trigger that method with it.
A team I am working with on a Chrome extension has figured out the following CHROME_RUN.py Python script:
cwd = sys.path[0]
CHROME_EXTENSION_DIR = cwd + "/Chrome-Extension"
TEMP_DIR = tempfile.mkdtemp()
TEMP_CHROME_PROFILE = TEMP_DIR + "/Chrome-Temp-Profile"
ccUrl = "PAGE_TO_OPEN.HTML"
if not os.path.exists(TEMP_DIR):
os.makedirs(TEMP_DIR)
FULL_CHROME_ARGS = "-user-data-dir=" + TEMP_CHROME_PROFILE + " --load-extension=" + CHROME_EXTENSION_DIR + " \"" + ccUrl + "\"";
if _platform == "win32":
os.system("BUILD_CHROME_PROJECT.py")
os.system("start chrome " + "-user-data-dir=" + TEMP_CHROME_PROFILE + " --load-extension=" + CHROME_EXTENSION_DIR + " \"" + ccUrl + "\"")
elif _platform == "darwin":
os.system("python BUILD_CHROME_PROJECT.py")
os.system("open /Applications/Google\ Chrome.app --args " + "-user-data-dir=" + TEMP_CHROME_PROFILE + " --load-extension=" + CHROME_EXTENSION_DIR + " \"" + ccUrl + "\"")
elif _platform == "linux" or _platform == "linux2":
os.system("./BUILD_CHROME_PROJECT.py")
os.system("chromium " + "-user-data-dir=" + TEMP_CHROME_PROFILE + " --load-extension=" + CHROME_EXTENSION_DIR + " \"" + ccUrl + "\"")
shutil.rmtree(TEMP_DIR)
which is compatible with OSX, Windows and Linux.
If you are looking for the actual arguments to provide Chrome, it is as follows:
FULL_CHROME_ARGS = "-user-data-dir=" + TEMP_CHROME_PROFILE + " --load-extension=" + CHROME_EXTENSION_DIR + " \"" + ccUrl + "\"";
It will creates a temporary profile and launches Chrome with the provided URL. This version of Chrome is similar to how FireFox sandboxes an instance of the browser for plugin testing (fresh, clean instance of the browser with history, cache, etc. from your browsing history)
Go to the extension page, press ctrl+R, the original extension will be reloaded automatically and that doesn't need to do any import action any more.