Posts

Showing posts from February, 2014

compilation - docker unable to compile program (possibly undefied macro AC_MSG_ERROR) -

i'm trying compile following program inside of docker container. https://github.com/adaptivecomputing/torque when attempting run autoconf given error "possibly undefined macro: ac_msg_error" google has dozens of results exact error. of them solved installing pkg-config or libtool-ltdl as can see docker file, both of packages installed. from centos run yum install -y autoconf make autogen gcc gcc-c++ openssl-devel git libxml2-devel libtool libtool-ltdl run git clone git://github.com/adaptivecomputing/torque.git -b 4.2.6.1 /tmp/pbs_server run cd /tmp/pbs_server run autoconf run ./configure --with-debug run make -j4 run make install here error when running docker build . step 4 : run autoconf configure.ac:50: error: possibly undefined macro: ac_msg_error if token , others legitimate, please use m4_pattern_allow. see autoconf documentation. configure.ac:54: error: possibly undefined macro: am_init_automake configure.ac:57: error: poss

Django: capturing values in url to generic class view -

so have url: url(r'^mousesmall/(?p<name>.*)/$', idview.as_view()), and view is: class idview(detailview): model = rna template_name = "home/details.html" since i'm using generic view detailview, how pass name value that's captured in url detail view? the base view class detailview inherits sets args , kwargs self.args , self.kwargs respectively in processing. since it's named pattern, should in self.kwargs['name'] .

javascript - After Dropping Collection, Collection is re-made when saving first records, but why aren't its indexes? -

below method dropping mongodb collection. works, after saving first records collection re-created without appropriate indexes. since model has 3 properties unique: true , need indexes created, no duplicates saved. why aren't instances being created, , how auto-create them? model: var objectschema = new schema({ propertyone: { type: string, required: true, unique: true, trim: true }, propertytwo: { type: string, required: true, unique: true, trim: true }, propertythree: { type: string, required: true, unique: true, trim: true } }); method - dropping collection exports.dropcollection = function(collectionname, callback) { console.log("dropping collection: " + collectionname); // drop in collection name string var collection = mongoose.connection.collections[collectionname] collection.drop(function(err) { if (err) {

segmentation fault - segfault in c/gtk+3 program -

structs defined inside header: struct info{ gint mode, issignalactivate; gchar *filename; gtkwidget *pwdentry, *pwdreentry, *mainwin, *dialog, *file_dialog; }; extern struct info s_info; struct hashes{ gchar *filename; gtkwidget *entrymd5, *entrys1, *entrys256, *entrys512, *entrywhir, *entryrmd; gtkwidget *checkmd5, *checks1, *checks256, *checks512, *checkwhir, *checkrmd; }; extern struct hashes s_hashtype; and main part of program: int main(int argc, char **argv){ if(!gcry_check_version(gcrypt_min_ver)){ fputs("libgcrypt min version required: 1.5.0\n", stderr); return -1; } gcry_control(gcryctl_init_secmem, 16384, 0); gcry_control(gcryctl_initialization_finished, 0); gtkapplication *app; int status; app = gtk_application_new ("org.gtk.polcrypt",g_application_flags_none); g_signal_connect (app, "startup", g_callback (startup), null); g_signal_connect (app, "activa

.net - WCF service and interoperability -

i have following wcf service believe can improved. need able support windows , non-windows clients using soap1.1 , soap1.2. my concerns input parameter initdata on api initdatarequest , return parameter of getdata. currently, have development policy parameters constrained xml-formatted strings , client , server responsible serializing/deserializing in respective environments. [servicecontract] public interface iatomdatainterfacewcf { [operationcontract] guid opensession(atomsessiontype sessiontype); [operationcontract] void closesession(guid sessionid); [operationcontract] int initdatarequest(guid sessionid, string initdata); [operationcontract] string getdata(guid sessionid, int count); } using soapui soap request initdatarequest shows following element parameter 'initdata'. <tem:initdata>?</tem:initdata> this bothered our ibm websphere developers expected else. suggested, without guidance, use xsd describe api hence

uiviewcontroller - how to pop view from stack in tab bar controller in iOS -

i have tabbar controller. in 1 of viewcontroller children check , determine if show login view code: if(loggedin){ }else{ signupviewcontroller *svc = [self.storyboard instantiateviewcontrollerwithidentifier:@"signupview"]; svc.hidesbottombarwhenpushed = yes; [self.navigationcontroller pushviewcontroller:svc animated:yes]; } from here user goes through several subsequent views in wizard format. signupviewcontroller1->signupviewcontroller2->signupviewcontroller3->etc. @rocky pointed out, cannot pop signupviewcontroller1 off stack while in signupviewcontroller2 or 3 or subsequent viewcontroller. i know ios docs state following: if yes, bottom bar remains hidden until view controller popped stack. my question how acccess original signupviewcontroller pop off stack see tabbar again once have moved subsequent views in navigation controller? (the next answer swift, but, can traduce objective-c) i not know, maybe can try that:

minix - How can I get the output of ls -

how can output of ls? want add indirection operator =>, , it's function same >, means in command line $ls => files, list of files in directory stored in file files output redirection (and other redirection matter) facility provided shell, not ls program. ls writes output standard output and, if shell has redirected file, that's goes. so, if want add => token, it's shell you're going have modify, recompile , install. that's not easy task, i've made changes bash in past and, while it's relatively easy tinker around edges (i added internal command outputting ps1 result string), suspect redirection may little more difficult. still, may matter of creating new token => , copying code that's executed > . may ash , minix3 shell, lot cleaner bash . advice investigate ash , version found in minix3, , have play.

javascript - Add more data to series in highchart pie chart -

i want able show 'good' or 'bad' in tooltip depending on data particular each data in series. right have following: data: [ ['firefox', 1], ['ie', 2], ['safari', 3], ['opera', 4], ['others', 5] ] how add member array, example: ['firefox', 1, 'good'] so reference in tooltip such as: tooltip: { pointformat: '{series.good_or_bad}: <b>{point.percentage:.1f}%</b>' }, i using tooltip formatter there 2 approaches it use tooltip > formatter own validations tooltip: { formatter : function(){ //your validations here decide or bad } } pass addl details data point , access tool tip pass data shown below series:[{ data: [{ name: 'firefox', y: 1, isgood: 'good' }] }] access tooltip shown below tooltip:{ formatter: function() { this.point.option

java - Android backround music across multiple activities; How to catch Home button presses -

i have been searching days on issue , while has been brought on , on again here on , other places haven't found single proper solution. i want play audio file in background of app. easy enough. want music persist , not stop or pause while switching between activities in app. easy , accomplished doing in oncreate method: protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); ... mp = mediaplayer.create(mainactivity.this, r.raw.lostmexicancity); mp.setlooping(true); mp.start(); } the problem? getting music stop when press home button. killing sound when user presses button seems easy. here's have , works great: public void onpause() { if(this.isfinishing()){ //back pressed activity mp.stop(); } super.onpause(); } pretty simple right? yeah. not complicated. not catch presses of home button. if home button pressed, music keeps playing while user no longer

typeahead.js test failing on Rails 4 with Cucumber and Capybara-Webkit -

i have following cucumber feature testing input form using typeahead.js: @javascript scenario: creating battery using typeahead when create new battery using typeahead should on show battery page , should see battery created message the test fails on second step following error message: activerecord::recordnotfound (activerecord::recordnotfound) ./features/step_definitions/admin/car_part_steps/battery_steps.rb:37:in `/^i should on show battery page$/' features/admin/creating_car_parts/creating_batteries.feature:20:in `then should on show battery page' the relevant step definitions follows: when /^i create new battery using typeahead$/ select_from_typeahead :field => 'battery_manufacturer_typeahead', :select => @manufacturer.name fill_in 'type', :with => '700w' click_button 'create battery' end /^i should on show battery page$/ battery = battery.find_by_type_and_manufacturer_id!('700w', @manufactur

macros - Why is TeraTerm not putting out the same bytes that are in the send call? -

using teraterm , serial port adapter ran macro line on it: send $55 $0b $00 $00 $00 $bb $42 $aa the $bb sent out 2 different bytes instead of one. forget ones result on o-scope looked this: 55 0b 00 00 00 c8 e9 42 aa does know why is? looked in manual , verified send8ctrl set off , debug option. did research, tested , verified answer question teraterm using utf-8 instead of english under general settings menu. there 2 options present may confusing 2 options 'english' , 'default'.

version control - Host git repository and access it through my computer's ip -

i host project on own computer, since computer on time, , access when im away home , clone on other laptop when needed, , commit desktop computer, using git host. is possible so? not want use github since dont want pay $7 month, , use computer instead. i made repository right of project files inside, how continue here? you instead use atlassian bitbucket , has unlimited free private repos

r - Remove mainPanel area in Shiny app -

is possible remove mainpanel shiny app? mean, if want big sidepanel (without mainpanel area), how should it? have tried write: mainpanel() but doens't work (it empties area...). any suggestions? i trying imagine why want :) can tell how plan use app? options: you use basicpage instead of pagewithsidebar in ui.r there (relatively) new layout features in shiny discussed here . need use shiny 0.8.0.99: install.packages('devtools'); library(devtools); install_github('shiny','rstudio')

html5 - How to make KineticJS canvas stage responsive -

when adding canvas element page want canvas , contents scale down browser window scales down. there seem several questions asked here , each 1 haven't quite found answer looking for. seem have works , thought post others shoot down or improve upon. in example have page 1000px wide @ max width. canvas element 800px wide @ max width. html: <div id="container"></div> css: #container { background-color: #888888; display: inline-block; max-width: 1000px; } javascript: var maxstagewidth = 800; var maxstageheight = 500; var maxpagewidth = 1000; // check see if window less desired width , calls sizing functions function setstagewidth() { if (window.innerwidth < maxpagewidth) { resizestage(); } else { maxstagesize(); }; }; // sets scale , dimensions of stage in relation window size function resizestage() { var scalepercentage = window.innerwidth / maxpagewidth; stage.setattr('scalex'

php - Determine if two MySQL records exist before detemining their relationship -

imagine have table of persons, busses, , mapping table in between. want determine, given set of people, on given bus. create php page return simple list of persons. want page robust, want return error reflected db or other failures. also, pdo used make site flexible. to reduce database queries (assuming querying db expensive part, if db big and/or lots of visitors), want reduce queries db absolute minimum. a simple script would, after validating data types , other unintended values, such on db side: //see if bus exists select id busses id={$bus_id}; //see if given persons exist select id persons id in ({$comma-seperated-person-ids}); //finally check mappings table , discover on bus. select person_id busses_persons bus_id={$bus_id} person_id in ({$comma-seperated-ids}); i think order important, because suppose bus did not exist, page return success , show empty list if first query did not execute determine existing busses. return successful page no persons, if none of pers

php - Cannot find true $PATH file on Mavericks -

i have both ~/.bash_profile & ~/.profile files. ~/.bash_profile contains 1 line: export path=/applications/mamp/bin/php5.5.3/bin:$path ~/.profile contains 3 lines: # macports installer addition on 2014-02-02_at_20:54:53: adding appropriate path variable use macports. export path=/applications/mamp/bin/php5.5.3/bin/:/opt/local/bin:/opt/local/sbin:$path # finished adapting path environment variable use macports. as can see trying default php path use mamps php because have mcrypt installed on it. reason when type whereis php native route: /usr/bin/php , , when echo $path get: /applications/mamp/bin/php5.5.3/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin somewhere have file thats controlling path , have no clue is. else controlling path route? note: have homebrew , macports , xcode , , xcode command-line tools installed. what you're seeing coming system-wide /etc/paths file. source of base $path environment variable before ~/.profile, ~/.bash

python - How to create a Boggle Board from a list of Words? (reverse Boggle solver!) -

i trying solve reverse boggle problem. put, given list of words, come 4x4 grid of letters in many words in list can found in sequences of adjacent letters (letters adjacent both orthogonally , diagonally). i not want take known board , solve it. easy trie problem , has been discussed/solved death here people's cs projects. example word list: margays, jaguars, cougars, tomcats, margay, jaguar, cougar, pumas, puma, toms solution: atjy ctsa omgs puar this problem hard (for me). algorithm have far: for each word in input, make list of possible ways can legally appear on board itself. try possible combinations of placing word #2 on boards , keep ones have no conflicts. repeat till end of list. ... profit!!! (for read /.) obviously, there implementation details. start longest word first. ignore words substrings of other words. i can generate 68k possible boards 7 character word in around 0.4 seconds. when add additional 7 character board, need compare 6

javascript - replace URL into HTML Jquery -

i have used static http:// url html(s) page, want replace empty string. suppose here html content: <div id="mso_contenttable"> <script type='text/javascript'> function redirecturl(redurl,curtab) { window.location.href='http://www.contoso.com/sales/sitepages/'+redurl; } function nav2lib(redurl) { navigatehttpfolder('http://www.contoso.com/sales/rfp%20bank/'+h3url, '_blank'); } function nav2proposal(redurl) { navigatehttpfolder('http://www.contoso.com/sales/proposals/'+h3url, '_blank'); } </script> ........ lots of html contents </div> edit : $('#mso_contenttable').html().replace(/http://www.contoso.com/g,''); i want replace whole url " http://www.contoso.com/ " empty string. try this. think need escape 2 forward slashes that's it. $('#mso_contenttable').html().replace(/http:\

Is it possible to test web apps using MonkeyTalk? -

i want automate web application or website testing using monkeytalk. possible? yes, possible test web application using monkeytalk. try latest monkeytalk professional 2.0.1 edition more functionalities.

camera - JMonkey Selection Square Complication -

i have created way draw selection box on screen when click , drag mouse. in strategy games. when mouse pressed, call draw method creates quad mesh , adds guinode. (flat on screen). while mouse still pressed, following update method called: main.gui.getchild("selection box").removefromparent(); xmousecur = inputmanager.getcursorposition().x; ymousecur = inputmanager.getcursorposition().y; if (xmousecur < xmouse) { } quad = new quad(xmousecur - xmouse, ymousecur - ymouse, false); geom = new geometry("selection box", quad); geom.setlocaltranslation(new vector3f(xmouse, ymouse, 0)); geom.setmaterial(mat1); geom.setcullhint(cullhint.never); main.gui.attachchild(geom); the method creates new quad based on first click location of mouse , current location of mouse. issue when try click , drag left, square doesnt show. when drag right, does. my assumption when on left side, width parameter when creating new quad n

c - can't we use same variable name as a function? -

here code..it giving segmentation fault error...please tell me why...in small program taking 1 function add() , 1 variable int add. , inside main function creating function pointer of add() , trying print value of add variable. giving error...plz tell me why?? #include<stdio.h> float add(int , float); int main() { float (*fp)(int , float); float result; int add=10; fp = add; result = fp(5 , 9.9); printf("%f\n",result); printf("%d\n",add); return 0; } float add(int ,float b) { return + b; } global names shadowed local names. so, when mention add in main , try take add declared in main first. when giving fp = add assigning integer ( int add = 10 ) function pointer. , trying call address. invalid address ( 10 ), got segmentation fault.

Trouble using a loop to add characters to an array of "strings" in c? -

so tried both datatype char , data type int. nomatter printf shows first letter of inputted word. example if inputs dog 'd'. guess maybe syntax of word[i] takes first letter im not sure how fix that. know how fix this? #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #define pause system("pause") #define cls system("cls") void getuserwords(int *counter, int words[]){ int i; printf("how many words enter cross word puzzle\n"); scanf("%i",&*counter); for(i=0; < *counter; i++){ printf("please enter word #%i\n",i+1); scanf("%s",&words[i]); printf("the word %c added crossword puzzle\n",words[i]); pause; cls; }//end printf("your words have been added crossword puzzle

java - MQ-7 connectivity issue -

hi below code used check connectivity string qmanager=""; int openoptions = cmqc.mqoo_fail_if_quiescing + cmqc.mqoo_input_shared + cmqc.mqoo_inquire+cmqc.mqoo_browse; try{ hashtable props = new hashtable(); props.put(cmqc.host_name_property, "ip"); props.put(cmqc.port_property, port_num); props.put(cmqc.channel_property, "system.default.local.queue"); mqqueuemanager qmgr = new mqqueuemanager("qm", props); mqqueue destqueue = qmgr.accessqueue("q_name", openoptions); system.out.println("connected"); destqueue.close(); qmgr.disconnect(); }catch(mqexception mqe){ system.out.println(mqe.reasoncode); } } } when run program exception mqje001: mqexception occurred: completion code 2, reason 2009 mqje016: mq queue manager closed channel during connect 2009 closure reason = 2009 mqje001: completion code 2, reason 2009 kindly me

python - \Z doesn't match end of string -

i have regex (?p<url>http.{1,}?[\s)\z]) find url ending in \s character, close parenthesis, or end of string, matches first 2 cases. how match third (end of string)? \z doesn't work inside character sets - matches z (most features disabled inside character class, including . , + , etc. other character classes work: \w , \d , etc). want use alternation: (?:[\s)]|\z) . in addition, .{1,}? same .+? , whole pattern can written as (?p<url>http.+?(?:[\s)]|\z))

jquery - javascript pass argument to object.keys -

i have object contains things i'm looking for: exclusions 1: object [ id: "38433" , location: "central"] 2: object [ id: "43434" , location: "west"] and have object called schools contains set of things: using object.keys() method loop through object, need pass in location search search in central, or west,etc. if try (schools.district.location) error. how pass in correct argument object.keys function? part2: correct way remove element array. need remove location[15] if id's match. code: $.each(exclusions , function (index, value) { var location = value.location; //gives me central, west, east var id = value.id; object.keys(schools.district.{{pass in location}}).foreach(function (key) { //each location array of schools need scan each matching id (var i=0; < {{get length of location array}}.length; i++) { if(location[i][id] == id) { location.slice(); //not sure } } })

GWT java CELLTABLE MouseHover Buttoncell -

so have here cellbutton : column<dateiles, string> column_2 = new column<dateiles, string>(new buttoncell()) { @override public string getvalue(dateiles object) { int s = object.comments.size(); string ss = string.valueof(s); return ss; } }; celltable.addcolumn(column_2, "comments"); celltable.setcolumnwidth(column_2, "100px"); i want add buttons each cell column tooltip how possible this.addcellpreviewhandler(new handler<tabletype>() { @override public void oncellpreview(final cellpreviewevent<tabletype> event) { int columnid = event.getcolumn(); } }); } just replace tabletype object definded when instantiating table ( t of celltable<t> ) columnid can detect right column.

c# - Second call of stored procedure throws ORA exception -

i calling stored procedure in oracle database via nhibernate in app. first time call works fine , result second time ora-00942 (table or view not exist) exception. idea possibly wrong? procedure return me object. no changes done. thank ideas. so have found out mistake. bad wcf config. missing section because guy deleted it. thank help.

node.js - Javascript, NodeJS: Call Asychronous Methods in a Loop & Return Result -

is there way call async method in loop, put results in array & return results in end. pseudo code of want do: methodthatrunsasync(callback){ once completes, invoke callback; } anothermethod (){ var result = []; for(i=1; i=10; i++){ methodthatrunsasync(function(resp){ result.push(resp); }); return result; } } but value of result default value. how can trap results of async block in sync block , return same caller. looking promise framework, finding bit tough head around it. if can please me understand how achieve this, psuedo code great. no, can't return result, calls asynchronous. use callback function too, , call when last result added: function anothermethod (callback) { var result = []; var count = 10; for(i = 0; < count; i++) { methodthatrunsasync(function(resp){ result.push(resp); if (result.length == count) { callback(result); } }); } } note changed loop. loop had n

html - position elements over image -

Image
i'm trying position elements on image while keeping following behaviour: when in mobile stop floating "muuh" text right keep text aligned bottom of image the .item div size should not bigger image what i've achieved far: http://jsfiddle.net/wn6m9/14/ this @ moment doesn't work can see div background, nor text aligned bottom of picture. do mean this? jsfiddle i changed css to: .masonry { position: relative; } .item { width: 20%; position: relative; } .item-image { width: 100%; } .item-text { background: pink; position: absolute; top:0; left:0; bottom:0; right:0; margin: auto; width:100%; height:20px; } .item-title { padding: 0px; } .item-right { padding: 0px; } @media(min-width:992px){ .item-creator { float: right !important; } } jsfiddle 2 - pink bit @ bottom of image

ios - Suppress "undeclared selector" warning in Xcode 5 -

i have parent view controller , child view controller. in child view controller's view, have uibutton called "startbutton". button, have added target below [startbutton addtarget:[self parentviewcontroller] action:@selector(test:) forcontrolevents:uicontroleventtouchupinside]; i have implemented, test: method in parent controller , works fine me. when button tapped, event passed child view controller parent view controller , code snippets within test: method gets executed. but problem is, getting warning message, "undeclared selector test:". know, getting because test: not implemented in child view controller implementation file. is there way suppress warning alone? of suggestions have seen here makes entire warnings suppressed want suppress above mentioned warning alone. thanks if know sure you've done right thing, , code works fine, can stop xcode warning surrounding method with #pragma clang preprocessor commands. for example: #

c# - Null reference exception when try to get link by class in HtmlAgilityPack -

i have asp.net mvc application , html page parse using htmlagilitypack, when try looping elements have next error in foreach: object reference not set instance of object . code next. know mistake? i'm new using htmlagilitypack. part of html: <li class="b-serp-item i-bem" onclick="return {&quot;b-serp-item&quot;:{}}"> <i class="b-serp-item__favicon" style="background-position: 0 -0px"></i> <h2 class="b-serp-item__title"> <b class="b-serp-item__number">1</b> <a class="b-serp-item__title-link" href="http://googlescraping.com/google-scraper.php">google</a> </h2> </li> code datetime dt = datetime.now; string dtf = string.format("{0:u}", dt); string wp = "page" + dtf + ".html"; htmldocument hd = new htmldocument(); hd.load(wp); string output = ""; foreach (htmlnode node in hd.d

java - Get all e-mail accounts from outlook exchange server of an user -

which oauth requests , steps necessary obtaining e-mail contacts of user outlook exchange server. have tried java without external lib ? thanks exchange not support oauth. have looked using exchange web services ?

mysql - how to decrypt a password and send mail in php -

i had encrypted password in register.php <?php // set error message blank upon arrival page $errormsg = ""; // first check see if form has been submitted if (isset($_post['username'])){ //connect database through our include include_once "connect_to_mysql.php"; // filter posted variables $username = ereg_replace("[^a-za-z0-9]", "", $_post['username']); // filter numbers , letters $country = ereg_replace("[^a-z a-z0-9]", "", $_post['country']); // filter spaces, numbers, , letters $state = ereg_replace("[^a-z a-z0-9]", "", $_post['state']); // filter spaces, numbers, , letters $city = ereg_replace("[^a-z a-z0-9]", "", $_post['city']); // filter spaces, numbers, , letters $accounttype = ereg_replace("[^a-z]", "", $_post['accounttype']); // filter lowercase letters $email =

c++ - Retrieving shared vectors from Boost InterProcess Shared Memory -

i have created boost shared memory, purpose of sharing vectors. the sharing has been accomplished. however, not understand how vectors pushed shared memory. i push_back shared memory writing process. vectors being pushed stack push shared memory, in lifo order? the other application, reader, retrieves vector in following fashion : managed_shared_nmemory segment (open_only, "shared_mem_name"); vector = segment.find<vector_type>("vector_name").first; if (vector != null) { //codde } now here, vector reading. 1 pushed in last ( newest 1 )? , if i'm reading it, imply vector popped? i.e. still there in shared memory after read, , if so, shared memory overflow after time, , how stop it? don't see in documentation regarding it... the vectors aren't "pushed" shared memory. there no implicit stack. instead, vector lives in shared memory. you're reading in fact same vector in process, at same time . note impl

hadoop - Checking filesize and its distribution in HDFS -

is possible know filesize in blocks , distribution on datanodes in hadoop? currently using: frolo@a11:~/hadoop> $hadoop_home/bin/hadoop dfs -stat "%b %o %r %n" /user/frolo/input/rmat-* 318339 67108864 1 rmat-10.0 392835957 67108864 1 rmat-20.0 which not show actual number of blocks created after uploading file hdfs. , dont know way how find out distribution. thanks, alex the %r in stat command shows replication factor of queried file. if 1, means there only single replica across cluster blocks belonging file. hadoop fs -ls output shows value listed files 1 of numeric columns, replication factor per file fs attribute. if looking find blocks reside instead, looking hdfs fsck (or hadoop fsck if using dated release) instead. below, example, let see list of block ids , respective set of resident locations, file: hdfs fsck /user/frolo/input/rmat-10.0 -files -blocks -locations

jquery - Change tab on div click and not in <a> -

im have tabs script , works when click on link , not when click on main div, if click outside area tab changes dont show proper content, im new on jquery please dont hard me, think noob problem :( this jquery: $(document).ready(function () { /* ____tabs menu (en gradient)____ */ function changetabs(elemtab){ /* default estate */ elemtab.first().addclass('on_tab'); elemtab.first().next().find('a').css('border-left-color','transparent'); /*add class on active */ elemtab.click(function(){ elemtab.removeclass('on_tab'); $(this).addclass('on_tab'); /*change border*/ elemtab.find('a').css('border-left-color','#0086c3'); $(this).next().find('a').css('border-left-color','transparent'); $(this).find('a').css('border-color','transparent'); });

php - Checking if website is down using curl -

i using following code see if website down or not. <?php if (isset($_post['submit'])) { $url = $_post['url']; $curl = curl_init($url); curl_setopt($curl, curlopt_nobody, true); curl_setopt($curl, curlopt_followlocation, true); curl_exec($curl); $code = curl_getinfo($curl, curlinfo_http_code); if ($code == 200) { echo "<h3>up!</h3>"; } else { echo "<h3>down!</h3>"; } } ?> <form action="" method="post"> url: <input type="text" name="url" /><br /> <input type="submit" name="submit" /> </form> the issue having when check facebook.com says down isn't... why doing this? orginally thought https google works fine. i believe curl isn't following http redirects, means you'll receive 301 response faceb

drop down menu - data binding to dropdownlist in asp.net? -

for label in bind data using <asp:label id="label2" runat="server" text='<%#eval("address") %>'></asp:label> how bind data dropdownlist that? asp:dropdownlist id="droplist" runat="server" > <asp:listitem text="admin"></asp:listitem> <asp:listitem text="manager"></asp:listitem> </asp:dropdownlist> like this.... <asp:dropdownlist id="droplist" runat="server" selectedvalue='<%#eval("fieldname")%>'> <asp:listitem text="admin"></asp:listitem> <asp:listitem text="manager"></asp:listitem> </asp:dropdownlist> note intellisense not pick selectedvalue out. of course need populate dropdown data... using method suits

java - Prevent network sync loop when syncing from network in Android ContentProvider -

i'm writing own contentprovider synced web service using syncadapter. problem happens when sync adapter modifying content provider's data provider triggers network sync when internally calling getcontentresolver().notifychange causing sync loop. the notifychange network sync flag required when client application modification should avoided when sync adapter modifying. how can one, inside contentprovider, easly tell if it's being used client application (which should trigger network sync upon modification) or sync adapter (which should not trigger network sync). currently i'm using different content_uri's (sync adapter accesses data using content_uri_no_sync , client apps using content_uri) able distinguish between 2 types of access , set network sync flag accordingly. watch this video rest api usage in syncadapter s. the method discuss add set of metadata flags columns database. allows 3 things. the flags allow syncadapter determine row

css - Flexbox and Internet Explorer 11 (display:flex in <html>?) -

i planning move away "floaty" layouts , use css flexbox future projects. delighted see major browsers in current versions seem support (in 1 way or another) flexbox. i headed on "solved flexbox" http://philipwalton.github.io/solved-by-flexbox/demos/sticky-footer/ @ examples. "sticky footer" example not seem work in ie11. played around bit , got work adding display:flex <html> , width:100% <body> so first question is: can explain logic me? fiddled around , worked, don't quite understand why worked way... then there "media object" example works in browsers except - guessed - ie. fiddled around that, too, no success. my second question therefore is: there "clean" possibility "media object" example working in ie? according http://caniuse.com/#feat=flexbox : "ie10 , ie11 default values flex 0 0 auto rather 0 1 auto , per draft spec, of september 2013" so in plain words, if so

openam - How to access group details in SAML -

i creating id provider through openam, user details in saml assertion returned, want user group details in assertion,how can it. thnx in advance there several approaches ... 1) create custom attribute mapper allows put group info assertion 2) create post auth plugin puts group info in session property , use default attribute mapper 3) leverage data store , data store config this depends on data store being used if data store (e.g. ldap based directory server) provides (operational) attribute shows group info @ user entry can map attribute in data store config , use default attribute mapper. e.g. opendj provides 'ismemberof' , see real group dns values mapped attribute

azure - Microsoft.WindowsAzure.MobileServices in COM -

i created library interacting windowsazure.mobileservices [progid("mypush.clientlib")] [classinterface(classinterfacetype.autodual)] [guid("********-****-****-****-************")] [comvisible(true)] public class clientlib { private static mobileserviceclient mobileservice; private imobileservicetable<todoitem> todotable; public clientlib() { /* mobileservice = new mobileserviceclient( "https://galpush.azure-mobile.net/", "*******************************"); todotable = mobileservice.gettable<todoitem>(); */ } i used regasm register library when try init new mobileserviceclient have error 80070002 make sure deploy references library: newtonsoft.json (≥ 5.0.8) microsoft.bcl (≥ 1.1.3) microsoft.net.http (≥ 2.2.15)

php - TCPDF: How to store a pdf page separately? -

my php script generates multiple page document tcpdf that: foreach($data $datarow) { // .... $this->writehtmlcell(...); $this->addpage(); } $this->output(...); this works perfectly. have store each single page separately. in other words: every foreach-iteration must store current page single pdf file. possible? move $this->output(...); function inside foreach function. foreach($data $datarow) { // .... $this->writehtmlcell(...); $this->addpage(); $this->output(...); }

c# - Most used methods from external libraries -

is there way know used methods external libraries within c# project / solution? right now, i'm using visual studio 2008 (but ansers newer versions ok). just need simple listing like: namespace class method times used --------------------------------------------- namespace1 class1 methoda 10 namespace1 class2 methoda 9 namespace2 class2 methodb 7 maybe there no easy way, ideas doing programmatically welcomed. thanks! the commercial application ndepend can (and more of course).

javascript - Decimal number gets disapper -

my code: var $label = $(ev.currenttarget); var $price = $label.parent("form").find(".oe_price .oe_currency_value"); if (!$price.data("price")) { $price.data("price", parsefloat($price.text()); //price 10.30 returns 10.3 number } $price.html($price.data("price")+parsefloat($label.find(".badge span").text() || 0)); /* value coming in **badge** **12.00** * parsefloat converts **12** * thats why after addition got output **22.3** * want **22.30** */ i have string '10.30' now, if convert string number using parsefloat parsefloat('10.30') i got output 10.3 and if using .tofixed(2) parsefloat('10.30').tofixed(2) i got output 10.30 in string big problem me because want output number . and if this number(parsefloat('10.30').tofixed(2)) i got output 10.3 but want output in number , decimal point 10.30 plz help...!!! try this: parsefl

angularjs - How to trigger a function after typed a single letter in kendo combobox? -

i trying use angular ken-do_combo box auto-complete.. how trigger event while typed single letter in angular-ken combobox. but cant event while typing letter in combobox hey don't know if still looking try putting scope variable on combobox: <input kendo-combo-box="kendocombo"/> <script> angular.controller("kendoctlr", ["$scope", function($scope){ console.log($scope.kendocombo.text()); } ] ); </script>

javascript - Unit Testing with ExpresJS (Confused) -

so trying unit test expresjs routes. looks somthing server.js var boards = require('./routes/boardsroute.js'); app.get('/api/v1/boards/:id', boards.getboard); boardroutes.js exports.getboard = function(req, res) { boardmodel.find({ name: 'kanban board' }, function(err, columns) { if (!err) { return res.send(columns); } else { return console.log(err); } }); return res.send(board); }; i mock out boardmodel call mongoose model (aka database call). assume unit tests should not making calls database , have no server running. should testing getboards seperatly server.js app.get() call. (as these requests apt.get covered integration tests/e2e tests , http requests) all documentation , frameworks can see either have have express server running in order unit test route , particular exports.getboard. things have tried , use sinon.js mock fakeserver test http request , method getboard. use superagent , super

plugins - Platform.getBundle(Activator.PLUGIN_ID) returns null -

i have function ex public void func { .... .... url url = platform.getbundle(activator.plugin_id).getentry("config"); .... .... } now writing junit test case above function in different test plugin. when call func in junit test method getting null pointer exception. i tried printing platform.getbundle(activator.plugin_id) returns null platform.isrunning() returns false. please let me know how solve this? can junit testcase successful. thank in advance. just pseudo code... private platform platform; public void func() { //.... //.... url url = getplatform().getentry("config"); //.... //.... } public platform getplatform() { return platform.getbundle(activator.plugin_id); } in testcase, override getplatform() method mock/stub. class yourclass = new yourclass() { @override public platform getpla

java - Servlet abnormal invoking -

i have servlet: @webservlet ("/*") public class x extends httpservlet { @override protected void doget(httpservletrequest req, httpservletresponse resp) throws servletexception, ioexception { system.out.println("1"); } } i cannot figure out why prints "1" twice. can explain that? output: 1 1 you can print out request.getrequesturi() to confirm urls 2 requests.

android - How to set the background colour of a RadioButton? -

can please tell me how set background colour of radiobutton? if user selects yes , background color should change green. when user selects no , background color should change red. here xml: <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <include layout="@layout/header" /> <tablelayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:paddingtop="20dp" android:stretchcolumns="2" > <tablerow android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#ffff00" > <textview