Scala Ancored Regex acts as non-detached

So for some reason in Scala 2.11, my anchored regex patterns act as unanchored regex patterns. scala> """something\.com""".r.anchored findFirstIn "" res66: Option[String] = Some( sc

Is there a performance difference between 'let' and 'var'

The difference between these two keywords in terms of scoping has already been thoroughly discussed here, but I was wondering if there is any kind of performance difference between the two, and if so, is it negligible, or at what point would it becom

How to write a unit test for this method

I am writing unit test for this method. I have tried lot of times but still can not write any code for it. Please suggest me how to unit test it. I am using C# , nunit framework and rhino mock. Thanks in advance. public FileUploadJsonResult AjaxUploa

Wpf instantiated object object to datacontext

EDIT : Question was not clear enough. In fact there are two of them. Q1 : I have a UserControl "CustomView" that is dynamically created with a template: <Window.Resources> <DataTemplate DataType="{x:Type my:CustomViewModel}"&g

Shutil.copytree without files

I'm trying use shutil.copytree: shutil.copytree(SOURCE_DIR, TARGET_DIR, ignore=None) This copy also files in folder. I need copy only folders without ANY files. How to do it?You can do that by providing a "ignore" function def ig_f(dir, files):

Prevent angular compilation directive

Im currently working on a Validation directive. Everything works fine but the link function gets called even when the input element is inside a element which will be hidden via "ng-if". Is there a way to check if the element is inside a hidden n

Recovery Latitude and Longitude of Google GeoCoding API

What I want to do is to generate latitude & longitude given an address, so I thought Google geocoding API would be great. I've tried everything and still it doesn't want to work. I am not an experienced web programmer, so any help will be great. I've

Error: non-exhaustive reasons based on Haskell

I did a thread for an error like this one, in it I explain my program. here's the link I'm going forward in my project and I have an another problem like that one. I did an other thread but if I just need to edit the first one just tell me. I want to

How do I delete the first column of each line?

I am having trouble trying to remove the first column from every row. I have a felling it is my understanding of jquery. I've tried the following. $("table:eq(2) tr td:first").remove() // this only removed the first cell $("table:eq(2) tr t

C # form saving state with all controls

I have a form and I have some buttons doing stuff. When I press buttons the windows form controls, like textboxes or group-boxes, buttons appear and disappear and change place on my form, for it is a dynamic form :) However, what I'd like to do is ha

How do I set certain variables to specific views?

I found in documentation that something similar can be done But for all views By putting in AppServiceProvider or other own ServiceProvider something like View::share('key', 'value'); But how to share data only with some specific views? Not all. Not

Open the ssh connection in a single line without a public key

Is there any way to execute a ssh connection with out use interactive password autentification and non public keys, I need too run a command in the remote server all this with out manual intervention, I know that i can use a script but I donĀ“t have a

Drupal 8 - How to resize the image programmatically?

I'm developing a module. The image saves on the server correctly, and I could manually write PHP code to resize the image... but what is the native way to resize the image programatically in Drupal 8? I can see an Image class, but it needs to work wi

The user control in XAML displays only the name

I'm trying to use user controls in XAML, after a while and several tutorials I managed to get it "working" (read 'it builds without errors'). However when I run it, all I can see (instead of 2 test labels) is the name of the Class. Here's my cod

Android Bounce Ball

So i'm just trying to make a ball bounce around the screen which should slow down due to gravity and reflect (bounce) from the wall like a normal ball would. Can someone give some basics and VERY simple implementation of this? Other examples seem a b

foreach table display result

I have been looking at this code etc for so long that I am now confusing myself - not good I have foreach of foreach($sort_order as $sort) { echo '<pre>'; var_dump($sort['sorder']); echo '</pre>'; } That gives me a result of: string(2) "2

Tworld lookup API does not work?

I'm trying to use Twilio's Lookup API to get certain properties of a mobile number via PHP... with very little success: $twilioClient = new Lookups_Services_Twilio(Credential::TwilioSID, Credential::TwilioToken); $number = $twilioClient->phone_number

Why is my UILabel void?

I have a link from three UILabels in a table cell to a custom class, which is a separate file from my VC (View Controller). listOfTasks is a dictionary with tuples inside. Here's the relevant code: func tableView(tableView: UITableView, cellForRowAtI

Check if the output is OK

I am running a command from the CMD via a batch file like so.. echo Step 3. Check TNSPING tnsping vtdbs 2>NUL if not errorlevel 1 set error=PASSED if errorlevel 1 set error=FAILED echo Result: %error% But this only tells me if it actually was able to

Dynamic SSIS Dynamic Column Header

I am having a problem using SSIS and hoped someone could help me. I am new to this Microsoft software and I was asked to import data from a Excel schedule file that features 13 weeks. So the data is displayed as followed in the Excel file: Person id

Load the asynchronous jquery kernel with the fallback

With performance optimization and non-blocking scripts in header, I've been trying to asynchronously load the jquery itself. I ran into a jQuery Loader script, that async loads jquery and thereafter catches and queues jquery document ready calls. Thi

How do I change the bootstrap submenu?

I am using bootstrap 2.3.2 and I make its submenus to open from left site and I put the submenu arrow icon in the left side but I don't know how to change the right arrow icon to a left one. Update This is the li tag that contains children: <li class