Iterating though desearialised JSON via HttpWebResponse

json
Question: In a WPF application we are returning JSON like this { "AccountHistory":[ { "AccountNumber":123456, "DailyEndingBalances":[ {"BalanceDate":"/Date(14508540000000000)/","EndingBalance":2511.5700}, //Other elements ], "Transactions":[ { "TransactionID":"98787676", //Other elements }, { "TransactionID":"2683901", //Other elements }], "IsSuccessful":true, "StatusCode":0, "StatusMessage":"success" ], "IsSuccessful":true, "StatusCode":0, "StatusMessage":"success } and it is being deserialised like this Using response As HttpWebResponse = DirectCast(request.GetResponse(), HttpWebResponse) Dim deserializer As New DataContractJsonSerializer(GetType(ABank.AHistoryResponse)) ResponseObject = DirectCast(deserializer.ReadObject(response.GetResponseStream()), ABank.AHistoryResponse) End Using The following classes pick up, and work correctly, for the root elements Public Property IsSuccessful() As Boolean Get Return m_IsSuccessful End Get Set m_IsSuccessful = Value End Set End Property Private m_IsSuccessful As Boolean Public Property StatusCode() As Integer Get Return m_StatusCode End Get Set m_StatusCode = Value End Set End Property Private m_StatusCode As Integer Public Property StatusMessage() As String Get Return m_StatusMessage End Get…
Read More

android fragments not getting refreshed the second time while swiping to the previous fragment from the current fragment

Uncategorized
Question: I hav created an android project in the tabbed activity fashion. i have implemented a search in the action bar of the main activity which s calling two fragments. the prob m facing is at the frst go my search is working properly in both the fragments . but wen my swiping bak to d frst fragment from the second fragment the frst fragment is not getting refreshed or rather called because of which the search is not wrking for the frst fragment in the second go. the contents are still getting loaded of the second fragment. how to solve this problem. Answer: Read more
Read More

Can Java Keyword and Class name be passed from String args[] (Command Line arguments)?

Uncategorized
Question: I studied in books that both cannot pass from command line arguments but when I tried in eclipse, both java keyword and class name are passing through command line arguments. Can someone tell me the reason behind it? public class MakeSelection { public static void main(String[] args) { System.out.println("Number of arguments passed are " + args.length); System.out.println("The First " + args[0]); System.out.println("The second " + args[1]); System.out.println("The Third " + args[2]); System.out.println("The Fourth " + args[3]); System.out.println("The Fifth " + args[4]); System.out.println("The Sixth " + args[5]); System.out.println("The Seventh " + args[6]); } } And the arguments I set in Run configurations are: java klnjcks ajkj bjknkj bjkbkj java MakeSelection ****And Output is:**** Number of arguments passed are 7 The First java The second klnjcks The Third ajkj The Fourth…
Read More

Select where rows exist more than once with variation

Uncategorized
Question: This is a hard one to put a title to so I apologise for ambiguity. I have the following MySQL table (it's a Magento table):id attr_id store_id entity_id value ----+---------+---------+------------+------------------------ 1 45 0 173 Sale Gifts + Apartment 2 45 0 175 Sale Outerwear 3 45 1 175 Sale Outerwear 4 45 0 177 (null) 5 45 1 177 New Arrivals 6 45 0 178 New Tops 7 45 1 178 New Tops As you can see, some of the rows have the same everything except store_id. I want to do the following: If a row with store_id = 0 has a duplicate row, but with store_id = 1 and different values (for example, rows 4 and 5 above), update the row with store_id = 0 to have the…
Read More

Python Selenium search for [object Text]

Uncategorized
Question: This is my selenium code below. sourcesearch = driver.find_element_by_xpath('//*[@id="Table_Exame"]/tbody/tr[1]/td/text()[1]') And the result is - selenium.common.exceptions.InvalidSelectorException: Message: invalid selector: The result of the xpath expression "//*[@id="Table_Exame"]/tbody/tr[1]/td/text()[1]" is: [object Text]. It should be an element. Would there be any ways I can retrieve [object Text] via Selenium? Any kind of help would be appreciated. Anything other than Xpath weren't available since the site did not add any tags for the text. Also, sorry for not being able to include the site address since it's only a member only website. Answer: As your XPath expression terminates with text()[whatever], this resolves to a text container, and not an HTML element (or list of). Hint: try your XPath expression in the Firefox console with $x(some_xpath_expression) while browsing the page. Perhaps you should edit your…
Read More

Css grid children are overflowing each other only in Firefox [duplicate]

Uncategorized
Question: This question already has an answer here:Prevent grid items from stretching in CSS Grid Layout 1 answer I have a simple container with items. The container has property display: inline-grid. The idea is that if items don't fit in one line - they move to next row. Items have to have display: flex property and adjust their width to available space. They also contain text that has to be partially hidden when it's wider than parent element. I have it working, but there is an issue that is only visible in Firefox. When decreasing the size of the window the items don't resize properly as you can see here: http://prntscr.com/g8mtab This is the first time I'm working with css grid, but I didn't find any firefox specific issues. If…
Read More

my second activity is not returning result for first one

Uncategorized
Question: I am trying to make an app in which MainActivity ask for result from Main2Activity code for MainActivity is:package hello.option_menu; import android.app.Activity; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.TextView; import com.ye.collor.stackapplication.R; public class MainActivity extends AppCompatActivity { Button bt; TextView tv; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button bt=(Button)findViewById(R.id.bt); TextView tv=(TextView)findViewById(R.id.tv) ; bt.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View arg0) { Intent i=new Intent(MainActivity.this,Main2Activity.class); startActivityForResult(i,1); } }); } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if(requestCode==1) { String message=data.getStringExtra("message"); tv.setText(message); } } @Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.jai, menu); return true; } } code of Main2Activity is:package hello.option_menu; import android.content.Intent; import android.support.v7.app.AppCompatActivity; import…
Read More

How to fix broken images and icons in jenkins UI

ubuntu
Question: I am having trouble with the jenkins ui these days with all the images and icons (build icons and those in the manage jenkins page) broken. I have googled and haven't found anything clear. Also, the jenkins became much slower. I read that clearing the TEMP folder might cause this issue. and yes after restarting the jenkins service on the instance it has become much worse and all icons were broken. How can I fix it? Screenshots attached Can someone help me with this. location of jenkins.war : /usr/share/jenkins/jenkins.war jenkins version: 1.651.2 instance : ubuntu size: t2.large I have these files in the tmp dir:hs_err_pid9138.log, jetty-0.0.0.0-8080-war--any- , winstone3877623187585170658.jar, winstone6494081310724055556.jar, hsperfdata_jenkins, jna--1712433994 ,winstone5277385331684199945.jar Answer: after some research found this and it helped: do:- sudo service jenkins stop - sudo mv…
Read More

Android No resource matches android:windowIsFloating

Uncategorized
Question: I am trying to make my activity as popup / floating activity after watching this video https://www.youtube.com/watch?v=fn5OlqQuOCk But I want to make window background Semi Translucent. So I added windowIsFloating -> true But getting following error Error:(2374, 21) No resource found that matches the given name: attr 'android:windowIsFloating'. Answer: Add a parent android theme to your custom theme. For example, Read more
Read More

google fonts not loading in IE or edge

Uncategorized
Question: Have been reading around trying a few of the fixes mentioned on similar topics. trying to use the lato font and its rendering fine on every browser apart from IE and edge. I've been reading that IE doesn't use woff2? @font-face { font-family: 'Lato'; font-style: normal; font-weight: 400; src: local('Lato Regular'), local('Lato-Regular'), url(https://fonts.gstatic.com/s/lato/v13/UyBMtLsHKBKXelqf4x7VRQ.woff2) format('woff2'); unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60- 2C7F, U+A720-A7FF; } /* latin */ @font-face { font-family: 'Lato'; font-style: normal; font-weight: 400; src: local('Lato Regular'), local('Lato-Regular'), url(https://fonts.gstatic.com/s/lato/v13/1YwB1sO8YE1Lyjf12WNiUA.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215; } Answer: You could import them using the link attribute like this: body { font-family: 'Lato', sans-serif; } Iste officia in delectus asperiores recusandae deleniti natus. Quia consequuntur incidunt repellat quibusdam omnis maxime nostrum. Incidunt molestiae vero…
Read More