text:
Q: Selecting a piece of the picture with the cursor and zoom the same I have ImageView and I want to mark a part from that for zooming.
I need something like "Select" in Paint.
How I can do it with the Cursor or otherwise?
I just need help with selecting.
Something like this

A: Solved, but at the beginning will be the point. Square is drawn at the end
imageViewDisplaySectrum.setOnTouchListener(new View.OnTouchListener() {

        float rectX,rectY,rectX2,rectY2;

        @Override
        public boolean onTouch(View v, MotionEvent event) {

            switch (event.getAction())
            {
                case MotionEvent.ACTION_DOWN:

                    rectX = event.getX();
                    rectY = event.getY();

                    rectX2 = rectX;
                    rectY2 = rectY;

                    canvasDisplaySpectrum.drawPoint(rectX , rectY , paintRect);
                    imageViewDisplaySectrum.invalidate();

                    break;

                case MotionEvent.ACTION_MOVE:

                    rectX2 = event.getX();
                    rectY2 = event.getY();

                    break;

                case MotionEvent.ACTION_UP:
                    canvasDisplaySpectrum.drawRect(rectX, rectY, rectX2, rectY2, paintRect);
                    imageViewDisplaySectrum.invalidate();

                    break;
            }

            return true;
        }
    });

        paintRect = new Paint();

        paintRect.setColor(Color.RED);
        paintRect.setStrokeWidth(3);
        paintRect.setStyle(Paint.Style.STROKE);


text:
Q: Gitlab Testhosts for multiple Braches Does anybody know a way to test webapplications while developing in gitlab?
A solution like: branchname.myserver.com uses a automatic exported branch as document root?
Specific:
Bind it to a Webapplication, so dynamic virual hosts appear if I create a branch and maybe a ci...

A: Well, it's pretty straightforward: you need to define a set of stages (at least one) and mark each job with
- only: branchname

and then define a CI routine to deploy it into this specific server/docroot.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Redirect to custom tab in lightning experience I have custom tab in lightning experience that include lightning component.
How can I redirect to this tab using client controller?
URL of this tab:

https://kasyan-dev-ed.lightning.force.com/one/one.app#eyJjb21wb25lbnREZWYiOiJvbmU6YXVyYUNvbnRhaW5lciIsImF0dHJpYnV0ZXMiOnsidmFsdWVzIjp7InRhZyI6ImM6QXBwcm92YWxzUGFnZSJ9fSwidCI6MTQ4MTIwMDQyNTQzNn0%3D

I can to hard code this url but I am not sure that this token won`t changed...


text:
Q: Need a regex to validate an custom input I have an input that needs to be validated and I was looking at a way to use a regex to do it.
Input Syntax
add passenger general {passenger-name} add passenger airline
{passenger-name} add passenger loyalty {passenger-name} {current-
loyalty-points} {using-loyalty-points} {has-extra-bag}

Input
add passenger airline Trevor add passenger general Mark add passenger
loyalty Joan 100 FALSE TRUE add passenger general Daniel

Few points

*

*There can be any number of add passenger statements in the input

*Passengers are of 3 types, general or airline or loyalty

*For general passengers it would be add passenger general Mark

*For airline passengers it would be add passenger airline Trevor

*For loyalty passengers it would be add passenger loyalty Joan 100
FALSE TRUE
I had tried the below logic but it does not validate the multiple occurrence of the sentences. Like it validates the first occurrence of add passenger general but will not for any subsequent add passenger general occurrences. Similar for any other type of passengers
String s = "add passenger general Mohit add passenger general ra add
passenger airline rajui";

Pattern pattern = Pattern.compile("((add passenger general) \\D+)*
((add passenger airline) \\D+)*");

Matcher matcher = pattern.matcher(s);
System.out.println(matcher.matches());

A: Here is a regex that will validate the entire input string, or,
if the outter cluster group is taken off, you could get individual add passanger
types. The types are indicated based on if capture group 1, 2, or 3 matched and
is the name.
"(?i)^(?:\\s*add\\s+passenger\\s+(?:general\\s+(\\w+)|airline\\s+(\\w+)|loyalty\\s+(\\w+)\\s+(\\d+)\\s+(TRUE|FALSE)\\s+(TRUE|FALSE)))+\\s*$"
Readable version
 (?i)
 ^
 (?:
      \s* add \s+ passenger \s+
      (?:
           general \s+
           ( \w+ )                       # (1)

        |  airline \s+
           ( \w+ )                       # (2)

        |  loyalty \s+
           ( \w+ )                       # (3)
           \s+
           ( \d+ )                       # (4)
           \s+
           ( TRUE | FALSE )              # (5)
           \s+
           ( TRUE | FALSE )              # (6)
      )
 )+
 \s*
 $

Output
 **  Grp 0 -  ( pos 0 : len 128 )
add passenger airline Trevor add passenger general Mark add passenger
loyalty Joan 100 FALSE TRUE add passenger general Daniel

A: This isn't an answer to your question; rather, it is some advice. Yes, it would be possible to create one or more regular expressions to parse your input. However, given all the requirements, it would end up being fairly complex. Once it was written, any change to your inputs would require modifying those regular expressions.
First, I suggest, if possible, changing your input. Something like JSON would be much easier to create and parse.
Second, sometimes it is easier to start at the beginning of your String and break it down using String.indexOf(), .substring(), etc. This lets you control the logic in a more maintainable manner.


text:
Q: Removing product Link from the product price on content-product.php template I am using the Woocommerce WP plugin. On my Shop page, I would like to remove the link  to the product page from the .
In this article the author is suggesting to alter the  tags in /your-child-theme/woocommerce/content-product.php WooCommerce template, but this is no longer possible in the newest WooCommerce version 2.6+.
I have only found a way to remove the whole link, not just the price-link.
How can I move the link only from the price?
Here it is what i would like:

TITLE

        PRICE

A: Update2 (there where 2 missing ";" in the code, that was doing the 500 error. So you should retry.
Here is an extract from content-product.php template (with solution (1) and (2):
/**
 * woocommerce_after_shop_loop_item_title hook.
 *
 * @hooked woocommerce_template_loop_rating - 5
 * <===  <===  <===  <===  <===  <===  <===  <===  <=== (2) To here
 * @hooked woocommerce_template_loop_price - 10  ====> (1) From here
 */
do_action( 'woocommerce_after_shop_loop_item_title' );

/**
 * woocommerce_after_shop_loop_item hook.
 *
 * @hooked woocommerce_template_loop_product_link_close - 5  ==> (2) From here
 * <===  <===  <===  <===  <===  <===  <===  <===  <===  <=== (1) To here
 * @hooked woocommerce_template_loop_add_to_cart - 10
 */
do_action( 'woocommerce_after_shop_loop_item' );

So there is 2 alternatives to achieve take out the price from :

*

*We are going to try to unhook 'woocommerce_template_loop_price' from one location to another just after 'woocommerce_template_loop_product_link_close' hooked function.

Then you could try to add this code snippet to the function.php file of your active child theme:
add_action('init', function(){
   remove_action('woocommerce_shop_loop_item_title', 'woocommerce_template_loop_price', 10 );
   add_action('woocommerce_after_shop_loop_item', 'woocommerce_template_loop_price', 7);
}

*We are going to try to unhook 'woocommerce_template_loop_product_link_close' from one location to another just before 'woocommerce_template_loop_price' hooked function.

Then you could try to add this code snippet to the function.php file of your active child theme:
add_action('init', function(){
   remove_action('woocommerce_after_shop_loop_item', 'woocommerce_template_loop_product_link_close', 5 );
   add_action('woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_link_close', 7);
}

I haven't test it yet, but this time it should work without error 500.
You can try them also add_action('init', function(){ … } in case.
The final working Solution (chosed by fjott )
remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10 );
add_action('woocommerce_after_shop_loop_item', 'woocommerce_template_loop_price', 7);

A: you can disable the Link to Products @ Loop only adding 2 line code, I have test it into my client store and its working. You need to put that below 2 link code into your child-them functions.php.
remove_action( 'woocommerce_before_shop_loop_item', 'woocommerce_template_loop_product_link_open', 10 );
remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_product_link_close', 5 );


text:
Q: Tosca XML Ressource - more than one control found for action "XML node" Context: I'm trying to automatize the comparison between an XML and data Table
XML structure:
<mtm>
 <mtmGlItemList>
   <mtmGlItem>
   </mtmGlItem>
   <mtmGlItem>
   </mtmGlItem>
</mtmGlItemList>
</mtm>

First step is working, I'm counting the number of lines of my table let's say 2.
I'm buffering this count = 2
Second steps I'm looping on the XML read based on buffer from step 1 with the hope to read the first mtmGlItem and then the second.
I end up with the error message :

mtmGlItem > More than one control found for action mtmGlitem.

I understand that tosca doesn't know which mtmGlitem to read but I don't see how to get rid of this issue.
Any help super appreciated. Thanks in advance.

A: You need to constrain, meaning you need to tell it which item you want to compare. In your case that would be the index. Find more about it here: https://documentation.tricentis.com/en/1200/index.htm#engines_3.0/api/api_tc_lists.htm?Highlight=constrain


text:
Q: Having trouble with creating env variables that take affect while running my server this is my first question here, so although I'll try my best to ask the question correctly, please have patience with me.
I'm trying to run an OCR with Tesseract with Django on my server at some server (pythonanywhere, if it's important in any way), but I keep having this error:
pytesseract.pytesseract.TesseractError: (1, 'Tesseract Open Source OCR Engine v3.04.01 with Leptonica
 Error opening data file /usr/share/tesseract-ocr/tessdata/heb.traineddata Please make sure the
TESSDATA_PREFIX environment variable is set to the parent directory of your "tessdata" directory. Failed
loading language \'heb\' Tesseract couldn\'t load any languages! Could not initialize tesseract.')

So, at first, I thought I could just move the correct "tessdata" file (which exists on my server) into /usr/share/bin... but I couldn't do that without a root user. no matter what I tried in the Bash shell, I don't have access to the root user (although I was never asked to implement one). I cannot use the "sudo" command that I see so often, I guess it's because it's not a valid command in Bash shell (or Unix, I'm not sure how to refer to it). I guess I have a root user named "Orikle", but no matter what, I couldn't manage to find a correct password (tried the pythonanywhere password for my account, and the Django superuser password (yeah, I know it was wishfull-thinking)).
After giving up on that method, I saw that the error mentioned that the TESSDATA_PREFIX environment variable can be set. so then I STFW and found out how to create shell and env variables and indeed I created them, but to no avail. when I enter the console and type printenv I can see
TESSDATA_PREFIX=/home/Orikle/.virtualenvs/myenv/bin/Tesseract-OCR
so that led me to believe that I really managed to make it work, but alas, I keep getting the same error as before.
Just to make clear, I tried the parent directory, I tried the exact directory, and maybe every other directory out there.
Any help would be appreciated. Thanks.

A: Thanks everyone.
It's been a while, but I ended up replacing the heb.traineddata all together and then adding the TESSDATA_PREFIX variable. I wish I was more certain as to what was the problem, but at least I got it to work.


text:
Q: Texmaker portable with Miktex portable I am trying to setup texmaker portable to work with Miktex portable. I found instructions here: http://jimstitzel.com/2010/01/configuring-texmaker-usb-with-miktex-portable/.
Updating of Miktex doesn't seem to work for me since it keeps searching for packages, so I skipped that step since I didn't think it was necessary. Also, I did not add the tikz files and change the ghostscript and r directories etc since I don't use them anyway.
So the only thing I really changed was to change the directories in texmaker to these:

LaTeX: "../MiKTeX/miktex/bin/latex.exe" -interaction=nonstopmode %.tex
PdfLaTeX: "../MiKTeX/miktex/bin/pdflatex.exe" -interaction=nonstopmode %.tex
XeLaTeX: "../MiKTeX/miktex/bin/xelatex.exe" -interaction=nonstopmode %.tex
LuaLaTeX: "../MiKTeX/miktex/bin/lualatex.exe" -interaction=nonstopmode %.tex
Latexmk: "../MiKTeX/miktex/bin/latexmk.exe" -e "$pdflatex=q/pdflatex -interaction=nonstopmode/" -pdf %.tex
Bib(la)tex: "../MiKTeX/miktex/bin/bibtex.exe" %
Makeindex: "../MiKTeX/miktex/bin/makeindex.exe" %.idx
dvips: "../MiKTeX/miktex/bin/dvips.exe" -o %.ps %.dvi
Dvipdfm: "../MiKTeX/miktex/bin/dvipdfm.exe" %.dvi
ps2pdf: "../MiKTeX/miktex/bin/ps2pdf.exe" %.ps
metapost: "../MiKTeX/bin/mpost.exe" --interaction nonstopmode
Dvi Viewer: "../MiKTeX/miktex/bin/yap.exe" -1 -s @%.tex %.dvi

However, whenever I compile I get the error that Texmaker "could not start the command" for pdflatex. What could be the issue here?
Also, on a sidenote, I noticed that whenever I execute texmaker from a different computer, the settings are lost. I know I can save them and load them each time, but is there no way to do this quicker?


text:
Q: What is the purpose of the Recent Tags cloud? What is the thinking behind the Recent Tags cloud feature on the home page? I can't see what value it adds.

A: I expect it's similar to the 'recent badges awarded' section; it gives a sense that 'things are happening on this website'. So in that sense it's a user interface thing, making the website feel more dynamic and exciting. And as Kev says, you might as well do something with that big blank area.
If you're not one of those people who appreciates this sense of busy-bee activity (I'm not either), then both are pointless from a functional perspective.

A: Before we had moderation tools, it was one way to keep an eye on tags that were being created inappropriately.  For example, hyphen vs. no hyphen, abbreviations versus full spelling, or misspellings.  Of course this backfired as well, when we had our share of trolls putting blatantly offensive tags into the system, and they couldn't be easily cleaned from the front page.
Now that we have moderation tools to show us newly created tags only, it's little more than a "Hey look at what we're discussing on this cool site!" bit of marketing, for people browsing to the site for the first time.

A: I'm guessing it's a way to see what tags are hot/most active at a point in time. Can't say I'm a huge fan of tag/category clouds myself, they just seem like a bit of flare to fill up white space. Your mileage may vary of course with regard to them.


text:
Q: Problema al validar archivo - Laravel Estoy intentando validar inputs para generar array de archivos.

FrontEnd

<input type="file" class="form-control-file" id="exampleFormControlFile1" name="archivo[]">

BackEnd

Estoy intentando validar de la siguiente forma.
Lamentablemente no me guarda mi archivo si lo hago así:
foreach($files as $key => $file){
  if($request->hasFile($file)){
  ...
  }
}

Si no hago validación, es decir:
foreach($files as $key => $file){
 ...
}

Me funciona perfectamente, entonces... ¿Como deberia validar esta información?

A: El método hasFile() recibe como parámetro el nombre del atributo que contiene el archivo, en tu caso tu estás pasando una variable. Prueba del siguiente modo:
public function myMethod(Request $request)
{
    if ($request->hasFile('files'))
    {
        $files = $request->file('files');

        foreach($files as $key => $file)
        {
            //   ...
        }
    }
}

Para más información, revisa esta sección de la documentación.


text:
Q: pass value of List i try to show my data using viewmodel, but i have error like this
The model item passed into the dictionary is of type 'System.Collections.Generic.List`1[XNet.Repository.Model.FacilityViewModel]', but this dictionary requires a model item of type 'XNet.Repository.Model.FacilityViewModel'.
how i can solve my problem??
this my code
my service
public List<FacilityViewModel> GetViewHotel(int HotelID)
        {
            List<Hotel> Hotels = (from d in _HotelRepository.All()
                                  where d.HotelID == HotelID
                             select d).ToList();

            List<FacilityViewModel> facilityViewModel = new List<FacilityViewModel>();

            foreach (Hotel hotel in Hotels)
            {
                facilityViewModel.Add(new FacilityViewModel
                {
                    HotelID = HotelID,
                    HotelName = hotel.HotelName,
                    Address1 = hotel.Address1,
                    Address2 = hotel.Address2,
                    HotelDescription = hotel.HotelDescription,
                    HotelInformation = hotel.HotelInformation,
                });
            }

            return facilityViewModel;
        }

my controller
public ActionResult Index()
        {
            //var x = _hotelService.GetByID(_HotelID);
            List<FacilityViewModel> facilityViewModel = _viewService.GetViewHotel(_HotelID);
            return View(facilityViewModel);
        }

my viewmodel
public class FacilityViewModel
    {
        public int HotelID { get; set; }
        public string HotelName { get; set; }
        public string Address1 { get; set; }
        public string Address2 { get; set; }
        public string HotelDescription { get; set; }
        public string HotelInformation { get; set; }

    }

my view
@model XNet.Repository.Model.FacilityViewModel

@{
    ViewBag.Title = "Index";
}

Index

<fieldset>
    <legend></legend>

         @Html.Label("Hotel ID")

        @Html.DisplayFor(model => model.HotelID)

         @Html.Label("Hotel Name")

        @Html.DisplayFor(model => model.HotelName)

         @Html.Label("Address 1")

        @Html.DisplayFor(model => model.Address1)

         @Html.Label("Address 2")

        @Html.DisplayFor(model => model.Address2)

         @Html.Label("Hotel Description")

        @Html.DisplayFor(model => model.HotelDescription)

         @Html.Label("Hotel Information")

        @Html.DisplayFor(model => model.HotelInformation)

</fieldset>

<input style="width:100px;" type="button" title="EditHotelDetail" value="EditDetails"  onclick="location.href='@Url.Action("Edit", "Hotel", new { HotelID = Model.HotelID})'" />

A: The error message says it all.
Your view has the model typed as just the instance of FacilityViewModel while you are returning a List of FacilityViewModel from the action
In your view:
@model XNet.Repository.Model.FacilityViewModel

In your action:
List<FacilityViewModel> facilityViewModel = _viewService.GetViewHotel(_HotelID);
return View(facilityViewModel); //<-- This is a list.

Either
return View(facilityViewModel.First()) //just an example to show a single instance.

or
Modify the code to handle a list in the view.

A: Your declaring you model for the View as:
@model XNet.Repository.Model.FacilityViewModel

Instead of:
@model List<XNet.Repository.Model.FacilityViewModel>

In your controller's action you are returning a List to the View.
Either modify the model to take a List<FacilityViewMOdel> in the View or return a single FacilityViewModel to the View.
return View(facilityViewModel.FirstOrDefault());


text:
Q: Create new columns based on another column value Assuming I have the following toy dataset:
count    orders    books
   1         40       2
   1         60       4
   1         80       6
   2         10       8
   2         30      10
   2         50      12

I want to create new columns by transforming the dataset such that each column only contains orders and books by the count group
This is the output:
   orders_1   orders_2    books_1    books_2
       40           10        2           8
       60           30        4          10
       80           50        6          12

I have attempted to use pivot tables, but the code throws me an error for using the same index as well as columns.

A: Use GroupBy.cumcount for counter, pivot by DataFrame.pivot and last flatten MultiIndex in columns:
df = df.assign(g = df.groupby('count').cumcount()).pivot('g','count')
df.columns = df.columns.map(lambda x: f'{x[0]}_{x[1]}')
print (df)
   orders_1  orders_2  books_1  books_2
g
0        40        10        2        8
1        60        30        4       10
2        80        50        6       12


text:
Q: How to add value to an array on click event What I am trying to achieve is to read value on click event and save it to an array. My code:
Add to favourites

var hotelName = [];
$('.hotel').on('click', function(e){
    e.preventDefault();
    hotelName.push( $(this).data('hotel-name') );
});
console.log(hotelName.length);

The output is always 0. Could someone tell me what am I doing wrong, please?

A: Your logic is fine, you just need to read the length of the array after you modify it in the click handler:
var hotelName = [];
$('.hotel').on('click', function(e){
    e.preventDefault();
    hotelName.push( $(this).data('hotel-name') );
    console.log(hotelName.length); // < read the length of the amended array here
});

Working example


text:
Q: Hive date conversion I intended to extend certain records in a table by adding 366 days to its date keys:
to_date(date_add(from_unixtime(unix_timestamp('20150101' ,'yyyyMMdd'), 'yyyy-MM-dd'), 366)) as new_date

2016-01-01

But how to convert this value back to format of original key i.e. 20160101 ?

A: date_add gives you a date type as output.
As you have already used from_unixtime and unix_timestamp, I'll assume that you are already aware of their functionalities.
In Hive/Impala, there's no native DATE_FORMAT function like MySQL/MariaDB, so you'll have to convert the output of your date_add to unix_timestamp and then use from_unixtime on the output to achieve the desired format.
Something along the lines of:
select
   from_unixtime(unix_timestamp(
   date_add(from_unixtime(unix_timestamp('20150101' ,'yyyyMMdd')), 365)),
   'yyyyMMdd');

A: Since your requested date is 2016-01-01 it seems you want to add 365 days and not 366.
select from_unixtime(unix_timestamp(date_add(from_unixtime(unix_timestamp(
           '20150101','yyyyMMdd')),365),'yyyy-MM-dd'),'yyyyMMdd');

Demo
hive> select from_unixtime(unix_timestamp(date_add(from_unixtime(unix_timestamp(
    >            '20150101','yyyyMMdd')),365),'yyyy-MM-dd'),'yyyyMMdd');
OK
20160101


text:
Q: Filter by multiple conditions / drop-downs using DataTables - Table plug-in for jQuery Using this example from http://www.verticalcoder.com/2014/11/21/datatables-in-visualforce-part-1/ I implemented a Visualforce page that creates a dropdown and filters records in the datatable based on the dropdown value. How would I go about filtering by multiple dropdowns using an "AND" condition. Is that even possible using datatables in jQuery? Everything I've tried so far (Two dropdowns and two-sided multi select lists) have not worked, so any help would be greatly appreciated. Cheers.
<script>
            j$ = jQuery.noConflict();
            j$(document).ready( function () {
                var contactTable = j$('[id$="contacttable"]').DataTable({
                    order: [[2, 'asc']],

                    initComplete: function() {
                        var api = this.api();
                        var select = j$('[id$=accountSelect]');
                        api.column(0).data().unique().sort().each( function ( d, j ) {
                            select.append( '<option value="'+d+'">'+d+'</option>' )
                        } );
                    }
                });

                j$('[id$=accountSelect]').change(function() {
                    var val = j$.fn.dataTable.util.escapeRegex(
                        j$(this).val()
                    );
                    contactTable.column(0)
                        .search( val == 'All' ? '' : '^'+val+'$', true, false )
                        .draw();
                });
            });
        </script>

A: Yes just create two dropdown.
once you int your datatable
just add the script
var table = table =  $('#tableId').DataTable( {});

$('#firstDropdownId').on('change', function () {
        table.columns(6).search( this.value).draw();
} );

$('#SecondDropdownId').on('change', function () {
       table.columns(7).search( this.value).draw();
} );

Here 6, 7 are the column no. of your table Using this you can filter the data.
check out this http://jsfiddle.net/Ratan_Paul/5Lj6peof/1/


text:
Q: Is there a way to call & use a classes type from methods within the class? Vb.Net Hello I will preface this by saying Im previously an asp developer and am learning oop programming/Vb.Net
Im working on a 3 tier architecture and trying to abstract my code as much as possible since I have a very large intranet to convert. In my business layer I am defining my classes with management methods. Below is an example of one of my classes.
My question: Is there a way for me to genericaly refer to the class type and object type so that I dont have to continualy refer to the class name/type "ServiceRequest" throughout the class. For example something like:
"Public Function GetItem(ByVal ID As Integer) As Me.GetType"?

Any info if this is possible and what topic i should research would be appreciated. Feel free to comment on the code in general if im doing something glaringly wrong. Thanks
Public Class ServiceRequest
    Inherits DataUtility

#Region "Properties"
    Public Property ReqID As Integer
    ' Public Property PrjID As Integer
    Public Property EntBy As String
    Public Property EntDate As DateTime
    Public Property ServiceType As String
    Public Property ResponseTime As String
    Public Property ServiceReason As String
    Public Property Comments As String
#End Region

#Region "Public Methods"
    Public Function Save() As Integer
        Return SaveRecord(GetParamsList(Me))
    End Function

    Public Function Delete(ByVal ID As Integer) As Boolean
        Return DeleteRecord(ID)
    End Function

    Public Function GetItem(ByVal ID As Integer) As ServiceRequest
        Dim retVal As ServiceRequest = New ServiceRequest()
        Dim sdr As SqlDataReader = GetRecord(ID)
        While sdr.Read()
            retVal = ParseDataToObj(sdr)
        End While
        Return retVal
    End Function

    Public Function GetList(ByVal ID As Integer) As List(Of ServiceRequest)
        Dim retVal As List(Of ServiceRequest) = New List(Of ServiceRequest)()
        Dim sdr As SqlDataReader = GetRecords(ID)
        While sdr.Read()
            Dim listObj As ServiceRequest = ParseDataToObj(sdr)
            retVal.Add(listObj)
        End While
        Return retVal
    End Function
#End Region

#Region "Helper Methods "
    Private Function GetParamsList(ByVal paramVal As ServiceRequest) As List(Of SqlParameter)
        'Sending Data to SQL Server - Stored Procedures
        Dim retVal As List(Of SqlParameter) = New List(Of SqlParameter)

        With paramVal
            retVal.Add(New SqlParameter("@ReqID", .ReqID))
            'retVal.Add(New SqlParameter("@CusID", .CusID))
            retVal.Add(New SqlParameter("@EntBy", .EntBy))
            retVal.Add(New SqlParameter("@ServiceType", .ServiceType))
            retVal.Add(New SqlParameter("@ResponseTime", .ResponseTime))
            retVal.Add(New SqlParameter("@ServiceReason", .ServiceReason))
            retVal.Add(New SqlParameter("@Comments", .Comments))
        End With
        Return retVal
    End Function

    Private Function ParseDataToObj(ByVal dr As SqlDataReader) As ServiceRequest
        ' Reading data and converts to object
        ' Single vs list - if boolean then get case types list

        Dim returnObjData As New ServiceRequest()
        With returnObjData
            .ReqID = MyBase.GetDataValue(Of Integer)(dr, "ReqID")
            '.CusID = MyBase.GetDataValue(Of Integer)(dr, "CusID")
            .EntBy = MyBase.GetDataValue(Of String)(dr, "EntBy")
            .EntDate = MyBase.GetDataValue(Of DateTime)(dr, "EntDate")
            .ServiceType = MyBase.GetDataValue(Of String)(dr, "ServiceType")
            .ResponseTime = MyBase.GetDataValue(Of String)(dr, "ResponseTime")
            .ServiceReason = MyBase.GetDataValue(Of String)(dr, "ServiceReason")
            .Comments = MyBase.GetDataValue(Of String)(dr, "Comments")
        End With
        Return returnObjData
    End Function
#End Region

End Class

A: If I'm understanding correctly; you might be able to use Generics.
Public Class classHolder(Of T)
    Private someValue As T

    Public Function GetItem(ByVal ID As Integer) As T
        Return someValue
    End Function
End Class

T is whatever type you want it to be.


text:
Q: Setup Eclipse EGit to Push to Windows Share Over SSH I am new to git, and version control in general, and am trying to implement it for my team of three developers. We are the only developers for our agency.
I am trying to make the setup as simple as possible to just get the ball rolling. My plan is that we will use EGIT in Eclipse (Spring Tool Suite), with each person running off a local repository for developing and then pushing to a remote repository on a Windows share. I was planning to use SSH to facilitate push/pull between our work PCs and the Server so that I do not have to do any site setup and it seemed easiest while still having authentication.
I have added EGit to Eclipse on my work PC and followed the process to getting a project shared and having the initial commit on my local repository.
I installed OpenSSH on my Windows 2012R2 server, installed Git on it, and initiated a bare repository inside a folder in the share I wish to use as the remote repository.
Here is my remote repository setup in Eclipse:
URI: ssh://domain\user@server:22/share/git/repositories
Host: server
Repository path: share/git/repositories
Protocol: ssh
Port: 22
Authentication: currently using username and password, will eventually switch to SSH key once I get things working

When I try to run the preview I get the following error:
"Transport Error: Cannot get remote repository refs. 'ssh://domain\user@server:22/share/git/repositories": 'git-upload-pack' is not recognized as an internal or external command, operable program or batch file."

I'd appreciate help and recommendations to getting things going in a basic setup.
Thanks


text:
Q: Erro de "expected expression before 'int'" Estava seguindo este exemplo, mas foi feito no Windows, então foi usado <conio.h>. Quando tento rodar no Linux recebo 2 erros: um em *h=int(tempo);,  que não entendo porquê, e o outro no getch. Como posso substitui-los?
#include <stdio.h>

void horario(float tempo, int *h, int *m)
{
    *h=int(tempo);
    *m=(tempo-*h)*60;
}

int main ()
{
    int hora,minuto;
    char resp;
    float t;

    do
    {
        printf("Digite o horario na forma centesimal: ");
        scanf("%f",&t);
        horario(t,&hora,&minuto);
        printf("Horario: %02d:02%d\n",hora,minuto);
        printf("Quer calcular outro horario? (S/N):");
        resp=getch();
    } while (resp=='S');
    getch();
    return 0;
}

A: Para fazer um "cast" usa o tipo desejado entre parentesis seguido do valor
(int)tempo // cast de tempo para tipo int: correcto
int(tempo) // incorrecto: aparenta ser a chamada da funcao int com argumento tempo

Podes substituir o getch() por getchar() (prototipo em <stdio.h> que ja incluiste).

A: Você tinha dois problemas:

*

*Typecast mal feito.

*getchar em vez de getch
void horario(float tempo, int *h, int *m){
    *h=(int)tempo;
    *m=(tempo-*h)*60;
}

int main(){
    int hora,minuto;
    char resp;
    float t;
    do
    {
        printf("Digite o horario na forma centesimal: ");
        scanf("%f",&t);
        horario(t,&hora,&minuto);
        printf("Horario: %02d:02%d\n",hora,minuto);
        printf("Quer calcular outro horario? (S/N):");
        getchar();
        resp = getchar();
    } while (resp=='S');
    getchar();
    return 0;
}


text:
Q: Coherent intervals in SQL? Consider a simple Diary table:
 Date   Mood
 ----   ----
 1      Good
 2      Good
 3      Good
 4      Bad
 5      Bad
 6      Good

I am interested in the mood intervals, so that I would get a result like:
 Mood   BeginDate   EndDate
 ----   ---------   -------
 Good   1           3
 Bad    4           5
 Good   6           6

Is that possible in SQL without using iteration?

A: If you subtracts a sequence number from the days that starts for each mood, you will get a constant when the values are adjacent:
 Date   Mood    Seqnum
 1      Good       1
 2      Good       2
 3      Good       3
 4      Bad        1
 5      Bad        2
 6      Good       4

Then you can use aggregation to do what you want.  If date is really a number:
select mood, min(date), max(date)
from (select t.*,
             row_number() over (partition by mood order by date) as seqnum
      from t
     ) t
group by mood, (date - seqnum);

If date is really a date:
select mood, min(date), max(date)
from (select t.*,
             row_number() over (partition by mood order by date) as seqnum
      from t
     ) t
group by mood, dateadd(day, - seqnum, date)

A: In response to this comment in Gordon Linoff's answer:

If date is really a number:

What if it's not? You still have a way forward, with one tiny tweak.
WITH d AS (
    SELECT * FROM (VALUES
        (cast('2021-04-22 00:00' as datetime2(0)), 'Good'),
        (cast('2021-04-22 00:05' as datetime2(0)), 'Good'),
        (cast('2021-04-22 00:07' as datetime2(0)), 'Good'),
        (cast('2021-04-22 00:10' as datetime2(0)), 'Bad'),
        (cast('2021-04-22 00:25' as datetime2(0)), 'Bad'),
        (cast('2021-04-22 01:43' as datetime2(0)), 'Good')
    ) AS x([date], mood)
), t AS (
    SELECT *,
        ROW_NUMBER() OVER (ORDER BY [date]) AS a,
        ROW_NUMBER() OVER (PARTITION BY mood ORDER BY [date]) AS seqnum
    FROM d
)
select mood, min(date), max(date)
from t
group by mood, a - seqnum
order by min(date)

Breaking it down, the first cte is just your data, but now with a datetime column instead of an integer for date. Note, the intervals between successive rows is not constant (it can be, but I did it that way to show that it needn't be). From there, we're calculating two values with the row_number() function - one enumerates over the entire set and the other partitioned by mood.  The rest is the same (in spirit) as Gordon's answer.


text:
Q: Two While Loops in one html table I have two SQL tables:

*

*News

*Editors

In News table, I have 2 colums (News_Added and News_Updated). I am entering Editor IDs to these columns and joining them to Editors table's Ed_ID to get Editor names.
Since I have 2 while queries I have to use 2 while loops, but in 1 html table. I don't know how to solve this problem. Any help?
echo '

News ID	Title	Added By	Last Edit By	Action</th
';

$query = mysql_query("SELECT * FROM N1News AS N1
LEFT JOIN A1Editors AS A1 ON N1.N1_Addedby=A1.Ed_ID WHERE N1_Co=$Ed_Co ORDER BY N1_ID LIMIT $show,$limit");
    while($row = mysql_fetch_array($query)){
    echo '
'.$row["N1_ID"].'	'.$row["N1_Title"].'
    	'.$row["Ed_Name"].'	';
}
$query7 = mysql_query("SELECT * FROM N1News AS N1
LEFT JOIN A1Editors AS A1 ON N1.N1_Lastedit=A1.Ed_ID WHERE N1_Co=$Ed_Co ORDER BY N1_ID LIMIT $show,$limit");
    while($row7 = mysql_fetch_array($query7)){
    echo ''.$row7["Ed_Name"].'	';
    }

A: There are probably more efficient ways to combine your two queries, but a quick solution would be to use UNION:
$query = "(SELECT * FROM N1News AS N1
            LEFT JOIN A1Editors AS A1 ON N1.N1_Addedby=A1.Ed_ID WHERE N1_Co=$Ed_Co ORDER BY N1_ID LIMIT $show,$limit)
          UNION
          (SELECT * FROM N1News AS N2
            LEFT JOIN A1Editors AS A2 ON N2.N1_Lastedit=A2.Ed_ID WHERE N1_Co=$Ed_Co ORDER BY N1_ID LIMIT $show,$limit)
          ORDER BY N1.N1_ID

That way you have al results in one array, making it easy to generate your table.
By the way, the mysql_* functions are deprecated and you should really switch to prepared statements in PDO or mysqli

A: The solution here is to create a query that retrieves all information at once, like so
SELECT N1.*, A1.ED_name addedby_name, A2.ED_name lasteditor_name FROM N1News AS N1
INNER JOIN A1Editors AS A1 ON N1.N1_Addedby=A1.Ed_ID
LEFT JOIN A1Editors AS A2 ON N1.N1_Lastedit=A2.Ed_ID
WHERE N1_Co=$Ed_Co
ORDER BY N1_ID
LIMIT $show,$limit

Note that this query assumes that each news item references an AddedBy editor. A reference to LastEdit is optional in this query.

A: You can place second query into first while.
<?php
$query = mysql_query("SELECT * FROM N1News AS N1
LEFT JOIN A1Editors AS A1 ON N1.N1_Addedby=A1.Ed_ID WHERE N1_Co=$Ed_Co ORDER BY N1_ID LIMIT $show,$limit");
while($row = mysql_fetch_array($query)){
echo '
'.$row["N1_ID"].'	'.$row["N1_Title"].'
    	'.$row["Ed_Name"].'	';
    // call second query //
    $newsid = $row["N1_ID"];

    $query7 = mysql_query("SELECT * FROM N1News AS N1
    LEFT JOIN A1Editors AS A1 ON N1.N1_Lastedit=A1.Ed_ID WHERE N1_ID = ".$newsid." AND N1_Co=$Ed_Co ORDER BY N1_ID LIMIT $show,$limit");

    if($row7 = mysql_fetch_array($query7)){
    echo ''.$row7["Ed_Name"].'	';
    }
    /////////////////////

    }

?>


text:
Q: TSQL Convert DateTime & Timezone Offset (in Minutes) to another Time Zone In my SQL Server 2008 R2 database, I have a LastHWScan column (datetime) and a TimzoneOffset column (int).
The LastHWScan column stores the datetime that is local to the workstation being scanned. The TimezoneOffset column stores the timezone offset as either a positive or negative number of minutes. Dallas is -300, Bucharest is 180.
How can I, in a SQL query, convert these datetime from various timezones to Dallas time?
Would it be easier to convert everything to UTC and then convert it to Dallas time?

A:
In my SQL Server 2008 R2 database, I have a LastHWScan field (datetime) and a TimzoneOffset field (int).

That's fine, though you might also consider that SQL Server has a datetimeoffset field which can combine these into a single type.
Or, if the time zone offset is unimportant to your scenario, you might consider storing just the equivalent UTC value in a datetime or datetime2 field.

The LastHWScan field stores the datetime that is local to the workstation being scanned. The TimezoneOffset field stores the timezone offset as either a positive or negative number of minutes. Dallas is -300, Bucharest is 180.

Be careful here.  The offset should be aligned to the specific date and time.  Dallas may be -300 (UTC-5) in the summer when DST is in effect, but most of the year it's -360 (UTC-6).  Likewise, Bucharest alternates between 180 (UTC+3) and 120 (UTC+2).
Do not detach the offset from the date/time, or assume that the offset for one location and date/time is valid for all possible other date/time values within that location.

How can I, in a SQL query, convert these datetimes from various timezones to Dallas time?

That's difficult to do in SQL, because you have to account for the daylight saving time rules of Dallas.  Other DBs have functions like CONVERT_TZ, but SQL Server doesn't have anything like that built in.  You can write your own functions, or you might consider my SQL Server Time Zone Support project.

Would it be easier to convert everything to UTC and then convert it to Dallas time?

"Easier" is subjective.  Many people prefer storing values in UTC.  Storing them in a datetimeoffset (or in two fields like you have done) is fine - and it's preferable when the local time is important in the context of the application domain (See DateTime vs DateTimeOffset).  The only thing that you shouldn't do is drop the offset and store only local time.
Even if you did convert to UTC, that wouldn't help with the conversion.  Though you've properly identified a specific instant in time, you still have to account for time zone rules of the destination time zone.  If you only need US Central time, you might consider hardcoding the transition rules and offsets into a UDF or stored proc.  Otherwise, use my time zone integration project with the "America/Chicago" time zone id.
Example:
SELECT Tzdb.UtcToLocal(dateadd(mi, -offset, localdatetime), 'America/Chicago')

Note the negation of the offset to convert from local back to UTC before calling the custom UDF.


text:
Q: C++ assign element of a string to a new string Im trying to assign a piece of a string, to a new string variable. Now Im pretty new so longer, but easier to understand explanations are the best for me. Anyways, how Im trying to do it is like this:
string test = "384239572";
string u = test[4];

The full code of what im trying to do is this:
#include <iostream>
#include <string>
#include <sstream>
using namespace std;

int main()
{
string test = "384239572";
string u = test[4];
int i = 0;
istringstream sin(u);
sin >> i;
cout << i << endl;
return 0;
}

Though it seems to complain at the upper part that I put up there. So how can I take a small part of a string from a string, and assign it to a new string? Thanks a lot in advance! If you know any good links or anything about this, that would be appreciated too!

A: use substring,
#include <iostream>
#include <string>
#include <sstream>
using namespace std;

int main()
{
    string test = "384239572";
    string u = test.substr(4,1);
    cout << u << endl;
    return 0;
}

A: You can use one of the string constructors
string u(1,test[4]);

EDIT:  The 1 indicates the number of times to repeat the character test[4]
In your code you are trying to assign a char to a string object.

A: The string class has a method substr() that would be useful here:
// Substring consisting of 1 character starting at 0-based index 4
string u = test.substr(4, 1);

This generalizes nicely to substrings of any length.


text:
Q: Hadoop Job finishes at map 0% reduce 0% I am trying to learn hadoop. It installed fine on my system. Its located at /usr/local/hadoop and I'm using jdk1.7.0_45 java.
Whenever I try to run the famous wordcount example, it produces the following output:
/usr/local/hadoop $ bin/hadoop jar hadoop-examples-1.0.4.jar wordcount /user/hduser/gutenberg /user/hduser/gutenberg-output
Warning: $HADOOP_HOME is deprecated.

13/10/31 20:03:24 INFO input.FileInputFormat: Total input paths to process : 3
13/10/31 20:03:24 INFO util.NativeCodeLoader: Loaded the native-hadoop library
13/10/31 20:03:24 WARN snappy.LoadSnappy: Snappy native library not loaded
13/10/31 20:03:24 INFO mapred.JobClient: Running job: job_201310311657_0006
13/10/31 20:03:25 INFO mapred.JobClient:  map 0% reduce 0%
13/10/31 20:03:25 INFO mapred.JobClient: Job complete: job_201310311657_0006
13/10/31 20:03:25 INFO mapred.JobClient: Counters: 0

Any ideas what I'm doing wrong? There's nothing desired in the output folder as it should.

A: replace the "HADOOP_HOME" variable with "HADOOP_PREFIX" variable in your .bashrc file

A: You need to open
jobtracker(http://localhost:50030/jobtracker.jsp) -> completed job : job_201310311657_0006 -> It will get you to the job details.
Click on Failed Map attempts . (number under Failed Map)-> click on taskId -> Logs
there you be be able to see the full stack-trace .
Figure out it out .
The job launched the map task are given, so there may be some prob with the i/p file.(guess)
Paste the Log of job for more help .


text:
Q: Price rules in Prestashop based on time I want to automatically reduce the prices on fixed time intervals. For example, all products older than 2 weeks get 30% off, after 3 weeks, 40% etc. I don't think I could do that using the built-in price rules module. Suggestions?

A: You can create a script in the PrestaShop root folder that checks when the products were created (date_add field in the ps_product table) and reduce their price (price field in the ps_product table) if they are x weeks old. It would look something like this:
include(dirname(__FILE__) . 'config/config.inc.php');
$db = Db::getInstance();
$discount = .3;
$weeksOld = 2;
$sql = "UPDATE ps_product SET price = price * (1 - $discount) WHERE DATE(date_add) = DATE_SUB(CURDATE(), INTERVAL $weeksOld WEEK)";
$db->execute($sql);

Then you should configure a cron job to run it once a day.


text:
Q: Represent function as Maclaurin series and find its radius of convergence $x^2\ln(4+x^2) $ Represent function as Maclaurin series and find its radius of convergence:
$$x^2\ln(4+x^2) $$

I tried to use an already known Maclaurin series for $\ln(1+x) = \displaystyle \sum_{n=1}^{\infty} (-1)^{n+1}\frac{x^n}{n}$ :
$\displaystyle x^2\ln(4+x^2) = x^2 \ln(4(1+x^2/4)) = x^2\cdot(\ln 4 + \ln(1+x^2/4)) = x^2\ln4 + \sum_{n=1}^{\infty}(-1)^{n+1} \frac{(x^2)^{n+1}}{4^n\cdot n}$
But now since there is $x^2\ln4$ it doesn't seem to be a Maclaurin series. What can I do with it?


text:
Q: After updating to 1.9.3 images in fronted not loading from cache Upgraded Magento from 1.8.0.1 to latest 1.9.3. and all seemed to be fine. The image uploader was broken but managed to fix that by reading the files for the older flash uploader. So basically can add images to products and it works. However, there is some problem with the cache and images on frontend is slowly disappearing. They are loaded from media/catalog/product/cache/etc... but the image is not there. Seems as the caching of images is broken or something. Found several threads on the subject but none with this particular issue. Any ideas how to solve it?
EDIT: Some new info. Also upgraded php on the server from 5.4 to 5.6 and it seems as magento is rebuilding cache fine but only for png images. My assumption is that php_gd is not set to work with jpg. How do activate that?

A: I think this should be solved by clearing the image cache so Magento builds it up again, you can do this in Cache Management:

A: Please click on flush cache and before that make sure your memory limit is at least 512M


text:
Q: How do you use math.random to generate random ints? How do you use Math.random to generate random ints?
My code is:
int abc= (Math.random()*100);
System.out.println(abc);

All it prints out is 0, how can I fix this?

A: Cast abc to an integer.
(int)(Math.random()*100);

A: For your code to compile you need to cast the result to an int.
int abc = (int) (Math.random() * 100);

However, if you instead use the java.util.Random class it has built in method for you
Random random = new Random();
int abc = random.nextInt(100);

A: As an alternative, if there's not a specific reason to use Math.random(), use Random.nextInt():
import java.util.Random;

Random rnd = new Random();
int abc = rnd.nextInt(100); // +1 if you want 1-100, otherwise will be 0-99.

A: int abc= (Math.random()*100);//  wrong

you wil get below error message

Exception in thread "main" java.lang.Error: Unresolved compilation
  problem:      Type mismatch: cannot convert from double to int

int abc= (int) (Math.random()*100);// add "(int)" data type

,known as type casting
if the true result is
int abc= (int) (Math.random()*1)=0.027475

Then you will get output as "0" because it is a integer data type.
int abc= (int) (Math.random()*100)=0.02745

output:2   because (100*0.02745=2.7456...etc)

A: you are importing java.util package. That's why its giving error. there is a random() in java.util package too. Please remove the import statement importing java.util package. then your program will use random() method for java.lang by default and then your program will work. remember to cast it i.e
int x = (int)(Math.random()*100);

A: double  i = 2+Math.random()*100;
int j = (int)i;
System.out.print(j);

A: You can also use this way for getting random number between 1 and 100 as:
SecureRandom src=new SecureRandom();
int random=1 + src.nextInt(100);


text:
Q: Windows Media Encoder - Audio Codecs When encoding and streaming audio with Windows Media Encoder 9 (with WMA 10 Professional codecs installed), there seems to be a minimum audio latency of ~2 seconds, even when using the Low Delay CBR configurations.
Are there any codecs out there that can be installed into Windows Media Encoder and that would encode to mp4a with a reduced latency?  Or are there other WME settings that can be changed to accomplish this?  VLC seems to be able to encode to mp4a with a 1.5 sec delay.


text:
Q: How to Post data from external HTML form to Eloqua Form using cURL I want to post data from an external HTML form to a simple form created in Eloqua, using cURL method. I tried to follow this documentation but I am not able to post data to Eloqua.
When I try from command line (Windows) -

curl --user "usercreds" --header "Content-Type: application/json" --request POST --data "{"testfirstname":"abc","testlastname":"def","singleCheckbox":1}" https://secure.p0{POD Number}.eloqua.com/api/REST/1.0/data/form/{formid}

I get below error:

[{"type":"ObjectValidationError","property":"fieldValues","requirement":{"type":"NoDuplicatesRequirement"},"value":""}]

When I try from PHP, as mentioned here https://www.eehelp.com/question/using-curl-to-repost-to-eloqua-data/
or https://github.com/fredsakr/eloqua-php-request the curl returns HTTP code 0.
This is a simple form created in Eloqua without any validations.
I do not know what I am doing wrong here.


text:
Q: Triggering a UITextField unwind segue by pressing Return: Why/How does this work? In my current project I discovered that I could add an unwind segue to a UITextField and trigger the segue by pressing the return key if I also added an action to handle the didEndOnExit event. If the didEndOnExit handler is not connected to the event then the segue is not triggered.
I would like to understand this behavior. My interest stems from that there might be something for me to learn about how segues operate. On the other hand, the behavior might just be unique to UITextFields.
This simple GitHub project demonstrates the behavior.
Thank you for your attention.

A: You have done a very unusual thing: you've attached a triggered segue to a text field, as its action segue. So the question is simply: what does that mean? In particular, what triggers a triggered segue attached to a text field? What is the "action" of a text field?
I mean, we know what triggers a triggered segue attached to a button: it's that the user taps the button. And we know what triggers a triggered segue attached to a table view cell: it's that the user selects the cell. But what about a text field? What must the user do to trigger its action segue?
The "unwind" business is a red herring, so let's eliminate it from our thinking. Delete the text field from the second view controller and put it in the first view controller. Hook the text field's action segue as a modal segue to the second view controller.
Now contemplate the text field in the first view controller. It behaves as you have described:

*

*If we click in the text field and type and hit return, nothing happens.

*If we add Did End On Exit to the text field and type and hit return, the keyboard is dismissed and we segue.
Well, think about that phrase "nothing happens" in the first bullet point. The keyboard is not dismissed! But dismissal of the keyboard is the text field's "action". There was no action. So there is no triggering of the action segue.
Now try this experiment: make the view controller the text field's delegate, and implement this method:
extension ViewController : UITextFieldDelegate {
    func textFieldShouldReturn(_ textField: UITextField) -> Bool {
        textField.resignFirstResponder()
        return true
    }
}

Type in the text field and hit Return. The keyboard is dismissed and we segue to the next view controller. Dismissing the keyboard in response the Return key is the text field's action.
So you see, in a sense, both the unwind segue and the DidEndOnExit were red herrings, since I just accomplished the same thing without either of those. What matter is what the text field's Action is, and the triggering of its Action Segue in response.


text:
Q: detach screen session I have an attached screen session where I am running some jobs. I closed its terminal without detaching it because it does not respond suddently. Now by screen -ls I can see it is still attached. But I cannot reattach it without detaching it first, however detaching it takes a very long time and still is not finished yet.
  bash-3.2$ screen -ls
  There are screens on:
   14493.ssh2others (Attached)
  1 Socket in /tmp/uscreens/S-tim.

  bash-3.2$ screen -r 14493
  There is a screen on:
   14493.ssh2others (Attached)
  There is no screen to be resumed matching 14493.
  bash-3.2$ screen -d 14493

I wonder why it takes so long and is not finished detaching yet?
Since my jobs are running in the screen session, I am afraid killing it will kill my jobs as well. So what can I do to detach and reattach it now?
Thanks!

A: In some cases, your previous screen session may not have detached properly when you lost your connection for example. If this happens, you can still detach your session manually.
To see your existing screen sessions, enter:
screen -list

To detach an attached screen, enter:
screen -D

If you have more than one attached screen, you can specify a particular screen to detach. For example:
screen -D 14493.ssh2others

Once you've done this, you can resume the screen by entering the screen -r command.


text:
Q: Aptana Folding/Collapsing javascript code I need to be able to fold/collapse various code fragments throughout my javascript, kind of like #region #endregion in C#.  I can't find a way to do this, any help?

A: Window menu -> select Preferences -> expand Aptana -> expand Editors -> expand JavaScript -> select Folding.


text:
Q: Clear form and redirect back to index I have a form which takes input and enters it into the database. This is fine and working perfectly, except I have run into an issue with clearing the form. In Wamp it merely takes me to contactForm.php, which is a blank page. I have been trying to find a way of redirecting the user back to index.php and clearing the form. From searching around I have tried a couple of things (perhaps incorrectly) including putting this at the end of my php:
header('Location: http://stackoverflow.com');

and I also tried to write a JS function to do it

<input type="submit" name="submit" value="Submit" onclick="clearForm();">

js
function clearForm(){
    alert("Thanks, we will be in touch shortly");
    document.getElementById("contactForm").reset();
}

A: function clearForm(){
      alert("Thanks, we will be in touch shortly");
      window.location=ur_url_here;
}

When you got redirect form will automatically reset

A: function clearForm(){
      alert("Thanks, we will be in touch shortly");
      window.location='http://stackoverflow.com';
}

There is no need to clear the form specifically, unless you are using some other element to save the details the form will be forgotten when you move to a new page.

A: function clearForm() {
    alert("Thanks, we will be in touch shortly");
    window.location='http://stackoverflow.com';
}


text:
Q: Copy build artifacts from insider docker to host This is my jenkinsfile:
   pipeline {
    agent any
    stages {
        stage('Build') {
            steps {
                echo '####################################################
                echo 'Building Docker container'
                echo '####################################################

                script {
                    sh 'docker build -t my-gcc:1.0 .'
                }
            }
        }
        stage('Run') {
            steps {
                echo '##########################################################
                echo 'Running Docker Image'
                echo '##########################################################
                script {
                    sh 'docker run  --privileged -i my-gcc:1.0'
                    sh 'docker cp my-gcc:1.0:/usr/src/myCppProject/build/*.hex .'
                }
            }
        }
        stage('Program') {
            steps {
                echo '#######################################################
                echo 'Programming target '
                echo '#######################################################

                script {
                    sh 'openocd -d0 -f board/st_nucleo_f4.cfg -c "init;targets;halt;flash write_image erase Testbench.hex;shutdown"'
                }
            }
        }
    }
}

the docker image is build and then run, after this I would like to extract the hex file form the container to the jenkins working directory so that I can flash it to the board.
But when I try to copy the file I get this error:
+ docker cp my-gcc:1.0:1.0:/usr/src/myCppProject/build/*.hex .
Error: No such container:path: my-gcc:1.0:1.0:/usr/src/myCppProject/build/*.hex

I tried to access other folders in the container and copy the content, but always the same error. This way it seems that I cannot access any folder or file in the container.
What am I doing wrong?
Regards
Martin

A: Jenkins has some standard support for Docker; this is described in Using Docker with Pipeline in the Jenkins documentation.  In particular, Jenkins knows how to use a Docker image that contains just tools, combined with the project's workspace directory.  I'd use that support instead of trying to script docker cp.
That might look roughly like so:
pipeline {
  agent none
  stages {
    stage('Build') {
      // Jenkins will run `docker build` for you
      agent { dockerfile { args '--privileged' } }
      steps {
        // The current working directory is bind-mounted into the container;
        // the image's `ENTRYPOINT`/`CMD` is ignored.
        // Copy the file out of the container:
        sh "cp /usr/src/myCppProject/build/*.hex ."
      }
    }
    stage('Program') {
      agent any // so not in Docker
      steps {
        sh 'openocd -d0 -f board/st_nucleo_f4.cfg -c "init;targets;halt;flash write_image erase Testbench.hex;shutdown"'
      }
    }
  }
}

If you use this approach, also consider whether you should run the main build sequence via Jenkins pipeline steps, or a sh invocation that runs a shell script, or a Makefile, or if a Dockerfile is actually right.  It might make sense to build a Docker image out of your customized compiler, but then use the Jenkins pipeline support to build the image for the target board rather than trying to do it all in a Dockerfile.
In the invocation you show, you can't directly docker cp a file out of an image.  When you start the container, use docker run --name to give it a name, then docker cp from that container name.
sh 'docker run --name builder ... my-gcc:1.0'
sh 'docker cp builder:/usr/src/myCppProject/build/*.hex .'
sh 'docker rm builder'


text:
Q: search an user input throughout an article For some reason, I can't return how many times an user input appears in an article.  Here is my code
infile = open ("the path to the file...blah blah")
count = 0
for line in infile:
    user = input("please enter a search term or click x to exist: " )
    if user in line:
        count = count + 1
        print("your input appears",count "times")
else:
    print("invalid")

infile.close()

A: Your above program is wrong for a number of reasons. First, as it was mentioned in the comments, you have to have a comma after count in print or make it str(count) and add to the string when printing. Also logically your program is wrong as your count variable is appended only once before printing the output per line. What you need is to print it after the total count is taken.
Try this simple solution.
infile = open ("your_file")
count = 0
lines = infile.readlines()
lines = [line.strip().split() for line in lines]
user = input("please enter a search term or click x to exist: " )

for line in lines:
    if user in line:
        count += line.count(user)

print("your input appears " + str(count) + " times")

infile.close()

This should work for your scenario.


text:
Q: Overlapping LAS tiles and edge artifacts I've read the Overlapping LAS tiles post, but it doesn't pertain to the following situation.
I'm trying to process a las catalog where I clip the catalog at specific plot locations with a 30 m radius.

As a result of the 30 m radius, the clipped tiles overlap and I see edge artifacts in the output (as indicated might happen in the readLAScatalog warning).

Is it possible to process these tiles as a catalog without edge artifacts?
Or will I need to read each file individually using readLAS?
I've tried processing the catalog sequentially, but the output still has edge effects.

A: Your case is covered in the book in this section. The idea here is that your files are no longer a wall-to-wall coverage of a territory. The LAScatalog engine is designed to process las files that encompass a territory where each files is spatially related to its neighbourhood.
In your case the files are independent. You basically want to loop through each file. In this case you can put this information in the catalog
opt_independent_files(ctg) <- TRUE

Each file will be processed independently, without buffer. This is equivalent to a regular loop (but with parallel capabilities and real time monitoring).
In addition depending of what you are doing you may want to avoid final merging
opt_merge(ctg) = FALSE


text:
Q: Java Swing - How to draw new lines in a canvas and adding them to the existing lines? I've made a map over Copenhagen in Java Swing, but I would like to be able to draw new lines to the map, and then afterwards add them to the existing line, that I get in from my buffered reader. I have tried adding the new drawn lines to an arraylist of temporary lines, but that does not seem to work - I am simply not able to draw on the canvas anymore. Can anyone help out?
public class Model extends Observable implements Iterable<Line2D>, Serializable {
    private List<Line2D> lines;
    private List<Line2D> tmpLines;

    public Model() {
        lines = new ArrayList<>();
        tmpLines = new ArrayList<>();
    }

    public Model(String filename) {
        readFromFile(filename);
    }

    public void add(Line2D line) {
        lines.add(line);
        dirty();
    }

    public void dirty() {
        setChanged();
        notifyObservers();
    }

    public void readFromFile(String filename) {
        lines = new ArrayList<>();
        tmpLines = new ArrayList<>();
        try {
            BufferedReader b = new BufferedReader(new FileReader(filename));
            for (String line = b.readLine(); line != null; line = b.readLine() ) {
                String[] tokens = line.split(" ");
                if (tokens[0].equals("LINE")) {
                    double x1 = Double.parseDouble(tokens[1]);
                    double y1 = Double.parseDouble(tokens[2]);
                    double x2 = Double.parseDouble(tokens[3]);
                    double y2 = Double.parseDouble(tokens[4]);
                    lines.add(new Line2D.Double(x1, y1, x2, y2));
                }

            }

        }
        catch (FileNotFoundException e) {
            e.printStackTrace();
        }
        catch (IOException e) {
            e.printStackTrace();
        }
    }

    /**
     * Returns an iterator over elements of type {@code T}.
     *
     * @return an Iterator.
     */
    @Override
    public Iterator<Line2D> iterator() {
        return lines.iterator();
    }

    public Line2D removeLastFromTmpLines() {
        Line2D line = tmpLines.remove(tmpLines.size() - 1);
        dirty();
        return line;
    }

    public Line2D removeLastFromLines() {
        Line2D line = lines.remove(lines.size() - 1);
        dirty();
        return line;
    }

    public void addTmpLinesToLines() {
        lines.addAll(tmpLines);
        dirty();
    }

    public void addToTmpLines(Line2D line2D) {
        tmpLines.add(line2D);
        dirty();
    }

    public List<Line2D> getTmpLines() {
        return tmpLines;
    }
}
public class MouseController extends MouseAdapter {
    private Model model;
    private CanvasView canvas;
    private Point2D lastMousePosition;

    public MouseController(CanvasView c, Model m) {
        canvas = c;
        model = m;

        canvas.addMouseListener(this);
        canvas.addMouseWheelListener(this);
        canvas.addMouseMotionListener(this);
    }

    @Override
    public void mouseDragged(MouseEvent e) {
        Point2D currentMousePosition = e.getPoint();
        if (canvas.inDrawingMode()) {
            Point2D origin = model.removeLastFromTmpLines().getP1();
            model.addToTmpLines(new Line2D.Double(origin, canvas.toModelCoords(currentMousePosition)));
        }
        else {
            double dx = currentMousePosition.getX() - lastMousePosition.getX();
            double dy = currentMousePosition.getY() - lastMousePosition.getY();
            canvas.pan(dx, dy);
        }
        lastMousePosition = currentMousePosition;
    }

    @Override
    public void mousePressed(MouseEvent e) {
       lastMousePosition = e.getPoint();
       if (canvas.inDrawingMode()) {
           model.addToTmpLines(new Line2D.Double(
               canvas.toModelCoords(lastMousePosition),
               canvas.toModelCoords(lastMousePosition)));
       }
    }

    public void mouseMoved(MouseEvent e) {
        Point2D modelCoords = canvas.toModelCoords(e.getPoint());
        //System.out.println("Screen: [" + e.getX() + ", " + e.getY() + "], "+"Model: [" + modelCoords.getX() + ", " + modelCoords.getY() + "]");
    }

    @Override
    public void mouseWheelMoved(MouseWheelEvent e) {
        double factor = pow(1.1, e.getWheelRotation());
        canvas.zoom(factor, -e.getX(), -e.getY());
    }
}

A: to be honest, I don't understand very well the code because I don't see the paint method, so I don't see what you do with the arrays. I suppouse that you add lines in the Lists and return them to the paint method using the iterator method.
I suppouse that you add a DOT, not a line, when the mouse button is pressed here:
model.addToTmpLines(new Line2D.Double(
               canvas.toModelCoords(lastMousePosition),
               canvas.toModelCoords(lastMousePosition)));

A DOT because the coordinates are the same. Then, when the mouse is dragged you remove the last line (DOT) and add a new line from the starting coordinate of the dot to the actual mouse position. Is it right? But, when do you pass the line from the tmp list to the real list? Wouldn't you need a mouseReleased method to pass the lines from the tmp list to the real list? And the iterator method returns only the List lines, so I suppouse that the last line, the line being dragged, isn't painted because the actual new line is in the tmpLines list and is not returned.
But I think tht I'm not seeing the whole picture, so my comment could be unuseful...


text:
Q: IIS 7 - Multiple bindings on one website, redirecting to separate virtual directories Is there any way of adding multiple bindings to the same website, and have each binding redirect to a different virtual directory on that same website?
E.g. http://application1.some.thing redirecting to application1.some.thing/application1 and http://application2.some.thing redirecting to http://application2.some.thing/application2


text:
Q: creating MLP in python showing error Iam a newbie in neural networks while creating MLP in python using opencv 3.1.0 error pops.The code is
    import cv2
    import numpy as np
    import glob
print 'Loading training data...'
e0 = cv2.getTickCount()

# load training data
image_array = np.zeros((1, 38400))
label_array = np.zeros((1, 4), 'float')
training_data = glob.glob('training_data/*.npz')

for single_npz in training_data:
with np.load(single_npz) as data:
    print data.files
    train_temp = data['train']
    train_labels_temp = data['train_labels']
    print train_temp.shape
    print train_labels_temp.shape
image_array = np.vstack((image_array, train_temp))
label_array = np.vstack((label_array, train_labels_temp))

train = image_array[1:, :]
train_labels = label_array[1:, :]
print train.shape
print train_labels.shape

e00 = cv2.getTickCount()
time0 = (e00 - e0)/ cv2.getTickFrequency()
print 'Loading image duration:', time0

# set start time
e1 = cv2.getTickCount()

# create MLP
layer_sizes = np.int32([38400, 32, 4])
model = cv2.ml.ANN_MLP_create()
model.create(layer_sizes)
criteria = (cv2.TERM_CRITERIA_COUNT | cv2.TERM_CRITERIA_EPS, 500, 0.0001)
criteria2 = (cv2.TERM_CRITERIA_COUNT, 100, 0.001)
params = dict(term_crit = criteria,
           train_method = cv2.ml.ANN_MLP_BACKPROP,
           bp_dw_scale = 0.001,
           bp_moment_scale = 0.0 )

print 'Training MLP ...'
num_iter = model.train(train, train_labels,  params = params )

# set end time
e2 = cv2.getTickCount()
time = (e2 - e1)/cv2.getTickFrequency()
print 'Training duration:', time

# save param
model.save('mlp_xml/mlp.xml')

print 'Ran for %d iterations' % num_iter

ret, resp = model.predict(train)
prediction = resp.argmax(-1)
  print 'Prediction:', prediction
  true_labels = train_labels.argmax(-1)
  print 'True labels:', true_labels

  print 'Testing...'
  train_rate = np.mean(prediction == true_labels)
  print 'Train rate: %f:' % (train_rate*100)

this is the error
       AttributeError: 'cv2.ml_ANN_MLP' object has no attribute 'create'

A: Based on this code sample, I would suggest setting the number of layers as follows:
model.setLayerSizes(layer_sizes)

You can also have a look at the Learning OpenCV 3 book.
I can't seem to be able to find a proper complete doc at the minute, but for the record here's what dir(model) gives:

*

*calcError

*clear

*empty

*getBackpropMomentumScale

*getBackpropWeightScale

*getDefaultName

*getLayerSizes

*getRpropDW0

*getRpropDWMax

*getRpropDWMin

*getRpropDWMinus

*getRpropDWPlus

*getTermCriteria

*getTrainMethod

*getVarCount

*getWeights

*isClassifier

*isTrained

*predict

*save

*setActivationFunction

*setBackpropMomentumScale

*setBackpropWeightScale

*setLayerSizes

*setRpropDW0

*setRpropDWMax

*setRpropDWMin

*setRpropDWMinus

*setRpropDWPlus

*setTermCriteria

*setTrainMethod

*train


text:
Q: Is composition with Funcs preferable to inheritance to change behaviour in a single function? I am working on creating an IronPython console similar to the IronPythonConsole project provided with the IronPython source code. However, I want to make the ConsoleHost more extensible than the sample provided, such that it could be extended to run an IronPython interpreter in XNA, or WPF etc. As such, I have created a class IronPythonConsoleHost that extends ConsoleHost (from Microsoft.Scripting.Hosting.Shell), modelled on the PythonConsoleHost source.
public class IronPythonConsoleHost : ConsoleHost
{
    ...
    public override IConsole CreateConsole(ScriptEngine engine, CommandLine commandLine, ConsoleOptions options)
    {
        return new IronPythonConsole();
    }
    ...
}

// run in a ConsoleApplication
static void Main(string[] args)
{
    new IronPythonConsoleHost().Run(args);
}

This creates a situation where IronPythonConsoleHost can be extended in other applications. For instance, a console could be integrated into XNA as follows (assuming appropriate supporting classes):
public class XnaConsoleHost : IronPythonConsoleHost
{
    public override IConsole CreateConsole(ScriptEngine engine, CommandLine commandLine, ConsoleOptions options)
    {
        return new XnaConsole();
    }
}

However, this creates a situation where I am inheriting IronPythonConsoleHost simply to override a single method - no other functionality of the class needs to be changed. Furthermore, XnaConsoleHost is not being used in any situation that expects an IronPythonConsoleHost (or indeed a ConsoleHost), and this would seem to go against the Liskov substitution principle, as there is no usage scenario where substitutability is required or appropriate.
It seems it would be more appropriate to design IronPythonConsoleHost such that it can be provided with a means of selecting what IConsole to create (i.e. using composition instead of inheritance):
public class IronPythonConsoleHost : ConsoleHost
{
    public IronPythonConsoleHost(Func<ScriptEngine, CommandLine, ConsoleOptions, IConsole> consoleSelector)
    {
        _consoleSelector = consoleSelector;
    }
    ...
    public override IConsole CreateConsole(ScriptEngine engine, CommandLine commandLine, ConsoleOptions options)
    {
        return _consoleSelector(engine, commandLine, options);
    }
    ...
}

This would allow the XNA game to simply construct an IronPythonConsoleHost with the appropriate selector function:
_console = new IronPythonConsoleHost((eng, cl, co) => new XnaConsole());

This approach works, but passing Funcs seems somewhat clunky. This definitely seems like a situation where inheritance is a much less robust solution, but I don't think composition via awkward Funcs is necessarily better (especially if selectors are required for other areas - as they probably will be).
Is composition a good approach for this situation, and if so, are Funcs appropriate? Or is there a common design pattern that is used in similar situations that I am perhaps missing?

A: Passing a Func as a factory method seems reasonable to me - but you may want to overload your constructor to accept a simpler form:
public class IronPythonConsoleHost : ConsoleHost
{
    // Full version
    public IronPythonConsoleHost(
       Func<ScriptEngine, CommandLine, ConsoleOptions, IConsole> consoleSelector)
    {
        _consoleSelector = consoleSelector;
    }

    public IronPythonConsoleHost(Func<IConsole> consoleSelector)
        this((engine, commandLine, options) => consoleSelector())
    {
    }

    ...
    public override IConsole CreateConsole(ScriptEngine engine,
        CommandLine commandLine, ConsoleOptions options)
    {
        return _consoleSelector(engine, commandLine, options);
    }
    ...
}

So you could then write:
_console = new IronPythonConsoleHost(() => new XnaConsole());


text:
Q: Click event on button type input is not working I am designing webpage using jquery and php. My page has side menu, and clicking one of the option it send a request to server to read some information from file and it will create a form out of it, with submit and other button edit(in case anybody wants to change the information in that form) and send this html back to client. I am able to do this successfully. But when I click on the edit button it actually not calling the click handler I registered for the all the buttons.
$('button').click(function(){
  alert("click event");
 });

I included this in the
jQuery(document).ready(function() {

But because all the jquery/js code in ready() and it gets executed at the page load time, its not able to find these buttons in form because its something which i get from server after loading and replacing it to existing 'div' and hence its not able to invoke the event handler. If I define click handler for the parent div of this form, it receives the click event if I click 'edit' button because that 'div' was present when initial page got loaded. I might not be doing it correctly, may be getting the whole form from server is not a good idea, if you have to do some operation on the form at client side. But is it doable? if yes then whats the possible way out?. Thanks!

A: If I understand you correctly you adding the buttons dynamic to the form. You should try to use jQuery.on() insteed, see http://api.jquery.com/on/
And in your example this might work for you
  $("body").on("button","click", function(event){
     alert("Hello world");
  });

A: Your event isn't firing because you define it prior to the element existing on the page. Using the .on() method should fix this. Something along the lines of:
$('body').on('click','button', function(){
    alert("click event");
});

should work.

A: Use on (jQuery 1.7 and up). Previously was delegate (1.4.2+), before that live...
$('*your_form*').on('click', 'button', function(){
  alert("click event");
});

A: You may simply need to use this instead:
$(document).on('click','button',function(){
    alert("click event");
});

(jQuery 1.7 or higher)

A: you have to call using button id
$('#buttonid').click(function(){
  alert("click event");
 });

or button class
  $('.buttonclassname').click(function(){
      alert("click event");
     });


text:
Q: Implementing hash method in scala classes I have a base abstract class and several case classes derived from it. I need to have a hash function to identify repeated case objects..Is there any built-in hash method in scala?
for example, I have a base class
abstract class CDR_NOR {
val SUBSCRIBER_ID: String
val CHARGING_ID: String
val NODE_ID: String
val START_TIME: String
val hashvalue:Strng

//hashvalue=this.hashCode().toString() doesn't work here
}

and also some derived classes as follow:
case class CHG_NOR(Subscriber_ID: String,..., hashvalue:String) extends   CDR_NOR

case class NW_NOR(Subscriber_ID: String,...,hashvalue:String) extends  CDR_NOR

I need to have a hash function in the base class which make a unique value for each derived class..

A: Case classes by default have a hashcode implementation over their constructor parameters. You could use that like below and avoid implementing your own hashcode for equality testing.
abstract class CDR_NOR {
  val SUBSCRIBER_ID: String
  val CHARGING_ID: String
  val NODE_ID: String
  val START_TIME: String}

case class CHG_NOR(SUBSCRIBER_ID: String, CHARGING_ID: String, NODE_ID: String, START_TIME: String) extends   CDR_NOR

val x = CHG_NOR("001","123","1","12:23AM")

val y = CHG_NOR("001","123","1","12:23AM")

x == y // true

If you want to customize your hashcode implementation, then override hashcode in abstract class like below:
override def hashCode: Int = {// your custom implementation}


text:
Q: Maximum frequency of a number using hashmaps. Alternative approach  public static int maxFrequencyNumber(int[] arr){

        HashMap<Integer,Integer> m = new HashMap<>();

     for(int i=0;i<arr.length;i++){
        if(m.containsKey(arr[i]))
            m.put(arr[i],m.get(arr[i])+1);
         else
             m.put(arr[i],1);

     }
       ArrayList<Integer> p = new ArrayList<>();

     Set<Integer> s = m.keySet();
        for(Integer i:s)
           p.add(m.get(i));

           Collections.sort(p);

         for(Integer i:s){
             if(m.get(i)==p.get(p.size()-1))
                 return i;

         }
        return 0;

    }

You are given an array of integers that contain numbers in random order. Write a program to find and return the number which occurs the maximum times in the given input.
If two or more elements contend for the maximum frequency, return the element which occurs in the array first.
I am getting correct output except for one case in which all elements in an array have same frequency.whats wrong?

A: Your problem is that a HashMap does not record the order in which its entries are inserted.  So when there is a "tie" in frequency, your code could return any one of the corresponding keys.
If you change HashMap to LinkedHashMap in your code, you guarantee that the entries will be iterated in the same order they were originally inserted.  This will solve your problem.


text:
Q: How to move items between listbox I have a 3 Listboxes, The first one gets the data from server and on click of the first listbox, there is an "ON Selection" change event to populate listbox 2. Autopostback is made to true for the first list box.
I then need to move items from Listbox 2 to listbox 3 through buttons. The issue i am facing is.
After i move the items from listbox 2 to 3. I then go and click on listbox 1, the page refreshes and the items in listbox 3 disappear.
Please let me know, on how to fix this issue.
Thank you
Please find the code below..
 <asp:ListBox ID="lstdata" runat="server" Style="margin-top: 0px" Rows="20" AutoPostBack="true"
                        OnSelectedIndexChanged="lstdata_SelectedIndexChanged1" SelectionMode="Multiple"
                        EnableViewState="true" Height="318px" Width="199px"></asp:ListBox>

                Metric Options
                    <asp:ListBox ID="lstdata2" runat="server" Rows="20" Width="184px"
                        SelectionMode="Multiple"></asp:ListBox>

        Selected Metric
            <asp:ListBox ID="ListBox1" runat="server" AutoPostBack="false" Rows="20"
                SelectionMode="Multiple" Height="317px" style="margin-top: 0px"
                Width="149px">
            </asp:ListBox>


text:
Q: SVG Changing specific colour - CSS & JS I've got a selection of images and SVG's I wish to use on a website. I wish to use a SVG and change a single specific colour based on the scroll position.
I already have the scroll script in place as I use it for the menu, however I don't know how to make a specific section / colour of a SVG change colour.
Scroll Script
// Sticky Nav
$(window).on('scroll', function () {
        if ($(window).scrollTop() > 200) {
            $('.scrolling-navbar').addClass('top-nav-collapse');
            $('.navbar-logo').addClass('logo-black')
        } else {
            $('.scrolling-navbar').removeClass('top-nav-collapse');
            $('.navbar-logo').addClass('logo-white')
        }
    });

You can visit https://bagraddemo.tgtmedia.co.uk/ to see what I mean about the script working.
Now I know that SVG's can be effected using the fill:currentColor; but I don't want to fill the whole SVG. I just want to change a single colour, the black.
Before you ask, here's some html for you:
<svg viewBox="0 0 919.3 264.9" xmlns="http://www.w3.org/2000/svg" class="navbar-logo">
  <defs>

  </defs>
  <title>
    v7
  </title>
  <g id="Layer_2" data-name="Layer 2">
    <g data-name="v7 - Shortlist">
      <path d="M4.5 2.1C21.8 32.2 39.2 62.4 56.8 92.8H3.1V0H103.4V93.1L4.9 1.7Z"/>
      <path d="M118.9 15.3c4.2 0.2 8.3 0 12.2 0.6 6.3 1.1 8.2 6.3 6.3 11.4 -0.5 1.3-1.9 2.3-2.9 3.5 0.6 0.3 1.3 0.6 2 1A7.7 7.7 0 0 1 141 39.6a7.8 7.8 0 0 1-5.9 7.5 34.4 34.4 0 0 1-7.1 1.1c-2.9 0.2-5.9 0-9 0Zm4.8 28.5c2.8-0.2 5.5-0.2 8.1-0.6a5 5 0 0 0 4-4.5 4.9 4.9 0 0 0-3.9-4.6c-2.7-0.4-5.4-0.4-8.2-0.7Zm0-14.4a49.1 49.1 0 0 0 6.3-0.7c2-0.5 2.9-2.2 2.9-4.5a3.7 3.7 0 0 0-2.8-3.8c-2.1-0.4-4.2-0.4-6.4-0.6Z"/>
      <path d="M374.7 17.9v4.9c-2.4-0.9-4.8-1.8-7.2-2.5 -5.6-1.7-10.4-0.3-14.1 4.2a12.5 12.5 0 0 0-0.3 14.5c4.1 5.5 11 5.9 16.4 4a1.6 1.6 0 0 0 0.8-1.2c0.1-1.7 0-3.4 0-5.4h-5.8V32h11c0 4.4 0 8.8 0 13.3 0 0.4-0.6 0.9-1 1a86.7 86.7 0 0 1-10.6 2.2 16.5 16.5 0 0 1-16.5-9.2c-4.1-8.8-0.4-19.5 9.5-23 5.6-2 11-1.1 16.3 1.1Z"/>
      <path d="M227.8 32.8V48h-5.1V15.6h5V29.3l0.4 0.2c0.7-0.8 1.3-1.6 2-2.4 3.1-3.3 6.2-6.6 9.2-10a4.3 4.3 0 0 1 4-1.6 39.6 39.6 0 0 0 4 0c-4.9 5.4-9.5 10.4-13.7 15l15.8 17.6c-1.1 0-3.2 0-5.2 0 -0.3 0-0.7-0.4-1-0.7 -3.8-3.7-7.6-7.4-11.4-11C230.6 35.2 229.4 34.2 227.8 32.8Z"/>
      <path d="M147.1 48.1c0.7-1.6 1.2-3 1.7-4.3 3.9-9.1 7.7-18.2 11.6-27.4a2.2 2.2 0 0 1 1.5-1 15 15 0 0 1 2.7 0l14.5 32.6a30 30 0 0 1-4.5-0.1c-0.6-0.1-1.2-0.9-1.5-1.5C172 44.3 171 42 170 39.6a1.6 1.6 0 0 0-1.8-1.1c-3.6 0.1-7.2 0-10.8 0a1.5 1.5 0 0 0-1.7 1.2c-0.9 2.6-2.1 5.1-3.3 7.7a1.8 1.8 0 0 1-1.2 0.8C150 48.2 148.8 48.1 147.1 48.1Zm15.6-24.8l-4.4 10.6h9.1Z"/>
      <path d="M326.7 15.5c4.8 10.8 9.6 21.6 14.5 32.6h-5.2l-4.3-9.6c-4.1 0-8.3 0-12.4 0a1.6 1.6 0 0 0-1.2 0.8c-1.2 2.5-2.2 5.1-3.4 7.6a2.2 2.2 0 0 1-1.5 1.1 34.9 34.9 0 0 1-4.1 0c0.9-2.1 1.7-4.1 2.5-6q5.5-12.8 11-25.7a2 2 0 0 1 1.3-0.9A17.3 17.3 0 0 1 326.7 15.5ZM329.6 34c-1.6-3.7-3.2-7.1-4.8-10.7 -1.5 3.7-3 7.1-4.4 10.7Z"/>
      <path d="M404.7 15.6v4.3H391.6v9.7h12.8V34H391.6v9.3h13.5v4.4H386.4v-32Z"/>
      <path d="M212.3 23.1c-3.8-2-7.6-3.4-11.7-3.2 -5.4 0.3-10.9 4-11.7 10.7a11.8 11.8 0 0 0 12 13.1 18.7 18.7 0 0 0 8.9-2.1c0.8-0.4 1.7-0.8 2.9-1.4 0 1.8 0.1 3.3 0 4.8a1.5 1.5 0 0 1-0.8 1.2 45.5 45.5 0 0 1-7.7 1.9 29.1 29.1 0 0 1-7.9-0.3c-6.5-1.2-10.6-5.4-12-11.7 -2.3-9.9 2.8-17.6 12.4-20.4 5.2-1.5 10.2 0.1 15.1 1.8 0.3 0.1 0.6 0.8 0.6 1.2C212.3 20.1 212.3 21.5 212.3 23.1Z"/>
      <path d="M256.8 39.6a60.8 60.8 0 0 0 5.4 3.7 6 6 0 0 0 6.1 0c2-1.1 2.9-3.6 1.4-5.2a50 50 0 0 0-5.8-4.8c-1.9-1.5-4.2-2.8-5.7-4.7a8.3 8.3 0 0 1 5-12.9 12.6 12.6 0 0 1 9.6 1.4 2.2 2.2 0 0 1 1 1.5c0.1 1.5 0 2.9 0 4.8 -1-0.7-1.7-1.3-2.5-1.8 -2.7-1.5-5.4-2.5-8.4-0.8 -2 1.1-2.5 3.3-0.8 4.8a49.8 49.8 0 0 0 6.6 4.8c2.6 1.6 5 3.3 5.8 6.4 1.5 5.6-0.9 10.9-7.4 11.6a13.7 13.7 0 0 1-9.6-2.3 1.9 1.9 0 0 1-0.8-1.2C256.7 43 256.8 41.3 256.8 39.6Z"/>
      <path d="M281.8 15.7a3 3 0 0 1 0.6-0.1h26.3v4.4H297.6V48h-4.8V20H281.8Z"/>
      <path d="M233.7 77h-2.8V64.4l-0.4-0.2c-1.2 1.5-2.5 3-3.7 4.6 -1.5 2-1.5 2.1-3.1 0.2 -1.3-1.5-2.4-3-3.9-4.8V77h-3V59.5c3.1-1.3 4 1.5 5.4 3 1 1.1 1.9 2.4 3 3.8 1.4-1.8 2.6-3.4 3.9-5 1.1-1.4 2.4-2.6 4.6-1.7Z"/>
      <path d="M179 58.9c3.8 0.4 7.6 0.4 11.2 1.1 3 0.6 5.1 3.8 5.4 6.8 0.6 6.3-3.8 10.6-9.4 10.2 -2.3-0.1-4.7 0-7.1 0Zm3 2.6v13c1.7 0 3.3 0.1 4.9 0a6.4 6.4 0 0 0 5.7-5.2c0.5-2.7-0.7-5.7-3.4-6.6C187 61.9 184.5 61.9 182 61.5Z"/>
      <path d="M134.1 77.1c-1.6-0.1-3.1 0.6-3.8-1.4 -0.4-1.3-1-2.4-1.6-3.7h-7.2a14.1 14.1 0 0 0-1.1 2.7c-0.5 2.3-1.8 3-4.1 2.2 1.3-3.1 2.7-6.4 4-9.6 1-2.3 1.9-4.7 3-7A2.8 2.8 0 0 1 125.1 59c0.4 0 1.2 0.8 1.4 1.3 1.9 4 3.7 8 5.5 12C132.7 73.9 133.3 75.3 134.1 77.1Zm-6.7-7.8c-0.9-2-1.6-3.6-2.5-5.4l-2.2 5.5Z"/>
      <path d="M174.8 77c-3.1 0.2-3.2 0.2-4.2-2.5a3.5 3.5 0 0 0-4.1-2.6c-4.3 0.2-4.3 0-5.9 4 -0.8 1.9-2.2 1.2-3.7 1.2l7.7-18c1.4-0.5 2.3 0 2.9 1.5C169.8 66.1 172.3 71.5 174.8 77Zm-6.7-7.7l-2.4-5.5 -2.2 5.5Z"/>
      <path d="M152.5 62.8a46.2 46.2 0 0 0-7.1-0.9 6 6 0 0 0-5.7 5.7 6.5 6.5 0 0 0 4.8 6.9c2.3 0.7 4.4-0.1 6.5-0.8 0.7-0.2 1.3-0.6 2-1 0.3 4 0.5 3.7-4.7 4.6 -2.9 0.5-6.1 0.3-8.3-2.1 -1.3-1.4-2.7-3-3-4.7 -1.6-8.1 4.9-12.6 11.7-11.4 0.4 0.1 0.7 0.2 1.1 0.2C152.4 59.7 152.8 60.2 152.5 62.8Z"/>
      <path d="M204.2 61.8v4.9h6.9v2.6h-6.9v5.2h7.6V77H201.3V59.4h10.1v2.4Z"/>
      <path d="M237.8 59.6c3.5-1.4 4.7 1.3 6.2 3.1 0.6 0.7 1.1 1.4 1.8 2.3 0.9-1.2 1.7-2.2 2.5-3.3 1.3-1.8 2.7-3.2 5.4-2.1 -1.1 1.4-2.1 2.9-3.2 4.4a26.3 26.3 0 0 0-2.2 2.7 7.5 7.5 0 0 0-1.1 3.1c-0.1 2.4 0 4.8 0 7.3h-3a41.4 41.4 0 0 1 0-6c0.4-3-1.2-4.9-2.9-6.9C240.2 62.6 239 61.1 237.8 59.6Z"/>
      <path d="M260.3 66.3c-2.8 0-4.7-1.6-4.6-4.2a4.6 4.6 0 1 1 9.2 0A4.1 4.1 0 0 1 260.3 66.3Zm3.5-4.3c0-1.8-1.8-3.9-3.4-3.8A4 4 0 0 0 256.8 62a3.5 3.5 0 1 0 7 0Z"/>
      <path d="M259.9 62.2c-0.5 1.2-0.7 1.8-1 2.4l-0.5-0.2V59.7c0.7 0 1.4 0 2.1 0 1.6-0.1 2.3 0.4 1.7 2.2 -0.2 0.5 0.2 1.2 0.2 1.8 0 0.3-0.2 0.6-0.3 0.9 -0.2-0.2-0.5-0.4-0.7-0.6C260.8 63.3 260.4 62.9 259.9 62.2Z"/>
      <text class="cls-1" transform="translate(0 211.99)">
        GRADUATION
        <tspan class="cls-2" x="631.2">
          2018
        </tspan>
      </text>
    </g>
  </g>
</svg>

And some SCSS:
.navbar-logo {}

.logo-white {
    color: white;
    fill: currentColor;
}

.logo-black {
    color: black;
    fill: currentColor;
}

Your svg markup already defines a custom blue coloring for the 2018 so adding color: whatever; and fill: currentColor; won't override it, but it will override the part of the SVG that is black, which seems to be exactly what you want.

Thanks for the advice, I don't use SVG's often, and this is the code I'm trying to use. I'm not quite sure what part I've done wrong, but something isn't changing the colour when I add the class.
I also seem to have an issue previewing the SVG on chrome. As can be seen here: https://i.imgur.com/BxiGVQg.png
But oddly it seems to work completely fine on edge?https://i.imgur.com/0cEVW8t.png

here's some raw links to the svg and png versions of the image.
PNG: https://bagraddemo.tgtmedia.co.uk/assets/img/v7.png
SVG: https://bagraddemo.tgtmedia.co.uk/assets/img/v7.svg

A: Your svg markup already defines a custom blue coloring for the 2018 so adding color: whatever; and fill: currentColor; won't override it, but it will override the part of the SVG that is black, which seems to be exactly what you want. Here's some screenshots of me editing your SVGs from chrome devtools:
color: red; + fill: currentColor; on SVG:

color: white; + fill:currentColor; + background: black; on SVG:

A: Use CSS Variables FTW
The easiest way to control SVG colors are using CSS variables (87% browser support).
They not only allows you to control multiple colors but also allows to control colors
on shadow dom elements (when using <use>).
To provide the best experience I use a CSS Variable with a default color and a fallback–should the browser not be the supporting kind
<path style="fill: var(--color-name, #8d5000)" fill="#8d5000" d="M...." />
                       CSS variable  Default         Fallback

Example:
(click run code snippet to see result)

/*
.robo-1 uses the default colors provided as second parameter
in the inline css variables or the fill color if css variables
are not supported (like old ie)
*/
.robo-2 {
  --head-color: olive;
  --body-color: orange;
  --arm-color: maroon;
  --feet-color: maroon;
}

.robo-3 {
  --head-color: magenta;
  --body-color: purple;
  --arm-color: hotpink;
  --feet-color: hotpink;
}
.robo-4 {
  --head-color: lightgray;
  --eye-color: black;
  --body-color: lightgray;
  --arm-color: lightgray;
  --feet-color: lightgray;
}

/* hover state */
.robo-4:hover {
  --head-color: black;
  --eye-color: white;
  --body-color: black;
  --arm-color: black;
  --feet-color: black;
}

svg { width: 20%; }

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000" id="robot" class="robo-1">

    <path style="fill:var(--head-color, black)" fill="black" d="M751.8 203.2H639.9l90.7-114.7c3.4 1.3 7.1 1.9 10.9 1.9 19.6 0 35.5-18 35.5-40.3C777 28 761.1 10 741.5 10S706 28 706 50.3c0 8.9 2.5 17.1 6.9 23.8L610.7 203.2H403.9c9.8-9.9 16-24.3 16-40.3 0-29.9-21.5-54.1-48.1-54.1s-48.1 24.2-48.1 54.1c0 16 6.2 30.4 16 40.3h-91.5a114.8 114.8 0 0 0-114.5 115l34.3 306c0 63.5 51.3 115 114.5 115h435c63.2 0 114.5-51.5 114.5-115l34.3-306c0-63.5-51.2-115-114.5-115z"/>

    <path style="fill:var(--eye-color, white)" fill="white" d="M332.9 541.4a32.2 32.2 0 0 1 0-64.4 32 32 0 0 1 32 32.2 32 32 0 0 1-32 32.2zm318.2 9.2c-19 0-34.3-13.4-34.3-29.9s15.4-29.9 34.3-29.9c19 0 34.3 13.4 34.3 29.9s-15.3 29.9-34.3 29.9z"/>

    <path style="fill:var(--body-color, black)" fill="black" d="M385.4 753c-8.7 15-13.6 32.2-13.6 50.6 0 57.2 47.7 103.5 106.5 103.5h50.4c58.8 0 106.5-46.4 106.5-103.5 0-18.4-5-35.7-13.6-50.6H385.4z"/>

    <path style="fill:var(--arm-color, black)" fill="black" d="M325.1 753a44.4 44.4 0 0 0-5.9 21.9c0 22.6 18.4 42.2 41.6 52l.1.6a108 108 0 0 1-.5-10c-1.9-12.7-5.5-38.6 8.8-64.4h-44.1zm314.8 0c4.2 14.2 9.4 37.7 7.1 63.5a64.3 64.3 0 0 0 38.1-63.5h-45.2z"/>

    <path style="fill:var(--feet-color, black)" fill="black" d="M572.9 916.5c-31.6 6.8-31.6 9.1-31.6 9.1l-8.8-.2a40 40 0 0 0-7.2 23.2c0 20.3 14.4 36.8 32.1 36.8 17.7 0 32.1-16.5 32.1-36.8a38.5 38.5 0 0 0-16.6-32.1zm-118.7 6.8s-6.8-2-16.8-6.5a40.2 40.2 0 0 0-17.5 34.1c0 21.6 15.4 39.1 34.3 39.1 19 0 34.3-17.5 34.3-39.1 0-10.4-3.6-19.9-9.5-26.9l-24.8-.7z"/>
</svg>

<svg viewBox="0 0 1000 1000" class="robo-2">
  <use xlink:href="#robot"></use>
</svg>
<svg viewBox="0 0 1000 1000" class="robo-3">
  <use xlink:href="#robot"></use>
</svg>
<svg viewBox="0 0 1000 1000" class="robo-4">
  <use xlink:href="#robot"></use>
</svg>

Codepen example

A: After the advice from pretzelhammer, I have come up with the following solution to this issue.
HTML
    <svg viewBox="0 0 919.3 264.9" xmlns="http://www.w3.org/2000/svg" class="navbar-logo">
  <defs>

  </defs>
  <title>
    v7
  </title>
  <g id="Layer_2" data-name="Layer 2">
    <g data-name="v7 - Shortlist">
      <path d="M4.5 2.1C21.8 32.2 39.2 62.4 56.8 92.8H3.1V0H103.4V93.1L4.9 1.7Z"/>
      <path d="M118.9 15.3c4.2 0.2 8.3 0 12.2 0.6 6.3 1.1 8.2 6.3 6.3 11.4 -0.5 1.3-1.9 2.3-2.9 3.5 0.6 0.3 1.3 0.6 2 1A7.7 7.7 0 0 1 141 39.6a7.8 7.8 0 0 1-5.9 7.5 34.4 34.4 0 0 1-7.1 1.1c-2.9 0.2-5.9 0-9 0Zm4.8 28.5c2.8-0.2 5.5-0.2 8.1-0.6a5 5 0 0 0 4-4.5 4.9 4.9 0 0 0-3.9-4.6c-2.7-0.4-5.4-0.4-8.2-0.7Zm0-14.4a49.1 49.1 0 0 0 6.3-0.7c2-0.5 2.9-2.2 2.9-4.5a3.7 3.7 0 0 0-2.8-3.8c-2.1-0.4-4.2-0.4-6.4-0.6Z"/>
      <path d="M374.7 17.9v4.9c-2.4-0.9-4.8-1.8-7.2-2.5 -5.6-1.7-10.4-0.3-14.1 4.2a12.5 12.5 0 0 0-0.3 14.5c4.1 5.5 11 5.9 16.4 4a1.6 1.6 0 0 0 0.8-1.2c0.1-1.7 0-3.4 0-5.4h-5.8V32h11c0 4.4 0 8.8 0 13.3 0 0.4-0.6 0.9-1 1a86.7 86.7 0 0 1-10.6 2.2 16.5 16.5 0 0 1-16.5-9.2c-4.1-8.8-0.4-19.5 9.5-23 5.6-2 11-1.1 16.3 1.1Z"/>
      <path d="M227.8 32.8V48h-5.1V15.6h5V29.3l0.4 0.2c0.7-0.8 1.3-1.6 2-2.4 3.1-3.3 6.2-6.6 9.2-10a4.3 4.3 0 0 1 4-1.6 39.6 39.6 0 0 0 4 0c-4.9 5.4-9.5 10.4-13.7 15l15.8 17.6c-1.1 0-3.2 0-5.2 0 -0.3 0-0.7-0.4-1-0.7 -3.8-3.7-7.6-7.4-11.4-11C230.6 35.2 229.4 34.2 227.8 32.8Z"/>
      <path d="M147.1 48.1c0.7-1.6 1.2-3 1.7-4.3 3.9-9.1 7.7-18.2 11.6-27.4a2.2 2.2 0 0 1 1.5-1 15 15 0 0 1 2.7 0l14.5 32.6a30 30 0 0 1-4.5-0.1c-0.6-0.1-1.2-0.9-1.5-1.5C172 44.3 171 42 170 39.6a1.6 1.6 0 0 0-1.8-1.1c-3.6 0.1-7.2 0-10.8 0a1.5 1.5 0 0 0-1.7 1.2c-0.9 2.6-2.1 5.1-3.3 7.7a1.8 1.8 0 0 1-1.2 0.8C150 48.2 148.8 48.1 147.1 48.1Zm15.6-24.8l-4.4 10.6h9.1Z"/>
      <path d="M326.7 15.5c4.8 10.8 9.6 21.6 14.5 32.6h-5.2l-4.3-9.6c-4.1 0-8.3 0-12.4 0a1.6 1.6 0 0 0-1.2 0.8c-1.2 2.5-2.2 5.1-3.4 7.6a2.2 2.2 0 0 1-1.5 1.1 34.9 34.9 0 0 1-4.1 0c0.9-2.1 1.7-4.1 2.5-6q5.5-12.8 11-25.7a2 2 0 0 1 1.3-0.9A17.3 17.3 0 0 1 326.7 15.5ZM329.6 34c-1.6-3.7-3.2-7.1-4.8-10.7 -1.5 3.7-3 7.1-4.4 10.7Z"/>
      <path d="M404.7 15.6v4.3H391.6v9.7h12.8V34H391.6v9.3h13.5v4.4H386.4v-32Z"/>
      <path d="M212.3 23.1c-3.8-2-7.6-3.4-11.7-3.2 -5.4 0.3-10.9 4-11.7 10.7a11.8 11.8 0 0 0 12 13.1 18.7 18.7 0 0 0 8.9-2.1c0.8-0.4 1.7-0.8 2.9-1.4 0 1.8 0.1 3.3 0 4.8a1.5 1.5 0 0 1-0.8 1.2 45.5 45.5 0 0 1-7.7 1.9 29.1 29.1 0 0 1-7.9-0.3c-6.5-1.2-10.6-5.4-12-11.7 -2.3-9.9 2.8-17.6 12.4-20.4 5.2-1.5 10.2 0.1 15.1 1.8 0.3 0.1 0.6 0.8 0.6 1.2C212.3 20.1 212.3 21.5 212.3 23.1Z"/>
      <path d="M256.8 39.6a60.8 60.8 0 0 0 5.4 3.7 6 6 0 0 0 6.1 0c2-1.1 2.9-3.6 1.4-5.2a50 50 0 0 0-5.8-4.8c-1.9-1.5-4.2-2.8-5.7-4.7a8.3 8.3 0 0 1 5-12.9 12.6 12.6 0 0 1 9.6 1.4 2.2 2.2 0 0 1 1 1.5c0.1 1.5 0 2.9 0 4.8 -1-0.7-1.7-1.3-2.5-1.8 -2.7-1.5-5.4-2.5-8.4-0.8 -2 1.1-2.5 3.3-0.8 4.8a49.8 49.8 0 0 0 6.6 4.8c2.6 1.6 5 3.3 5.8 6.4 1.5 5.6-0.9 10.9-7.4 11.6a13.7 13.7 0 0 1-9.6-2.3 1.9 1.9 0 0 1-0.8-1.2C256.7 43 256.8 41.3 256.8 39.6Z"/>
      <path d="M281.8 15.7a3 3 0 0 1 0.6-0.1h26.3v4.4H297.6V48h-4.8V20H281.8Z"/>
      <path d="M233.7 77h-2.8V64.4l-0.4-0.2c-1.2 1.5-2.5 3-3.7 4.6 -1.5 2-1.5 2.1-3.1 0.2 -1.3-1.5-2.4-3-3.9-4.8V77h-3V59.5c3.1-1.3 4 1.5 5.4 3 1 1.1 1.9 2.4 3 3.8 1.4-1.8 2.6-3.4 3.9-5 1.1-1.4 2.4-2.6 4.6-1.7Z"/>
      <path d="M179 58.9c3.8 0.4 7.6 0.4 11.2 1.1 3 0.6 5.1 3.8 5.4 6.8 0.6 6.3-3.8 10.6-9.4 10.2 -2.3-0.1-4.7 0-7.1 0Zm3 2.6v13c1.7 0 3.3 0.1 4.9 0a6.4 6.4 0 0 0 5.7-5.2c0.5-2.7-0.7-5.7-3.4-6.6C187 61.9 184.5 61.9 182 61.5Z"/>
      <path d="M134.1 77.1c-1.6-0.1-3.1 0.6-3.8-1.4 -0.4-1.3-1-2.4-1.6-3.7h-7.2a14.1 14.1 0 0 0-1.1 2.7c-0.5 2.3-1.8 3-4.1 2.2 1.3-3.1 2.7-6.4 4-9.6 1-2.3 1.9-4.7 3-7A2.8 2.8 0 0 1 125.1 59c0.4 0 1.2 0.8 1.4 1.3 1.9 4 3.7 8 5.5 12C132.7 73.9 133.3 75.3 134.1 77.1Zm-6.7-7.8c-0.9-2-1.6-3.6-2.5-5.4l-2.2 5.5Z"/>
      <path d="M174.8 77c-3.1 0.2-3.2 0.2-4.2-2.5a3.5 3.5 0 0 0-4.1-2.6c-4.3 0.2-4.3 0-5.9 4 -0.8 1.9-2.2 1.2-3.7 1.2l7.7-18c1.4-0.5 2.3 0 2.9 1.5C169.8 66.1 172.3 71.5 174.8 77Zm-6.7-7.7l-2.4-5.5 -2.2 5.5Z"/>
      <path d="M152.5 62.8a46.2 46.2 0 0 0-7.1-0.9 6 6 0 0 0-5.7 5.7 6.5 6.5 0 0 0 4.8 6.9c2.3 0.7 4.4-0.1 6.5-0.8 0.7-0.2 1.3-0.6 2-1 0.3 4 0.5 3.7-4.7 4.6 -2.9 0.5-6.1 0.3-8.3-2.1 -1.3-1.4-2.7-3-3-4.7 -1.6-8.1 4.9-12.6 11.7-11.4 0.4 0.1 0.7 0.2 1.1 0.2C152.4 59.7 152.8 60.2 152.5 62.8Z"/>
      <path d="M204.2 61.8v4.9h6.9v2.6h-6.9v5.2h7.6V77H201.3V59.4h10.1v2.4Z"/>
      <path d="M237.8 59.6c3.5-1.4 4.7 1.3 6.2 3.1 0.6 0.7 1.1 1.4 1.8 2.3 0.9-1.2 1.7-2.2 2.5-3.3 1.3-1.8 2.7-3.2 5.4-2.1 -1.1 1.4-2.1 2.9-3.2 4.4a26.3 26.3 0 0 0-2.2 2.7 7.5 7.5 0 0 0-1.1 3.1c-0.1 2.4 0 4.8 0 7.3h-3a41.4 41.4 0 0 1 0-6c0.4-3-1.2-4.9-2.9-6.9C240.2 62.6 239 61.1 237.8 59.6Z"/>
      <path d="M260.3 66.3c-2.8 0-4.7-1.6-4.6-4.2a4.6 4.6 0 1 1 9.2 0A4.1 4.1 0 0 1 260.3 66.3Zm3.5-4.3c0-1.8-1.8-3.9-3.4-3.8A4 4 0 0 0 256.8 62a3.5 3.5 0 1 0 7 0Z"/>
      <path d="M259.9 62.2c-0.5 1.2-0.7 1.8-1 2.4l-0.5-0.2V59.7c0.7 0 1.4 0 2.1 0 1.6-0.1 2.3 0.4 1.7 2.2 -0.2 0.5 0.2 1.2 0.2 1.8 0 0.3-0.2 0.6-0.3 0.9 -0.2-0.2-0.5-0.4-0.7-0.6C260.8 63.3 260.4 62.9 259.9 62.2Z"/>
      <text class="cls-1" transform="translate(0 211.99)">
        GRADUATION
        <tspan class="cls-2" x="631.2">
          2018
        </tspan>
      </text>
    </g>
  </g>
</svg>

SCSS
.navbar-brand {
    position: relative;
    padding: 0px;
    svg {
        width: 75%;
    }
}

.navbar-logo {
    padding-top: 10px;
    max-height: 58px;
}

.logo-white {
    color: white;
    fill: currentColor;
}

.logo-black {
    color: black;
    fill: currentColor;
}

JS
$(window).on('load', function () {

        // Sticky Nav
        $(window).on('scroll', function () {
            if ($(window).scrollTop() > 200) {
                $('.scrolling-navbar').addClass('top-nav-collapse');
                $('.navbar-brand')
                    .addClass('logo-black')
                    .removeClass('logo-white');
            } else {
                $('.scrolling-navbar').removeClass('top-nav-collapse');
                $('.navbar-brand')
                    .addClass('logo-white')
                    .removeClass('logo-black');
            }
        });

So basically, I have added the class logo-white and logo-black to the  tag via JS. This then effects the SVG using the fill: currentColor defined in the SCSS, which only effects the black zones.
You can see the working demo here: https://bagraddemo.tgtmedia.co.uk/ as look at the code yourself. (Working 22/07/18 - if it's not working for you, please comment below)
In terms of the issue with SVG's not showing on chrome. It was a issue where I hadn't defined a size properly and therefor chrome wasn't seeing it. I also fixed the font issue with a simple @font-face which I had forgotten to do.


text:
Q: Inconsistent question totals There are 334,911 questions under the "active" tab, 334,914 under the "newest" and "votes" tabs, and 333,037 under the "hot" tab.
Is there a reason for this inconsistency, or is it a bug?  Are there 3 questions which for some reason are not considered active and 1,877 that aren't hot?
Perhaps the lesser number of active questions is due to page caching, but that doesn't seem likely for the hot tab given the number of missing questions.

A: Hot screens out posts below a certain vote threshold.