Posts

Showing posts from July, 2014

android - Position View X Y and translate animation to an Original location -

Image
i trying animation small circle goes next screen clicked. have custom list view, 2 text views. 1 of textview in circle background. now on click event listitem following code triggered : intent intent = new intent(v.getcontext(), detailactivity.class); int[] location = new int[2]; holder.initialview.getlocationinwindow(location); intent.putextra("location", location); intent.putextra("initialtext", holder.initialview.gettext()); context.startactivity(intent); in above code getting location in windows of initialtextview, i.e. circle background, , pass same detailactivity. inside of detailactivity, onresume, have following code: private textview minitialtextview; private string minitialtext; private int[] listitemlocation; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_detail); ...

c++ - Recursive Merge Sort Function Giving Bad Output -

i trying figure out why merge sort function not working. believe problem within merge() part of it. here code: int mergesort(int *data, int left, int right) { //divide if (left < right) { int q = floor((left + right) / 2); //conquer mergesort(data, left, q); mergesort(data, q + 1, right); //combine merge(data, left, q, right); } //print results testing purposes (int = 0; < n; i++) { cout << data[i] << "\n"; } return 0; } and here merge() part of it. believe problem within part. int merge(int *data, int left, int q, int right) { int *temp = data; int = left, j = q + 1, z = left; int t1 = 0, t2 = 0; while (i <= q && j <= right) { //while both variables have not reached end of sub arrays if (temp[i] <= temp[j]) { data[z] = temp[i]; i++; } else { data[z] = temp[j]; ...

String To Date Conversion in Mysql -

i have column values 20150921 . want convert string value specified date format 2015-09-21 in mysql. try this: date_format(str_to_date('20150921', '%y%m%d'),'%y-%m-%d') sql fiddle demo ( assuming want date format in yyyy-mm-dd format )

Filter for Camel Restlets -

i working on camel restlet. have kind of authentication/authorization before allowing client access restlets. check header api key. how add filter, servlet? have read reference here? http://camel.apache.org/restlet.html according that, have define so-called restlesrealm.

windows - What does & mean in a MENUITEM in a .rc file? -

i beginner in windows programming. have seen .rc file looks idr_mainframe menu preload discardable begin popup "&file" begin menuitem "&new", id_file_new menuitem "&open...\tctrl+o", id_file_open menuitem separator menuitem "p&rint setup...", id_file_print_setup menuitem separator menuitem "recent file", id_file_mru_file1, grayed menuitem separator menuitem "e&xit", id_app_exit end end can explain me & mean in menuitem "&new" , mean in menuitem "e&xit" ? & defines accelerator entry - menu entry corresponding "&file" can selected pressing "f" when menu active or "alt+f" top level choices. same applies dialog resources.

linux - Script shell for renaming and rearranging files -

i rearrange , rename files. have tree structure of files : ada/rda/0.05/alpha1_freesurface.md ada/rda/0.05/p_freesurface.md ada/rda/0.05/u_freesurface.md ada/rda/0.1/alpha1_freesurface.md ada/rda/0.1/p_freesurface.md ada/rda/0.1/u_freesurface.md i want files renamed , rearranged structure below: ada/rda/ada-0.05-alpha1.md ada/rda/ada-0.05-p.md ada/rda/ada-0.05-u.md ada/rda/ada-0.1-alpha1.md ada/rda/ada-0.1-p.md ada/rda/ada-0.1-u.md using perl rename (sometimes called prename ) utility: rename 's|ada/rda/([^/]*)/([^_]*).*|ada/rda/ada-$1-$2.md|' ada/rda/*/* (note: default, distributions install rename command util-linux package. command incompatible . if have such distribution, see if perl version available under name prename .) how works rename takes perl commands argument. here argument consists of single substitute command. new name file found applying substitute command old name. allows not give file new name new directory above. in mor...

html - Adding borders with border title in materialize -

Image
i trying add section seperator using border shown in image. how appreciable. dont know there materialized component available same or not? myfiddle : https://jsfiddle.net/fcvr8oxq/ image demo : <body> <main> <link href="https://fonts.googleapis.com/icon?family=material+icons" rel="stylesheet"> <nav> <div class="nav-wrapper light-blue lighten-1"> <ul id="nav-mobile" class="full side-nav"> <li><a href="#">john daglas</a> <ul class="collection"> <li class="collection-item avatar"> <img src="http://globe-views.com/dcim/dreams/dog/dog-05.jpg" alt="" class="circle"> <span class="title">title</span> ...

nfa - Regex Pattern to Match Certain Rules -

Image
update: turns out idiot , misread original problem. original problems specifies there must @ 3 of 4 letters used, not @ least. changes question , eliminates doubts when creating nfa , dfa. sorry , help! for homework problem, have create regex pattern match these specifications... must composed of letters a, b, c, , d must in reverse alphabetical order must use @ least 3 of 4 given letters (a,b,c,d is, can have many total letters possible) my answer confident (d+c+b+a*)|(d+b+a+)|(d+c+a+)|(c+b+a+). first question if correct. second if expression can simplified or altered @ all. the next step draw graph non-deterministic finite automaton regex , having difficulty completing step. as requested, here attempt @ nfa (rough sketch) your answer fine me. there 5 kinds of patterns match: d+c+b+a+ c+b+a+ d+b+a+ d+c+a+ d+c+b+ (d+c+b+a+)|(c+b+a+)|(d+b+a+)|(d+c+a+)|(d+c+b+) ,which in following forms merging first pattern sub-fours: (d+c+b+a*)|(d+b+a+)|(d+c+a+)|(c...

html - Clipping Image when it goes outside TD border -

i've looked everywhere can't think of solution problem. i've looked on site can't find anything. i have table , each td has image within it. when hover on img want move down 100px not flow outside of td (i want cropped when goes beyond border of td). right moves down 100px , it's not clipped. here table , css: <table cellspacing="0"> <tr> <td><img src="_images/ardlthumblarge.jpg" alt="ardl thumb" width="270" height="203"></td> <td><img src="_images/thousandyearsthumblarge.jpg" alt="1000 years thumb" width="270" height="203"></td> <td><img src="_images/tablethumblarge.jpg" alt="table thumb" width="270" height="203"></td> </tr> </table> img:hover { position:relative; top: 103px; } i've tried using clip propert...

I can not use sudo and other commands in ubuntu on amazon server -

i create server on amazon , want connect ssh in putty. connect can not send comands. have errors: sudo apt-get install openjdk-7-jdk sudo: apt-get: command not found apt-get install openjdk-7-jdk -bash: apt-get: command not found root apt-get install openjdk-7-jdk -bash: root: command not found but if write sudo sudo usage: sudo [-d level] -h | -k | -k | -v usage: sudo -v [-akns] [-d level] [-g groupname|#gid] [-p prompt] [-u user name|#uid] usage: sudo -l[l] [-akns] [-d level] [-g groupname|#gid] [-p prompt] [-u user name] [-u user name|#uid] [-g groupname|#gid] [command] usage: sudo [-abehknps] [-r role] [-t type] [-c fd] [-d level] [-g groupname|#gid] [-p prompt] [-u user name|#uid] [-g groupname|#gid] [var=value] [-i|-s] [<command>] usage: sudo -e [-akns] [-r role] [-t type] [-c fd] [-d level] [-g groupname|#gid] [-p prompt] [-u user name|#uid] file ... what it? it not sudo causing trouble ...

git - I have PHP code I need to use—how do I install it? -

i'm trying code set use particular company's api. i have experience perl , if need module installed, type cpan modulename , of time works. how work php code of similar complexity? the company in question have github repository php client system access api, looks same perl module. i can git clone it, can download it, what? have install it? there no installation instructions. or start using it? there's composer.json file in there. need run composer command can figure out , install dependencies cpan module would? install system folders or right there in whatever directory happens in? feel there ought kind of official installation process because there's /tests/ folder in files downloaded. their example code literally starts this: <?php /* @var $companyname \companyname_api */ $companyname = new \companyname_api(); /* interesting stuff */ and that's it. of course nothing works if because doesn't know companyname_api files are. wo...

java - Google App Engine - Does HttpSessionListener work? -

i've found post regarding fact cannot use httpsessionlistener ( google app engine how track httpsession destroy ). i know if there's change, if can track when session opened or destroyed in java, on google app engine. thank you.

when loading a huge file into hadoop cluster , what happends if the client failed while transfering data to datanodes? -

for example,the file 1280mb , hdfs block 128mb,what happends when the client transfered 3 blocks , failed? namenode obtain file of 3 blocks or delete 3 blocks ? no not delete 3 blocks. here how works, assume block 4 in next of queue maintained fsdataouputstream. after writes x bytes due network issue datanode fails, pipeline first closed , data written deleted, new datanode given new identity , added queue , same communicated name node update metadata information block 4 , data written newly identified datanode starting 1st byte of block. anatomy of file write in definitive guide in better understanding on how done.

Navbar Horizontal list problems, not centering or taking up full width -

Image
i've been frustrated problem days on end , cannot solve it. css/html skills elementary, appreciated. (to start let me mention using weebly editor , using html/css editor customize.) so have horizontal list inside wrapper. problem cannot take entire width of #navwrap ul { or #navwrap parent/s . can't list center inside parent. i have put borders around elements see going on. (hopefully can attach pic). of css leftover trying many different things fix this, if may unnecessary. html: <div id="header-wrap"> <table id="header"> <tr id="header-row"> <td id="logowrap"><img id="logo" src="img.svg"></td> <td id="navwrap">{menu} </td> etc... css: #navwrap { height: 50px; border: 1px solid red; background-color: no...

sql server 2008 r2 - Restoring sql table including identity column -

we had few tables have data deleted. now have copy database running able restore lost data. running in same server instance. however, id columns out of sync. rows have been deleted on time etc , example row 98 in new table data 98. maybe 101 in old table. is possible copy data table across including id? or can turn identity off column. inert data , turn on. i have tried following code; truncate table dev_db.dbo.usernames go set identity_insert dev_db.dbo.usernames on insert dev_db.dbo.usernames select * live_db.dbo.usernames set identity_insert dev_db.dbo.usernames off however error msg 8101, level 16, state 1, line 6 an explicit value identity column in table 'dev_db.dbo.usernames' can specified when column list used , identity_insert on. what avoid in new table copying not make id auto increment copy data on via loop , id stay same create separate table 1 column (not auto inc) , put last record number in there then when add...

java - Spring-Data not summing up the quarterly results -

i new mongodb , spring-data, , referred stackoverflow link grouping quarterly wise , link using $cond operator in spring data , framed code snippet below, retrieving quarterwise sales report in mongodb: string pipeline = "{$project:{_id:1,'unitssold':1,'datesold':1,'results': 1 , 'productname': 1, 'year':{$year:['$datesold']}, "+ "'quarter':{$cond:[{$lte:[{$month:'$datesold'},3]},"+ "'first'," + "{$cond:[{$lte:[{$month:'$datesold'},6]},"+ "'second',"+ "{$cond:[{$lte[{$month:'$datesold'},9]},"+"'third',"+ "'fourth']}]}]}}},"+ "{$group:{'_id':{ 'year':'$year', 'quarter':'$quarter...

php - How to iterate over all the inner array elements and make modification to the original multidimensional array? -

i'm relatively newbie php arrays , i've big challenging task in front of me, please understand situation. i've multidimensional array titled $events follows : //output of print_r($events); array ( [0] => array ( [0] => array ( [rsvp_id] => 2 [event_id] => 237 [formatted_start_time] => 1443052800 [formatted_end_time] => 1443052800 [event_group_date] => 24 sep, thursday 2015 ) [1] => array ( [rsvp_id] => [event_id] => 295 [formatted_start_time] => 1443070800 [formatted_end_time] => 1443070800 [event_group_date] => 24 sep, thursday 2015 ) [2] => array ( [rsvp_id] => ...

android - How to find coustom history in Google Fit -

i working on android application wristband devices , devices have specific ble protocol, google fit can't work directly. , add application google fit historyapi, when receive steps,distance,calories device, store in fit server via api using code this datasource dstep_source = new datasource.builder() .setapppackagename(app.mcontext.getpackagename()) .setdatatype(datatype.type_step_count_delta) .setname("geekfit steps") .setstreamname("geekfit steps") .settype(datasource.type_raw) .build(); // steps data dataset dataset = dataset.create(dstep_source); datapoint datapoint = dataset.createdatapoint(); datapoint.settimestamp(sport.gettimestamp(), timeunit.milliseconds); datapoint.getvalue(field.field_steps).setint(sport.getsteps() - lastsport.getsteps()); dataset.add(datapoint); log.i(tag, "inserting dataset in history api"); com.google.android.gms.common....

javascript - Backbone.js - Remove standard submit event -

i handle submit event of form so: events: { 'submit #contactus-form': 'submit' }, ... submit: function() { alert("handle"); }, but though after seeing alert page refreshes , adds url: ?name=&email=&text= how prevent standard behavior? leaving handler. this because submiting can use event.preventdefault prevent this. try code:- submit: function(e) { e.preventdefault(); alert("handle"); },

c# - What is the difference between these two pieces of code? -

int[] div = new int[] {2,3,5}; ienumerable<int> seq = new int[] {10,15,20,25,30}; int x; (int i=0; i<div.length; i++){ x = div[i]; seq = seq.where( s=> s%x ==0); } seq = seq.tolist(); and int[] div = new int[] {2,3,5}; ienumerable<int> seq = new int[] {10,15,20,25,30}; (int i=0; i<div.length; i++){ int y = div[i]; seq = seq.where( s=> s%y ==0); } seq = seq.tolist(); the first seq's final value 10,15,20,25,30 , second one's 30. i'm little confused difference between int x; , int y = div[i]; . can explain me? thanks! invoking seq = seq.where( s=> s%x ==0); not iterate on elements. creates ienumarable encapsulating iteration, can iterated in fututre. so if declare x variable before loop, lambda, passed in where() uses same variable. since changing value in loop, last 1 used. instead of expression like: seq.where( s=> s % 2 == 0).where( s=> s % 3 == 0).where( s=> s % 5 == 0); you get: seq.where( s=...

linux - what is the difference between chanctx based drivers and non-chanctx based drivers? -

i newbie linux device drivers. have been writing driver wlan device. while registering callbacks mac80211, found few callbacks (optional ones) regarding channel contexts. dont understand how work? please go through this link understand significance of structures.

Will deleting temporary files in wamp speed up my localhost server? -

i have reinstalled wamp server , project running fast before. different there no tmp file in tmp folder (which of 34gb!!) apache maintains website access , error logs can grow in size quickly. php has similar logs (if enabled via configuration). c:\wampdeveloper\logs c:\wampdeveloper\temp once apache log files grow in size above several 100 mb, performance issues can arise. also temp folder holds lots of session , temporary data files don’t cleaned up, causes it’s own issues. to speed read wamp running slow , have points windows hosts file ipv6 firewall , anti-virus software power plan local issues your browser clear wamp log files apache mysql etc...

arrays - Adding double quotes with white spaces words in php -

i have string in below format. banking sector , lorem ispum dummy text , partner or agri business not corporate finance i need convert query below format using php. "banking sector" , "lorem ispum dummy text" , "partner" or "agri business" not "corporate finance" i need add double quotes words in between and/or/not operators. how can that? if string don't start , don't terminate (and/or/not) can use this: $output = str_replace(array(" , "," or "," not "),array('" , "','" or "','" not "'),$input); $output ='"'.trim($output).'"';

jquery - Drop Down CSS error -

i installed drop down menu buts it's not working. happens on other pages text below. causing , how can correct it? i've been working om drop down menu thing while , decided i'm not able myself. i've googled many solutions , seen couple of youtube tutorials css drop down menus somehow work person in question not me. fiddle .logo { float: left; background: #fff; padding: 28px 29px 19px 30px; } .top-nav ul li { display: inline-block; float: left; } .top-nav ul li { background: #fff; float: none; display: inline-block; padding: 40px 47.6px; letter-spacing: 2px; text-transform: uppercase; position: relative; z-index: 1; color: #32332e; font-size: 0.875em; transition: 0.5s ease; -o-transition: 0.5s ease; -webkit-transition: 0.5s ease; margin: 0 -1px; border-left: 1px solid #fff; text-decoration...

Unable to connect to ejabberd server using smack api -

i trying connect ejabberd server , using smack api. below code connection server. after setting username, host, , localhost service, trying show toast whenever connected. on debugging, neither toast shown nor exception... please have @ code below xmpptcpconnectionconfiguration config = xmpptcpconnectionconfiguration.builder() .setusernameandpassword("alien@localhost", "alien") .setservicename("localhost") .sethost("192.168.1.xx") .setport(5222) .setdebuggerenabled(true) .build(); abstractxmppconnection conn2 = new xmpptcpconnection(config); try { conn2.connect(); conn2.login(); if(conn2.isconnected()) { toast.maketext(chatclient.this,"isconnected",toast.length_long).show(); } else { toast.maketext(chatclient.this,"failed...

wordpress - WooCommerce category page is blank -

i'm usgin wp 4.3.1 , woocommerce 2.4.6. after installed works fine. go /shop page , products list there. clicked /product-category/digital-product digital product category blank page. empty page sidebar! what have make show products or sub categories? here permalink settings. common settings http://localhost/wp /%postname%/ /wp wordpress root. product category base: product-category product tag base: product-tag product permalink base http://localhost/wp /shop/%product_cat% 1st method: disable plugins ( except woocommerce ) , check if issue solved. if fix issue, try activate plugins 1 one , locate plugin responsible issue. 2nd method: try switch theme , check see if solved problem. if fix issue, inform issue theme developer , ask them fix it.

javascript - Get HTML inner HTML in C# when element not runat="server" -

i have html span contains number. the span has value set javascript, not runat="server" i need value contained in span, , store in c# string. this proving more difficult expected. i able alert box displays value doing following: clientscript.registerstartupscript(gettype(), "ir", "settimeout(function(){alert(document.getelementbyid(\"loaninterestrate\").innerhtml);}, 3000)", true); but cannot see how return value c# code. i know because clientscript.registerstartupscript returns void, there way of setting return value this? or there way of getting html element. i know can use hidden server side div, not suit purposes. i need way obtain value of html span using c#. any ideas, have been trying while , not got anywhere, , think is useful thing do. you cannot create "real" runat=server element/control without doing full postback server. the best approach may write script stores innerhtml asp.net hidd...

javascript - How to draw multipart geometries in OpenLayers 3? -

ol.interaction.draw has point, linestring, polygon, multipoint, multilinestring, multipolygon , circle type options. couldn't figure out how draw e.g. multipolygon containing several single polygons. here's demo console-logs valid geojson string, however, containing 1 single polygon. relevant code: // create draw interaction , add map: drawinteraction = new ol.interaction.draw({ source:vectorsource, type:"multipolygon" }); map.addinteraction(drawinteraction); // define geojson format: var formatgeojson = new ol.format.geojson(); // set listener on "drawend": drawinteraction.on("drawend", function(e) { // feature: var feature = e.feature; // clone feature: var featureclone = feature.clone(); // transform cloned feature wgs84: featureclone.getgeometry().transform('epsg:3857', 'epsg:4326'); // geojson of feature: var geojson = formatgeojson.writefeature(featureclone); // log: console...

php - Call a function on Form Submit and then pass variables into the function -

i have php function strip dodgy characters may used maliciously. <?php function strip_tags_content($text, $tags = '', $invert = false) { preg_match_all('/<(.+?)[\s]*\/?[\s]*>/si', trim($tags), $tags); $tags = array_unique($tags[1]); if(is_array($tags) , count($tags) > 0) { if($invert == false) { return preg_replace('@<(?!(?:'. implode('|', $tags) .')\b)(\w+)\b.*?>.*?</\1>@si', '', $text); } else { return preg_replace('@<('. implode('|', $tags) .')\b.*?>.*?</\1>@si', '', $text); } } else if($invert == false) { return preg_replace('@<(\w+)\b.*?>.*?</\1>@si', '', $text); } return $text; } ?> i have sign form above function , want pass every single form input throug...

sorting - Unix Sort Merge Workaround -

i have around five-hundred 23m files of data trying sort 1 database. have sorted them individually using sort , , trying merge them using sort --merge , whole sample sorted together. plan split them five-hundred files again. the issue running drive congested, , have 805gb available according df . when run sort --merge file1 file2 file3... receive error sort has failed due no more space left on drive. are there tips how work around or solve issue, or solution free more space? as comments say, sounds /tmp partition filling up. try sort -t . --merge file1 file2 file3 change directory (and partition) sort uses temporary storage.

Javascript Print method works in jsfiddle but not in asp.net -

i'm trying run function below in asp.net page using ie-11: function openwin() { var mywindow=window.open('','','width=200,height=100'); mywindow.document.write("<p>this 'mywindow'</p>"); mywindow.document.close(); mywindow.focus(); print(mywindow); mywindow.close(); } this runs on jsfiddle using internet explorer. however, when run asp.net web application in internet explorer, function causes internet explorer stop working , windows close. this aspx page source: <%@ page language="c#" autoeventwireup="true" codebehind="printbarcode.aspx.cs" inherits="application.barcode.printbarcode" %> <!doctype html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <style type="text/css"> .titlelabel { font-size: large; ...

repeating custom cells label swift with core data -

this followup question question asked before. didselectatrow updating multiple cells below reloaded tableview + counter after reading , experimenting after accepted guys answer still having same issue. going try different approach after reading around found use of adding/removing index path having set <nsindexpath>() var checking. after experimentation got working check on set <nsindexpath> problem reason in xcode 7 when try create second array capture integer values related set xcode freezes on indexing. altogether different issue. how go keeping track of not indexpath row counter well? latest code insert/remove indexpaths @ row is: if indexcount == 1 || indexcount == 2 { countindex.insert(indexpath) } else { countindex.remove(indexpath) } my latest try try creating dictionary stores indexpath + counter in dictionary var cardcountindexcount = [nsindexpath: int]() setting in func tableview(tableview: uitableview, didselectrowatindexpath indexp...

java - Passing arraylist from one activity to fragment of another -

i trying pass arraylist 1 activity activity's fragment. searched lot solution couldn't working answer. this passing arraylist. intent intent = new intent(sizeactivity.this,cartactivity.class); intent.putextra("printlist", photoprintslist); startactivity(intent); accepting in activity fragment. public class exampleactivity extends appcompatactivity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_cart); if (savedinstancestate == null) { fragment newfragment = new cartactivityfragment(); newfragment.setarguments(getintent().getextras()); fragmenttransaction ft = getfragmentmanager().begintransaction(); ft.commit(); } } and fragment. how pass data 1 activity fragment. private arraylist<photoprints> printsarraylist = new arraylist<>(); private string tag = "cartactivityf...

java - syntx error, insert } to complet ClassBody -

package me.san33der.pvp; import java.util.random; import org.bukkit.chatcolor; import org.bukkit.location; import org.bukkit.material; import org.bukkit.command.command; import org.bukkit.command.commandsender; import org.bukkit.enchantments.enchantment; import org.bukkit.entity.player; import org.bukkit.inventory.itemstack; import org.bukkit.inventory.meta.itemmeta; import org.bukkit.plugin.pluginmanager; import org.bukkit.plugin.java.javaplugin; import me.san33der.pvp.listeners; public class main extends javaplugin { private static main instance; public void log(string string) { } public static main getinstance() { return instance; } public void registerlisteners() { pluginmanager pm = getserver().getpluginmanager(); pm.registerevents(new listeners(this), this); } public void registercommands() { // not used yet } @override public void onenable() { getlogger().info("has been enabled"); instance = this; registerlisteners(); ...

angular 2 / typescript : get hold of an element in the template -

does know how hold of element defined in component template? polymer makes easy $ , $$. wondering how go in angular 2. take example tutorial: import {component} '@angular/core' @component({ selector:'display' template:` <input #myname(input)="updatename(myname.value)"/> <p>my name : {{myname}}</p> ` }) export class displaycomponent { myname: string = "aman"; updatename(input: string) { this.myname = input; } } how catch hold of reference of 'p' or 'input' element within class definition? you can handle dom element via elementref injecting component's constructor: constructor(myelement: elementref) { ... } docs: https://angular.io/docs/ts/latest/api/core/index/elementref-class.html

jquery - Multiple elements inline with full width button that collapses (Bootstrap) -

i'm creating responsive calendar shows info on "well" when click on name (collapsable). and want button full-width along date , icon on same line, when i'm using bootstrap grid keeps making in blocks. what can wrap on same line , make collapsable "well" appear below? this example of 1 event: <!--event 1--> <div class="row"> <div class="div-event"> <span class="date-event col-xs-2 col-sm-2"><span class="num-date-event">22</span> <br>sep</span> <button class="btn btn-event btn-block col-xs-8 col-sm-8" type="button" data-toggle="collapse" data-target="#collapse-1" aria-expanded="false" aria-controls="collapse-1">katy's super party<br>at house</button> <span class="glyphicon glyphicon-gift icon-event col-xs-2 col-sm-2" aria- hidde...

How send value in collectd with perl script? -

i created script , use in collectd. i used collectd-perl plugin don't know how use it. the goal count how many mail sent server. #!/usr/bin/perl use strict; use warnings; $pathvalue = 'value.txt'; ($value, $old_value) = (countmodule(), old_value()); ########## main ############# main(); ####### functions ############# sub old_value { open(fic,$pathvalue) or die return 0; @fic = <fic> ; foreach $line (@fic) { chomp($line) ; return $line; #return old value } } sub countmodule { $file = "mail.log"; open $fh, "<",$file or die return 0; @contents = <$fh>; @filtered = grep (/status=sent/ ,@contents); $count = scalar @filtered; return $count; } sub new_value { ($value) = @_; open (fichier, ">$pathvalue") || die ("vous ne pouvez pas créer le fichier"); print fichier "$value"; close (fichier);...

ios - PFFacebookUtils initializeFacebookWithApplicationLaunchOptions freezes app (semaphore wait trap) -

Image
on next launch after logging using fb, app freezes on initializefacebookwithapplicationlaunchoptions . heard problem before parse v1.7.2, i'm using latest sdks: installing bolts (1.2.2) installing fbsdkcorekit (4.6.0) installing fbsdkloginkit (4.6.0) installing fbsdksharekit (4.6.0) installing parse (1.8.5) installing parsefacebookutilsv4 (1.8.5) (xcode 7.0, ios 9.0) anyone knows what's problem? it bug due fbsdk trying post notification on main thread , blocking it. should fixed in parse ios sdk 1.8.6.

lucene - Optimization of solr indexing by removing redundancy -

i'm working on production scenario, having less data, going in millions. scenario: i'm having folder contains multiple students' data (student_id, rol etc). now, 1 student's data can in different folders (yes our requirement). @ current system, details of student indexed under each folder. data less, duplicacy doesn't create problem right now. but, if continue @ same process, same student's data indexed multiple times (depends on number of folders containing student data), thereby increasing redundancy , index size. want minify index size , dont want data redundancy.please provide simpler solution achieving task in solr. as long have uniquekey field defined, document same key previous document overwrite existing document, , you'll avoid having duplicates in index. if don't have unique value identify students, you're going have hard time merging (outside of solr well), , might have write custom code merge entries appropriately outs...

Data not fetched from MySQL table in PHP -

i want print name , last name of id entered in text box. here php , html code: <head> <title> search name id </title> </head> <?php if(isset($_post["searchname"])) { $id = $_post["searchname"]; $connect = new mysqli("localhost","adarsh","yeah!","adarsh"); $a = mysql_query("select * users id='$id'",$connect); $row = mysql_fetch_assoc($a); echo "$row[0] , $row[1] , $row[2]"; } else { echo "error"; } ?> <body> <form method="post" action="<?php echo htmlspecialchars($_server["php_self"]);?>"> <input type="text" maxlength="6" name="searchname"> <input type="submit" name="submit"> </form> </body> output when enter id: , , the...

cordova - Jquery Mobile DateBox is not showing time picker if created dynamically -

i using jquery mobile datebox plugin date/time picker in cordova application. works fine if written html file. problem comes if clone div has datebox input , append div. time picker not poping on tap of timer icon. the div cloning is, <div class="time-picker-template"> <input class="time-input day-time-picker" type="text" data-role="datebox" data-options='{"mode":"timebox", "usenewstyle":true}' /> </div> the way clone , var daytimepicker = $("#page-add-reminder .time-picker-template").clone(); $("#page-add-reminder #time-picker-block").append(daytimepicker); it renders datebox input field disabled. when inspect element, shows, <input class="time-input day-time-picker" type="text" data-role="datebox" data-options="{"mode":"timebox", "usenewstyle":true}" readonly="readonly...

Reading Json file from angularJs causing error -

Image
i trying read json file visual studio 2013 environment. throwing error mentioned below the page requesting cannot served because of extension configuration. if page script, add handler. if file should downloaded, add mime map. however working fine on plnkr http://plnkr.co/edit/std1ngb40yijbmc94zdm?p=preview can please let me know how resolve same ? error screen shot folder structure have set mime map correctly? see screenshot handler mapping. open iis manager display properties iis server click mime types , add json extension: file name extension: .json mime type: application/json go properties iis server click on handler mappings add script map request path: *.json executable: c:\windows\system32\inetsrv\asp.dll name: json if still fails work remove script map completed , stick mime map, not know why adding script map in first place.

installation - Installing GLscene in Delphi 10 Seattle bds -

before upgrading delphi 10 seattle got demo copy in site , tried install glscene following strictly instructions in file:///c:/glscene_vcl/_installation/installation.htm . everything going , go step 10 without serious problems including “compile here”. compiled correctly. nevertheless when tried “install every designtime package of visual components rad studio palette pages” in of them error of access violation … in module bds.exe. installed , re-installed delphi 10 , tried other times without success. sure cause related path of libraries. can me?

java - If/else statements in ANTLR using listeners -

i'm creating simple programming language school project. i'm using antlr 4 generate lexer , parser grammar. until now, have been using antlrs listener pattern apply actual functionality of programming language. now implement if/else statements i'm not sure these can implemented when using listener pattern antlr decides in order traverse parse tree when using listeners , imagine implementation of if/else statements require jumping around parse tree depending on condition in statement satisfied. can tell me if possible implement if/else statements using antlr or if have implement visitor pattern myself? also, can give extremely simple example of implementation statements? by default, antlr 4 generates listeners. if give org.antlr.v4.tool command line parameter -visitor , antlr generates visitor classes you. these work listeners, give more control on (sub) trees walked/visited. particularly useful if want exclude (sub) trees (like else/if blocks, in case). wh...