Posts

Showing posts from September, 2012

command - How do I get the appcmd? Windows 10 -

how appcmd write commands? using windows 10. getting error: 'appcmd' not recognized internal or external command, operable program or batch file. also, if have used command: appcmd delete site "default web site" if opposite - use add instead of delete ? thanks in advance! malin appcmd.exe located @ path %windir%\system32\inetsrv , default not listed in path variable. in order use command have navigate folder first , can update iis configuration using appcmd utility. by way appcmd.exe available administrator account or users members of administrators group on computer. and second question, yes opposite verb delete add . more information can found @ documentation: https://technet.microsoft.com/en-us/library/jj635852(v=ws.11).aspx#bkmk_start

angularjs - how to fix mobile portable devices elements are not working touch? -

i using bootstrap framework, angular js, node js develop application trying apply css on hover(on touch on mobile). not working in real device. how solve 1 me use :focus pseudo class well, on elements using :hover on. .class:hover, .class:focus { /* insert hover style rules here */ } this should give desired effect on mobile.

unix - How can I omit a specific comma from my output? -

i wanted format output using awk/sed, can't understand how it. using following command: uptime | awk '{print $1" " $2" " $3$4" " $6" " $10$11$12}' 15:36:17 177days, 7 0.39,0.43,0.36 my desired output 15:36:17 177days 7 0.39,0.43,0.36 i wanted omit first comma, i.e. 1 after "177days". use either sub (substitute comma empty string) or substr (make substring last character): uptime | awk '{sub(",","",$4); print $1" " $2" " $3$4" " $6" " $10$11$12}' uptime | awk '{print $1" " $2" " $3 substr($4,1,length($4)-1) " " $6" " $10$11$12}'

coffeescript - Coffescript show alert when clicking on element? -

i have code $ -> $('h1').click -> alert "i knew it!" init() what's wrong it?nothing happens. not sure probablt code formatted inproperly (what important in coffeescript). callback click event must nested (otherwise passed callback empty function) $ -> $('h1').click -> alert("i knew it!") init()

java - FileTransfer DWR and input file MULTIPLE. Uploading files -

my problem: use dwr3 (filetransfer) upload files jsp without problem, want use file in multiple mode, is: input type="file" multiple="multiple" name="... (html5) this avoid typical dialog searching files select more 1 file of client system. but, how catch them in server? i attempt without success: public string catchmultiplefiles(filetransfer[] files, httpservletrequest req) throws exception{ ...} public string catchmultiplefiles(arraylist<filetransfer> files, httpservletrequest req) throws exception{ ...} always older version catch 1 works perfectly, simply: public string catchonefile(filetransfer file, httpservletrequest req) throws exception{ ...} anyone have problem? thanks lot in advance.

NPGSQL CURSOR MOVE ALL getting affected rows (or row count) -

i trying "rows affected" count following query using npgsql: declare cursor scroll cursor select * public."table"; move in cursor; using pgadmin's sql editor, running query gives: "query returned successfully: 5736 rows affected, 31 msec execution time." using npgsql: var transaction = conn.begintransaction(); npgsqlcommand command = new npgsqlcommand("declare cursor scroll cursor select * public.\"partij\"; move in cursor", conn); var count = command.executenonquery(); // valided here cursor did move end of result -- cursor working. transaction.commit(); i expecting 5736, count equals -1. can same rows affected count pgadmin using npgsql? this happening because you're trying affected row count of multistatement command - first statement creates cursor, , second 1 moves (although i'm not sure "rows affected" mean when moving cursor, opposed fetching). try send statements in 2 different comman

processing - Java, how to store multiple integers, separated by comma, into one variable -

in java, want setup variable can store multiple integers (rgb values) , integers separated comma. example, current code like background(255,255,0); // changes gui background color yellow. the code want is type yellow = (here goes yellow's rgb value 255,255,0) background(yellow); my question how setup variable yellow can replace actual rgb values. thank you. all answers got far somehow solve problem described. problem is: not helpful. never put information strings , rely on parsing them. if want that; not need overhead of statically compiled language java. better of using languages python, ruby ... allow handle "stringified" information easier. what want is: learn object orientation. so, want represent colors. model class represents color. somehow like: public class color { private final int r, g, b; public color(int r, ... { this.r = r and on. can write down color color yellow = new color(255,255,0) heck; start , declare constan

How do you create two priority arrays of queues in java? / Linux constant time scheduler -

this step in assignment , seems easy, seems little confusing me. great considering thing due tomorrow. code format response great. here step: you need create 2 priority arrays of queues: active array , expired array. in our case simplify , have priority values of 0 4, i.e. active array , expired array each comprised of 5 queues. the java class priorityqueue , not "priority array". think misunderstood assignment. let's suppose have object priority value, , we'll leave out restriction here. can put in on own. public class task { private integer priority; // let's not have priorities change accident. private string name; private double cost; // constructors, getters, setters elided. } now, priorityqueue needs of comparable class or made comparator. let's use latter, since i'm assuming equal priorities equally weighted, , there's no natural ordering of task . public class taskcomparator implements comparator<ta

java - REST API is unable to work in JSON format -

Image
i new developing rest api java. made simple 1 using mkyong tutorials, says "hello". using apache tomcat. now trying develop 1 return json objects. attempting example here - http://www.mkyong.com/webservices/jax-rs/json-example-with-jersey-jackson/ . of code changed (ex: package name).below code. track.java package com.tutorialspoint; /** * * @author yohan */ public class track { string title; string singer; public string gettitle() { return title; } public void settitle(string title) { this.title = title; } public string getsinger() { return singer; } public void setsinger(string singer) { this.singer = singer; } @override public string tostring() { return "track [title=" + title + ", singer=" + singer + "]"; } } jsonservice.java package com.tutorialspoint; import javax.ws.rs.consumes; import javax.ws.rs.get; import javax.ws.rs

javascript - Usage of ngStorage(angularjs) for language option -

i have html <button class="btn btn-info" ng-click="setlanguage('en')">english</button> <button class="btn btn-info" ng-click="setlanguage('de')">danish</button> <p>{{name[language]}}</p> and javascript $scope.language='en'; //initial default value $scope.setlanguage = function(language) { $scope.language = language; } i binding language button 2 languages.based on language selected, content shown. how store en or de localstorage. if refresh or change page also, set language should same. how it. can me here plunker http://plnkr.co/edit/zhmvbwckevkggeberhhe?p=preview // getter if ($window.localstorage.language) { $scope.language = $window.localstorage.language; } else { $scope.language = 'en'; } // setter $scope.setlanguage = function(language) { $scope.language = language; $window.localstorage.language = language; } to check r

ios - UIScrollView programmatically add buttons and scroll -

Image
i'm new ios , objective-c. please little bit patient me. the functionality in app, i'm trying develop, small scrolling toolbar, contains several buttons, state toggling buttons. there button above toolbar slides in , out toolbar. second functionality achieved successfully, using view whole setup , when slide button touch event animates whole view , down. for scrollview, wanted add buttons programmatically, hence drew outlet class , tried adding self created button subview. cannot see button. nor can observe scrollview sliding. the following way i'm adding button: also, total view above functionality less in size total view controller uibutton *button = [[uibutton alloc] init]; button.titlelabel.text = @"hello"; [_scrolltop setcontentsize:self.view.frame.size]; [_scrolltop addsubview:button]; the 2 images down, hope, should understand functionality i'm trying develop. if aware of existence of similar functionality, please direct me. edit:

javascript - Bootstrap tour template not applying id on all buttons -

i added id next button style following template tag in bootstrap tour. applied new id next button applies first one, not latter stages. know why? template: "<div class='popover tour'> <div class='arrow'></div> <h3 class='popover-title'></h3> <div class='popover-content'></div> <div class='popover-navigation'> <button class='btn btn-default' data-role='prev'>« prev</button> <span data-role='separator'>|</span> <button class='btn btn-default' id="thisone" data-role='next'>next »</button> </div> <button class='btn btn-default' data-role='end'>end tour</button> </nav> </div>", the problem you're using id many times, use class instead. id should unique. careful. from: id="thisone" to: class="thisone" you

jquery - Get values from select options - use values to toggleClass() -

i have select box number of options. each option represents class name can selected , added div. div may have other classes not touched. my issue toggle between these classes - not keep adding new ones. how can create script loops through class names of select box , toggles between them? here's have - adds classes - doesn't toggle. html: <form id="form"> <div> <label for="height">height:</label> <select id="height"> <option>- select class -</option> <option value="height133">133</option> <option value="height55">55</option> <option value="otherclass">127</option> </select> </div> <button type="button" id="go">submit</button> </form> <div class="gridbox otherclass1 otherclass2"> <div></div> </div> jquer

r - How to match elements of row with elements of a column and perform calculations on them in rstudio -

i want match columnname "name" dataframe list rowname of dataframe "volume" , perform calultion on columns. can use match or row.match purpose. i trying this total <- as.data.frame(matrix(0, ncol = 5, nrow = 5)) (i in 1:5) { print(list$s.no[i] * 100) (j in 1:5) { if (match(list$name, colnames(volume)), 2])) value = total + volume[j] print(value) } } print(total) problem code: total <- as.data.frame(matrix(0, ncol = 5, nrow = 5)) (i in 1:5) { print(list$s.no[i] * 100) (j in 1:5) { if (match(list$name, colnames(volume)), 2])) # match condition not correct. not know how call column header value = total + volume[i] # want add data matching column total print(value) } } print(total) i want read first element in list$name match corresponding column, extract column , perform simple addition on , store result in dataframe "total". want same thing done elements in row individually.

c++ - Is there difference between the list of preprocessor directives generated in 32 bit linux machine than those generated for 64 bit linux machine? -

i generating list of preprocessor directive using gcc -dm -e - < /dev/null on linux machine i686 32 bit , huge number number of directives. want know if linux machine 64 bit these preprocessor directives going different? what specific directives change 64 bit linux machine? also x86_64 directive used 64 bit linux machine have directive i686 32 bit machine? yes list different (not completely). have different values size definitions etc. list can vary between compiler , system versions. you can use directives identify architecture , system eg: #define __x86_64 1 #define __amd64__ 1 #define __linux__ 1 #ifdef __amd64__ #include <someheader> #endif here list linux x64 (gcc 5.3 libc 2.22) #define __dbl_min_exp__ (-1021) #define __uint_least16_max__ 0xffff #define __atomic_acquire 2 #define __flt_min__ 1.17549435082228750797e-38f #define __gcc_iec_559_complex 2 #define __uint_least8_type__ unsigned char #define __sizeof_float80__ 16 #define __intmax_c(c)

How do I get a Wyam pipeline of documents based of a comma-delimited meta value from a previous pipeline? -

i have wyam pipeline called "posts" filled documents. of these documents have tags meta value, comma-delimited list of tags. example, let's has 3 documents, tags meta of: gumby,pokey gumby,oscar oscar,kermit i want new pipeline filled one document each unique tag found in documents in "posts" pipeline. these documents should have tag in meta value called tagname . so, above values should result in new pipeline consisting of four documents, tagname meta values of: gumby pokey oscar kermit here solution. this technically works , feel it's inefficient, , i'm pretty sure there has better way. documents(c => c.documents["posts"] .select(d => d.string("tags", string.empty)) .selectmany(s => s.split(",".tochararray())) .select(s => s.trim().tolower()) .distinct() .select(s => c.getnewdocument( string.empty, new list<keyvaluepair<string, object>>

c++ - explicit specialization for overloading operator '<<' (left shift) -

lets have class, want overload operator based on enum type: #include <iostream> enum class option : char { normal, do_something_stupid }; class foo { public: int i; explicit foo(int a=0) : i(a) {}; /* overload operator '+=' based on 'option' */ template<option e = option::normal> void operator+=(const foo& f) { += f.i; } }; /* explicit specialization operator += */ template<> void foo::operator+=<option::do_something_stupid>(const foo& f) { += (f.i +1000); } int main() { foo f1(1), f2(2); f1 += f2; std::cout << "\nf1 = " << f1.i; f1.operator+=<option::do_something_stupid>(f2); std::cout << "\nf1 = " << f1.i; std::cout << "\n"; return 0; } this builds clean (ignoring fact pretty dump) both on g++ , clang++. what if want overload '<<' operator same way? similar approach not seem work: #include

css - Angular DatePicker overlapping with the bootstrap modal window -

Image
i trying render angular datepicker in bootstrap's modal window. calendar getting clipped. attached screenshot same. i tried fix z-index. failed badly. pre-conditions : the header , footer of modal fixed. only modal -body scroll. the modal-body have max-height occupy remaining height of browser the content in modal may increase or decrease. hence modal extend utilize remaining browser height scrollbar content. as <uib-datepicker> has fixed size , cannot resized, can customize size of small buttons (days). for example define .custom-size .btn-sm css rule: .custom-size .btn-sm { padding: 4px 8px; font-size: 11px; line-height: 1.5; border-radius: 3px; } and apply custom-size class uib-datepicker: <uib-datepicker ng-model="dateto" starting-day="1" min-date="datefrom" show-weeks="false" class="custom-size"></uib-datepicker>

java - Custom AuthenticationProvider with extra login fields -

i have customauthenticationprovider , want authenticate user 3 parameters: username, password , tokenpin. @ moment have little problem provider: @component public class customauthenticationprovider implements authenticationprovider { @autowired private userservice userservice; @override public authentication authenticate(authentication authentication) throws authenticationexception { string username = authentication.getname(); string password = authentication.getcredentials().tostring(); string pin = ???? authentication auth = null; user user = userservice.findbyusernameandpassword(username, password); if (user != null) { list<grantedauthority> grantedauths = new arraylist<>(); grantedauths.add(new simplegrantedauthority("role_admin")); auth = new usernamepasswordauthenticationtoken(username, password, grantedauths); } return auth; } @override public boolean supports(class<?> authentic

Android, custom component design -

Image
in application need have image below. have experience of creating custom components , know how it. however, have no idea how create kind of component. need when designing custom rating bar? anyway, many way can achieve this. one way seeing using radio group , radio button, vertical lines , text view can achieve this. put inside layout of choice , inflate layout ever need. after need set radio button radio1.setchecked(true) .this simple solution may not a optimal one. alternatively can create custom view extending view class or of subclass, whatever feel suitable work override ondraw method entire thing manually.

How to notify android app about the credential given to cyberoam if wifi is connected? -

i have created android app detecting internet connectivity intent filter "android.net.conn.connectivity_change" , callback in mybroadcastreceiver when wifi connected , disconnected, want callbacks when wifi getting authorized , when not? have cyberoam restrict access internet untill putting our credential, how can notified when authorized accessing internet , when not? there no android event that. far phone knows connected network. if network not giving access internet matter. best ping known ip address , see if response. don't ping often. else may blocked.

c# - SQLite In Clause not working in trigger -

Image
i have 2 tables table1 , table2. table1 have columns id,stringids , table2 columns id,data i have created trigger delete rows based on table1. doesn't works if comma seperated stringids more one. works if stringids single value create trigger tgtriggername after delete on table1 begin delete table2 id in (old.stringids); end gordon right, table structure really not want. if reason must way, query might accomplish want: delete table2 id = old.stringids -- id matches or old.stringids id + ',%' -- or id @ beginning of list or old.stringids '%,' + id -- or id @ end of list or old.stringids '%,' + id + ',%' -- or id in middle of list but that's mess. don't it. instead remove stringids column table1, , add column table2 called table1id indicate table1 id table2 record belongs to. table2 this id table1id data 1 1 data 2 1

c# - how to add upload control in gridview in asp.net -

how add file upload control in item template in grid view.unable file name upload control of gridview.how add file upload control in gridview every row <asp:gridview runat="server" id="gridviewaddpo" autogenerateeditbutton="false" onrowediting="gridviewaddpo_rowediting" onrowupdating="gridviewaddpo_rowupdating" autogeneratecolumns="false"> <columns> <asp:templatefield> <itemtemplate> <asp:button id="btn_edit" runat="server" text="edit" commandname="edit" /> </itemtemplate> <edititemtemplate> <asp:button id="btn_update" runat="server" text="update" commandname="update"/> <asp:button id="btn_cancel" runat="server" text="cancel" commandname="cancel"/

excel - How to fill a column with the header of the maximum value in a range of columns for every row -

Image
i have csv file this screen name,sports,music,movies,politics,vehicles,media,word count henrywinter,0.12,0.005714286,0,0.005714286,0,0.017142857,175 bumblecricket,0.081818182,0.009090909,0,0,0,0.009090909,110 samwallacetel,0.196172249,0.009569378,0,0.004784689,0,0.019138756,209 marcotti,0.06779661,0,0,0,0,0.02259887,177 now, how fill column in each row header of maximum value in range of columns every row?? i'm assuming don't want include word count because it's bigger others. if read csv a1:h5 , put formula in (say) j2 , pull down, should find column header matching maximum value in each row:- =index($b$1:$g$1,match(max($b2:$g2),$b2:$g2,0)) the result in example sports. (have changed b2 0 show media selected).

.htaccess - Custom directory viewer (php) -

i started little project few days ago, directory viewer . (not redesigned htaccess thing.) it's written in php , works great except few little things. i have 1 file ( masterfile ) parts of viewer (css, php, ..) come , build final viewer. whenever access directory without index.php , index.html , etc. in it, should end in masterfile , see directory (-content). example: example.com/css/ => you're in css dir => show custom dir viewer (css folder) idea: disable .htaccess indexing produces 403 error, redirect error masterfile. options -indexes errordocument 403 /masterfile.php this work, lists content of masterfile directory , not content original folder (example: /css/ ) ideas? possible solution (i don't like): put file, includes "masterfile", in every directory , name index.php i hope guys have ideas, appreciate help! you can put @ top of masterfile.php : $parsed = parse_url($_server['request_uri']); $files = scandir($_se

jwplayer - JW Player 7 loads HLS file only once in a tabbed container, with FLV all goes well -

i have multiple jwplayer instances on 1 page, switched tabbed div. 1 of tabs has hls file assigned jwplayer, other ones have flv files assigned. when viewing hls tab first time , playing it, works charm, when switch tabs (display:none <> display:block) returns no playable source error. this exact same behaviour not result in error flv files, switching , forth tabs , viewing flv not propose problem. <script type="text/javascript"> $(document).ready(function() { var player_container0 = jwplayer('container0'); player_container0.setup({ file: 'http://samplescdn.origin.mediaservices.windows.net/e0e820ec-f6a2-4ea2-afe3-1eed4e06ab2c/azuremediaservices_overview.ism/manifest(format=m3u8-aapl-v3)', type: 'hls', width: '100%', aspectratio: '16:9' }); var player_container1 = jwplayer('container1'); player_container1.setup({ file: 'http://ww

cmd - Can I make Atlassian Bamboo to accept a different return code than 0 as success -

i have issue exciting task type command return different exit codes meaning success , while atlassian bamboo see 0 success , else failed. i'm trying execute robocopy command 0 , 1 , 2 meaning (or in casses 4) nothing success notes. see doc: http://ss64.com/nt/robocopy-exit.html my example here, tht have task of type command execute robocopy following argument: . c:\inetpub\civebuildcentral\ui\. /is /s /xd node_modules how can make accept codes rather 0 ? i found easy simple solution : i replaced task new task of type script , kept script location inline , in script body did write following simple codes : robocopy . c:\inetpub\civebuildcentral\ui\. /is /s /xd node_modules if %errorlevel% leq 4 exit /b 0 in case if exit code less or equal 4 force script make return 0 success. you can make more code handle exit codes rem messages , them make return 0 or 1 . edit : if using linux: handle error codes example if condition like: if [$? le 4]

Order of Sprite transformations in libgdx -

Image
i want following: which apply rotation and then, resize sprite but since sprite transformations have predefined order, happens: resize sprite rotate it so, question is, there way it? if take @ api docs, says... sets size of sprite when drawn, before scaling , rotation applied. so guess way modifying manually vertices? or wrong? better way?

xml - BizTalk Business Rules Engine Pipeline Framework -

Image
i have xml message: <ns0:purchaseorder xmlns:ns0="http://samples.breframework.schemas.schema1"> <header> <reqid>reqid_0</reqid> <date>date_0</date> </header> <item> <description>description_0</description> <quantity>400</quantity> <unitprice>20</unitprice> </item> <status>denied</status> </ns0:purchaseorder> i'm using pipeline named purchaseorder_receive following stages set: my policy set so: all ports configured correctly, using above pipeline in receivelocation. the xml message posted 1 being used input, however, output xml message should contain status value of "approved", remains "denied". basically, question here is, doing wrong prevents policy being used on pipeline, keep in mind policy's "if condition" true. i pinged author of bre pipeline framework , response. i no

vectorization - Improve code / remove for-loop when using accumarray MATLAB -

i have following piece of code quite slow compute percentiles data set ("data"), because input matrices large ("data" approx. 500.000 long 10080 unique values assigned "indices"). is there possibility/suggestions make piece of code more efficient? example, somehow omit for-loop? k = 1; = 0:0.5:100; % in 0.5 fractile-steps fractile(:,k) = accumarray(indices,data,[], @(x) prctile(x,i)); k = k+1; end calling prctile again , again same data causing performance issues. call once each data set: fractile=cell2mat(accumarray(indices,data,[], @(x) {prctile(x,[0:0.5:100])})); letting prctile evaluate 201 percentiles in 1 call costs computation time 2 iterations of original code. first because prctile faster way , secondly because accumarray called once now.

java - jgraphx Layout algorithms explanations -

Image
in order understand better how layout algorithms works in jgraphx , i've developed little example display issue. 1) in first example create node 2 nodes connected, apply layout algorithm, works expected, because i'm using parent of nodes , edges default parent ``` package it.test.graphdisplay; import javax.swing.jframe; import javax.swing.swingconstants; import javax.swing.swingutilities; import com.mxgraph.layout.hierarchical.mxhierarchicallayout; import com.mxgraph.swing.mxgraphcomponent; import com.mxgraph.view.mxgraph; public class graphdisplaytest { public static void main(string[] args) { swingutilities.invokelater(new runnable() { public void run() { jframe frame = new jframe(); frame.setbounds(0, 0, 400, 300); mxgraph graph = buildgraph(); mxgraphcomponent graphcomponent = new mxgraphcomponent(graph); frame.getcontentpane().add(graphcomponent); frame.setvisible(true); } p

javascript - Add jQuery Calendar plugin to gvNIX sample project -

i trying add jquery calendar plugin, located @ http://keith-wood.name/calendarspicker.html gvnix project sample uses datepicker (i wanted see how works). goal replace datepicker plugin provided k.wood. have calendars other gregorian. unfortunately did not succeed in doing so. here file think should modify gvnix project http://pastebin.com/5uvudzfg i not javascript developer, not know call new calendar make work. thank time. if need write have done. implemented jquery plugin replace current date picker changed dojo, because roo using it. https://dojotoolkit.org/reference-guide/1.9/dojox/date/umalqura.html change load-script load desired dojo.js files , create copy of datetime tag modify new picker. ( being able set new tag need recompile project once ). datepicker working well. stored date in gregorian way. in load-script <spring:url value="/dojox/date/umalqura.js" var="umalqura_url" /> <spring:url value="/dojox/date/umalq

How to Compare two lists in java -

i have 2 lists list listone, list listtwo, , want compare both , if both same want add list item other list ol1 else add ol2. here elementrangeindex bean class contains string values. while comparing 2 lists needs compare each string value bean. i have used below code contains adding duplicate values since both lists have different objects. public static map<integer, list<elementrangeindex>> comparelists(list<elementrangeindex> listone, list<elementrangeindex> listtwo) { boolean indicator = false; list<elementrangeindex> listones = new arraylist<elementrangeindex>(); list<elementrangeindex> listtwos = new arraylist<elementrangeindex>(); list<elementrangeindex> listthree = new arraylist<elementrangeindex>(); map<integer, list<elementrangeindex>> map = new hashmap<integer, list<elementrangeindex>>(); if (listone!= null && listtwo!=null && listone.

office365 - Azure AD for Office 365 does not show in new portal -

in new azure portal don't see way manage ad. customer not have azure ad subscription office 365. can see in old management , add apps work ad , everything. how can in new azure portal? demonstrated on screnshot using same account: https://dl.dropboxusercontent.com/u/16550256/azure%20vs%20azure.png everything find on matter regards old azure management. new portal doesn't support azure ad management yet, not services migrated yet, example service bus still there too. unfortunately @ time of writing have use both portals, prefer new portal if can. new features resource groups not available in classic portal, , aad not available in new one.

jquery - If a div inside of a div is empty change the background color of the parent CSS -

i trying check if status_comment_holder empty , if want change background of comment-container without having refresh page, @ moment, appending comments status_comment_holder , removing comment when remove comment, not sure if can css or jquery have marked tags both. <div class="well well-small comment-container" id="comment-container""> <div class="status_comment_holder" id="image_comment"></div> </div> i have tried: if($('#image_comment').is(':empty')){ alert("fhfhf"); $('.well').css('background-color', '#ffffff'); } with no avail, it's not alerting reason. check out: how check if html element empty using jquery? your idea seems fine enough, maybe div has whitespace inside? try like if($.trim($("selector").html())=='') or, adriano repetti said in comments: if($("selector").children().length ==

MongoDB order of operators -

i trying find movies which: contains "comedy" , "crime" in "genres". "comedy" listed first i know query such: .find({ "genres": ["comedy", "crime"] }) however, cannot grasp why following doesn't work: .find({ "genres.0": "comedy", "genres": { $size: 2 }, "genres": { $all: ["comedy", "crime"] } } as result, entries such as: ["comedy", "crime", "drama"] but why? you have genres twice in find-object, means second entry overwrites first. when have 2 conditions same field, either need use $and operator or combine them this: "genres": { $size:2, $all: ["comedy", "crime"] }

java - How set Http setHeader? -

i use below code: class test extends asynctask < string, void, string > { @override protected string doinbackground(string...urls) { string response = ""; (string url: urls) { defaulthttpclient client = new defaulthttpclient(); httpget httpget = new httpget(url); try { httpresponse execute = client.execute(httpget); inputstream content = execute.getentity().getcontent(); bufferedreader buffer = new bufferedreader( new inputstreamreader(content)); string s = ""; while ((s = buffer.readline()) != null) { response += s; } } catch (exception e) { e.printstacktrace(); } } return response; } @override protected void onpostexecute(string result) { testlogin.textview.settext(result); } } what changes should modified in above code set header? want access webpage jsonobjcets " http://apimobile.dev2.rtbtracker.com/api/v2/users " use setheader() method on httpget htt

android - How to use recyclerview and cardview in ecilipse? -

i have tried copying jar files libs folder, importing recyclerview.jar dependencies nothing seems work. please give solution eclipse not android studio. advice helpful. first of please consider switch android studio . you can find release of support libraries library in folder: sdk/extras/android/m2repository/com/android/support/ here can check version. in folders find aar file of support libraries. inside can check classes.jar file,the res folder , androidmanifest file. create project in workspace unzip aar directory. copy androidmanifest.xml , res , , assets folders aar project. create libs directory in project , copy classes.jar add dependency. use sdk 23 compile mark project library the recyclerview library has support-v4.jar , support-annotations-23.x.x.jar dependencies.

angularjs - Angular unit test vs integration test -

i've started writing unit tests angular app i'm working on. there 1 thing i'm not sure , that's difference between unit test , integration test in context of angular. assuming have controller test depends on (non angular) service, should create mock of service or try use real service when it's possible. if inject service doesn't mean i'm creating integration test instead of unit test? i'm asking because work colleagues keep writing tests inject real servicesand still call them unit tests. sucks big time when have debug errors injected services in tests , each service depends on 5 other services... the purpose of unit test verify underlying unit's behavior in isolation environment , other units. essentially, if system under test, or test itself, interacts external systems, not real unit test. a couple of months ago have written article topic. check out more information.

mysql - stored with degree symbol, be able to search without, php SQL LIKE statement -

i'm haveing abit of trouble search function i've built. i have column in mysql table called: title (utf8_swedish_ci) this 2 titles out of around 20.000: 50° riesling réserve trocken 50° parallel riesling trocken is there somehow can make work user search 50 riesling or 50 parallel, without degree symbol? my code: $search = str_replace("\'","&#8217;", $_get['searchstring']); $search = htmlentities($search); $search = esc_sql($search); $search = trim($search); if(!empty($_get["searchstring"])){ $str .= "`title` '%".$search."%' , "; } sql statement (part of it, regarding this): $res = $wpdb->get_results("select * searchtbl ".$str." order ".$sortby." ".$sort." limit 500"); as question: there "easy" way make user able search 50 riesling , find both items? (its relevant alot of titles not these two) thanks in advance you

I can't find options for creating mobile services in a locally-installed Windows Azure -

i work in company requested create mobile app , distributed our employees only. requirement host windows azure platform locally. followed tutorial , , here portal looks like: my portal screenshot based on i've seen in trial version, there should "mobile services" tab in there under website clouds, isn't there. searched around can't seem find answer. what missing here? thanks! :) the azure pack features list not include mobile services: https://www.microsoft.com/en-ca/server-cloud/products/windows-azure-pack/features.aspx

jquery - How to keep the record in Kendo dataSource while Adding or Editing or Cancel? -

my requirements following when ever adding new record grid time have add 1 flag column "operationcotext: isadded", , when ever editing new record added want keep flag same "operationcotext: isadded". suppose clickeded edit after don't want change values in that. if click cancel or update records disappering. reason i'm splicing record based on model.dirty value. should not go condition. should model.dirty value "true". getting false reason it's deleting. please me achieve this. when ever editing existing record means record coming database time have add 1 flag column "operationcotext: isupdate", when ever deleting existing record means record coming database time have add 1 flag column "operationcotext: isdelete", suppose record added , want delete record time no need set flag. want remove datasource. i hope requirement briefing well. if you're not getting elobrate more. please @ dojo example here , r

utf 8 - How to understand a range in hexadecimal -

i have range: u+f0000..u+ffffd its utf, private use characters. understand f0000 ffffd means range, why u+ added in beggining? means? the "u+" means it's unicode codepoint, "0x" means follows hexadecimal number. "u+" implies hexadecimal, follows in hexadecimal notation, represents codepoint in unicode. in utf-8, u+f0000 encoded 0xf3 0xb0 0x80 0x80. u+ffffd encoded 0xf3 0xbf 0xbf 0xbd.

javascript - Measure how quickly users abandon slowly loading pages -

i'm trying measure how users abandon loading pages. my plan register listener "unload" event possible, , send value of performance.now() using navigator.sendbeacon() my problem "unload" event appears not fire if "domcontentloaded" hasn't fired yet. suppose makes sense ... can unloaded if hasn't been loaded yet? still need workaround measure how users abandon page if abandon before "domcontentloaded". i've attempted listen "abort" event, doesn't seem fire. guess fires if download interrupted, , isn't fired when dom parsing interrupted. any suggestions on how measure this? ps: suggestions don't work in browsers welcome. edit: i've read jquery ajaxerror() handler fires if user leaves page before page finishes loading , , tried build solution registers "abort" handler on xmlhttprequest server intentionally answers slowly. produce event, fires in case of navigation, doesn'

php - How to display a new image right away after successfully uploaded? -

Image
i implemented logo upload system. take effect right away. require me refresh page see effect. i'm wondering how stop that. img <img id="userlogo" src="/images/account/operator/logo.png" alt="" class="thumbnail img-responsive"> form {!! form::open(array('url' => '/profile/logo/update', 'class' => 'form-horizontal', 'role' =>'form','id' => 'editlogo','files'=>true)) !!} <input name="logo_path" type="file"> <br><br> <button class="btn btn-success btn-sm mr5" type="file"><i class="fa fa-user"></i> update logo</button> {{ csrf_field() }} {!! form::close();!!} controller public function updatelogo(){ $inputs = input::all(); $logo_path = array('logo_path' => input::file('logo_path')); $rule = ['logo_path

c - This programming is compiling but not running. Where's the error? -

#include<stdio.h> void main() { int a[3]; a[0]=1; a[1]=2; a[2]=3; printf("%d", a[2]); } it isn't showing errors or warnings. isn't running void main(){ is non-standard. main() function should return int . ides/platforms check return value of process. might problem. change to: int main(void){ if using c89 should have return statement main() . not required since c99. in c99 , later, main() implicitly return success if control reaches end of main if had: return 0; @ end of main() function. in c89/c90, must have return 0; or return exit_success; @ end of main() . otherwise, leads undefined behaviour . not required in c99 , c11. there's no other problem in code except this. if still have issues, need provide more details environment/compiler.

c# - how do I make my DataGridView equal to my List<List<decimal>>? -

Image
i have list of decimal lists, when filled it's grid... 2.0, 3.1, 4.0 3.2, 7.0, 1.4 6.0, 3.1, 8.8 the code list... list<list<decimal>> rows = new list<list<decimal>>(); is there easy way make me datagridview display data, tried... datagridview1.datasource = rows; but did not work. the grid outputs this... one way convert list of lists datatable object , set datasource property. here example of method such conversion: public datatable createdatatable(list<list<decimal>> data) { datatable table = new datatable(); if (data.count == 0) return table; int fields = data[0].count; (int = 0; < fields; i++) { table.columns.add("column" + (i + 1), typeof (decimal)); } foreach (var list in data) { var row = table.newrow(); (int = 0; < fields; i++) { row.setfield(i, list[i]); } table.rows.add(row); }

wpf - New Thread for Loading animated Gif -

i have read countless pages on how can achieved none seem working me.. wonder if because using wpf?? i have image control on wpf page holds animated gif. initial visibility property set hidden - idea being become visible when user logs in , disappears once login has been achieved. so, first thought make image visible on button click - carry out grunt work hide again. image never gets displayed until after processing has completed - rendering idea useless one. so, after bit of digging seems people have achieved processing new thread , using background worker object. have tried continually error: the calling thread cannot access object because different thread owns it. my code follows: global variable thread object: friend g_thloading thread on button click login on have: private sub btnloginok_click(sender object, e routedeventargs) handles btnloginok.click g_thloading = new thread(addressof loadingimage) g_thloading.isbackground = true g_thloadi

android - How to fill list view in fragment activity? -

i trying fill list in fragment return null object reference.( attempt invoke virtual method 'android.view.view android.view.view.findviewbyid(int)' on null object reference ) there code: public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); person.add(new gender("35ae111", false, "60 km/h")); final listview listview= (listview)getview().findviewbyid(r.id.liste); customadapter customadapter=new customadapter(getactivity(), kisiler); listview.setadapter(customadapter); } @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { // inflate layout fragment return inflater.inflate(r.layout.fragment_all_vehicles, container, false); } } you need move things need view oncreateview: public void oncreate(bundle savedinstancestate) { super.oncreate(savedins

c# - Send message to specific user -

i'm trying send user connects welcome message, won't work: public void connected(string name) { clients.this.newmessage("hello world!"); //welcome message current user clients.all.userconnected(name); //joined message } i know it's not lot of information give you, don't know need. (my front end angularjs, might useful) you can public override task onconnected() { string name = context.user.identity.name; groups.add(context.connectionid, name); clients.group(name).newmessage("hello world!"); //welcome message current user return base.onconnected(); }

java - JPA/Hibernate: mapping a one to many relation to hashmap using part of embedded id as key (without join table) -

i stuck on following problem: i have entity embedded composite id. entity used 'many' in 1 many relationship. want refer relationship on 'one' side map, key 1 attribute of embedded id, , value entity (see code below clarification). i have tried several combinations of elementcollection, joincolumn, mapkeycolumn , mapkeyjoincolumn annotations, both jpa , hibernate specific ones, cannot work. maybe not possible embedded id? @entity public class item { @column private long id; //which annotations use here? private map<team, teamstatus> statusses; } and @entity public class team { @column private long id; } and @entity public class teamstatus { @embeddedid private itemteampk itemteampk; @column private boolean statusflag; } and @embeddable public class itemteampk { @manytoone private team team; @manytoone private item item; } edit: note using jpa 2.1 errors get: using