[Solved] Convert Map to List with new java 8 streams

As already mentioned in a comment by the user “soon”, this problem can be easily solved with flatMap and map: List<TestSession> list = mapList.entrySet().stream() .flatMap(e1 -> e1.getValue().stream() .map(e2 -> new TestSession(e1.getKey(), e2.getKey(), e2.getValue()))) .collect(Collectors.toList()); solved Convert Map to List with new java 8 streams

[Solved] PHP If variable equals

Its variable type mistake. Check your assigned variable, you assigned the Array Element not the entire array. so try like below. <?php $result = mysql_query(“SELECT * FROM hr_recruitment_stages where vacancy_ref=”$vacancyref” order by added_on DESC limit 0,1″) or die(‘ERROR 315’ ); $row = mysql_fetch_array($result); $stage_name = $row[‘stage_name’]; if($stage_name == ‘Shortlisting’) { echo”Shortlisting”; } else { echo”Not … Read more

[Solved] How to make css style on Google custom search engine [closed]

<div class=”messagepop pop”> <script> //Google Custom Search Engine Code </script> <gcse:search> </gcse:search> </div> .messagepop input{ border: none; -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; outline:0; height:55px; padding: 5px; } .messagepop input{box-shadow: 1px 1px 1px 1px rgba(0, 0, 0, 0.34), -15px -14px 0px rgba(255, 255, 255, 1), 18px -55px 0px rgba(255, 255, 255,1), 33px -6px 0px rgba(255, … Read more

[Solved] Extracting a char from a string

You can’t parse a String which represents a Double with Integer.parseInt(). This will not work: Integer.parseInt(“3.0”); This will work: Integer.parseInt(“3”); Use this instead: new Double(“3.0”).intValue() But consider following behavior: new Double(“2.5”).intValue() will return 2. 2 solved Extracting a char from a string

[Solved] any idea to transfer this code to php or js using while or something? [closed]

Here is a PHP example <?php $arr_data[‘Accion’] = array(‘picture’ => ‘img/thumbs/megamovieshd.jpg’, ‘html’ => “https://stackoverflow.com/questions/34283005/Accion.html”); $arr_data[‘Bob Esponja’] = array(‘picture’ => ‘img/thumbs/mega_bobesponja.jpg’, ‘html’ => ‘Bob-Esponja.html’); ?> <div class=”contenedor canales”> <?php foreach($arr_data AS $name => $arr_details){ ?> <div class=”thumb”> <a href=”https://stackoverflow.com/questions/34283005/<?php echo $arr_details[“html’]; ?>”> <img title=”<?php echo $name; ?>” src=”https://stackoverflow.com/questions/34283005/<?php echo $arr_details[“picture’]; ?>” alt=””/> </a> <h4 class=”txt-oculto”> <a … Read more

[Solved] Counting Occurrences of integers in map c++ [closed]

Use map::find int keyToInsert = 2; std::map<int, int>::iterator it; it = yourMap.find(key); if(it != yourMap.end()){ //alert user key exists } else { //key doesn’t exist } See docs: http://www.cplusplus.com/reference/map/map/find/ 1 solved Counting Occurrences of integers in map c++ [closed]

[Solved] PHP add counter to name if already exists in array

$arrayOfNames = array( array(‘clientName’ => ‘John’), array(‘clientName’ => ‘John’), array(‘clientName’ => ‘Mary’), array(‘clientName’ => ‘Mary’), array(‘clientName’ => ‘Mary’), array(‘clientName’ => ‘Tony’), array(‘clientName’ => ‘Alex’) ); $namesCount = array(); $finalNames = array_map(function ($item) use (&$namesCount) { if (!isset($namesCount[$item[‘clientName’]])) { $namesCount[$item[‘clientName’]] = 0; } $namesCount[$item[‘clientName’]]++; $item[‘clientName’] = $item[‘clientName’] . ‘ ‘ . $namesCount[$item[‘clientName’]]; return $item; }, $arrayOfNames); … Read more