text:
Q: Can JS on a page detect if the user has a toolbar installed? If a website visitor has an adware toolbar installed, it executes popups when the visitor comes to my page.
Is there a way to run Javascript on my page that will detect this activity and stop it?  Or, is there a way to detect and redirect the user to a page with removal instructions?

A: Theoretically, yes.
It all depends on whether the toolbar is exposing a public variable that javascript can access.  For example, MyToolbar for Chrome, could expose the object, mt  then you can just do a
if ( typeof mt !== 'undefined' ) { // they have it installed.

You would need to research the toolbars, and find whether they expose these or not.


text:
Q: PyCharm auto pop up source code I've been using Eclipse PyDev, which can show you the source code snippet of an object or a function when your mouse hovers over it.
I'm aware that PyCharm can show a quick documentation snippet on hover: How can I make docstrings popup on hover in PyCharm?
However, the ability to hover and peek at the source code is very important to my workflow. I wonder whether there's a built-in way or a plugin to achieve this?

A: You can do this for functions using the "Open quick definition lookup" in the default keymap.

The keyboard shortcut is Ctrl+Shift+I while cursor is on the function call. However, this only seems to work for definitions and not objects.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Is there any way to populate data from Oracle Table to Active Directory? Is there any way to populate data from Oracle Table to Active Directory? We have a requirement to populate 1 column from 1 of the tables in an Oracle schema to Active Directory. We would like to automate this process.
Let me know if there is any solution for that?
Regards,

A: Yes there is. Generally to talk with active directory you have to use dbms_ldap package.
Start from setting up the connection to AD. And get to know how to querying AD. https://davegugg.wordpress.com/2015/01/16/querying-active-directory-through-oracle/.
Next step is updating records.
http://ermanarslan.blogspot.co.uk/2013/10/plsql-dbmsldap-updating-active.html


text:
Q: Displaying array elements using JavaScript I'm trying to display elements of a JavaScript array. Code:
var name = ["one" , "two"];
window.onload = function(){
document.getElementById('MinamaisVards').innerHTML=name[1];
}

Can anyone tell me why does it display the letter "n" instead of the second element of array? I don't understand where the problem is.

A: The problem is in var name as its a reserved word, use names instead.
var name = ["one" , "two"];
 window.onload = function(){
  document.getElementById('MinamaisVards').innerHTML=name[1];
 }

should be
var names = ["one" , "two"];
window.onload = function(){
  document.getElementById('MinamaisVards').innerHTML=names[1];
}

A: There already is a global with the name name, it's window.name, and it only accepts strings, so when you do
var name = ["one" , "two"];

in the global scope, and you get it back
console.log( name );

you get
"one, two"

and it's of type string, so name[1] is "n", the second character in that string.
This is because what you're really setting and getting is window.name, and it does not accept an array, so it runs toString() on whatever you pass it.
Change the variable name to something that isn't already in use


text:
Q: How to extract text pdf from an url without downloading it in Python I'm currently extracting pdf from an API using requests.get. I don't want to download them but just to extract the text from them.
response_pdf = requests.get(url, auth=TokenAuth(key))
text = convert_pdf_to_txt(response_pdf.content)

Here is the code for the function convert_pdf_to_txt:
def convert_pdf_to_txt(filename):

    rsrcmgr = PDFResourceManager()
    retstr = StringIO()
    codec = 'utf-8'
    #codec ='ISO-8859-1'
    laparams = LAParams()
    device = TextConverter(rsrcmgr, retstr, codec=codec, laparams=laparams)

    fp = open(filename, 'rb')

    interpreter = PDFPageInterpreter(rsrcmgr, device)
    password = ""
    maxpages = 0
    caching = True
    pagenos=set()

    for page in PDFPage.get_pages(fp, pagenos, maxpages=maxpages, password=password,caching=caching, check_extractable=True):
        interpreter.process_page(page)

    text = retstr.getvalue()

    fp.close()
    device.close()
    retstr.close()
    text = str(text)
    text = text.replace("\\n", "")
    text = text.lower()

    return text

I get the following error:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb5 in position 11: invalid start byte
The response_pdf.content is a "class 'bytes'" object and i don't know how to extract the text from it.
Any help would be highly appreciated !

A: You're passing in a bytestring to be interpreted as a filename to open, which is not good.
Instead, you can read the bytestring into io.BytesIO() and pass it in as fp:
def convert_pdf_to_txt(fp):
    rsrcmgr = PDFResourceManager()
    retstr = StringIO()
    codec = "utf-8"
    # codec ='ISO-8859-1'
    laparams = LAParams()
    device = TextConverter(
        rsrcmgr, retstr, codec=codec, laparams=laparams
    )

    interpreter = PDFPageInterpreter(rsrcmgr, device)
    password = ""
    maxpages = 0
    caching = True
    pagenos = set()

    for page in PDFPage.get_pages(
        fp,
        pagenos,
        maxpages=maxpages,
        password=password,
        caching=caching,
        check_extractable=True,
    ):
        interpreter.process_page(page)

    text = retstr.getvalue()
    device.close()
    retstr.close()
    text = str(text)
    text = text.replace("\\n", "")
    text = text.lower()
    return text

response_pdf = requests.get(url, auth=TokenAuth(key))
pdf_stream = io.BytesIO(response_pdf.content)
text = convert_pdf_to_txt(pdf_stream)

This has the additional nicety to it that you can still use it with files:
with open('my_pdf', 'rb') as pdf_stream:
  text = convert_pdf_to_txt(pdf_stream)


text:
Q: Pegar endereço de array com ID e usar em um IF Duvida básica preciso pegar o endereço do array que contem um id e utilizar em um if, OUTRA: é possivel fazer um array de id? o que quero fazer é ao clicar na imagem apareça a descrição do atributo do objeto orgaos, simplificando clicar na imagem e aparecer determinada descrição por um alert, não consegui editar o código desculpe ;-; meu código:
function teste(){
        let selecao = [document.getElementById('cerebro'),
                       document.getElementById('pulmao'),
                       document.getElementById('coracao'),
                       document.getElementById('rim'),
                       document.getElementById('encefalo'),
                       document.getElementById('esofago'),
                       document.getElementById('estomago'),
                       document.getElementById('intestino'),
                       document.getElementById('figado')]

        orgaos = { cerebro: 'parte do sistema nervoso central situada na caixa craniana dos vertebrados e que recebe estímulos dos órgãos sensoriais, interpretando-os e correlacionando-os com impressões armazenadas, a fim de acionar impulsos motores que, essencialmente, controlam todas as atividades vitais',
                   coracao: 'O coração é um órgão muscular presente nos humanos e em outros animais que bombeia o sangue através dos vasos sanguíneos do sistema circulatório',
                   encefalo: 'conjunto do tronco cerebral, cerebelo e cérebro, parte superior do sistema nervoso central que controla o organismo.' ,
                   esofago: 'onduto musculomembranoso que liga a faringe ao estômago',
                   pulmao: 'cada um de dois órgãos respiratórios promovem as trocas gasosas, fornecendo oxigênio a todo o corpo',
                   rim: 'Rim cada um dos dois órgãos são os principais órgãos do sistema excretor e osmoregulador dos vertebrados',
                   estomago: 'O estômago é um órgão presente no tubo digestivo, situado logo abaixo do diafragma, Nele, os alimentos são pré-digeridos e esterilizados, a fim de seguirem para o intestino, onde são absorvidos.',
                   intestino: 'O intestino é um órgão em forma de tubo que se estende desde o final do estômago até ao ânus, permitindo a passagem dos alimentos digeridos, facilitando a absorção dos nutrientes e a eliminação dos resíduos.',
                   figado: 'glândula volumosa anexa ao tubo digestivo que realiza sínteses e transformações complexas de diversas substâncias'}

        // Isso aqui que preciso fazer mais não funfa ;-;
         if (selecao == selecao[0]) {
            document.getElementById('cerebro').innerHTML = alert(orgaos.cerebro)
         }
    }

A: Acho que você não precisa de um array. Basta enviar o id como parâmetro na função e mostrar o valor da respectiva chave do objeto orgaos:

function teste(id){

   let orgaos = { cerebro: 'parte do sistema nervoso central situada na caixa craniana dos vertebrados e que recebe estímulos dos órgãos sensoriais, interpretando-os e correlacionando-os com impressões armazenadas, a fim de acionar impulsos motores que, essencialmente, controlam todas as atividades vitais',
                   coracao: 'O coração é um órgão muscular presente nos humanos e em outros animais que bombeia o sangue através dos vasos sanguíneos do sistema circulatório',
                   encefalo: 'conjunto do tronco cerebral, cerebelo e cérebro, parte superior do sistema nervoso central que controla o organismo.' ,
                   esofago: 'onduto musculomembranoso que liga a faringe ao estômago',
                   pulmao: 'cada um de dois órgãos respiratórios promovem as trocas gasosas, fornecendo oxigênio a todo o corpo',
                   rim: 'Rim cada um dos dois órgãos são os principais órgãos do sistema excretor e osmoregulador dos vertebrados',
                   estomago: 'O estômago é um órgão presente no tubo digestivo, situado logo abaixo do diafragma, Nele, os alimentos são pré-digeridos e esterilizados, a fim de seguirem para o intestino, onde são absorvidos.',
                   intestino: 'O intestino é um órgão em forma de tubo que se estende desde o final do estômago até ao ânus, permitindo a passagem dos alimentos digeridos, facilitando a absorção dos nutrientes e a eliminação dos resíduos.',
                   figado: 'glândula volumosa anexa ao tubo digestivo que realiza sínteses e transformações complexas de diversas substâncias'}

   document.getElementById(id).innerHTML = orgaos[id];
}
img{
   width: 50px;
   height: 50px;
   cursor: pointer;
}


text:
Q: C: Address trap error when accessing a struct with odd no. of members I am working with MPLABX with compiler xc16-gcc developing for the 16-bit dsPIC33CH128MP508 microcontroller. I am making code to read from RTC through I2C.
I have defined the following structs:
typedef struct tagRTC_VL_SECONDSBITS{
    uint8_t SECONDS: 7 ;
    uint8_t VL:1 ;      /* 0: clock integrity is guarantee */
}sRTC_VL_SECONDSBITS_t;

typedef struct tagRTC_MINUTESBITS{
    uint8_t MINUTES: 7 ;
    uint8_t :1 ;
}sRTC_MINUTESBITS_t;

typedef struct tagRTC_HOURSBITS{
    uint8_t HOURS: 6 ;
    uint8_t :2 ;
}sRTC_HOURSBITS_t;

typedef struct tagRTC_DAYSBITS{
    uint8_t DAYS: 6 ;
    uint8_t :2 ;
}sRTC_DAYSBITS_t;

typedef struct tagRTC_WEEKDAYSBITS{
    uint8_t WEEKDAYS: 3 ;
    uint8_t :5 ;
}sRTC_WEEKDAYSBITS_t;

typedef struct tagRTC_CENTURY_MONTHSBITS{
    uint8_t MONTHS: 5 ;
    uint8_t :2 ;
    uint8_t C:1 ;
}sRTC_CENTURY_MONTHSBITS_t;

typedef struct tagRTC_YEARSBITS{
    uint8_t YEARS ;
}sRTC_YEARSBITS_t;

typedef struct tagRTC_TIME{
    sRTC_VL_SECONDSBITS_t sec;
    sRTC_MINUTESBITS_t min ;
    sRTC_HOURSBITS_t hr ;
    sRTC_DAYSBITS_t day ;
    sRTC_WEEKDAYSBITS_t wDay ;
    sRTC_CENTURY_MONTHSBITS_t month ;
    sRTC_YEARSBITS_t year ;

}sRTC_TIME_t ;

The issue with struct sRTC_TIME_t has odd numbers of members, the memory alignment is packed automatically by the compiler. The reading from RTC requires the struct packed also.
When trying to read the first member sec  the code trap with TRAPS_ADDRESS_ERR = 2, /** Address error Trap vector */.
sRTC_TIME_t time;
second_reading  = time.sec.SECONDS;
When we add an eighth dummy member in the struct sRTC_TIME_t there is no error!
What could be the source of this issue?


text:
Q: Laravel Select only specific columns while eagerloading polymorphic relationships This is not working the response contains all the columns, but I want to return only idcolumn from comments table.
I'm using Laravel 5.4
Tables
notifications table
content_type

content_id

comments table
id

body

Models
Notification.php
public function content() {
        return $this->morphTo('content');
    }

NotificationController.php
public function getNavbarNotifications(Request $request) {
        $notifications = $request->user()->notifications()->latest()->limit(5)->get();
        foreach ($notifications as $notification) {
            $notification->load(['content' => function ($query){
                $query->select('id');
            }]);
        }
        return $notifications;
    }

Response from the NotificationController

A: You could try with this:
return $this->morphTo('content')->select(array('id'));

in your Notification.php.


text:
Q: Replace a part of url generated by get_term_link Is there a way to edit a text in url given by get_term_link()
I want to replace this text listing-category/  in all the links generated by get_term_link()
Till now I have been using the following code to do it manually wherever i wanted but now I realize that it will be efficient .
$term_link= str_replace('listing-category/', 'jobs/?fwp_cate=', get_term_link( $term ));
$term_link= rtrim($term_link, '/');

So is there a way to apply the above code in all the get_term_link()
Please help me out on this

A: Yes, there is a hook "term_link" which you can use for this purpose.
Here you can find documentation.
https://codex.wordpress.org/Plugin_API/Filter_Reference/term_link
so the solution will be like this
add_filter('term_link', 'term_link_filter', 10, 3);
function term_link_filter( $url, $term, $taxonomy ) {

  $url= str_replace('listing-category/', 'jobs/?fwp_cate=', $url);
  $url= rtrim($url, '/');

    return $url . "#results";

}


text:
Q: Determine where the function $f(z)=\operatorname{Log}(z^3+2i)$ is analytic. I need to know if my intuition is correct here.
Idea: I would use De'Moivre's formula to find all third roots of -2i and exclude one of these rays because these are the values that give $z^3+2i=0$ and $\operatorname{Log}(z)$ is not defined at $0$, hence not analytic at $0$. Given that the third roots of $-2i$ are, $2^{\frac{1}{3}}[\cos(\frac{-\pi}{2}+\frac{2k\pi}{3})+i\sin(\frac{-\pi}{2}+\frac{2k\pi}{3})]$ for $k=0,1,2$. Then pick a cut of principal branch say $k=0$ and say the function is analytic of the set $\mathbb{C}\setminus\{re^{i\theta}:\theta=\frac{\pi}{2}\}$.


text:
Q: What is the use of extension of the real and complex field?
What is the use of the extension of the real and complex fields to extended real and complex numbers (including $\infty$)?

If the extended real and complex sets are no longer fields, then what is the use of such extensions?
What is the application of the extended real and complex number sets over the real and complex field?


text:
Q: Ignore specific file Xdebug Visual Studio Code I'm using Xdebug as my debugger for my code. Although adminer errors all the time (probably because of the obfuscation of the source code.)
I now want to ignore that specific file, and found that you can ignore folders, but don't see any option to ignore a specific file.
This is how to ignore a specific folder:
"version": "0.2.0",
"configurations": [
    {
        "name": "Listen for XDebug",
        "type": "php",
        "request": "launch",
        "port": 9000,
        "ignore": [
            "**/vendor/**/*"
          ]
    }

Now, logically thinking I thought I'd change "**/vendor/**/*" to adminer.php. But that didn't work. I also tried changing it to *adminer.php and */adminer.php but this doesn't work as well.
Is there a possibility for doing this?
I need it to be able to have this specific different, so not in any config file of Xdebug itself, but in launch.json


text:
Q: Stoppable background timer/observable with RXAndroid I am trying to create a repeating, background timer with RXAndroid. I have written code that executes at a specified interval in the background, but I cannot find a way to stop it.
Observer<Long> observer = new Observer<Long>() {
        @Override
        public void onSubscribe(Disposable d) {}

        @Override
        public void onNext(Long aLong) {

            Log.d(LOGTAG, "Interval:" +String.valueOf(aLong));
        }

        @Override
        public void onError(Throwable e) {}

        @Override
        public void onComplete() {}
    };

    Observable observable = Observable.interval(1, 1, TimeUnit.SECONDS)
            .subscribeOn(Schedulers.io())
            .observeOn(Schedulers.io());

    observable.subscribe(observer);

I would like to know please:

*

*Is this the correct approach for creating a "timer" in RXAndroid to execute code periodically in the background?

*How do I stop it?

A:

*

*Is this the correct approach for creating a "timer" in RXAndroid to execute code periodically in the background?

Yes,

*How do I stop it?

To cancel the observer in RxJava you have to use the reference of Disposable.
Which you can find in the onSubscribe(Disposable d).
onSubscribe() will call whenever you subscribe to observable. in your case it is observable.subscribe(observer).
In observer you have method public void onSubscribe(Disposable d) {} which will provide reference of Disposable.
   Declare global instance of Disposable, and whenever you want to cancel call Disposable::dispose().


text:
Q: How to use volume keys to change not-master volume up-down in Windows 10? I have a USB soundcard with Toslink (S/PDIF) output under Windows 10 and as such master volume does nothing. Looking at Audio quality via S/PDIF this is not at all unexpected. I can control the volume in, say, YouTube if I change the volume up-down in their video player. My keyboard has volume up-down keys. How could I use them to change the volume of the currently playing channel instead of master? Or perhaps all channels.

A: I downloaded Nir Sofer's SoundVolumeView , put it in a directory in %PATH% and wrote an Autohotkey script:
Volume_Up::
    Run, SoundVolumeView /ChangeVolume "AllAppVolume" +5
return

Volume_Down::
    Run, SoundVolumeView /ChangeVolume "AllAppVolume" -5
return

Credit where credit is due: this is a very slightly adjusted version of this reddit comment. The documentation said

You can specify 'AllAppVolume' to change the volume of all applications at once. For example, in order to set the volume of all applications to 100%:
SoundVolumeView.exe /SetVolume AllAppVolume 100

So I did.


text: Q: How do I add a custom icon to the macOS menu bar? I've been looking and the only thing I can find is how to add ones that already exist. Say I want to add a picture of the pog face, And when I click it it says ok. Is there any software to help me do that, or do I need to code my own AppleScript by myself? (Also I'm on high Sierra.)


text:
Q: Parsing columns lines with a single double quotations in Graphlab.SFrame I have lines as such from this dataset (https://raw.githubusercontent.com/alvations/stasis/master/sts.csv):
Dataset Domain  Score   Sent1   Sent2
STS2012-gold    surprise.OnWN   5.000   render one language in another language restate (words) from one language into another language.
STS2012-gold    surprise.OnWN   3.250   nations unified by shared interests, history or institutions    a group of nations having common interests.
STS2012-gold    surprise.OnWN   3.250   convert into absorbable substances, (as if) with heat or chemical process   soften or disintegrate by means of chemical action, heat, or moisture.
STS2012-gold    surprise.OnWN   4.000   devote or adapt exclusively to an skill, study, or work devote oneself to a special area of work.
STS2012-gold    surprise.OnWN   3.250   elevated wooden porch of a house    a porch that resembles the deck on a ship.

I have read it into a graphlab.SFrame using the read_csv() function:
import graphlab
sts = graphlab.SFrame.read_csv('sts.csv', delimiter='\t', column_type_hints=[str, str, float, str, str])

And there were lines that are not parsed. The traceback is as follows:
PROGRESS: Unable to parse line "STS2012-gold    MSRpar  3.800   "She was crying and scared,' said Isa Yasin, the owner of the store.    "She was crying and she was really scared," said Yasin."
PROGRESS: Unable to parse line "STS2012-gold    MSRpar  2.200   "And about eight to 10 seconds down, I hit. "I was in the water for about eight seconds."
PROGRESS: Unable to parse line "STS2012-gold    MSRpar  2.800   "It's a major victory for Maine, and it's a major victory for other states. The Maine program could be a model for other states."
PROGRESS: Unable to parse line "STS2012-gold    MSRpar  4.000   "Right from the beginning, we didn't want to see anyone take a cut in pay.  But Mr. Crosby told The Associated Press: "Right from the beginning, we didn't want to see anyone take a cut in pay."
PROGRESS: Unable to parse line "STS2014-gold    deft-forum  0.8 "Then the captain was gone. Then the captain came back."
PROGRESS: Unable to parse line "STS2014-gold    deft-forum  1.8 "Oh, you're such a good person! You're such a bad person!""
PROGRESS: Unable to parse line "STS2012-train   MSRpar  3.750   "We put a lot of effort and energy into improving our patching process, probably later than we should have and now we're just gaining incredible speed. "We've put a lot of effort and energy into improving our patching progress, p..."
PROGRESS: Unable to parse line "STS2012-train   MSRpar  4.000   "Tomorrow at the Mission Inn, I have the opportunity to congratulate the governor-elect of the great state of California.   "I have the opportunity to congratulate the governor-elect of the great state of California, and I'm lookin..."
PROGRESS: Unable to parse line "STS2012-train   MSRpar  3.600   "Unlike many early-stage Internet firms, Google is believed to be profitable.   The privately held Google is believed to be profitable."
PROGRESS: Unable to parse line "STS2012-train   MSRpar  4.000   "It was a final test before delivering the missile to the armed forces. State radio said it was the last test before the missile was delivered to the armed forces."
PROGRESS: 22 lines failed to parse correctly
PROGRESS: Finished parsing file /home/alvas/git/stasis/sts.csv
PROGRESS: Parsing completed. Parsed 19075 lines in 0.069578 secs.

Look at these lines there seems to be a problem if any of my Sent1 or Sent2 columns contains odd-numbered double quotation marks.
Using the error_bad_lines to track the problematic lines:
sts = graphlab.SFrame.read_csv('sts.csv', delimiter='\t', column_type_hints=[str, str, float, str, str],
                              error_bad_lines=True)

It throws the traceback:
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-15-a1ec53597af9> in <module>()
      1 sts = graphlab.SFrame.read_csv('sts.csv', delimiter='\t', column_type_hints=[str, str, float, str, str],
----> 2                               error_bad_lines=True)

/usr/local/lib/python2.7/dist-packages/graphlab/data_structures/sframe.pyc in read_csv(cls, url, delimiter, header, error_bad_lines, comment_char, escape_char, double_quote, quote_char, skip_initial_space, column_type_hints, na_values, line_terminator, usecols, nrows, skiprows, verbose, **kwargs)
   1537                                   verbose=verbose,
   1538                                   store_errors=False,
-> 1539                                   **kwargs)[0]
   1540
   1541

/usr/local/lib/python2.7/dist-packages/graphlab/data_structures/sframe.pyc in _read_csv_impl(cls, url, delimiter, header, error_bad_lines, comment_char, escape_char, double_quote, quote_char, skip_initial_space, column_type_hints, na_values, line_terminator, usecols, nrows, skiprows, verbose, store_errors, **kwargs)
   1097                 glconnect.get_client().set_log_progress(False)
   1098             with cython_context():
-> 1099                 errors = proxy.load_from_csvs(internal_url, parsing_config, type_hints)
   1100         except Exception as e:
   1101             if type(e) == RuntimeError and "CSV parsing cancelled" in e.message:

/usr/local/lib/python2.7/dist-packages/graphlab/cython/context.pyc in __exit__(self, exc_type, exc_value, traceback)
     47             if not self.show_cython_trace:
     48                 # To hide cython trace, we re-raise from here
---> 49                 raise exc_type(exc_value)
     50             else:
     51                 # To show the full trace, we do nothing and let exception propagate

RuntimeError: Runtime Exception. Unable to parse line "STS2012-gold MSRpar  3.800   "She was crying and scared,' said Isa Yasin, the owner of the store.    "She was crying and she was really scared," said Yasin."
Set error_bad_lines=False to skip bad lines

Is there a way to resolve this problem where my lines contains odd number of double quotes?
Is there a way to do it without cleaning the data (e.g. identifying the problematic lines and then clean/correct them but keep another SFrame to track the cleaning/correction?

As a sanity check, if we do a search \t in the raw csv file, there's a tab in the rows that gives problem but when graphlab parses it, it disappears:

As another sanity check, reading the file line by line and splitting it by \t returns 5 columns for the whole file:
alvas@ubi:~/git/stasis$ head sts.csv
Dataset Domain  Score   Sent1   Sent2
STS2012-gold    surprise.OnWN   5.000   render one language in another language restate (words) from one language into another language.
STS2012-gold    surprise.OnWN   3.250   nations unified by shared interests, history or institutions    a group of nations having common interests.
STS2012-gold    surprise.OnWN   3.250   convert into absorbable substances, (as if) with heat or chemical process   soften or disintegrate by means of chemical action, heat, or moisture.
STS2012-gold    surprise.OnWN   4.000   devote or adapt exclusively to an skill, study, or work devote oneself to a special area of work.
STS2012-gold    surprise.OnWN   3.250   elevated wooden porch of a house    a porch that resembles the deck on a ship.
STS2012-gold    surprise.OnWN   4.000   either half of an archery bow   either of the two halves of a bow from handle to tip.
STS2012-gold    surprise.OnWN   3.333   a removable device that is an accessory to larger object    a supplementary part or accessory.
STS2012-gold    surprise.OnWN   4.750   restrict or confine place limits on (extent or access).
STS2012-gold    surprise.OnWN   0.500   orient, be positioned   be opposite.
alvas@ubi:~/git/stasis$ python
Python 2.7.10 (default, Jun 30 2015, 15:30:23)
[GCC 4.8.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> with open('sts.csv') as fin:
...     for line in fin:
...             print len(line.split('\t'))
...             break
...
5

>>> with open('sts.csv') as fin:
...     for line in fin:
...             assert len(line.split('\t')) == 5
...
>>>

Even more sanity check that it's the no. of columns, @papayawarrior example of the 4 columns line was correctly parsed in my version of graphlab:

I have manually checked the problematic lines and they're:
STS2012-gold    MSRpar  3.800   "She was crying and scared,' said Isa Yasin, the owner of the store.    "She was crying and she was really scared," said Yasin.
STS2012-gold    MSRpar  2.200   "And about eight to 10 seconds down, I hit. "I was in the water for about eight seconds.
STS2012-gold    MSRpar  2.800   "It's a major victory for Maine, and it's a major victory for other states. The Maine program could be a model for other states.
STS2012-gold    MSRpar  4.000   "Right from the beginning, we didn't want to see anyone take a cut in pay.  But Mr. Crosby told The Associated Press: "Right from the beginning, we didn't want to see anyone take a cut in pay.
STS2012-train   MSRpar  3.750   "We put a lot of effort and energy into improving our patching process, probably later than we should have and now we're just gaining incredible speed. "We've put a lot of effort and energy into improving our patching progress, probably later than we should have.
STS2012-train   MSRpar  4.000   "Tomorrow at the Mission Inn, I have the opportunity to congratulate the governor-elect of the great state of California.   "I have the opportunity to congratulate the governor-elect of the great state of California, and I'm looking forward to it."
STS2012-train   MSRpar  3.600   "Unlike many early-stage Internet firms, Google is believed to be profitable.   The privately held Google is believed to be profitable.
STS2012-train   MSRpar  4.000   "It was a final test before delivering the missile to the armed forces. State radio said it was the last test before the missile was delivered to the armed forces.
STS2012-train   MSRpar  4.750   "The economy, nonetheless, has yet to exhibit sustainable growth.   But the economy hasn't shown signs of sustainable growth.
STS2014-gold    deft-forum  0.8 "Then the captain was gone. Then the captain came back.
STS2014-gold    deft-forum  1.8 "Oh, you're such a good person! You're such a bad person!"
STS2015-gold    answers-forums      "Normal, healthy (physically, nutritionally and mentally) individuals have little reason to worry about accidentally consuming too much water.  It's fine to skip arm specific exercises if you are already happy with how they are progressing without direct exercises.
STS2015-gold    answers-forums  1.40    "The grass family is one of the most widely distributed and abundant groups of plants on Earth. As noted on the Wiki page, grass seed was imported to the new world to improve pasturage for livestock.
STS2015-gold    answers-forums      "God is exactly this Substance underlying who supports, exist independently of, and persist through time changes in material nature.    I'd argue that matter and energy are substances in the category of empirical scientific knowledge.
STS2015-gold    belief      "watching the first fight i saw that manny pacquiao was getting tired, and i wasn't.    at the same time, an asian summit is being held in a tourist resort.
STS2015-gold    belief      "global warming doesn't mean every year will be warmer than the last.   doesn't matter, that will just be obama's fault as well.
STS2015-gold    belief      "the only reason i'm not as confident that there's something about the birth certificate... the conventional view is that the us and ussr fought it out in the body of vietnam.
STS2015-gold    belief      "im not playing these bullshit games... if not get the hell out of there.
STS2015-gold    belief      "that oil is already contaminating our shoreline.   what point are you trying to relay?
STS2015-gold    belief      "we cannot write history with laws. "she's not sitting here" he said.
STS2015-gold    belief      the protest is going well so far.   our request is the same.
STS2015-gold    belief      "for over 20 years, i have illustrated the absurd with absurdity, three hours a day, five days a week.  for the first 1-2 years he hated me going out with my friends.

Instead of finding these lines manually by repeatedly cleaning out these lines from the PROGRESS: ... verbose message, is there a way to just dump these lines out when loading it into a Graphlab SFrame?

A: UPDATED ANSWER
Apologies to @alvas, I didn't see that a full dataset was linked in the original post. There are indeed five columns in all of the rows, and the problem does seem to be mismatched quotes. The SFrame CSV parser gets confused if there aren't matching quotes within a column, so the short answer is to change the quote character to something you know doesn't appear in the dataset.
import graphlab
sts = graphlab.SFrame.read_csv('sts.csv', delimiter='\t',
                                column_type_hints=[str, str, float, str, str],
                                quote_char='\0')

This successfully reads all 19,097 rows for me.
As an aside, there is also an SFrame.read_csv_with_errors method that will read the "good" lines into an SFrame, and collect the "bad" lines in an un-parsed SArray. That would let you keep track of the problematic lines in a programmatic way.
ORIGINAL ANSWER
Your data rows don't appear to contain any quotes, so this is not the problem. The problem is that you have 5 columns in some rows of data (and the header), but only 4 columns in other rows of data.
The first row has four columns:
STS2012-gold    surprise.OnWN   5.000   render one language in another language restate (words) from one language into another language.

while the second row has five:
STS2012-gold    surprise.OnWN   3.250   nations unified by shared interests, history or institutions    a group of nations having common interests.

To work around this I would call the SFrame csv parser twice, once for the four-column data, and once for the five-column data. Because the first fow has four columns, that one is a little more straightforward:
import graphlab
sts4 = graphlab.SFrame.read_csv('sts.csv', delimiter='\t', header=True)

For the five-column data we have to skip the header and the first row, then rename the columns:
sts5 = graphlab.SFrame.read_csv('sts.csv', delimiter='\t',
                                header=False, skiprows=2)
sts5 = sts5.rename({'X1': 'Dataset', 'X2': 'Domain', 'X3': 'Score',
                    'X4': 'Sent1', 'X5': 'Sent2'})

Then sts4 looks like
+--------------+---------------+-------+-------------------------------+
|   Dataset    |     Domain    | Score |             Sent1             |
+--------------+---------------+-------+-------------------------------+
| STS2012-gold | surprise.OnWN |  5.0  | render one language in ano... |
| STS2012-gold | surprise.OnWN |  4.0  | devote or adapt exclusivel... |
+--------------+---------------+-------+-------------------------------+

And sts5 is
+--------------+---------------+-------+-------------------------------+
|   Dataset    |     Domain    | Score |             Sent1             |
+--------------+---------------+-------+-------------------------------+
| STS2012-gold | surprise.OnWN |  3.25 | nations unified by shared ... |
| STS2012-gold | surprise.OnWN |  3.25 | convert into absorbable su... |
| STS2012-gold | surprise.OnWN |  3.25 | elevated wooden porch of a... |
+--------------+---------------+-------+-------------------------------+
+-------------------------------+
|             Sent2             |
+-------------------------------+
| a group of nations having ... |
| soften or disintegrate by ... |
| a porch that resembles the... |
+-------------------------------+


text:
Q: Bitmap .clone gets error "OBJECT IS CURRENTLY IN USE ELSEWHERE" I'm getting this error during event with camera frame Bitmap from USB camera when I try to clone the Bitmap to change its format from 32bpp to 24bpp, in order to match input requirement of later comparison method.
Using Visual Studio 2017 Pro C# on Windows 10.
Initialize Bitmap objects...
namespace ACCORD_WindowsFormsApp9
{
    public partial class Control_Panel : Form
                    static Bitmap camera_snapshot_Bitmap = null;
                    static Bitmap camera_frame_Bitmap = null;
                    static Bitmap latest_frame_buffer_Bitmap = null;
                    static Bitmap latest_frame_clone_Bitmap = null;
                    static Bitmap reference_snapshot_Bitmap = null, reference_cropped_Bitmap = null;
                    static Bitmap target_snapshot_Bitmap = null, target_cropped_Bitmap = null;
            static int PictureBox_live_camera_changes = 0;

. . .

        // CONSTRUCTOR:
        public Control_Panel()
        {
            InitializeComponent();
        // Automatically start inputing each frame from camera:
            var videoDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice);
            // Select physical USB camera:
                videoSource = new VideoCaptureDevice( videoDevices[0].MonikerString, pixelFormat_for_ExhaustiveTemplateMatching);

        // Select event handlers:
            videoSource.NewFrame += new NewFrameEventHandler(Event_camera_frame);
            PictureBox_live_camera.Paint +=     Event_draws_crop_rectangle;

        // Start slurpin up them camera frames:
            videoSource.Start();

       }

Event fires with latest frame from USB camera..............
private  void Event_camera_frame(object sender, NewFrameEventArgs camera_frame_event)
{

    // Select latest frame from camera:
        if( camera_snapshot_Bitmap != null )
        {
            camera_snapshot_Bitmap.Dispose();
        }
        Bitmap  camera_frame_Bitmap =  camera_frame_event.Frame;                       // copy pointer

        camera_snapshot_Bitmap = new Bitmap( rotation_filter.Apply(   camera_frame_Bitmap ));

        if(  latest_frame_buffer_Bitmap != null )
        {
             latest_frame_buffer_Bitmap.Dispose();
        }
        latest_frame_buffer_Bitmap = new Bitmap(    camera_snapshot_Bitmap );           // copy frame bitmap data to buffer for later image snapshotting
        latest_frame_clone_Bitmap = latest_frame_buffer_Bitmap.Clone(new Rectangle(0, 0, latest_frame_buffer_Bitmap.Width, latest_frame_buffer_Bitmap.Height), System.Drawing.Imaging.PixelFormat.Format24bppRgb );

        set_display_rectangle();        //   PictureBox_latest_frame  ==>  display_rectangle X, Y, Width, Height
    update_target_view();
}

void update_target_view()
{
        if( PictureBox_live_camera_changes == 0 )       return;

        PictureBox_live_camera.Image = latest_frame_clone_Bitmap;
        PictureBox_live_camera.BackgroundImage = latest_frame_clone_Bitmap;
            PictureBox_live_camera_changes = 1;

 }

    void Event_draws_crop_rectangle(object sender, PaintEventArgs e)
    {
        e.Graphics.DrawRectangle( crop_pen, display_rectangle );                     /////////////   DRAW CROP RECTANGLE   /////////////
    }
    private void set_display_rectangle( )
    {
        int width, height;
            width = PictureBox_live_camera.Width;
            height = PictureBox_live_camera.Height;

        // Set crop factor as a function of max_wheel_clicks:
            double crop_factor_X =  Convert.ToDouble( mouse_wheel_clicksX ) /   max_wheel_clicksX;     // min 0 .. 1.0 max
            double crop_factor_Y =  Convert.ToDouble( mouse_wheel_clicksY ) /   max_wheel_clicksY;     // min 0 .. 1.0 max

        // Adjust crop rectangle to match mouse wheel:
            // Adjust height & width of crop rectangle by the crop factor:
                display_width_pixels  = Convert.ToInt32( width  * crop_factor_X  - crop_pen_size_pixels * 2);
                if( display_width_pixels < 5 )      display_width_pixels = 5;
                display_height_pixels = Convert.ToInt32( height * crop_factor_Y  - crop_pen_size_pixels * 2 ) ;
                if( display_height_pixels < 5 )     display_height_pixels = 5;

            // Adjust crop rectangle upper left x & y as a function of crop rectangle that will be centered within target image:
                display_x_pixels =  Convert.ToInt32( width  / 2.0 -  display_width_pixels / 2.0  + crop_shift_pixelX );
                display_y_pixels =  Convert.ToInt32( height / 2.0 -  display_height_pixels / 2.0 + crop_shift_pixelY );

            display_rectangle.Width =    display_width_pixels;
            display_rectangle.Height =   display_height_pixels;
            display_rectangle.X  =   display_x_pixels;
            display_rectangle.Y =    display_y_pixels;
    }


text:
Q: SESSIONID is not getting stored in Cookie in an application with Angular 6 as frontend and spring boot as backend I am building a simple Q&A website. The frontend is Angular 6 and the backend is Spring Boot. I am also using spring security with Redis to store sessions. I have a couple of questions.

*

*When a user login I see the response from the server contains a SetCookie: Session: XXXXX in the response header but on a subsequent call, never has session attribute set in the HEADER. I also checked the Cookie in the application tab in the inspect mode of Chrome. No value is set. However, If I set anything in the localStorage. I can see it there.

Login code
login.component.ts (This is called once the user press login)

       this.authenticationService.login(this.f.email.value, this.f.password.value)
            .pipe(first())
            .subscribe(
                data => {
                    // this.router.navigate([this.returnUrl]);
                    this.router.navigate(['/home']);
                },
                error => {
                    this.alertService.error(error);
                    this.loading = false;
                });

AuthenticationService

export class AuthenticationService {
    constructor(private http: HttpClient) { }

    login(emailId: string, password: string) {

        const headers = new HttpHeaders(
            emailId && password ? {
              authorization:'Basic ' + btoa(emailId + ':' + password)
            }:{}
          );

        return this.http.get<any>(`${environment.apiUrl}/users/login`, {headers:headers})
            .pipe(map(user => {

                if (user ) {

                    localStorage.setItem('currentUser', JSON.stringify(user));
                    console.log("user is " + JSON.stringify(user));
                }

                return user;
            }));
    }

SpringBoot
 @Override
    protected void configure(HttpSecurity http) throws Exception {
        logger.info("*********Authorizing in websecurityconfig*********");
        http.cors().and()
                //starts authorizing configurations
                .authorizeRequests()
                //ignoring the guest urls...
                .antMatchers("/resources/**", "/error","/users/**").permitAll()
                .anyRequest().fullyAuthenticated()
                .and()
                .logout().permitAll()
                .logoutRequestMatcher(new AntPathRequestMatcher("/users/logout", "POST"))
                .and()
                .formLogin().loginPage("/users/login").and()
                .httpBasic().and()
                .csrf().disable();
    }

REST API
  @CrossOrigin
    @GetMapping("/login")
    public ResponseEntity<?>  getStudentDetailById (Principal principal) throws Exception{

        final String emailId = principal.getName();
        try {
            ValidationUtil.validate(emailId);
            logger.info("Email id is " + emailId);
        } catch (InvalidArgumentException e) {
            logger.info("Exception = {} occurred", e);
        }

        return ResponseEntity.ok(principal.getName());
    }

Here is the SESSION in login response received from the server
Set-Cookie: SESSION=YjBjODE2MjQtMGQxOC00ZmU1LWI2MmMtOTg5YzkwM2FjY2Fm; Path=/; HttpOnly
After login, suppose I want to invoke another API on the same server/another server. The request does not contain the session detail.
What I am missing.

*I would like to have clarification between the functionality of the SESSIONID received and the advantage of storing userid in localStorage.

My Question
I want to get Questions posted by a user after he/she logs in. So, I need his/her userid in the response after login. So, after login, I am storing userid in localStorage. Then what is the use of SESSIONID? Is it just to make sure that subsequent request to server does not have to be authenticated again and again as the spring security will use SESSIONID to allow the user to use other resources. If yes, then will the spring security will verify each request for SESSIONID (I think so).

A: Here are my answers for you.
Setting cookie in your browser
When you want your browser to create a cookie when it received the Set-Cookie header in the response, you might need to tell the browser to be ready to accept such a behavior. By default, your browser does not store a Cookie if it was not suppose to. You have to change to get this way :
return this.http.get<any>(`${environment.apiUrl}/users/login`, {headers:headers, withCredentials: true})

Once you have done that, there is 2 scenarios possible:

*

*Either your frontend and your backend share the same root (http://localhost for instance), then you should be good, and not be concerned about CORS...

*Or, your frontend URL is http://myfrontend.com/ and your backend is http://mybackend.com, and in this case, you will experience what is a preflight request made by your browser, and some CORS issue, that your backend server is automatically enabling to avoid any attacks... See this:  Angular 2 cookie not set
Like you said in one of your comment, your server will want to make sure the client requesting your endpoint is allowed. You can accept a CORS Origin request with a global configuration:
@Configuration
@EnableWebMvc
public class WebConfig implements WebMvcConfigurer {

    @Override
    public void addCorsMappings(CorsRegistry registry) {
        registry.addMapping("/**").allowedOrigins("http://localhost:4200").allowCredentials(true);
    }
}

SESSIONID versus LocalStorage
Both things are both similar and different.
Similar:

*

*Both can be used to authenticate your user

Different:

*

*You don't authenticate the user the same way.

SESSION ID
They are used to stored your user information on the server. Basically, the server stores a map of  to keep some context :

*

*Are you authenticated ?

*Have you done this action ?

*Do you have any things you want me to hold for you ?

But it is all in the server... In the recent architecture, microservices, you don't want to allow the server to store information because you can't ensure that your client, by doing the same request twice, will call the same server... This to make sure you have a resident system, or you need to deploy more service because there is suddenly a pic of activity... Anyway, this is old school, but works fine when you know your client will talk to only one server.
The SESSION_ID is stored in a cookie, accessible only by HTTP, which means you can not read the cookie value from your javascript code... It is protected this way. And it is your browser that is in charge of sending that cookie to the server.
Each server has its own instance of the SESSION maps... It is not shared, and therefor, server1 does not have the same SESSION maps as server2... which is a big problem in a system where you don't know how servers you can have at the same time.
Local storage
Something that works well for microservices architecture is giving the possibility to the client to carry is own authentication information, in a Token. This way, you can have 1, 2 or 25 server to talk too, your client will be authenticated the same way. But this token has to sent at every you make to the server. Now the thing is How do I store the token and send it to the server ?
You have 2 options (even more, but let's consider only 2) :

*

*You store this in your local storage: localStorage.setItem('token', JSON.stringify(token));. But a local storage is vulnerable to XSS attack... an hacker could steal your token information, and then use it to authenticate to the website and doing things for you, or accessing some private data. For more information on XSS
So localStorage is perfect to store non-sensitive user date, and making the client holding its internal state... But it can be dangerous to use when storing the sensitive data, like a token.
The solution ? Use a HTTP ONLY cookie to store the client's token. It is different than the SESSION_ID, because it is still your client holding the authentication information, but it secured and protected from being accessed by any bad javascript code.
Hope it answers your questions.


text:
Q: Significance of 'In' in Java I've copied the following method from page 173 of this book.
public class ThreeSum
{
  public static int count(int[] a)
  { // Count triples that sum to 0.
    int N = a.length;
    int cnt = 0;
    for (int i = 0; i < N; i++)
      for (int j = i+1; j < N; j++)
        for (int k = j+1; k < N; k++)
          if (a[i] + a[j] + a[k] == 0)
            cnt++;
    return cnt;
  }

  public static void main(String[] args)
  {
    int[] a = In.readInts(args[0]); // error here
    StdOut.println(count(a)); // and here
  }
}

The In.readInts causes an error. Do I need to be including a library to access the 'In' object? (third last line)

A: Yes, In is not a original Java class, but probably an API/Library class from your book. Look at one of the first pages, probably you will find some information about the class.


text:
Q: Image doesn't show even when I can see it doing inspect in the browser I have tried for more than two hours and I can not find an answer to this problem. I have this part of the code in a view strongly typed in MVC:

    @foreach (var TitleBook in Directory.GetFiles(Server.MapPath("~/App_Data/Images"), "*.jpg"))
    {
        var fileName = Path.GetFileName(TitleBook);
        if (Convert.ToInt32(fileName.Substring(0,3)) == item.IdBook)
        {

        }
    }

The name of the image file is created so the three first characters in the filename are numbers.
When I run the code, I get the alternate message for the image in the hmtl view. However, the path to this image is well read and I know it because I can obtain it by doing inspect in the browser and calling only the src part of  in another window which shows the image as expected (sorry for my English). The css is handled by the version of boostrap installed in VS2017.
Could someone point to my error here?

A: Your titleBook is a full physical path. But  wants an URL.
Untested:

BTW: with Directory.GetFiles(..., $"{item.IdBook:D3}*.jpg")) you wouldn't need the foreach loop.


text:
Q: How to split paired-end fastq files? I have Illumina paired-end reads contained within one .fastq file, denoted as '/1' for forward reads and '/2' for reverse reads.
I am using grep to pull out the individual reads and place them into 2 respective files (one for forward reads and one for reverse.
grep -A 3 "/1$" sample21_pe.unmapped.fq > sample21_1_rfa.fq
grep -A 3 "/2$" sample21_pe.unmapped.fq > sample21_2_rfa.fq

However, when I try to use the files (fastqc, assembly, etc), they do not work. When running
fastqc i get the following error:
 Failed to process file sample21_1_rfa.fq
 uk.ac.babraham.FastQC.Sequence.SequenceFormatException: ID line didn't start with '@'
     at uk.ac.babraham.FastQC.Sequence.FastQFile.readNext(FastQFile.java:134)
     at uk.ac.babraham.FastQC.Sequence.FastQFile.next(FastQFile.java:105)
     at uk.ac.babraham.FastQC.Analysis.AnalysisRunner.run(AnalysisRunner.java:76)
     at java.lang.Thread.run(Thread.java:662)

But, if you look at the files they identifier does indeed start with an '@'. Any advice on why these files aren't working? I had originally converted .bam files into the .fastq files with
 samtools bam2fq

Here are samples of each individual file:

*

*merged .fastq

@HISEQ:534:CB14TANXX:4:1101:1091:2161/1
GAGAAGCTCGTCCGGCTGGAGAATGTTGCGCTTGCGGTCCGGAGAGGACAGAAATTCGTTGATGTTAACGGTGCGCTCGCCGCGGACGCTCTTGATGGTGACGTCGGCGTTGAGCGTGACGCACG
+
B/</<//B<BFF<FFFFFF/BFFFFFFB<BFFF<B/7FFF7B/B/FF/F/<<F/FFBFFFBBFFFBFB/FF<BBB<B/B//BBFFFFFFF/B/FF/B77B//B7B7F/7F###############
@HISEQ:534:CB14TANXX:4:1101:1091:2161/2
TGACGCCTGCCGTCAGGTAGGTTCTCCGCAGATCCGAAATCTCGCGACGCTCGGCGGCAACATCTGCCAGTCGTCCGTGGCGGGCGACGGTCTCGCGGCGTGCGTCACGCTCAACGCCGACGTAC
+
/B<B//F/F//B<///<FB/</F<<FFFFF<FFBF/FF<//FB/F//F7FBFFFF/B</7<F//<BB7/7BB7/B<F7BF<BFFFB7B#####################################
@HISEQ:534:CB14TANXX:4:1101:1637:2053/1
NGTTTACCATACAACAATCTTGCGACCTATTCAAATCATCTATATGCCTTATCAAGTTTTCATAGCTTTCAAGATTCTCAATTTCCTCACGTCTCGCTTTGCTCAACCTACAAAAACTCTCTTCT
+
#<<BBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF<FFFFFFFFFFFFFFFFFFFFFFB/BFBBFBB<<<<FFFFFFBB<FBFFBFF
@HISEQ:534:CB14TANXX:4:1101:1637:2053/2
TCGGTCGTTGGGAAAAGACCTGTGGTAAACATCCTACGCAAAAGCCATTGCGGTTACTCGTTCGTATGATTCTTGCATCAACTAATCAAGGCGATTGGGTTCTCGACCCATTTTGTGGAAGTTCG
+
BBBBBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFFFFFFFFFFFFFFBFFFFFB<FF<<BBFB
@HISEQ:534:CB14TANXX:4:1101:1792:2218/1
TCTATCGGCTGACCGATAAGCTGTCGCCTGCCGACCGTCCTGCCATGGGACGGCGCATCGCACAGCTCACCCTGGACTAACTCTCCAACACCATGATGCTGACACGCTCGGCAAAAACACCCGAT
+
<<B/<B</FF/<B/<//F<//FF<<<FF//</7/F<</FFF####################################################################################
@HISEQ:534:CB14TANXX:4:1101:1792:2218/2
TGCCGGAGGGCGTCGATGGTGGCATCGAGCTTTTTTGCCGAGCGTGTCAGCATGATGGTGTTGTAGAGATAGTCCATGGTGAGCTGTGCGATGCGCCGTTCCATGGCAGGACGGTCGGCAGGCGC
+
BBBBBFFFFFFFFBFFFBBFFFFFFFFFFFBBFFFF/FF<F7FF//F/FBB/FFBFFF/F7BFF<F/FFFFFFFFB/7BB<7BFFFFFFFFFFFFF<B///B/7B/7/B//77BB//7B/B7/B#
@HISEQ:534:CB14TANXX:4:1101:1903:2238/1
TATTCCAGCGACCGTTATAATCAAACTCAACTACATAGTCATTGCGGATTGCTTCAAGAAATTTTTTCCAGACTATTTCATCAATATTTATTTTGGGAACTGGTGCAACAGCAATTCTTTTTAAA
+
BBBBBFFFFFFFFFFFFFBFF/FFBFFBFFFFFFFF/FFFFFF<<FFFFFFFFFFFFFBFFFFFFFFFFFFFFFFFBF/B/<B<B/FBF7/<FFFFFFF/BB/7///7FF<BFFF//B/FFF###
@HISEQ:534:CB14TANXX:4:1101:1903:2238/2
TAAGGTTGGAGAAGCAACAATTTACCGTGATATTGATTTGCTCCGAACATATTTTCATGCGCCACTCGAGTTTGACAGGGAGAAAGGCGGGTATTATTATTTTAATGAAAAATGGGATTTTGCCC
+
B<BBBFFFFFFF<FFFFFFFFFFFFFFFFFF/BFFFFFFF<<FF<F<FFF/FF/FFFFBFB</<//<B/////<<FFFFB/<F<BFF/7/</7/7FB/B/BFF<//7BFF###############
@HISEQ:534:CB14TANXX:4:1101:2107:2125/1
TGTAGTATTTATTACATCATATAGAATGTAGATATAAAAGATGAAAAAGCTATAATTTCTTTGATAATATAAGGAGGGAATAACACTATGAGGATTGATAGAGCAGGAATCGAGGATTTGCCGAT
+
BBBBBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF<FFFFF/FFFFFFFFFFFFFFFFFFFFFFFFFFFFBBBFFFFFFFBB<FBB7BFF#
@HISEQ:534:CB14TANXX:4:1101:2107:2125/2
TACCACTATCGGCAAATCCTCGATTCCTGCTCTATCAATCCTCATAGTGTTATTCCCTCCTTATATTATCAAAGAAATTATAGCTTTTTCATCTTTTATATCTACATTCTATATGATGTAATAAA
+
BBBBBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF<FFFFFFFFFFFFFBFBFFFFFFFBBFFFFFFFBF7F/B/BBF7/</FF/77F/77BB#
@HISEQ:534:CB14TANXX:4:1101:2023:2224/1
TCACCAGCTCGGCACGCTTGTCCTTGACCTCCTGCTCGATCTGACCGTCCATCTTGGCTGCCACGGTGTTCTCCTCGGCGGAGTAGGCAAAGCAGCCCAGACGGTCGAACTGTATCTCCTTGACA
+
BBBBBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF<FFFFFFFFFFFFB<<B7BBFBFFF<FFBBFFFBF/7B/<B<
@HISEQ:534:CB14TANXX:4:1101:2023:2224/2
TCGAGGATCTGTGCAACTTTGTCAAGGAGATACAGTTCGACCGTCTGGGCTGCTTTGCCTACTCCGCCGAGGAGAACACCGTGGCAGCCAAGATGGACGGTCAGATCGAGCAGGAGGTCAAGGAC
+
BBBBBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFFFFFFFFBFBFFFFFFFFFFFFFFFFFFFFFFFFFBBFFFFFFFFFFFFF<7BF/<<BB###
@HISEQ:534:CB14TANXX:4:1101:2038:2235/1
TTTATGCGAATGTAGAGTGGCTTCTCCACTGCCTCGGTGAAGCCCACGCGCGAGATGAGCGAATTAAGCTGCTTTGCAGTGAATTGCATTGCATATACACCTGCGTCGGCTTGAATACTTGTGCT
+
BBBBBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFFFFFFFFFF//BFFFFFFFFFFFFF<B<BB###
@HISEQ:534:CB14TANXX:4:1101:2038:2235/2
AATCCGCTCGTGAAAGCTCCCGATAACGCCACAGTGAACACCGTGGAGTTCTCTGATACCGAAGATTTCGCACGCAGCACAAGTATTCAAGCCGACGCAGGTGTATATGCAATGCAATTCACTGC
+
BBBBBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBBFFFFFFFFFFFFFFFFFFFFFFF
@HISEQ:534:CB14TANXX:4:1101:2271:2041/1
NACACTTGTCGATGATCTTGCCAAGCTGCTTCTTGCCCACCAGGAAGCCGATCTCCAGATCAAACTCGTGGCCGGGAACACTCCGGTCCACAAAGCCCAGGTCCTGGGGAATGGGCTCATCGTAG
+
#<</BB/F/BB/F<FFFFFFFFF/<BFFFFFFFF<<FFBFFFFFFBFBFBBB<<FFFFBFFF/<B/FFFFFFFFFFFFFFFFF<FB<<BFF77BFFF/<BFFFB<</BB</7BFFFB########
@HISEQ:534:CB14TANXX:4:1101:2271:2041/2
GACTCATCTACAATGAGCCCATTCCCCAGGACCTGGGCTTTGTGGACCGGAGTGTTCCCGGCCACGAGTTTGATCTGGAGATCGGCTTCCTGGTGGGCAAGAAGCAGCTTGGCAAGATCATCGCC
+
<<BBBFFF<F/BFFFBFBF<BFF<<F/FFFBFFFF<<FFFFBFFFFFFBFFF/<B<F/<</<FFF//FFFFF/<<F/B/B/7/FF<<FF/7B/BBB/7///7////<B/B/BB/B/B/B/7BB##

*Example of forward reads after being pulled out and placed into their own .fastq file:

@HISEQ:534:CB14TANXX:4:1101:1091:2161/1
GAGAAGCTCGTCCGGCTGGAGAATGTTGCGCTTGCGGTCCGGAGAGGACAGAAATTCGTTGATGTTAACGGTGCGCTCGCCGCGGACGCTCTTGATGGTGACGTCGGCGTTGAGCGTGACGCACG
+
B/</<//B<BFF<FFFFFF/BFFFFFFB<BFFF<B/7FFF7B/B/FF/F/<<F/FFBFFFBBFFFBFB/FF<BBB<B/B//BBFFFFFFF/B/FF/B77B//B7B7F/7F###############
--
@HISEQ:534:CB14TANXX:4:1101:1637:2053/1
NGTTTACCATACAACAATCTTGCGACCTATTCAAATCATCTATATGCCTTATCAAGTTTTCATAGCTTTCAAGATTCTCAATTTCCTCACGTCTCGCTTTGCTCAACCTACAAAAACTCTCTTCT
+
#<<BBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF<FFFFFFFFFFFFFFFFFFFFFFB/BFBBFBB<<<<FFFFFFBB<FBFFBFF
--
@HISEQ:534:CB14TANXX:4:1101:1792:2218/1
TCTATCGGCTGACCGATAAGCTGTCGCCTGCCGACCGTCCTGCCATGGGACGGCGCATCGCACAGCTCACCCTGGACTAACTCTCCAACACCATGATGCTGACACGCTCGGCAAAAACACCCGAT
+
<<B/<B</FF/<B/<//F<//FF<<<FF//</7/F<</FFF####################################################################################
--
@HISEQ:534:CB14TANXX:4:1101:1903:2238/1
TATTCCAGCGACCGTTATAATCAAACTCAACTACATAGTCATTGCGGATTGCTTCAAGAAATTTTTTCCAGACTATTTCATCAATATTTATTTTGGGAACTGGTGCAACAGCAATTCTTTTTAAA
+
BBBBBFFFFFFFFFFFFFBFF/FFBFFBFFFFFFFF/FFFFFF<<FFFFFFFFFFFFFBFFFFFFFFFFFFFFFFFBF/B/<B<B/FBF7/<FFFFFFF/BB/7///7FF<BFFF//B/FFF###
--
@HISEQ:534:CB14TANXX:4:1101:2107:2125/1
TGTAGTATTTATTACATCATATAGAATGTAGATATAAAAGATGAAAAAGCTATAATTTCTTTGATAATATAAGGAGGGAATAACACTATGAGGATTGATAGAGCAGGAATCGAGGATTTGCCGAT
+
BBBBBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF<FFFFF/FFFFFFFFFFFFFFFFFFFFFFFFFFFFBBBFFFFFFFBB<FBB7BFF#
--
@HISEQ:534:CB14TANXX:4:1101:2023:2224/1
TCACCAGCTCGGCACGCTTGTCCTTGACCTCCTGCTCGATCTGACCGTCCATCTTGGCTGCCACGGTGTTCTCCTCGGCGGAGTAGGCAAAGCAGCCCAGACGGTCGAACTGTATCTCCTTGACA
+
BBBBBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF<FFFFFFFFFFFFB<<B7BBFBFFF<FFBBFFFBF/7B/<B<
--
@HISEQ:534:CB14TANXX:4:1101:2038:2235/1
TTTATGCGAATGTAGAGTGGCTTCTCCACTGCCTCGGTGAAGCCCACGCGCGAGATGAGCGAATTAAGCTGCTTTGCAGTGAATTGCATTGCATATACACCTGCGTCGGCTTGAATACTTGTGCT
+
BBBBBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFFFFFFFFFF//BFFFFFFFFFFFFF<B<BB###
--
@HISEQ:534:CB14TANXX:4:1101:2271:2041/1
NACACTTGTCGATGATCTTGCCAAGCTGCTTCTTGCCCACCAGGAAGCCGATCTCCAGATCAAACTCGTGGCCGGGAACACTCCGGTCCACAAAGCCCAGGTCCTGGGGAATGGGCTCATCGTAG
+
#<</BB/F/BB/F<FFFFFFFFF/<BFFFFFFFF<<FFBFFFFFFBFBFBBB<<FFFFBFFF/<B/FFFFFFFFFFFFFFFFF<FB<<BFF77BFFF/<BFFFB<</BB</7BFFFB########
--
@HISEQ:534:CB14TANXX:4:1101:2678:2145/1
CTGTACATAGTACGTATTTGACGCCTGCGTCGATGTAGCGTTTGAGGAAGGGAAGCAGCGGTTCTGCAGAGTCCTCTTTCCATCCGTTGATGCTAATCATTCCGTTGCGTACATCCGCTCCGAGA
+
BBBBBFFFFFFF<FFF<FFFFFFFFBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF<BFFF7BFFFFFFFF<BBFFFFFFFFBBFBBB<FFBFFFFFFFFFFFFB<BFFFFFFBFB/BFFF####
--
@HISEQ:534:CB14TANXX:4:1101:2972:2114/1
CTCTGTGCCGATCCCTTTGCCTTTGCGTTTTGAGGAAAGGAAACCACCTTCTGGGTCGGTGAGGATAGTTCCGGTGAAGGTGTTGTCCACCGCCAGGCATAGGGAATAGCTGTCAGCCTTTGCTC
+
BBBBBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB/FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFFFFFBFFFF<FFFFFFFFFF<BFFFFF
--
@HISEQ:534:CB14TANXX:4:1101:2940:2222/1
CTAATTTTTTCATTATATTACTAATTTTGTAATTGGTAAAATATTATAATATCCTTGTACATTAAGACCCCAATAATCAGAAGAAGTAAAATTAATTCCTGCAACAGTTCTTAAATATCCATTAG
+
BBBBBFFFFFFFFFFFFFFFFFFFFFFFFFFFFF<FBFFFFFFFFFFFFFFF/FBFBFFBFFFFF/<F<FFFFFFFFFF<FFFFFFBFFFFFFFFF</FBFBBF<F/7//FFBFBBFFF/<7BF#
--
@HISEQ:534:CB14TANXX:4:1101:3037:2180/1
CGTCAGTTCCGCAACGATAAAGAGTTCCGCATTGCAGTCACCTGTACGCTGGTAGCCACCGGAACCGATGTCAAGCCGTTGGAGGTGGTGATGTTCATGCGCGACGTAGCTTCCGAGCCGTTATA
+
B/BBBBBFFFFFFF<FFBFFFFFF<FFFFBFFFFFFF<BBFFFFFFFFFFFFFFFFFBFF/FFFFBFFBFFFFBFF/7F/BFB/BBFFFFFFFFBFF<BBF<7BBFFFFFFBBFFF/B#######
--
@HISEQ:534:CB14TANXX:4:1101:3334:2171/1
ACCGATGTACATACCCGGACGGGTACGCACATGCTCCATATCGCTCAAGTGGCGGATATTGTCATCTGTATATTCTACAGGTTGCTCCTGAGGGGTATTTGCCAGTTCTTCGGCAGCACCCTTTT
+
BBBBBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFFFFFFFFFFFFFFFBFFFFFFFFFFFBFFFFFFFFFF</<BFFFFFFFFBBFFFFFFBF</BB///BF<FFFFF<</<B
--
@HISEQ:534:CB14TANXX:4:1101:3452:2185/1
CGCAGACGGATTTGCTTGAAGTCCGTCTCATCGTATTCCGACAACTCATCGAGGAACACACGCTTGTATTGACTGATACCCTTGATTTTCTCCGGGTCGTCAAGACCACTGAAATCAATCTTGCC
+
BBBBBFFFF<FFFFFFFFFFFFFFFFFFFFFFFFFFF<FFFFFBFFFFFFFFFFFFFFFFFFFFBFFFFFFFFFFBFFFFFBFFBFFFFFFFFFB/77B/FBBFFF/<FFF/77BBFFFBFFBBB
--

Any advice would be appreciated. Thanks!

A: The fastq format uses 4 lines per read.
Your snippet has 5, as there are -- lines.  That could cause confusion to softwares expecting a 4 line format.
You can add --no-group-separator to the grep call to avoid adding that separator.
I usually follow these steps to convert bam to fastq.gz
samtools bam2fq myBamfile.bam > myBamfile.fastq

cat myBamfile.fastq | grep '^@.*/1$' -A 3 --no-group-separator > sample_1.fastq
cat myBamfile.fastq | grep '^@.*/2$' -A 3 --no-group-separator > sample_2.fastq

gzip sample_1.fastq
gzip sample_1.fastq

Once you have the two files, you should order them to be sure that the reads are really paired.

A: In general, this operation is called deinterlace fastq or deinterleave fastq. The question already has the answer here:
deinterleave fastq file
https://www.biostars.org/p/141256/
I am copying it here, with minor reformatting for clarity:
paste - - - - - - - - < interleaved.fq \
    | tee >(cut -f 1-4 | tr "\t" "\n" > read1.fq) \
    |       cut -f 5-8 | tr "\t" "\n" > read2.fq

This command converts the interlaced fastq file into 8-column tsv file, cuts columns 1-4 (read 1 lines), changes from tsv to fastq format (by replacing tabs with newlines) and redirects the output to read1.fq. In the same STDOUT stream (for speed), using tee, it cuts columns 5-8 (read 2 lines), etc, and redirects the output to read2.fq.
You can also use these command line tools:
iamdelf/deinterlace: Deinterlaces paired-end FASTQ files into first and second strand files.
https://github.com/iamdelf/deinterlace
deinterleave FASTQ files
https://gist.github.com/nathanhaigh/3521724
Or online tools with Galaxy web UI, for example this tool: "FASTQ splitter on joined paired end reads", installed on several public Galaxy instances, such as https://usegalaxy.org/ .

Avoid using a regex for simple fastq file parsing if you can use line numbers, both for speed (pattern matching is slower than simple counting) and for robustness.
Highly unlikely, but a pattern like ^@.*/1$ (or whatever the readers might change it to, while reusing this code later) can match also the base quality line. A good general rule is to simply rely on fastq spec, which says 4 lines per record.
Note that @, /, 1, and 2 characters are allowed in Illumina Phred scores: https://support.illumina.com/help/BaseSpace_OLH_009008/Content/Source/Informatics/BS/QualityScoreEncoding_swBS.htm .
A one-liner that pulls out such (admittedly, very rare) reads is left as an exercise to the reader.

A: We can split FASTQ files using Seqkit.
seqkit split2 -p 2 sample21_pe.unmapped.fq

https://bioinf.shenwei.me/seqkit/usage/#split2
Example 4 will help this question.
I'm not sure if it recognize the read ID. It split and write alternately into 1st-output-file and 2nd-output-file.


text:
Q: Create multiple Java Threads at once Is there any possibility to create the threads as follows,
Thread odjhygThread= new Thread(objJob1, objJob2);

I think we couldn't, if we want to create what needs to be done?
anyone knows the answer? Thanks in advance.

A: A Thread runs one job. That's the way they are designed.
If you are trying to run two jobs, use two Threads.
If you want to hand over two jobs to be run in the background, read the JavaDocs for the Executors class, and the ThreadPoolExecutor class. It will take you a while to get your head around them, but unfortunately that's the nature of multi-threading in Java. Complicated.

A: I'm not sure this is what you're aiming for but.. Create a class that extends Thread, and give it a c'tor that takes 2 parameters.

A: Yes (unless I am missing something here)
public class MyThread extends Thread {
    private final Object object1;
    private final Object object2;

    public MyThread(Object o1, Object o2) {
        //implicate call to super()
        object1 = o1;
        object2 = o2;
    }
    @Override
    public void run() {
        //ha ha
        //he he
        //ho ho
        //off to work we go
    }
}

A: I assume you're already aware of the Thread constructor that takes a Runnable as an argument.  Are you trying to create a thread that calls run() on two different Runnable objects?  This doesn't exist, but it would be easy to write:
public class RunTwoThings implements Runnable {

  private Runnalbe thing1;
  private Runnable thing2;

  public RunTwoThings(Runnable thing2, Runnable thing2) {
    this.thing1 = thing1;
    this.thing2 = thing2;
  }

  public void run() {
    thing1.run();
    thing2.run();
  }

}

You'd might want to do some exception handling to prevent problems in thing1 from preventing the execution of thing2.  Then, just create a new thread like so:
Thread odjhygThread= new Thread(new RunTwoThings(objJob1, objJob2));

If that's not what you're trying to do (e.g. if you want them both to run simultaneously in their own threads), you probably want Steve M.'s answer above.


text:
Q: What happens to the IView.Load event on a Form? I've just read a tutorial on Winforms MVP and have come across something that seems a bit strange to me.
Without going into too much detail, the author suggests you should have a base view interface that looks like this:
public interface IView
{
    event EventHandler Initialize;
    event EventHandler Load;
}

Then any views you create implement this interface.
However I'm a bit confused what happens when a Windows Form implements this interface as it already has it's own Load event and intellisense seems to indicate that I am provided a handler for the form event.
public partial class Form1 : Form, IView
{
    public Form1()
    {
        InitializeComponent();
        Load += (s,e) => { }; // Signature: EventHandler Form.Load
    }
}

What happens to IView.Load in this scenario?


text:
Q: What kind of operation is allowed to be executed during onbeforeunload I decide to execute some code before popping up the confirm exit dialog box.
However, the behavior of onbeforeunload is quite puzzling. Certain operations are allowed, and certain operations aren't allowed.
function dummy() {
    alert('123');            // Not allowed. Blocked alert('123') during beforeunload
    console.log('123');      // Allowed.
    navigator.vibrate(1000); // Doesn't work in my chrome mobile.
    return "do you exit";
}

window.onbeforeunload = function() {
    return dummy();
}

I was wondering, why there's such behavior? Is there any documentation on this behavior?
Is there any workaround to overcome the restriction post on navigator.vibrate before returning popup string?

A: I think you'll find that the Mozilla Development Network does have documentation on this sort of thing.
To quote:

Since 25 May 2011, the HTML5 specification states that calls to window.alert(), window.confirm(), and window.prompt() methods may be ignored during this event.

And as for the why, meager has nicely pointed out in the comments that websites should not be allowed to aggressively prevent you from leaving the page.
navigator.vibrate is a time-based function. "Vibrate for x milliseconds". When the window is unloading, it does not want the user to have to wait for anything. You might be able to find a workaround for this, but I suspect that it will be patched as this is not desirable functionality.


text:
Q: Forcing a "fromUrl" to read a file in Genexus 16U11 I'm working with Genexus 16U11 in C#: I have a web panel with an image variable, when I click a button it should load in the variable an image from a specific URL, so in the event I have
Event 'Dodestra'

     &SpeseFoto.FromURL(&targetPath)

EndEvent

Where targetpath is set previously.
It works the first time, but if I change the image in the url, it continues to load always the same image, I need to delete the cache to make it works. As in this program the image in the url has to change very often, this is a problem.
How can I force a reload of the image with the fromURL method?
EDIT: this in Chrome. In Edge and Firefox it correctly sees the new image. I tried to add this Form.Meta.AddItem("pragma","no-cache") but without success

A: I found a workaround: I can add a random parm to the url, in this way chrome is forced to check again the url&randomn = Random()
&randomn = Random()
&randomx = &randomN * 10000000000
&nomeRandom = &targetPath+"?random="+&randomx.ToString().Trim()
&SpeseFoto.FromURL(&nomeRandom)

Not a lot elegant, but it works


text:
Q: How bumblebee Nvidia works in Ubuntu? As far as I know bumblebee enables nvidia gpu when a selected client is running or run with optirun. But in wiki page Bumblebee mentioned the following line.
Using Bumblebee, you can use your NVIDIA card for rendering graphics which will be displayed using the Intel card

By this line what do exactly they mean? Is selected client rendered by Nvidia GPU(computation) then transferred to Intel GPU(to display)? Is nvidia-prime doing the same thing??

A: Correct. Nvidia Optimus technology works this way. Rendered by Nvidia or Intel and displayed by Intel.


text:
Q: How can I put an image on top of a UITableViewRowAction title? I've already searched this question but what I found was:

*

*How to put the image as the row action background.

*How to put an unicode character \u{unicode here}. It worked, but I
couldn't find an unicode character to represent an add button, or a
delete button perhaps.
But what I want is to put a custom image on top of the row action title. For example: a trash can with the title delete below it.
I've tried this code too:
"\(UIImage(named: "trashImg"))"

In the row action title string, but xcode didn't seem to count the last ) as part of the code, but only as part of the string. But anyway, I built the project and when I tested, instead of the title, there was a huge text saying some stuff like "optional: (64,)...." etc, it didn't crash tho.
Please help me, many apps do this and I want it on mine too!
Thanks in advance.

A: You need to change insets according to your requirements.
class TableViewRowAction: UITableViewRowAction
{
    var image: UIImage?

    func _setButton(button: UIButton)  {

        if let image = image, let titleLabel = button.titleLabel {

             let labelString = NSString(string: titleLabel.text!)
             let titleSize = labelString.sizeWithAttributes([NSFontAttributeName: titleLabel.font])
             button.tintColor = UIColor.whiteColor()
             button.setImage(image.imageWithRenderingMode(.AlwaysTemplate), forState: .Normal)
             button.imageEdgeInsets.right = -titleSize.width
        }
    }
}

func tableView(tableView: UITableView, editActionsForRowAtIndexPath indexPath: NSIndexPath) -> [AnyObject]? {

    let moreRowAction = TableViewRowAction(style: UITableViewRowActionStyle.Default, title: "        ") { action, indexPath in
        // Action Block of more button.
    }

    moreRowAction.image = UIImage(named: "edit_white")
    moreRowAction.backgroundColor = UIColor(red: 252/255, green: 65/255, blue: 75/255, alpha: 1.0)

    let deleteRowAction = TableViewRowAction(style: UITableViewRowActionStyle.Default, title: "        ") { action, indexPath in
          // Action Block of delete button.

    }

    deleteRowAction.backgroundColor = UIColor(red: 252/255, green: 65/255, blue: 75/255, alpha: 1.0)
    deleteRowAction.image = UIImage(named: "delete_white")

    return [deleteRowAction, moreRowAction]

}

A: You are putting the image into a string object which will get the default string representation of that image.
Perhaps this post may help.  Looks like they are overriding editActionsForRowAtIndexPath and setting the background color with a patternimage. Custom table view row action (image)
Another post saying basically the same thing UITableViewRowAction image for title


text:
Q: Unable to get property 'indexOf' of undefined or null reference Im working on a Test AB on Adobe Target.
I have this code that works perfect on chrome but When i try it on Internet explorer I get an error.
MY CODE:
function hashHandler(eventData) {
      if (eventData.newURL.includes('#mypage-example')) {
          console.log('I  am on my page');
          funcionCarga();
      }
  }
      window.addEventListener('hashchange', hashHandler, false);

ERROR: Object doesn't support property or method 'includes'
I try with indexOf but i get another error: Unable to get property 'indexOf' of undefined or null reference
I can not use polymer because I don´t have access to the original code. Is there anyway I can fix this code so it could work on Internet explorer?

A: It looks like it is necessary to check whether eventData.newURL is null:
if (eventData && eventData.newURL && eventData.newURL.includes('#mypage-example')) {
   console.log('I  am on my page');
   funcionCarga();
}


text:
Q: Does placement of Dispatch Group Enter matter? Say I want a few asynchronous tasks to complete before running some completion block. I decide to make a function that uses a Dispatch Group to make sure those things get done before continuing, something like this:
func doStuff() {
    let dispatchGroup = DispatchGroup()

    dispatchGroup.enter()
    Do asynchronous task 1 {
        dispatchGroup.leave()
    }

    dispatchGroup.enter()
    Do asynchronous task 2 {
        dispatchGroup.leave()
    }

}

Would the code above behave the exact same as the following code?
func doStuff() {
    let dispatchGroup = DispatchGroup()

    dispatchGroup.enter()
    dispatchGroup.enter()

    Do asynchronous task 1 {
        dispatchGroup.leave()
    }

    Do asynchronous task 2 {
        dispatchGroup.leave()
    }

}

In other words, do I need to put the Dispatch Group enters right next to the task I want to complete or do they work more like a counter where I can just put all of them at the start corresponding to the number of tasks I want to complete?


text: Q: GSM and UTF string detection Is there any way to detect whether in a String,all characters corresponds to GSM/UTF/Both characters set??I am working on Python-3,and I need to know,if there exists any encoding method,by which i could decide all the characters correspond to that String are GSM/UTF/combination of both.


text:
Q: How to connect visual web developer (website) with SQL Server 2008 for website designing? Am new for designing portal using visual web developer 2010 express edition. Almost i have finished designing work for a website. And, now i want to connect with database. but i dont know how to do  that. So can anyone help me on this. Specifications are below

*

*Visual web developer 2010 express edition

*SQL server 2008


text:
Q: Android "INSTALL_PARSE_FAILED_NO_CERTIFICATES" I am getting this error in Gradle with an Android project:

Android "INSTALL_PARSE_FAILED_NO_CERTIFICATES" [Solved-New]

I've read these questions (1, 2, 3) but none of them solved my issue.

A: (Posted on behalf of the OP).
Finally I find the solution.
In my case The solution is gradle plugin version! I'm using android studio ver 2.3.0-rc1 and gradle plugin (root build.gradle) with the same version, the release file could not install due to INSTALL_PARSE_FAILED_NO_CERTIFICATES failure, so I change the version of gradle plugin to 2.2.3 and make a new release again and the failure solved. I hope my solution help other guys with the same issue.
Conclusion:
root build.gradle file:
Replace:
classpath 'com.android.tools.build:gradle:[any unstable version like 2.3.0-rc1]'

To:
classpath 'com.android.tools.build:gradle:2.2.3'


text:
Q: Scraping yahoo finance in a for loop with beautifulsoup I am learning to scrape websites with Beautifulsoup, and was trying to fetch data from yahoo finance. As I advance, I am stuck wondering if there would be a reason why it is successfully fetching what I want when I am not in a for loop (searing for a specific ticker), but as soon as I try to make it use a csv file to search for more than one ticker, the .find() method returns an error instead of the tag I am looking for.
Here is the code when it runs well,
    ```
    import requests
    import csv
    from bs4 import BeautifulSoup

    > ------ FOR LOOP THAT MESSES THINGS UP ----- <
    # with open('s&p500_tickers.csv', 'r') as tickers:
    #     for ticker in tickers:

    ticker = 'AAPL' > ------ TEMPORARY TICKER TO TEST CODE

    web = requests.get(f'https://ca.finance.yahoo.com/quote/{ticker}/financials?p={ticker}').text
    soup = BeautifulSoup(web, 'lxml')
    section = soup.find('section', class_='smartphone_Px(20px) Mb(30px)')
    tbl = section.find('div', class_='M(0) Whs(n) BdEnd Bdc($seperatorColor) D(itb)')
    headerRow = tbl.find("div", class_="D(tbr) C($primaryColor)")

    > ------ CODE I USED TO VISUALIZE THE RESULT ------ <
    breakdownHead = headerRow.text[0:9]
    ttmHead = headerRow.text[9:12]
    lastYear = headerRow.text[12:22]
    twoYears = headerRow.text[22:32]
    threeYears = headerRow.text[32:42]
    fourYears = headerRow.text[42:52]

    print(breakdownHead, ttmHead, lastYear, twoYears, threeYears, fourYears)

    ```

It returns this:
    ```
    Breakdown ttm 2019-09-30 2018-09-30 2017-09-30 2016-09-30

    Process finished with exit code 0
    ```

Here is the code that does not work
    ```
    import requests
    import csv
    from bs4 import BeautifulSoup

    with open('s&p500_tickers.csv', 'r') as tickers:
        for ticker in tickers:

            web = requests.get(f'https://ca.finance.yahoo.com/quote/{ticker}/financials?p={ticker}').text
            soup = BeautifulSoup(web, 'lxml')
            section = soup.find('section', class_='smartphone_Px(20px) Mb(30px)')
            tbl = section.find('div', class_='M(0) Whs(n) BdEnd Bdc($seperatorColor) D(itb)')
            headerRow = tbl.find("div", class_="D(tbr) C($primaryColor)")

            breakdownHead = headerRow.text[0:9]
            ttmHead = headerRow.text[9:12]
            lastYear = headerRow.text[12:22]
            twoYears = headerRow.text[22:32]
            threeYears = headerRow.text[32:42]
            fourYears = headerRow.text[42:52]

            print(breakdownHead, ttmHead, lastYear, twoYears, threeYears, fourYears)
    ```

I welcome any feedback on my code as I am always trying to get better.
Thank you very much

A: So I have resolved the problem.
I realized that the .writerow() method of the csv module adds '\n' at the end of the string.(Ex:'MMM\n').
Somehow, the new line was keeping the .find() method to be executed in the for loop. (Still don't know why)
Afterward, it worked for the first line but since there was empty spaces I had to get python to pass the empty spaces with an If statement.
I replaced the '\n' with a '' and it worked.
Here's what it looks like:
    '''
    for ticker in tickers.readlines():
        ticker = ticker.replace('\n', '')
        if ticker == '':
            pass
        else:
            web = requests.get(f'https://ca.finance.yahoo.com/quote/{ticker}/financials?p={ticker}').text
            soup = BeautifulSoup(web, 'lxml')
            headerRow = soup.find("div", class_="D(tbr) C($primaryColor)")
    '''

If any of you see a better way to do it, I would be pleased to have some of your feedback.
I am new to programming and would really like to know what I am doing wrong!


text:
Q: VHDL: How to verify that a signal has remained unchanged over a period of time in VHDL testbench? In VHDL testbench we can use the wait statement and then check the value of signal after arbitrary intervals of time. It is straight forward to do this. This can be used to check value of something at specific points in time.
I am in a sitauation where I not only need to check value of a signal but also ensure that is has remained constant since it was checked last time. How can this be done in a VHDL testbench? I do not think VHDL has a built in fuctionality to do something like this.


text:
Q: I encountered the print_req_error while trying to open Ubuntu 16.04 on my dual booted HP laptop So I have an HP Pavilion 15au627tx laptop and I had been using Ubuntu  16.04 for about 6 months before I first encountered this problem. Once when I logged in last November, everything was in a read only mode and I freaked out but nothing I tried seemed to work. I shut down my computer and Ubuntu never seemed to open, I seemed to get the BusyBox error. However as I had very little time to focus on that, I used Windows which worked perfectly fine. However, now that I have been trying to fix it, nothing seems to work. I tried fixing it but nothing seemed to work and eached time I went onto Ubuntu I got a huge list of corrupted sectors which made no sense to me. I finally decided to backup my data from Windows and decided to wipe the Ubuntu partition, and tried reinstalling. I installed it alongside windows using the same partition as before. However it didn't work and each time I've tried to log in, this thing comes on the screen. I'm really confused about this as I don't know what this means. All questions seemingly related to this state that my hard disk is dying. However, I've been working with Windows to do class work  and it seems perfectly fine. How do I fix this? Do I replace the hard disk (I have an extended warranty on my laptop)? Is there any other way to fix it without any such drastic measures. Here's  a screenshot if you want to know what I see https://i.imgur.com/umxENKJ.jpg
Also, it may or may not be relevant but I had to reinstall Ubuntu 16.04 twice before. Once when I downgraded from 18.04 to 16.04 and then the OS didnt work , reinstall Ubuntu 16.04 once again and things seemed perfectly fine. In case you want to know who the hard drive manufacturer is, let me know.

A: Considering no one answered this, I would just like to add that reinstalling it does the trick. I tried 18.04 once again and it seems fine.
Edit: After a few months, this still happens with me, so I might reccommend changing hard drive.


text:
Q: Java socket: Connection reset I have browsed, searched ... and nothing sparkles to my mind!
I am running a chat type service between a server and an Android app. The client connects, the server registers the socket, and every 10 minutes the server sends to all connected devices a message.
My problem is that randomly I have a connection reset exception. I can not trace back when the problem occurs.
My server side code is:
final public class ChatRoomService {
    private final static String AUTHENTICATE = "AUTHENTICATE";
    private final static String BROADCAST = "BROADCAST";
    private final static String DISCONNECT = "DISCONNECT";
    private final static String OK = "OK";
    private final static String NOK = "NK";

    private final static Logger LOGGER = Logger.getLogger(ChatRoomService.class);

    private ServerSocket listener = null;

    @Inject
    private EntityManager entityManager;
    public EntityManager getEntityManager() {
        return entityManager;
    }

    @Inject
    private PlayerManager playerManager;
    PlayerManager getPlayerManager() {
        return playerManager;
    }

    private static HashSet<ChatRoomConnection> connections = new HashSet<ChatRoomConnection>();
    public void addConnection(ChatRoomConnection c) {
        synchronized(connections) {
            connections.add(c);
        }
    }
    public void removeConnection(ChatRoomConnection c) {
        synchronized(connections) {
            connections.remove(c);
        }
    }

    public void startListeningToChatRoomConnection() throws IOException {
        listener = new ServerSocket(9010);

        try {
            LOGGER.infof("startListening - Start listening on port %s", 9010);
            while (true) {
                ChatRoomConnection connection = new ChatRoomConnection(listener.accept(), this);
                addConnection(connection);
                connection.start();
            }
        } catch (IOException e) {
            if (!listener.isClosed())
                LOGGER.errorf("listenToChatRoomConnection - Connection lost during connection: %s", e.getMessage());
        } finally {
            if (listener != null && !listener.isClosed()) {
                LOGGER.infof("listenToChatRoomConnection - Stop listening");
                listener.close();
            }
        }
    }

    public void stopListeningToChatRoomConnection() throws IOException {
        if (!listener.isClosed()) {
            LOGGER.infof("stopListeningToChatRoomConnection - Stop listening");

            listener.close();
            listener = null;

            // Closing all sockets
            for (ChatRoomConnection connection : connections) {
                    connection.close();
            }
            // Clear up the connections list
            synchronized (connections) {
                connections.clear();
            }
        }
    }

    public void broadcastToChatRoomClients(Object message) {
        synchronized (connections) {
            // Log
            LOGGER.debugf("Broadcast ChatRoom: %s - %s",
                    connections.size(),
                    message.toString());

            for (ChatRoomConnection connection : connections) {
                LOGGER.debugf("Broadcast ChatRoom to %s", connection.userName);
                connection.publish(message);
            }
        }
    }

    private ChatRoomService() {
    }

    private static class ChatRoomConnection extends Thread {
        private Socket socket;
        private BufferedReader readerFromClient;
        private PrintWriter writerToClient;
        public String userName;

        private ChatRoomService chatCService;

        ChatRoomConnection(Socket socket, ChatRoomService chatRoomService) {
            super("ChatRoomConnection");

            this.socket = socket;
            this.chatRoomService = chatRoomService;
        }

        public void run() {
            try {
                readerFromClient = new BufferedReader(new InputStreamReader(socket.getInputStream()));
                writerToClient = new PrintWriter(socket.getOutputStream(), true);

                // 1- Authenticate the Device/ Player
                writerToClient.println(ChatRoomService.AUTHENTICATE);
                writerToClient.flush();
                Gson gson = new Gson();
                Request request = gson.fromJson(readerFromClient.readLine(), Request.class);
                if (chatRoomService.getPlayerManager().isPlayerSignedIn(request.getPlayerId(), request.getSignedInOn())) {
                    Player player = (Player) chatRoomService.getEntityManager().find(Player.class, request.getPlayerId());
                    userName = player.getUsername();
                    LOGGER.infof("listenToChatRoomConnection - Connection established with %s", userName);
                    writerToClient.println(ChatRoomService.OK);
                    writerToClient.flush();
                    while (true)
                        if ((readerFromClient.readLine() == null) ||
                            (readerFromClient.readLine().startsWith(ChatRoomService.DISCONNECT)))
                        break;
                } else {
                    writerToClient.println(ChatRoomService.NOK);
                    writerToClient.flush();
                }
            } catch (Exception e) {
                LOGGER.errorf("listenToChatRoomConnection - Error with %s: %s", userName, e.getMessage());
                e.printStackTrace();
            } finally {
                try {
                    if (!socket.isClosed()) {
                        LOGGER.infof("listenToChatRoomConnection - Connection closed by the client for %s", userName);
                        socket.close();
                    }
                } catch (IOException e) {
                    LOGGER.errorf("listenToChatRoomConnection - Can not close socket: %s", e.getMessage());
                    e.printStackTrace();
                } finally {
                    chatRoomService.removeConnection(this);
                }
            }
        }

        public void publish(Object message) {
            if (!socket.isClosed()) {
                writerToClient.println(ChatRoomService.BROADCAST);
                Gson gson = new Gson();
                writerToClient.println(gson.toJson(message));
            }
        }

        public void close() {
            writerToClient.println(ChatRoomService.DISCONNECT);
            try {
                LOGGER.infof("listenToChatRoomConnection - Connection closed by the server for %s", userName);
                socket.close();
            } catch (IOException e) {
                LOGGER.errorf("Error when trying to close a socket: %s", e.getMessage());
                e.printStackTrace();
            }
        }
    };
}

The device code is:
public class ServerBroadcastManager {
    private static final String TAG = ServerBroadcastManager.class.getName();

    // Type of messages from the server
    static public String AUTHENTICATE = "AUTHENTICATE";
    static public String DISCONNECT = "DISCONNECT";
    static public String BROADCAST = "BROADCAST";
    static public String OK = "OK";
    static public String NOK = "NK";

    private int networkPort;
    private ServerBroadcastListener broadcastListener;
    private Socket networkSocket;

    BufferedReader in;
    PrintWriter out;

    public ServerBroadcastManager(Context context, ServerBroadcastListener listener, int port) {
    this.networkPort = port;
    this.broadcastListener = listener;
    }

    public void startListening(final Context context) {
    Runnable run = new Runnable() {
        @Override
        public void run() {
            // Make connection and initialize streams
            try {
                networkSocket = new Socket();
                networkSocket.connect(new InetSocketAddress(mydomain, networkPort), 30*1000);
                in = new BufferedReader(new InputStreamReader(
                        networkSocket.getInputStream()));
                out = new PrintWriter(networkSocket.getOutputStream(), true);

                // Process all messages from server, according to the protocol.
                while (true) {
                    String line = in.readLine();
                    if (line.startsWith(ServerBroadcastManager.AUTHENTICATE)) {
                        Request request = formatAuthenticateRequest(context);
                        Gson requestGson = new Gson();
                        out.println(requestGson.toJson(request));
                        out.flush();
                        // Waiting for confirmation back
                        line = in.readLine();
                        if (line.startsWith(ServerBroadcastManager.OK)) {
                        } else if (line.startsWith(ServerBroadcastManager.NOK)) {
                        }
                    } else if (line.startsWith(ServerBroadcastManager.BROADCAST)) {
                        Gson gson = new Gson();
                        @SuppressWarnings("unchecked")
                        LinkedHashMap<String,String> broadcast = gson.fromJson(in.readLine(), LinkedHashMap.class);
                        broadcastListener.processBroadcast(broadcast);
                    } else if (line.startsWith(ServerBroadcastManager.DISCONNECT)) {
                        break;
                    }
                }
            } catch (UnknownHostException e) {
                    Log.i(TAG, "Can not resolve hostname");
            } catch (SocketTimeoutException e) {
                    Log.i(TAG, "Connection Timed-out");

                broadcastListener.connectionFailed();
            } catch (IOException e) {
                    Log.i(TAG, "Connection raised on exception: " + e.getMessage());

                if (!networkSocket.isClosed()) {
                    broadcastListener.connectionLost();
                }
            }
        }
    };

    Thread thread = new Thread(run);
    thread.start();
}

public void stopListening() {
    try {
        if (networkSocket != null)
            networkSocket.close();
    } catch (IOException e) {
            Log.i(TAG, "Exception in stopListening: " + e.getMessage());
    }
}

private Request formatAuthenticateRequest(Context context) {
    Request request = new Request();
    SharedPreferences settings = context.getApplicationContext().getSharedPreferences(Constants.USER_DETAILS, 0);

    request.setPlayerId(BigInteger.valueOf((settings.getLong(Constants.USER_DETAILS_PLAYERID, 0))));
    request.setSignedInOn(settings.getLong(Constants.USER_DETAILS_SIGNEDINON, 0));

    return request;
    }
}

My last resort might be to move my server to another location, and see if this could not be related to my broadband router. I have notice that some of my HTTP call do not reach the server as well, though port forwarding is properly in place.
Thanks.
David.

A: I can't find where in your source code the server sends a message every 10 minutes to all connected clients, but I have experienced connection reset exceptions while using long-lasting WebSocket connections. I solved that problem by making sure some data (ping-pong message) was send from the client every minute.
At the time I traced the problem to my home-router which simply closed all idle connections after 5 minutes, but firewalls can exhibit the same kind of behavior. Neither server or client will notice a closed connection until data is transmitted. This is especially nasty for the client if the client is expecting data from the server - that data will simply never arrive. Therefor, make it the responsibility of the client to check if a connection is still valid (and reconnect when needed).
Since the introduction of the ping-pong message from the client every minute, I have not seen connection reset exceptions.


text:
Q: Voice Memos visible on iTunes, but files appear to have been deleted on iPhone. Can I recover? As in title. I am trying to locate old voice memos of interviews from 2015. My backups have been destroyed and I have charged up the old 4S I used to record them, and -- lo and behold -- when I connect the phone to my Mac, iTunes lists the entire playlist of interviews that I need. But when I try to play them on iTunes nothing happens, I just get the little '!' icon appear next to the file.
The Voice Memos app says 'No recordings' -- the recordings aren't visible on the device.
So I have a tiny sliver of hope. A discrepancy between what the device tells me is on the device and what iTunes tells me is on the device.
Does this indicate that it may be possible to recover my Voice Memos?
I have used the tool iFunBox to browse my phone's Raw System Files and found a plist file in the Recordings folder that lists the old filenames. Perhaps this is how iTunes is getting the list. But how can I get the files? They are of interviews with my father, now deceased, and I am quite desperate to find them.

A: so sorry that this happened to you. Indeed, iTunes is probably listing the voice memos from the plist file - if you haven't found the recordings themselves with iFunBox (.m4a files), they are probably lost unfortunately. You can have a look again in Media/Recordings and hunt for these if you haven't already.
Sorry I can't help more.


text:
Q: need help in choosing a pc to run my flash-kiosk-app on - what cpu factors affect flash performance? i am a self-taught actionscript 3 programmer and i have written a gaming-app to run on an all-in-one touchscreen pc in fullscreen kiosk mode. this project is a "garage business" meaning i learn as i go and i dont have any of the resources of a full company ("only" a great idea and a great app).
my question regards flash/air cpu needs, multicore, clockspeed and such
the app will run on Adobe AIR, and it is not heavy on computing but rather heavy on screen rendering. Since flash/AIR rely almost completely on the cpu for the graphics rendering (and not the graphics card) i need a pc that will most suit me. i do not live in the states and i have to choose a pc based on specs alone (and custom-order it).
currently i am developing the app on Flash cs4 on my old dual 2.3 ppc mac (and on it the app doesnt run quick enough).

*

*i am most interested in a Sony Vaio L VPCL116FX/B that has an Intel® Core™ 2 Quad Q8400S (2.66GHz) processor but it is backordered and will MAYBE be available next month.

*another option is a VPCL111FX/B Vaio L which is in stock, but has a weaker cpu (Intel® Pentium® E5400 (2.70GHz))

*a third option is an HP touchsmart 600-1055 which has an 2.13GHz Intel Core 2 Duo Processor P7450

time is crucial since the kiosk must be up and running on March 24th. so i have to decide quickly.
my questions:
since flash/air are not multi-threaded should i even wait for the Q8400s?
is clockspeed the factor that will most determine the app performace? in that case, is the "weakest" Pentium® E5400 the best choice? (it has a 2.7Ghz cpu)
is "core 2" much more stronger then a Pentium, and the hp's P7450 is the best choice?
i know the info is very lacking but i would like help nevertheless
thanx a lot,
Saar

A: definitely avoid Pentium, it was developed with GHz as the only requirement, no matter how badly it performed.  Almost any Core2 will outperform almost any pentium; the only exception i can think would be an old 'server style' pentium mainboard with fat busses and fast RAM outperforming a laptop-style core2 machine, with slow RAM.  I don't think the Vaio L is such a beast.