Помогите перевести код в visual basik

 int k = 0,n=10;             string y = Console.ReadLine();             char[] x = { '3', '2', '3' };             for (int i = 0; i < y.Length; i++)             {                 if (y[i] == x[0])                     k = x[0] - '0';                 if (y[i]!=x[0])                     k = n + 1;             }             Console.WriteLine(k);             Console.ReadLine(); 

Сама задача: переменной k присвоить либо номер первого вхождения Y в массив Х, либо число n+1, если Y не входит в Х.

JSP, what is the difference between javax.servlet.http.Part and java.io.File?

good afternoon everyone, I’m just adapting with JSP and I want to know when using java.io.File and javax.servlet.http.Part. What is the difference?. I could work these commands or libraries together or not?

        String Directorio_Archivo = "D:/Alumno.txt";         File file = new File(Directorio_Archivo);          try{             BufferedReader br = new BufferedReader(new FileReader(file));               String line;              while((line = br.readLine()) != null){                 String[] arr = line.split(",");                 String sql = "insert into ALUMNO (Codigo, Nombre) VALUES "                         + "('"+ arr[0] + "', '" + arr[1] + "');";                  PreparedStatement ps = cn.prepareCall(sql);                 ps.executeUpdate();             }             br.close();         }catch(Exception e){             System.out.println(e.getMessage());         } 

Now this code.

        String Directorio_Archivo = "D:/Alumno.txt";         File file = new File(Directorio_Archivo); 

Could I change this command File ** to **Part. I want the same example to work for me, but to capture through

        <input type="file" name="txt_name" accept="text/plain"> 

Failed to stop testeci.service: Interactive authentication required

Estou tentando reiniciar um serviço no sucesso da execução de um JOB no jenkins. Tudo funciona, exceto o fato do jenkins não conseguir executar o comando systemctl restart testeci.service. Ele me retorna o erro abaixo:

Failed to stop logicaldelivery.service: Interactive authentication required. See system logs and 'systemctl status testeci.service' for details. Failed to start testeci.service: Interactive authentication required. See system logs and 'systemctl status testeci.service' for details. Failed to restart testeci.service: Interactive authentication required. See system logs and 'systemctl status testeci.service' for details. 

Alguém consegue me auxiliar?

How to make AppleScript ignore escape characters in string to make a Note

I have a python script that takes a user’s input and inserts it into the name and body parameter of the make new note apple script. The problem is that any escape or special characters get interpreted by applescript. I want all strings to be treated as raw and to ignore all escape characters and things like :\//tft// without giving me a Expected “"” but found unknown token. error

The line of python looks like this:

cmd = "osascript -e 'tell application \"Notes\" \n tell account \"iCloud\" \n make new note at folder \"Notes\" with properties {name:\"%s\", body:\"%s\"} \n end tell \n end tell'" % (header, body) 

… where header and body are the user supplied strings.

But for manual testing I use the Script Editor to quickly reproduce the error.

tell application "Notes"   tell account "iCloud"     make new note at folder "Notes" with properties {name:"myname", body:"c:\test\test.txt"}   end tell end tell 

This particular note ends up looking like this:

enter image description here

I know that I can use \ instead of \ but I don’t want users to have to sanitize all their input as they could be copy pasting from a large body of text. Think of a log file or paste-bin style body of text.

Is there a way to programmatically sanitize the user’s input?

When exactly have you “taken/used the Attack action”?

There are several features with phrases similar to “When you take the Attack action” and I am wondering when exactly you have “taken the Attack action”, I have found several questions and features which have ended up making this even more confusing than I originally thought.

Extra Attack says:

“You can attack twice, instead of once, whenever you take the Attack action on your turn.”

This implies the following is true before getting extra attack: “you can attack once whenever you take the Attack action”, which, to me, is equivalent to the following: “After you take the attack action, you can attack once” which means you would have to first take the attack action, and thus you are allowed to attack once.
And then the Fighter’s Extra Attack (2) says:

“You can attack three times whenever you take the Attack action on your turn.”

I can’t think of a way “taking the Attack action” could mean making every available attack while having the extra attack features still work as intended.
The Battle Master Fighter’s Commander’s Strike Maneuver states:

“When you take the Attack action on your turn, you can forgo one of your attacks…”

If taking the Attack action meant making an entire attack then this maneuver would be useless until you acquired extra attack because you wouldn’t have any attacks left that you could forgo.
Then there’s the Polearm Master feat which says:

“When you take the Attack action and attack with only a glaive, halberd, quarterstaff, or spear…”

This unfortunately seems to say that “taking the Attack action” means completing all available attacks because only at that time could you know whether all your attacks were made with the required weapons.
And then there’s the Way of the Four Element Monk’s Fangs of the Fire Snake feature which says:

“When you use the Attack action on your turn… Your reach with your unarmed strikes increases by 10 feet for that action, as well as the rest of the turn…”

I would assume this is meant to benefit the triggering attack as well, in which case you would have to gain this benefit before you’ve made your first attack, which means “taking the Attack action” would happen before your first attack.
On top of all this, there’s the Gloom Stalker Ranger’s Dread Ambusher which has the following:

“If you take the Attack action on that turn, you can make one additional weapon attack as part of that action…” Emphasis mine

This answer here says that the additional attack must come after your first attack, due to the part that I have bolded making an exception to the general rule.
Lastly there is the Monk’s Flurry of Blows feature which states:

“Immediately after you take the Attack action on your turn…”

This answer here states that you can use FoB anytime after the first attack of your Attack action. But I am not exactly sure how this works, especially with the “immediately after” bit.
And amongst all this, though his tweets are no longer official, Crawford has said the following:

“No general rule allows you to insert a bonus action between attacks in a single action. You can interrupt a multiple-attack action with a bonus action/reaction only if the trigger of the bonus action/reaction is an attack, rather than the action.”

Which implies that “taking the Attack action” would actually mean making every single available attack.

All of these different features, at least to me, don’t seem to have any coherent/consistent meaning of the phrase and I’m wondering if there is one supported in these books.

When have you actually taken/used the Attack action?

This matters because at what point you are considered to have taken this action determines when you can use any of the above features.

Hide sharePoint list Columns based on users permissions

I want to hide SharePoint list(Three columns) from users. The columns are only see by HR manager and V/Manager. How to Achieve?

I just tried like this:

<script type="text/javascript"> $  (document).ready(function() {  $  ().SPServices({   operation: "GetGroupCollectionFromUser",   userLoginName: $  ().SPServices.SPGetCurrentUser(),   async: false,   completefunc: function(xData, Status) {   var xml = xData.responseXML.xml;       if (xml.search('Service Desk Operators') == -1)      {         $  ("select[title=Status;Approves;]").parent().parent().parent().hide();   $  ('nobr:contains("Status","approves")').closest('tr').hide();    }       }  }); }); </script> 

How can I know (without going to the station) if RTAP is offering the Anti Pollution tickets?

The Paris public transit system (RTAP) offers a reduced fare on days of high pollution, as described here: https://www.ratp.fr/forfait-antipollution (Google Translated).

This fare is a very good deal, especially as a tourist!

It has been offered so far every day that I have been visiting, but I only know that because I have been to the train station and seen it advertised. Is there a website where I can look to see whether a particular day is an anti pollution day?

Ionic/Angular mostrar opciones seleccionadas

estoy incursionando en el mundo de ionic y me encontre con algo que no puedo resolver. Tengo una lista de botones cada uno conteniendo una imagen, se deberia poder seleccionar/hacer click en varios de los botones y se termina la seleccion haciendo click en un boton al final de la pagina, este boton deberia mostrar un popup con la informacion de las opciones que seleccione.


  • Una lista con 5 opciones: A B C D E F.
  • El usuario selecciona algunas: A B C D E F.
  • El usuario hace click en el boton “submit”
  • Se muestra un popup con el contenido: B E F