I am trying to do a general Assert.AreEqual call on some details in a table header, however I am struggling figuring out how to successfully format the expected results. The return value on the GetTableHeader call is as follows:  "× •••\r\nAcme Health Fund\r\nBalance Date: 9/27/2017"   I ONLY want to assert that the Acme Health Fund text is present. My current call is this:  Assert.AreEqual("/.*Acme Health Fund.*/" , GetTableHeader() );   How can I format my first parameter in the AreEqual call to ONLY expect "Acme Health Fund"?
4355
For example, this regex  (.*)&lt;FooBar&gt;   will match:  abcde&lt;FooBar&gt;   But how do I get it to match across multiple lines?  abcde fghij&lt;FooBar&gt;
52745
I'm able to get cells to format as Dates, but I've been unable to get cells to format as currency... Anyone have an example of how to create a style to get this to work?  My code below show the styles I'm creating... the styleDateFormat works like a champ while styleCurrencyFormat has no affect on the cell.  private HSSFWorkbook wb; private HSSFCellStyle styleDateFormat = null; private HSSFCellStyle styleCurrencyFormat = null;   ......  public CouponicsReportBean(){     wb = new HSSFWorkbook();     InitializeFonts();  }  public void InitializeFonts() {     styleDateFormat = wb.createCellStyle();     styleDateFormat.setDataFormat(HSSFDataFormat.getBuiltinFormat("m/d/yy"));       styleCurrencyFormat = wb.createCellStyle();     styleCurrencyFormat.setDataFormat(HSSFDataFormat.getBuiltinFormat("$#,##0.00"));  }
31391
I am trying to give a table cell a grayscale color value based on it's numeric value. So far I have the following code  \documentclass{article} \usepackage{fp,xcolor,colortbl} \FPeval{\resb}{0.5}  \newcommand{\he}[1]{%     \FPeval{\resa}{2 * #1}%     \cellcolor[gray]{\resa}%     #1  }  \begin{document} \begin{tabular}{| c | c | c |}     \hline     \he{0.1} &amp; \he{0.2} &amp; \he{0.3} \\     \hline     \he{0.5} &amp; \he{0.8} &amp; \he{1.0} \\     \hline \end{tabular} \end{document}   The tables contain all floating point numbers. The error I get is :   Undefined control sequence. &lt;argument&gt; \resa    Is there a way I can use the result from the FPeval to color the cell?
18034
when i try to save the following code, i got the error below. Following same instructions given in this link, but still errors. Am i doing anything wrong here? please suggest.    @isTest private class WebSvcCalloutTest {     @isTest static void testEchoString() {         Account a = new Account(name='Tester',SAP_KUNNR__c='1172');         insert a;                       // This causes a fake response to be generated         Test.setMock(WebServiceMock.class, new WebServiceMockImpl());      } }   Error:  Save error: Method does not exist or incorrect signature: Test.setMock(Type, WebServiceMockImpl)    WebSvcCalloutTest.cls         @isTest global class WebServiceMockImpl implements WebServiceMock {    global void doInvoke(            Object stub,            Object request,            Map&lt;String, Object&gt; response,            String endpoint,            String soapAction,            String requestName,            String responseNS,            String responseName,            String responseType) {          sapComDocumentSapSoapFunctionsMcS.Z_GSSMWFM_HNDL_EVNTRQST00 sap1 = new sapComDocumentSapSoapFunctionsMcS.Z_GSSMWFM_HNDL_EVNTRQST00();                Map&lt;String,String&gt; mapSAP = new Map&lt;String,String&gt; {};         sapComDocumentSapSoapFunctionsMcS.ZgssmbstDatarcrd01 req = new sapComDocumentSapSoapFunctionsMcS.ZgssmbstDatarcrd01();               sapComDocumentSapSoapFunctionsMcS.ZGssmwfmHndlEvntrqst00Response_element ret =  sap1.ZGssmwfmHndlEvntrqst00('',req);         response.put('response_x', ret);     } }
100436
I've got an example like that:  \documentclass{article}  \usepackage{etoolbox}  \newcommand{\ab}{a}  \newcommand{\aORb}[1]{%         \ifstrequal{#1}{a}{"a" was given}{not a}, %         \ifstrequal{#1}{b}{"b" was given}{not b}% }  \begin{document}  begin       \aORb{\ab{}}   end \end{document}   And the output of that code is:  begin not a, not b end   However, if I put simply "a" or "b" as an argument to \aORb instead of \ab{} then it works fine.  Is there another command in etoolbox package that will allow me to do such a comparison correctly?
121388
How can I get the details and transpose it to horizontal form? Every record ends after Couse. Couse will never be blank or null. Note: These four headers will be there for the below data: Name, City, Age, Couse If you see the second record, there isn't any &quot;Name&quot;: &quot;&quot; -&gt; missing so it should be null in place of that and the remaining will be appended after that with a pipe separated like this:     null                | Ors  | 11 | MB I have data like below in the demo.txt file &quot;Name&quot;:&quot;asxadadad  ,aaf dsf&quot; &quot;City&quot;:&quot;Mum&quot; &quot;Age&quot;:&quot;23&quot; &quot;Couse&quot;:&quot;BBS&quot; &quot;City&quot;:&quot;Ors&quot; &quot;Age&quot;:&quot;11&quot; &quot;Couse&quot;:&quot;MB&quot; &quot;Name&quot;:&quot;adad sf&quot; &quot;City&quot;:&quot;Kol&quot; &quot;Age&quot;:&quot;21&quot; &quot;Couse&quot;:&quot;BB&quot; &quot;Name&quot;:&quot;pqr&quot; &quot;Age&quot;:&quot;21&quot; &quot;Couse&quot;:&quot;NN&quot;  Expected Output: asxadadad  ,aaf dsf | Mum  | 23 | BBS null                | Ors  | 11 | MB adad sf             | Kol  | 21 | BB pqr                 | null | 21 | NN  I tried the below code: but not working my logic counter=0 var_0='Couse'   while read -r line     echo &quot;$line&quot;     counter=$(( counter + 1 ))     var_1=`echo &quot;$line&quot; | grep -oh &quot;Couse&quot;`     if [ $var_0 == $var_1 ]    then         head -$counter demo.txt &gt; temp.txt         sed -i '1,$counter' demo.txt         counter = 0    else         echo &quot;No thing to do&quot;    fi   done &lt; demo.txt
121808
\documentclass{article} \usepackage{tabularx} \usepackage{multirow} \begin{document}  \begin{table}[h!] \setlength\extrarowheight{2pt} % for a ever so slightly more open "look"     \begin{tabularx}{\textwidth}{c X | c | c | c |}     \cline{3-5}     &amp;  &amp; \multicolumn{3}{c|}{Paired Differences} \\     \cline{3-5}      &amp; &amp; Mean &amp;  Std. Deviation &amp; Std. Error Mean \\          \hline     Pair 1 &amp; Testing 1 and Testing 2 and Testing 3 &amp; 4.20\% &amp; 44.6\% &amp; 4.54\%  \\     \hline       \end{tabularx} \caption{Testing 123} \end{table}  \end{document}   Outcome:    I cannot figure out. If I added \begin{tabularx}{\textwidth}{|c X | c | c | c |} It will not be working
71223
\documentclass[12pt,a4paper]{report} \usepackage[british]{babel} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[activate={true,nocompatibility},final,tracking=true,kerning=true,spacing=false]{microtype} \DisableLigatures[f]{encoding = T1} \microtypecontext{spacing=nonfrench} \usepackage{geometry} \geometry{     left=2cm,     right=2cm,     top=2cm,     bottom=2cm,     bindingoffset=0mm } \begin{document}     \noindent Note that the word “values” is not hyphenated as “val-ues”.     \begin{enumerate}         \item it could list every single one of them so that one knows that there are multiple mode values in a data set.         \item it could list every single one of them so that one knows that there are multiple mode val- ues in a data set.     \end{enumerate}     \noindent\rule{\textwidth}{0.1mm}\\      \noindent In the following example, the word “determined” is not hyphenated.     \vspace{3mm}      \noindent In a statistical hypothesis test, the \textbf{probability of an alpha error} (error probability) is determined. If the latter is low, $H_0$ can be rejected in favour of $H_1$!     \vspace{3mm}      \noindent In a statistical hypothesis test, the \textbf{probability of an alpha error} (error probability) is deter- mined. If the latter is low, $H_0$ can be rejected in favour of $H_1$! \end{document}
21604
I'm trying to write an automated test of an application that basically translates a custom message format into an XML message and sends it out the other end.  I've got a good set of input/output message pairs so all I need to do is send the input messages in and listen for the XML message to come out the other end.  When it comes time to compare the actual output to the expected output I'm running into some problems.  My first thought was just to do string comparisons on the expected and actual messages.  This doens't work very well because the example data we have isn't always formatted consistently and there are often times different aliases used for the XML namespace (and sometimes namespaces aren't used at all.)  I know I can parse both strings and then walk through each element and compare them myself and this wouldn't be too difficult to do, but I get the feeling there's a better way or a library I could leverage.   So, boiled down, the question is:  Given two Java Strings which both contain valid XML how would you go about determining if they are semantically equivalent?  Bonus points if you have a way to determine what the differences are.
63039
I'm trying to create question paper using Latex. Sample copy of expected header for first page is mentioned below. Note: Image above "First Page Header". Can you please suggest, how can I add table in header with Image on left hand-side as mentioned below. Is there any recommended package?
73868
I need help. I am currently trying to test this code before uploading  public class CoreValuesExt { ApexPages.StandardController sc; public boolean readonly {get; set;} public Core_Values__c cv {get; set;} public integer countEdit = 1; public string buttonValue {get; set;} public integer recordScan;  public CoreValuesExt(ApexPages.StandardController sc) {     this.sc = sc;     cv = new Core_Values__c();     cv.Account__c = sc.getid();      readonly = true;     buttonValue = 'Edit';     recordScan = [SELECT COUNT() FROM Core_Values__c WHERE Account__c = :cv.Account__c];    if (recordScan != 0){    cv = [SELECT id, HSE__c, Professionalism_Integrity__c, Quality_Accuracy__c, Technology_Innovation__c, Timeliness__c, Value_for_money__c FROM Core_Values__c WHERE Account__c = :cv.Account__c];     }  }  public ApexPages.PageReference Save() {     return sc.Save(); }  public void ApplyAction() {     countEdit++;     Integer modolus = Math.mod(countEdit, 2);     String total = cv.HSE__c + cv.Professionalism_Integrity__c + cv.Quality_Accuracy__c + cv.Technology_Innovation__c + cv.Value_for_Money__c + cv.Timeliness__c;     if(modolus == 0)     {         readonly = false;         buttonValue = 'Save';     }     else     {         if(total != 'nullnullnullnullnullnull')            {         if (recordScan == 0){         insert cv;         readonly = true;         buttonValue = 'Edit';         }         else         {         update cv;         readonly = true;         buttonValue = 'Edit';         }         }     }    }   }  With this trigger.  trigger CoreValuesTrigger on Core_Values__c (before insert) {  Core_Values__c cvs = Trigger.new; CoreValuesExt.ApplyAction(cvs);  }   But when I try to save, I get a message saying:      Illegal assignment from List to   CoreValuesExt__Core_Values__c at line 3 column 1   "  How do I go through with this? I need help. Thanks
75988
This question comes up occasionally, but I haven't seen a satisfactory answer.  A typical pattern is (row is a DataRow):   if (row["value"] != DBNull.Value)  {       someObject.Member = row["value"];  }   My first question is which is more efficient (I've flipped the condition):    row["value"] == DBNull.Value; // Or   row["value"] is DBNull; // Or   row["value"].GetType() == typeof(DBNull) // Or... any suggestions?    indicates that .GetType() should be faster, but maybe the compiler knows a few tricks I don't?  Second question, is it worth caching the value of row["value"] or does the compiler optimize the indexer away anyway?  For example:    object valueHolder;   if (DBNull.Value == (valueHolder = row["value"])) {}   Notes:   row["value"] exists. I don't know the column index of the column (hence the column name lookup). I'm asking specifically about checking for DBNull and then assignment (not about premature optimization, etc.).   I benchmarked a few scenarios (time in seconds, 10,000,000 trials):  row["value"] == DBNull.Value: 00:00:01.5478995 row["value"] is DBNull: 00:00:01.6306578 row["value"].GetType() == typeof(DBNull): 00:00:02.0138757   Object.ReferenceEquals has the same performance as "=="  The most interesting result? If you mismatch the name of the column by case (for example, "Value" instead of "value", it takes roughly ten times longer (for a string):  row["Value"] == DBNull.Value: 00:00:12.2792374   The moral of the story seems to be that if you can't look up a column by its index, then ensure that the column name you feed to the indexer matches the DataColumn's name exactly.  Caching the value also appears to be nearly twice as fast:  No Caching: 00:00:03.0996622 With Caching: 00:00:01.5659920   So the most efficient method seems to be:   object temp;  string variable;  if (DBNull.Value != (temp = row["value"]))  {       variable = temp.ToString();  }
64650
In an earlier question  I asked in general about the symbol table for an Apex class.  Using the Tooling API wrapper from  I am able to get part way there. But am unGodly confused.  If I go to the developer console, query editor, check the "Use Tooling API" box and run this query:  Select Id, Name, symbolTable FROM ApexClass Where Name Like '%NewCaseListController%'   I get back an ID, Name and [object Object] for the symbol table, meaning there is a symbol table object there.   But if I try the same query in Apex code in the execute anonymous window I get the error:   System.CalloutException: Web service callout failed: Unable to parse callout response. Apex type not found for element location   If I do this in Apex I can get a result back, and according to the code for the class the result should be of type ToolingAPIWSDL.QueryResult. The QueryResult should contain a member consisting of a list of sObject_x records sObject_x[], unless I am mis-reading what that means.  ToolingAPIWSDL.QueryResult result = tooley.query('select Id, Name from ApexClass WHERE Name Like \'NewCaseListController\'');   I can take the result and apparently put the sObject_x object in it like this:  List&lt;ToolingAPIWSDL.sObject_x&gt; objList = new List&lt;ToolingAPIWSDL.sObject_x&gt;(); for(Integer i = 0; i&lt;result.records.size(); i++){     objList.add(result.records[i]); }   At least that does not throw an error and I can write:     System.debug('objList: ' + objList[0]);  And get a result, but how do I access the symbol table? Or more to the point, how can I get a list of methods and variables? I am assuming the symbolTable is the only way?
40567
I'm working on a project where i find i'm checking for the following in many, many places:  if(item.Rate == 0 || item.Rate == null) { }   more as a curiousity than anything, what's the best way to check for both cases?  I've added a helper method which is:  public static bool nz(object obj) {     var parsedInt = 0;     var parsed = int.TryParse(obj.ToString(), out parsedInt);     return IsNull(obj) || (parsed &amp;&amp; parsedInt == 0); }   Is there a better way?
90950
I want to define a new command \tableheadline that (1) formats the headline text in some way and (2) takes an optional argument for spanning multiple columns while centering the headline.  I tried the following implementation:  \documentclass{minimal}  \newcommand{\tableheadline}[2][1]{\multicolumn{#1}{c}{\textit{#2}}} % \newcommand{\tableheadline}[2][1]{\multicolumn{1}{c}{\textit{#2}}}  \begin{document}   \begin{tabular}[\textwidth]{cc}      \tableheadline[2]{C}     \tableheadline{A} &amp; \tableheadline{B} \\     0 &amp; 1 \\     2 &amp; 3 \\   \end{tabular} \end{document}   This, however, gives me an error:  ! Misplaced \omit. \multispan -&gt;\omit                    \@multispan l.8 \tableheadline[2]{C}   I also get the error when I do not even use the optional argument (see commented line in the MWE). Any ideas what I am doing wrong?
86715
I'm looking at some GXT code for GWT and I ran across this use of Generics that I can't find another example of in the Java tutorials. The class name is  if you want to look at all of the code.  Here are the important parts:  private RpcMap map;  public &lt;X&gt; X get(String property) {   if (allowNestedValues &amp;&amp; NestedModelUtil.isNestedProperty(property)) {     return (X)NestedModelUtil.getNestedValue(this, property);   }   return map == null ? null : (X) map.get(property); }   X is defined nowhere else in the class or anywhere in the hierarchy, and when I hit "go to declaration" in eclipse it just goes to the &lt;X&gt; in the public method signature.  I've tried to call this method with the following two examples to see what happens:  public Date getExpiredate() {     return  get("expiredate"); }  public String getSubject() {     return  get("subject"); }   They compile and show no errors or warnings.  I would think at the very least I would have to do a cast to get this to work.  Does this mean that Generics allow a magic return value that can be anything and will just blow up at runtime?  This seems counter to what generics are supposed to do.  Can anyone explain this to me and possibly give me a link to some documentation that explains this a little better?  I've went through Sun's 23 page pdf on generics and every example of a return value is defined either at the class level or is in one of the parameters passed in.
89134
We have a SSRS report which shows the result of a dataset in a tablix. If the query in the dataset returns no data, the header of the Tablix gets displayed but not the tablix cells below the header. I know there is a property to NoRowMessage, but in fact it is not what we want. Because when I specify a message, SSRS shows the message instead of the empty tablix.I must show the tablix structure as it is, but with empty cells.   I even set the rule for each cell value of the tablix using IsNothing function, to show blank (""), if the value is null, but it didn't help.  Do you have any idea?  Thanks for your help in advance.