I had applied for UK visa recently and it got refused

enter image description here

(refused latter UK embasy)

The decision :

i have refused your application for a visit visa because I am not satisfied that you meet the requirements of paragraph 4.2 of appendix V : immigration rules for visitors because:

  • you stated that you wish to visit the UK for 6 days as a tourist.

  • under the UK immigration rules you must show that you are qualify for a visa by explaining your own circumstances and the plans you have for visit.it is your responsibility to satisfy me that they are such that if guaranteed leave to enter you will abide by all of the conditions attached to any such leave and that you will leave the United Kingdom on completion of proposed visit.

  • You state that you are unemployed. You have stated that you are traveling withe your spouse and that he is funding your visit.you have not stated that how you are supported.you have provided property documents withe your application but this documents do not dimostrareate that you drive an income from them.i also note that when your spouse received his uk visa last October he stated that he had an online business. The documents you have provided do no demonstrate this business or that you or your spouse receive and income such a business. The documents you have provided do not demonstrate how you support your self in bangladesh and as such I am not satisfied that they are an accurate reflection of your financial circumstances in bangladesh

  • On the evidence available to me today, I am not satisfied that your circumstances are as stated in your application. Therefore I am not satisfied that you are a genuine visitor to the UK for a purpose that is permitted by the visitors rules or that you intend to leave the uk at the end of your proposed trip (appendix V: 4.2 a c

I am going to reapply. What was wrong with my previous application? What do I need to provide in addition to other documents so as to ensure that I get the visa? What was wrong with my earlier application and what corrective steps should I take for my next application?

thanks in advance Farhana Rumpa

How do miners know how to remove recently confirmed transactions?

A miner is in the process of creating and mining a block of 1400 transactions. Suddenly they receive a broadcast that a new block was confirmed with 200 of the transactions currently in that miner’s block. How does a miner proceed in this scenario – dropping the 200 and adding 200 others from the mempool and trying to mine a block?

In a second scenario, two blocks are created almost at the same time and they each have some of the same and some different transactions. I’m assuming (a) that there is then a race to consensus for each and the first to 51% wins a confirmation. If so, then similar to above (b) the block with losing transactions has all the dissimilar transactions dumped back in the mempool. But what if a second chain surfaces with two blocks? Now all the confirmations in (a) that aren’t confirmed in this second block get dumped back into the mempool and hopefully finally mined into the blockchain?

The takeway for me >>> Obviously this system does work since its very popular! But it seems that transactions can take a very long time and no way to really guarantee that they will occur unless a payor decides to pay a high fee to almost confirm that miners will pay attention to his transactions first and most will include that transaction into the miner’s next block to add to the chain.

Recently, I have about 10 new orders that have an id and orderid but can’t find them in the sales order grid

I have the time of checkout and the amount as well as shipping_first_name and shipping_last_name. The thing is the status is abandoned and the response is “failed” like their CC didn’t process correctly. Why would magento create an increment id if the transaction didn’t go through? I’ve looked in admin and can’t find anything. Additionally, i’ve looked in the sales_order table to no avail. Is there another table that stores this information, failed sales?

Why recently an icnreasing number of website isn’t supporting “request desktop site” anymore?

Recently I more and more often, access websites via my mobile, just to realize a certain feature ha no (more) support on the mobile version of that site. So I request the desktop site. But even then, as soon I click on any link, the URL changes to something like m.URL.TD or having somewhere in the URL a .TD/XXX/mobile/.... So my impression is, the sites providers actively want to deny desktop site access from mobile devices. Why is that so? Especially since most of the time, I am getting denied access to specific features I intend to sue this way. And that way I feel often very dissapointed in regards of user experience not to say sometimes I get even mad about this logic, as I can’t see, why a site wouldn’t allow a user desktop access, where the user actively presses a button representing “Hey, I know my experience using this site as desktop version despite being on a mobile device might give me a bad experience.” So the experience of being denied getting that explicit requested desktop site is (at least for me) even worse.

Ideas I have come up with, why this could be done:

  • The site has an App, and wants to enforce the user to use the App instead.

    • But not all sites I noticed this recently have even an App.
    • Also, I wonder, is it that important, that their App is being used that they risk users stop using their service at all?
  • I.e. my bank denies it. But as soon you request a desktop site you get an information that continuing in desktop mode from mobile device is not supported by them, due to security risks. But you can just ignore that info and you remain on the desktop site. I am fine with that.

So given the above bullet points, I don’t really can see that this justify taking away the users agency.

So what am I missing? Or what other reasons are there that I notice this behavior recently more and more often?

Magento 2: Get recently reviewed Products on Category Page

On the product view page the reviews get loaded via the following code:

$  _items = $  block->getReviewsCollection()->getItems(); 

This is what the getReviewsCollection function looks like:

public function getReviewsCollection() {     if (null === $  this->_reviewsCollection) {         $  this->_reviewsCollection = $  this->_reviewsColFactory->create()->addStoreFilter(             $  this->_storeManager->getStore()->getId()         )->addStatusFilter(             \Magento\Review\Model\Review::STATUS_APPROVED         )->addEntityFilter(             'product',             $  this->getProduct()->getId()         )->setDateOrder();     }     return $  this->_reviewsCollection; } 

This is later used in the following way:

foreach ($  _items as $  _review):     ...     ...     foreach ($  _review->getRatingVotes() as $  _vote):         ...         ... 

I’m trying to replicate this in order to display the recently reviewed products on the category pages. My code so far looks like this:

public function __construct(     \Magento\Catalog\Api\ProductRepositoryInterface $  productRepository,     \Magento\Framework\Registry $  registry,     \Magento\Review\Model\ResourceModel\Review\CollectionFactory $  reviewCollection,     \Magento\Store\Model\StoreManagerInterface $  storeManager,      \Magento\Framework\View\Element\Template\Context $  context,     array $  data = [] ) {     $  this->productRepository = $  productRepository;     $  this->registry = $  registry;     $  this->reviewCollection = $  reviewCollection;     $  this->storeManager = $  storeManager;     parent::__construct($  context, $  data); }  public function getCollection() {     $  category = $  this->registry->registry('current_category');     $  collection = $  category->getProductCollection();      foreach( $  collection as $  product ) {          $  prod = $  this->productRepository->getById($  product->getId());          $  urlKey = $  prod->getData("url_key");         $  url = $  this->getUrl($  urlKey);          // this is the method from the magento         // core function (getReviewsCollection()) mentioned above         $  reviewCollection = $  this->reviewCollection->create()             ->addStoreFilter(                 $  this->storeManager->getStore()->getId()             )->addStatusFilter(                 \Magento\Review\Model\Review::STATUS_APPROVED             )->addEntityFilter(                 'product',                 $  prod->getId()             )->setDateOrder();          $  reviews = $  reviewCollection->getItems();          if( !empty($  reviews) ){             foreach ($  reviews as $  review){                 // this is where the code breaks                 foreach( $  review->getRatingVotes() as $  rating ){                     // do stuff here                 }             }         }      } } 

Inside the getCollection function I use the same method to retrieve the review collection as in the getReviewsCollection method from the magento core. I can successfully retrieve an array of \Magento\Review\Model\Review objects.

But my code breaks as soon as I try to iterate over the reviews and use the $ review->getRatingVotes() method inside the inner most foreach loop. getRatingVotes() returns null and I get an Invalid argument supplied for foreach() exception.

I decided to investigate the getRatingVotes() method but I cannot find where it is defined. I did a search of the whole codebase inside VSCode as well as via grep. The only place where it occurs is inside the .phtml template file of the reviews list.

List recently access documents

I am trying to develop a web part the lists the logged on users recently accessed documents, as per the home page of www.office.com, and the recent documents tab.

I originally thought this information would be coming from the MS Graph, using https://graph.microsoft.com/v1.0/me/drive/recent, but the results are different. The MS Graph doesn’t show all the documents I have accessed, unlike the www.office.com page.

Doing a fiddler trace showed that it is getting the data from this endpoint: https://ocws.officeapps.live.com/ocs/v2/recent/docs?apps=Word,Excel,PowerPoint,Visio,OneNote,Sway,Forms&show=100&rs=en-AU

From my testing, it looks as though if I access a document in word online I can get this via the MS Graph but if I access a document in the word client I cannot see this in the graph, unless I edit the document, but in both cases the www.office.com page shows these documents, so the data and usage profile is being tracked somewhere!

Is anybody able to help me understand how I can get this information or how I can call this endpoint, https://ocws.officeapps.live.com/ocs/v2/recent/docs?apps=Word,Excel,PowerPoint,Visio,OneNote,Sway,Forms&show=100&rs=en-AU, from my webpart?

My attempts to call this say the endpoint is not part of my tenant? Is this because I need to register the office live endpoint in AAD?

Thanks in advance Pete

I recently learned of a conviction I did not admit on a UK visa application. What happens if I admit/omit it next time?

I traveled to the UK on a visitors visa a couple of years ago. At the time I had one old conviction (20 years old) for a very minor offense which resulted in a very small fine, no jail time. I admitted this on my application and as expected it was of no concern. I have since decide to apply for a long term visa with the aim of eventually moving permanently.

I applied for a Police Clearance certificate last year and to my surprise found another conviction from 2005. Also minor (a traffic offense that is also a criminal offense) which led to another small fine and no jail time. I did not know about this because I did not go to court and paid what I thought was a regular traffic fine and am now told was an admission of guilt fine leading to instant conviction (this was not information I was given at the time.)

I’ve since had both expunged and now have a clean clearance certificate. I know that since I admitted the first offense on my visitor visa application I must admit it again. I would normally have no problem admitting the second since it was also minor and more than 10 years ago. My concern is that I did not admit it last time as I honestly did not know about it and my lack of admission last time will be seen as deception even if I explain the circumstances. But I am equally worried that if I do not admit it, even though it was expunged, they may find out and deny me the long term visa.

Naive Implementation of A Least Recently Used (LRU) Cache Memoiser

I wrote code to (naively) perform lru memoisation. I tried to write it in a functional programming style, and so did not make use of any global variables.

My Code

def naive_lru(mx=None):     """         *   Closure that returns a memoiser.          *   Params:             *   `mx`: (`int`) The maximum size of the cache of the returned memoiser.         *   Return:             *   `memoise`: (`function`) A memoiser.         *   Vars:             *   `caches`: (`defaultdict`) stores the caches for the various functions.             *   `lim`: (`bool`) set to `True` if `mx` isn't `None`. It is used to indicate that the size of the cache should be tracked.             *   `ln`: (`int`) that tracks the cache size.             *   `deck`: (`deque`) used for administrating the cache. Elements in the deque are ordered according to when they were last accessed.             *   `lengths`: (`defaultdict`) stores the lengths of the caches for the various functions.             *   `lims`: (`defaultdict`) stores whether a given cache has a maximum size.             *   `decks`: (`defaultdict`) stores the deques of the caches for the various functions.             *   `maxes`: (`defaultdict`) stores the maximum size of the caches for the various functions.     """     caches, lim = dd(lambda: dd(lambda: None)), False     if mx is not None:         lim, ln = True, 0         deck = deque()     lengths, lims, decks, maxes = dd(lambda: 0), dd(lambda: False), dd(lambda: deque()), dd(lambda: None)     def memoise(mxsize=None, lst=False, idx=None, init=0):         """             *   Returns a memoisation decorator for a given function.              *   Params:                 *   `mxsize` (`int`): The maximum size of the cache for the memoised variant of the input function.                 *   `lst` (`list`): A boolean variable that determines whether a list would be used for the function cache. For functions with domains that can be mapped onto a dense set, using a list for caching would be more efficient (and faster) than using a dict.                     *   The cache would only be set to a list if `mxsize` is `None` as implementing lru functionality with a list is quite nontrivial — and more importantly very messy — frequent deletions would destroy the dense property that was a prerequisite for using the list as a cache, so lru functionality is only provided when the cache is a dict.                 *   `idx` (`function`): The transformation function that maps input data unto their corresponding index in the cache.                 *   `init` (`int`): The initial size of the cache list. If an upper bound on the size of the function's domain is known, a list of that size can be created at initialisation. This is more efficient than repeatedly appending to or extending the list.              *   Return:                 *   `memoised`: (`function`) A memoisation decorator.         """         def memoised(f):             """                 *   Memoisation function that returns a memoised variant of a given input function.                  *   Params:                     *   `f`: (`function`) The function to be memoised.                 *   Return:                     *   `mem_f`: (`function`) Memoised variant of the input function.             """             nonlocal lst             if lim:                 deck.appendleft(f)                 ln += 1                 if ln > mx:                     del caches[deck.pop()]  #Remove the least recently used function cache.             if mxsize is not None:                 lims[f], lst, maxes[f] = True, False, mxsize             else:                 if lst:                     caches[f] = [None]*init             def mem_f(*args, **kwargs):                 tpl = (args, frozenset(kwargs))                 index = tpl if idx is None else idx(tpl)                 if caches[f][index] is None:                     caches[f][index] = f(*args, **kwargs)                     if lims[f]:                         decks[f].appendleft(index)                         lengths[f] += 1                         if lengths[f] > maxes[f]:                             del caches[f][decks[f].pop()]  #Remove the least recently used argument cache.                 return caches[f][index]             return mem_f         return memoised     return memoise 

Sample Usage

mem = naive_lru()  @mem(lst=True, init=10000, idx=lambda x: x[0][0]) def fib(n):     if n in [0, 1]:         return n     return  fib(n - 2) + fib(n - 1)  print(fib(500))    #Outputs "139423224561697880139724382870407283950070256587697307264108962948325571622863290691557658876222521294125".