[Solved] Merge different products belong to each standard – V2 [duplicate]

This XSLT will do the thing: <xsl:stylesheet xmlns:xsl=”http://www.w3.org/1999/XSL/Transform” xmlns:x=”http://ws.wso2.org/dataservice” xmlns=”http://ws.wso2.org/dataservice” exclude-result-prefixes=”x” version=”1.0″> <xsl:output indent=”yes” method=”xml” /> <xsl:template match=”x:Standards”> <Standards namespace=”{namespace-uri()}”> <xsl:apply-templates select=”.//x:Standard” /> </Standards> </xsl:template> <xsl:template match=”x:Standard”> <Standard> <xsl:copy-of select=”x:ProductID” /> <xsl:copy-of select=”x:Prefix”/> <xsl:copy-of select=”x:SNumber”/> <RelatedProducts> <xsl:apply-templates select=”.//x:RelatedProduct”/> </RelatedProducts> <xsl:copy-of select=”x:S1″/> <xsl:copy-of select=”x:S2″/> </Standard> </xsl:template> <xsl:template match=”x:RelatedProduct”> <xsl:element name=”RelatedProduct”> <xsl:element name=”RelationType”> <xsl:value-of select=”name(..)” /> </xsl:element> … Read more

[Solved] PEMDAS Visual Basic [closed]

This should be what you’re looking for. This built-in function has its limits especially if the expression involves trigonometric functions but this should be enough for your needs. Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Try Dim answer = New DataTable().Compute(TextBox1.Text, Nothing) MsgBox(answer) Catch ex As Exception MsgBox(“Syntax Error”) End Try End … Read more

[Solved] Is my application runs from inside Visual Studio vs. by executing an EXE file

It not exactly solution, but: Raymond Chen(Microsoft winapi guru*) is most close in spirit to the problem I facing, helping me detect in what mode or circumstances I run my console session. How can I tell whether my console program was launched from Explorer or from a command prompt? printf(“this process = %d\n”, GetCurrentProcessId()); DWORD … Read more

[Solved] complex array merge using nested loop

As discussed in chat, here is a javascript example that builds what you asked for: var tabs = [{“uId”:”2″,”tabId”:1,”tabName”:”Main”,”points”:”10″,”active”:”true”},{“uId”:”3″,”tabId”:2,”tabName”:”Photography”,”points”:”20″,”active”:””}]; var tasks = [{“taskId”:3,”taskName”:”Sing Sing Gem”,”priorty”:3,”date”:”2014-04-25″,”done”:0,”tabId”:1,”uId”:”2″},{“taskId”:4,”taskName”:”Shooting”,”priorty”:4,”date”:”2014-04-25″,”done”:0,”tabId”:2,”uId”:”3″}]; var uidSet = {}; var UIDSortFunction = function(a,b){ uidSet[a.uId] = 1; uidSet[b.uId] = 1; return a.uId – b.uId; }; tabs.sort(UIDSortFunction); tasks.sort(UIDSortFunction); var endResult = []; var i, j, tabsLen = … Read more

[Solved] How do I make a button stay “Pressed” after clicking

my sulotion (need to use a Directive) –html button.component.html <button class=”btn btn-danger” style=”width: 110px” appButton” ></button> –Typescript button.directive.ts @Directive({ selector: ‘[appButton]’ }) export class ButtonDirective implements OnInit { constructor(private elRef: ElementRef, private renderer: Renderer2) { } ngOnInit() { } @HostListener(‘mousedown’) onmousedown(eventData: Event) { if (this.elRef.nativeElement.style.backgroundColor === ‘blue’) { this.renderer.setStyle(this.elRef.nativeElement, ‘background-color’, ‘rgba(200,0,0,0.7)’); } else { this.renderer.setStyle(this.elRef.nativeElement, … Read more

[Solved] Count the occurences of rows based on it’s columns values

Here is the not-so-scalable C way. #include <stdio.h> int main(void){ int matrix[4][2] = {{1,1},{1,2},{2,1},{2,2}}; int i, j, counter=0; for (i=0;i<4;i++) { if (matrix[i][0] == 1 && matrix[i][1] == 1) counter++; } printf(“count %d”, counter); } 0 solved Count the occurences of rows based on it’s columns values

[Solved] dynamic filter choice field in django

So I figured this out, I was passing the plant_number instead of the id, which is what django was expecting since my filter is against the Sightings model and plant_number is a foreign key in the the Sightings model. The code that worked: plant_number = django_filters.ChoiceFilter(choices=[[o.id, o.plant_number + ” ” + o.Manufacturer] for o in … Read more

[Solved] Find string according to words count

A) Use String_Split or something similar to create a table for each word. LG 55 Vacuum theater home #table_of_words (text varchar(32)) text LG 55 Vacuum Theater Home B) join the created table with the main table using an expression like SELECT DISTINCT Description FROM main_table Main JOIN #table_of_words WD ON Main.Description Like ‘%’+WD.text+’%’ If you … Read more

[Solved] “Chances” for a function to occur? [duplicate]

Create a string of 100 letters, with 24 A’s, 12 B’s, and appropriate numbers of C’s and D’s. Generate a random number between 0 and 99; use this as an index into the string. That gives you your weighted random selection. That’s a simple but almost graphical way to do it. You can decide based … Read more

[Solved] Regex not matching all the paranthesis substrings [duplicate]

Parenthesis in regular expressions are used to indicate groups. If you want to match them literally, you must ‘escape’ them: import re found = re.findall(r’\(.*?\)’, text) print(found) Outputs: [‘(not all)’, ‘(They will cry “heresy” and other accusations of “perverting” the doctrines of the Bible, while they themselves believe in a myriad of interpretations, as found … Read more

[Solved] searching for list of vowels and replacing the vowels with dot (.) in a given string in scala [closed]

Check below code. scala> val vowels= Set(‘a’,’e’,’i’,’o’,’u’) // List Of vowels oval: Seq[Char] = List(a, e, i, o, u) scala> val data = “BangaLore” // Value data: String = BangaLore scala> data.toLowerCase.map(c => if(vowels(c)) ‘.’ else c) res17: String = b.ng.l.r. 4 solved searching for list of vowels and replacing the vowels with dot (.) … Read more