Posts

Showing posts from 2012

php - get a image for yii array -

i new 1 yii framework.i created menu way array('class' => 'bootstrap.widgets.tbmenu', 'items' => array( array('label' => 'home', 'url' => array('/site')), array('label' => 'display menu', 'url' => array('/admin/displaymenu')), array('label' => 'reports', 'url' => array('/admin/reports')), ), ), this working.but need replace home, display menu, reports images.i using chtml::image also.but not working.please can me solving problem.thank prompt support. along using chtml::image try setting encodelabel false, ... 'encodelabel'=>false, or try doing array('class' => 'bootstrap.widgets.tbmenu', 'encodelabel'=>false, 'items&

java - how to access main/resources of a maven dependency lib? -

got maven submodule project including set of dlls in main\resoursces. how can access other module project ? the maven profile detects guest os , download dlls submodule project similar resolving maven dependency differently if jvm in use x86 or x64? you can introduce resource in pom.xml file <project> <build> <resources> <resource> <directory>${submodule_path}</directory> <includes> <include>*.dll</include> </includes> <targetpath/> </resource> </resources> </build> </project> other option use " build-helper-maven-plugin " , introduce there source want.

Nulls While Loading Data into Hive Table -

i have text file consists of 6 fields. here sample: 1,8,07-jun-14,12:31:38,14:54:04,0.5 1,7,07-jun-14,10:18:34,13:30:56,0.5 1,6,05-jun-14,13:37:43,15:18:57,0.5 1,8,03-jun-14,08:15:10,11:28:17,0.5 1,7,05-jun-14,07:15:40,11:15:24,0.5 1,2,05-jun-14,10:09:04,11:42:54,0.5 1,9,05-jun-14,11:46:22,13:54:30,0.5 1,3,03-jun-14,07:14:10,10:47:10,0.5 while loading data hive table getting nulls last column. here create , load statements: create external table kantar_data(home_id int,channel int, date_id string, start_time string, end_time string,weight float) row format delimited fields terminated ',' lines terminated '\n'; load data local inpath '/media/test/kantar/output26.txt' table kantar_data; following sample output getting: 1 6 02-jun-14 07:12:42 10:25:53 null 1 6 05-jun-14 07:24:39 12:15:57 null 1 9 07-jun-14 12:07:43 14:40:59 null 1 5 04-jun-14

Jenkins Jobs are not to be seen after network issue -

today morning, noticed putty jobs running jenkins closed due network issue. once network up, re-started jenkins , observed jenkins dashboard not showing jobs. had around 80 jobs on dash board. using vm servers master/slave setup. config.xml fine. do? how on track? all jenkins jobs xml config files kept in jenkins home. if jenkins not showing these jobs not using same home directory. kindly check jenkins process see directory pointing to.

c# - Fetching date in SQL Server 2008 -

how split date in select query of sql server 2008 ? if feed feed current date in database , type of column in database date time store date time.if 1 want fetch date part column can do. i can use query should not work. select donorname, date(dateofdonation) dateofdonation createdonordetail; it give error- 'date' not recognized built-in function name. sql server 2008 has date datatype - it's disabled if database upgraded sql server 2005, , didn't change database compatibility level . check compatibility level this: select name, compatibility_level sys.databases name = '-your-database-name-here-' if compatibility level 90 , it's set sql server 2005 , won't able use date . update compatibility level 100: alter database adventureworks2012 set compatibility_level = 100 now should able use date : select donorname, cast(dateofdonation date) dateofdonation createdonordetail;

java - Multiple attribute queries in Apache Lucene -

the below program satisfies query title has both lucene , action. if want search tupple isbn (considering isbn not unique) 1234 , title contains both lucene , dummies. lucene provide facility that. standardanalyzer analyzer = new standardanalyzer(version.lucene_40); directory index = new ramdirectory(); indexwriterconfig config = new indexwriterconfig(version.lucene_40, analyzer); indexwriter w = new indexwriter(index, config); adddoc(w, "lucene in action", "193398817"); adddoc(w, "lucene dummies", "55320055z"); adddoc(w, "managing gigabytes", "55063554a"); adddoc(w, "the art of computer science", "9900333x"); w.close(); private static void adddoc(indexwriter w, string title, string isbn) throws ioexception { document doc = new document(); doc.add(new textfield("title", title, field.store.yes)); doc.add(new stringfield("isbn", isbn, field.store.yes)); w.adddoc

php - nginx load wordpress from a subdirectory -

Image
i followed guide here install wordpress on ubuntu server. upon entering url http://mydomain.com loads me front page. server { listen 80 default_server; root /var/www/wordpress; index index.php index.html index.htm; location / { try_files $uri $uri/ /index.php?q=$uri&$args; } location ~ \.php$ { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; include fastcgi_params; } error_page 404 /404.html; error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } } i want load wordpress subdomain i.e., http://mydomain.com/wordpress . went on modify location can't load (it still looks files under http://mydomain.com ). root /var/www; index index.php index.html index.htm; location /wordpress { try_files

php - How to define font in FPDF? -

i trying make writable .pdf document drupal-site. newbie @ drupal attaching code part of body. cannot load fonts. following error: ** fpdf error: not include font definition file ** i have tried modifying folder privileges , defining path in following way: define('php', 'module', 'resources/php/fpdf/font/courier.php'); module_load_include('php', 'module', 'resources/php/fpdf/fpdf'); could spare 5 minutes , tell me how it. mean lot me, thanks the definition of path fpdf font directory done this: define('fpdf_fontpath', 'resources/php/fpdf/font/'); the path must relative location of php code

Android Development Tool 23.0.0 and Android L Update error in eclipse -

this question has answer here: update eclipse android development tools v. 23 43 answers i updated sdk latest release of android l , restarted eclipse i.e running on adt v.22 . when check update hep -> check updates , says no updates found . i manually tried download adt bundle official website , tried install adt-23.0.0.zip help -> install new software , described installation guide on site, gave me error cannot complete install because of conflicting dependency. software being installed: android development tools 23.0.0.1245622 (com.android.ide.eclipse.adt.feature.feature.group 23.0.0.1245622) software installed: google app engine tools android 3.5.1.v201312301719-rel-r42 (com.google.gdt.eclipse.mobile.android.feature.feature.group 3.5.1.v201312301719-rel-r42) 1 of following can installed @ once: adt xml overlay 22.6.3.v201404151837-112

android - GridView takes the height of 1st element/gridItem rather than the height of tallest element/gridItem -

i have fixed number of elements, 3 precise, aligned horizontally in single row, in gridview. each grid element linear layout vertical orientation. //fixed size not optional //optional text //optional text //optional text //not optional as text1/text2/text3 not compulsory, each gridelement has variable height. if height of first gridelement less other 2 gridelements, heights of gridelements 2 , 3 cut gridview takes height of first element. i want gridview take height of tallest element. please me in resolving issue.

php - ZF2 How to add new folder in src Folder except regular folders -

this normal folder structure src folder: src/ aplicationfolder/ model/ controller/ entity/ document/ form/ so need add new folder next form folder, have add configuration related class map. my autoload config follows: 'config_glob_paths' => array( 'config/autoload/{,*.}{global,local}.php', ), here getautoloaderconfig() configuration code: public function getautoloaderconfig(){ return array( 'zend\loader\classmapautoloader' => array( __dir__ . '/autoload_classmap.php', ), 'zend\loader\standardautoloader' => array( 'namespaces' => array( __namespace__ => __dir__ . '/src/' . __namespace__, ), ), ); } since using both autoloaders, don't need anything, standard autoloader should handle files add. however, when you're ready move app production

apache - Failing to read files from Multipart File Post PhP 5.3.3 -

i have question. tough problem solved, still have question need answer to. here dilema: we have 2 systems send data 1 another. 1 building whole post manually , sending our php aplication server runing on php 5.3.3-7+squeeze15 suhosin-patch and had big problem file posts lost between them. when app sending data us: post https://test.xxxxx.php authorization: basic xxxxxx content-type: multipart/form-data; boundary=---------------------------457c884a074995 -----------------------------457c884a074995 content-disposition: form-data; name="file"; filename="bulkcommand" content-type: text/xml <?xml version="1.0" encoding="utf-8"?> <interface> ----- </interface> -----------------------------457c884a074995 content-disposition: form-data; name=""; filename="interface-xml" content-type: text/xml <?xml version="1.0"?>--------</infrec01> -----------------------------457c884a07499

mysql - re use existing selected column in sql server? -

say have query goes this select column1 ,column2 ,column3 ,column4 ,column5 + reusethiscolumn reusethiscolumn2 [ can use here data derived column below? ] ,case[computation here] reusethiscolumn table is there way this? in advance. select column1 ,column2 ,column3 ,column4 ,(column5 + reusethiscolumn) reusethiscolumn2 ( select column1 ,column2 ,column3 ,column4 ,column5 ,case[computation here] reusethiscolumn table ) subq

Multiple events in one MySQL trigger -

i want monitor multiple events on 1 table using mysql trigger. when these events happened, can on database. codes below can accomplish task: drop trigger if exists trigger_sample1;; create trigger trigger_sample1 after update on table_1 each row begin /* */ end ;; drop trigger if exists trigger_sample2;; create trigger trigger_sample2 after insert on table_1 each row begin /* */ end ;; drop trigger if exists trigger_sample3;; create trigger trigger_sample3 after delete on table_1 each row begin /* */ end ;; but wish combine these triggers 1 trigger. tried code like: drop trigger if exists trigger_sample;; create trigger trigger_sample after update, insert, delete on table_1 each row begin /* */ end ;; this can not work.i tried: drop trigger if exists trigger_sample;; create trigger trigger_sample after update on table_1 after insert on table_1 after delete on talble_1 each row begin /* */

Android ListView setting height -

we have android application listview, containing n items. setting height of listview component, use method: public static void setlistviewheightbasedonchildren(listview listview) { listadapter listadapter = listview.getadapter(); if (listadapter == null) { return; } int totalheight = 0; int desiredwidth = view.measurespec.makemeasurespec(listview.getwidth(), view.measurespec.at_most); (int = 0; < listadapter.getcount(); i++) { view listitem = listadapter.getview(i, null, listview); listitem.measure(desiredwidth, view.measurespec.unspecified); totalheight += listitem.getmeasuredheight(); } viewgroup.layoutparams params = listview.getlayoutparams(); params.height = totalheight + (listview.getdividerheight() * (listadapter.getcount() - 1)); listview.setlayoutparams(params); listview.requestlayout(); } the height measured bad in first run. if method called later (e.g. after reloading listview data be

popup - Foundation 5 Reveal modal, remove background -

i'm having issues trying remove reveal modal background the documentation gives several options none of them work: http://foundation.zurb.com/docs/components/reveal.html remove background: <div class="reveal-modal-bg" style="display: none"></div> optional javascript configuration: reveal options can passed in during initialization @ time. however, can bind open, opened, close, , closed events. i tried returning object literal in event callback, doesn't work: $(document).on('open.fndtn.reveal', '[data-reveal]', function () { return {bg_class: 'nobackground'} }); { animation: 'fadeandpop', animation_speed: 250, close_on_background_click: true, dismiss_modal_class: 'close-reveal-modal', bg_class: 'reveal-modal-bg', root_element: 'body', bg : $('.reveal-modal-bg'), css : { open : { 'opacity': 0, 'visibility': 'v

ios - Unwanted blinking in animation -

-(ibaction)duckaction:(id)sender{ cabasicanimation *moveduck = [cabasicanimation animationwithkeypath:@"position"]; [moveduck setremovedoncompletion:yes]; [moveduck setduration:.40]; [moveduck setrepeatcount:1]; [moveduck setautoreverses:no]; [moveduck setfromvalue:[nsvalue valuewithcgpoint: cgpointmake(btnduck.center.x+25 ,btnduck.center.y)]]; [moveduck settovalue:[nsvalue valuewithcgpoint: cgpointmake(btnduck.center.x -25, btnduck.center.y)]]; [btnduck.layer addanimation:moveduck forkey:@"position"]; } -(ibaction)frogaction:(id)sender{ ptfrog = btnfrog.center; [uiview animatewithduration:1.00 delay:0.0 options:(uiviewanimationoptionautoreverse|uiviewanimationoptionallowuserinteraction) animations:^ { cgpoint position; position.y = 577.

php - Ask about codeigniter session for Cart -

today have problem cart in codeigniter. at localhost thats fine when add products cart bag, no problem detected. after upload server, problem, must refresh page load products in cart bag. when remove product cart bag same problem. must refresh , refresh view product in cart bag. why problem occur? finally, solve problem using php native session, replace ci session php native session , problem solved. but, can php native session stored in database? ci session? know, session can store max 4kb. afraid session can not store product item in cart bag. sorry if english bad. :) i have tried using other browsers chrome , opera. problem still occur. thanks response friends.. appreciate it.. :d you can try here it issue same code igniter error issue. redirection problem in index function of controller. after remove , add product redirect @ index function of controller. think it.

sql - How to get this specific user rankings query in mysql? -

i've got tbl_items in user database want sort user rankings on particular item id (514). have test data on dev environment set of data: mysql> select * tbl_items classid=514; +---------+---------+----------+ | ownerid | classid | quantity | +---------+---------+----------+ | 1 | 514 | 3 | | 2 | 514 | 5 | | 3 | 514 | 11 | | 4 | 514 | 46 | | 5 | 514 | 57 | | 6 | 514 | 6 | | 7 | 514 | 3 | | 8 | 514 | 27 | | 10 | 514 | 2 | | 11 | 514 | 73 | | 12 | 514 | 18 | | 13 | 514 | 31 | +---------+---------+----------+ 12 rows in set (0.00 sec) so far :) wrote following query: set @row=0; select a.*, @row:=@row+1 rank (select a.ownerid,a.quantity tbl_items a.classid=514) order quantity desc; +---------+----------+------+ | ownerid | quantity | rank | +---------+----------+------+ | 11

android - When using System.exit() the app does't closes -

i have app in @ home screen onbackpressed() have used system.exit() nither app closes infact gives me forceclose. home.class @override public void onbackpressed() { super.onbackpressed (); system.exit (0); } use finish() method instead of system.exit (0);

android - create a linear layout of overlapping imageviews -

Image
i need create stack of overlapping imageviews in android spider solitaire in windows. also, need able dynamically add more imageviews . please suggest methods so. can use linearlayout (its not necessary. whatever works fine)? if so, how accomplish overlap? note: imageviews have same amount of overlap, no need worry unopened cards in give screenshot. thank you user layerlist a layerdrawable drawable object manages array of other drawables. each drawable in list drawn in order of list—the last drawable in list drawn on top. <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item> <bitmap android:src="@drawable/android_red" android:gravity="center" /> </item> <item android:top="10dp" > <bitmap android:src="@drawable/android_green" android:gravity="cent

mysql - Get a monthly summary -

i have database table contains column represents initial subscription date. want query number of records exists between 2 specific dates grouping months , years. may me please. example of such table. create table objects( id int primary key, subscription_date date, ) i want example count objects exists each month 12/12/2011 till 12/12/2013 knowing objects counted before must counted again in next month since still exist, , new objects subscribed in new dates added up. for month can try this:- select count(val) objects group month(subscription_date); and year can try this:- select count(val) objects group year(subscription_date); hope can you.

shell - escape character "\" not working in awk with $ -

below sample data: "udbpem1 "."histogrambin_@@@@@002__udbdi02$" "udbpem1 "."histogrambin_@@@@@002__udbdi02$" place in tt file, want replace "histogrambin_@@@@@002__udbdi02$" "histogrambin_@@@@@002__udbdi02$_mig" i using below below awk command substitution not happening. awk '/histogrambin_@@@@@002__udbdi02\$/ {sub("'histogrambin_@@@@@002__udbdi02\$'","'histogrambin_@@@@@002__udbdi02\$_mig'")} {print}' tt please let me know wrong command. thanks, rakesh adding further information: the awk command here used replace object name picked file. $ can anywhere in name, want _mig @ end. actual awk command use in script below: awk '/"'${tab_name}'"/{if (m==""){sub("'${tab_name}'","'${tab_name}_${tab_ext}'");m=1}}{print}' filename i have use "" expand awk use shell variables , want rep

sql - What is the difference between MOD and REMAINDER in oracle? -

although both functions perform same operation, produce same o/p, basic difference between these two? there performance related difference, if yes, 1 better? thanks the documentation pretty clear on difference: note the remainder function uses round function in formula, whereas mod function uses floor function in formula. in other words, when arguments positive integers, mod function returns positive number between 0 , second argument. remainder function returns number absolute value less second argument divided 2. the differences can more striking negative numbers. 1 example of difference is: remainder(-15, 4) mod(-15, 4) the first gives -3 , second 1 . edit: what happening here? how many times 4 go -15. 1 method "-4" times remained of 1. is: -15 = 4*(-4) + 1. other "-3" times: -15 = 4*(-3) - 3. the difference -15/4 expressed integer. using floor, -4 . using round, -3 .

SAS : Converting Text format to date format and finding difference between dates -

i new sas , have data set below: payment 335861 36416 5 41641 41648 payment 335861 85610 8 41641 41648 payment 335861 99214 156 41641 41648 in last 2 columns dates in text format, kind when make tab delimited file excel. now want convert these numbers date format. , find difference(in days) dates got. tried "informat" way not getting anywhere it.please help.... data sample_data; infile cards; input type $ id amount count tdate1 $ tdate2 $; cards ; payment 335861 36416 5 41641 41648 payment 335861 85610 8 41641 41648 payment 335861 99214 156 41641 41648 ; run; data out_data; set sample_data; format date1 date2 yymmdds10.; /* format=display number (of days) date */ date1 = input(tdate1, 5.);/* conversion text number (assuming it's sas date value=number of days 1jan1960 */ date2 = input(tdate2, 5.); datediff = date1 - date2; /* calculate date difference */ run; example assumes "dates" co

Vertical concatenation of many vectors Mata/Stata -

i working mata (stata) trying append (vertically concatenate) many vectors. mat c = a\b but since have 300 column vectors append in unique column vector, know if there command (since quite difficult type mat c = c1\c2\c3... 300 times). the code cite stata's matrix language, not mata. how did these vectors in first place? named systematically? there easy answer depending on details. for example, in stata can go column vectors c1 ... c300 mat c = c1 forval j = 2/300 { mat c = c \ c`j' } although matsize limit may mean better off handling such column vector stata variable or in mata. edit: produce matrix in stata columns, use , not \ .

.net - C# How to use FirstOrDefault with an array while unable to have System.Linq in the namespace? -

the code provided here works when test in ide, software using code doesn't give me possibility declare using system.linq . i'm stuck trying figure out how use else i'll have go solution i'd rather not use because has lower accuracy rate. the issue here var stringmatch = sarray.firstordefault(titleid.contains); i'm not sure how provide references. think should along ways of system.linq.enumerable ... it's first time i'm dealing such issue appreciated. string takeendperiod = ""; string newendperiod = ""; string findendspace = ""; string getendperiod = ""; string titleid = "document period ended december 31 2014"; string s1 = "ended "; string s2 = "ended "; string s3 = "ending "; string[] sarray = new [] { s1, s2, s3}; var stringmatch = sarray.firstordefault(titleid.contains);

Conflicting definition of Swift struct and array -

in swift programming language, says: “all of basic types in swift—integers, floating-point numbers, booleans, strings, arrays , dictionaries— are value types , , implemented structures behind scenes.” “ structure instances always passed value , , class instances passed reference” “if assign array instance constant or variable, or pass array instance argument function or method call, contents of array not copied @ point assignment or call takes place. instead, both arrays share same sequence of element values. when modify element value through 1 array, result observable through other.” clearly, swift contradicting when comes array. array value type or reference type? array special cases. value types special behavior. at page found point 3) there enough information understand why: the assignment , copy behavior swift’s array type more complex dictionary type. array provides c-like performance when work array’s contents , copies array’s contents when

c# - exposing datacontract defined in a different namespace via WCF -

i have developed webservice, accepts object input namespace someservice { public bool createbehavior(classinput classinput) { // code here } } now have defined classinput datacontract in business entities different namespace namespace someservice.businessentities { [datacontract] public class classinput { [datamember] public int intvariable{ get; set; } [datamember] public string stringvariable { get; set; } } } to use classinput in webservice have added project reference business entities project. how can expose datacontract consumer of webservice? instance in client side, need classinput, not exported via service!! someserviceclient someserviceclient = new someserviceclient(); someserviceclient.createbehavior( classinput ) i read datacontractsurrogate not able map scenario

ruby on rails - Escape format with number_to_currency -

i have weird situation, i'm using number_to_currency helper actionview::helpers::numberhelper . snippet of code using this: .price .value= number_to_currency price, format: "%u<b>%n</b>", precision: 0 when i'm running project locally, works should be: $500 (only numbers bold) but when i'm deploying stage server, gives me: $<b>500</b> i'm not sure kind of problem this, i've tried precompile assets didn't help. tried html_safe no success. any idea how resolve issue? thanks try this, may work.. .price .value= number_to_currency 100, format: "%u<b>%n</b>".html_safe, precision: 0

google compute engine - Persistent disk reliability and backups in GCE -

(my apologies being off-so question, seems gce questions tend loess tightly connected programming.) i designing data acquisition program run on gce. data collected onto persistent disk. data cannot afford lose, need know reliability of persistent disks. have been able find 3 pieces of information: persistent disks have built-in redundancy protect data against equipment failure , remain available through datacenter maintenance events. instances, free of local storage, can moved google live migration newer hardware without intervention. allows google datacenters maintained @ highest level; software, hardware, , facilities can continually updated ensure excellent performance , reliability cloud-based services. [google] google compute engine uses redundant, industry-standard mechanisms protect persistent disk users data corruption , sophisticated attacks against data integrity. [google] google persistent disk never return erroneous data, instead there io error. [i cannot find 1

c++ - Qt5: cross-compiling static program with evdev-support -

i'm trying cross compiling simple program. natively compiling on computer works (the program functionable). when cross-compiling dev-board, linuxfb work out of box. no input generated. that's how qt configured: ./configure -opensource -confirm-license -prefix /opt/qt5-armhf -static -no-qml-debug -xplatform armhf-g++ -no-gif -qt-libpng -no-libjpeg -no-openssl -no-cups -no-eglfs -no-directfb -qpa linuxfb -no-opengl -nomake examples -nomake tests that's .pro: qt += widgets destdir = bin headers = src/mainwindow.h src/modules/repartitionmodule.h src/modules/configmodule.h sources = src/main.cpp src/mainwindow.cpp src/modules/repartitionmodule.cpp resources = installer.qrc qtplugin += qevdevkeyboardplugin qevdevmouseplugin i'm getting following output @ dev board: this plugin not support setparent! there seems no difference between starting program using -plugin evdevxxx or parameters without. what's wrong , how fix it?

cocoa - dictionaryWithContentsOfFile and Sandbox -

i've created mac app load xml file user selected folder, , after using app, user saves customized file (.adgf) when try load .adgf file (that plist file) has xml path within 1 record call dictionarywithcontentsoffile return me "nil". think problem sandbox (sometime works sometime not). string path correct. maybe when user load xml file should save within of particular app "document folder"? edit: i'm trying right bookmark data solution , retraive nsurl doen't work. code i'm using this: - (nsdata *)bookmarkfromurl:(nsurl *)url { nserror *error = nil; nsdata *bookmark = [url bookmarkdatawithoptions:nsurlbookmarkcreationwithsecurityscope includingresourcevaluesforkeys:null relativetourl:null error:&error]; if (error) { nslog(@"error creating bookmark url (%@): %@", url, error); [nsapp presenterror:error]; } return bookmark; } - (

php - Looping trough multidimensional array to get specific results from sub arrays -

i have array , extract data out of array. no problem me time little bit different me. i have array: $arrparcellabelnumber = array ( "parcellabelnumber" => array ( 0 => "10", 1 => "20" ), "weight" => array ( 0 => "1111", 1 => "2222" ) ); i have following result: 10 = 1111, 20 = 2222 so means want value of parcellabelnumber key same 1 weight , want value of weight both same. i tried several methods of them didn't work. new code: $arrparcellabelnumber = array ( "parcellabelnumber" => array ( 0 => "09988014801055", 1 => "09988014801056" ), "weight" => array ( 0 => "1111", 1 => "2222" ) ); foreach($arrparcellabelnumber $val){ foreach($val['parcellabelnumber'] $key=>$v){ echo $val[&

selenium - HtmlUnitdriver issues with Ajax content, I think -

i have been testing app using firefox web driver slow comparing htmlunitdriver, decided translate last one. works fine have problems kind of links loads information async. in case not problem of "wait" because , said before, using firefox driver works well. htmlunit doesnt work well. in scene have following code: <a href="/requests?category=challenge" data-method="post" data-remote="true" id="759" rel="nofollow">send</a> viewing app on browser such firefox, when click on link, system return me result. when use htmlunitdriver, when click element, driver goes directly href , have bad result. i don't know how make works it. i'm interested on way because fast.

autocomplete - Customize WPF Toolkit autocompletebox -

Image
wpf toolkit library has autocompletebox control. 1. how place icon @ left of textbox part? 2. how add shadow borders of suggestions popup? changing textboxstyle property not give results. <!-- xmlns:extendedcontrols="clr-namespace:system.windows.controls;assembly=system.windows.controls.input.toolkit" --> <extendedcontrols:autocompletebox> <extendedcontrols:autocompletebox.textboxstyle> <style targettype="textbox"> <setter property="padding" value="20,0,0,0" /> <setter property="background"> <setter.value> <imagebrush imagesource="/img.png" stretch="none" alignmentx="left" /> </setter.value> </setter> </style> </extendedcontrols:autocompletebox.textboxstyle> </extendedcontrols:autocompletebox> the autocompletebox have got property : textbo

asp.net - Windows Azure VM SSL and Cloudapp.net -

Image
i installed asp.net application on windows azure vm (iis 7). ssl certificate installed, configured , application works correctly. have removed http binding , http endpoints. the issue having if use cloudapp.net link (using https), application still opens mismatched certificate. what can deny user opening application using https://xx.cloudapp.net/x ? it seems silly people saying isn't right place question, since of solutions code related. ie: in application, check host , if it's cloudapp.net, url redirect. there's few different options here sounds you're looking ability prevent viewing application using url. what set site in iis uses host header resolution xx.cloudapp.net. if url recognized, redirect using http redirect settings https version of app. don't bind ssl port site or you'll run ssl errors showed above. the other option leave out entirely , use host header resolution filter out requests site. suspect you've done assign incom

Twitter Typeahead square brackets -

i have twitter typeahead enabled control. uses bloodhound preload data, consists of results this: [1996] [1996] else [1996] more [1996] still more [1996] thats the control set display results after 3 characters. if type 199 , results return correctly, however, if type [199 or [1996 , no results. time results if close bracket, , type [1996] . has else experienced this? or knows issue? did ever resolved? if not, try following; var normalize = function(str) { $.each(charmap, function(chars, normalized) { var regex = new regexp('[' + chars + ']', 'gi'); str = str.replace(regex, normalized); }); return str; } taken here

scala - Using keytab file in spark standalone program -

i trying access file hdfs in standalone scala program using apache-spark. following error upon execution. simple authentication not enabled. available:[token,kerberos] i found this question explains need create keytab file , make standalone program use . have generated keytab file . tell me how can use program. any appreciated. ps - using hadoop 2.3.0 , spark 0.9.0 update : how core-site.xml looks : <?xml version="1.0" encoding="utf-8"?> <!--autogenerated cloudera manager--> <configuration> <property> <name>fs.defaultfs</name> <value>hdfs://ushadoop</value> </property> <property> <name>fs.trash.interval</name> <value>1</value> </property> <property> <name>io.compression.codecs</name> <value>org.apache.hadoop.io.compress.defaultcodec,org.apache.hadoop.io.compress.gzipcodec,org.apache.hadoop.io.compress.

javascript - Ajax delete returns 200 but firing off error event -

i have read through loads of posted threads , none seem deal delete. code returning 200 status yet fires of error event... $.ajax({ type: 'delete', url: '/' + type + '/' + name, success: function() { window.alert(type + " " + name + " successful"); }, error: function(xhr, status) { alert(xhr.status); alert('failed delete ' + type + ' ' + name) } }); i think it's because of type: 'delete' . change type: 'json' or remove @ all. since returning wrongly formatted response, error callback fired. safe if specify json type , echo besides of json string.

python - Get number of occurrences of certain attribute in a related table in an aggregation in django -

i'm creating extensible analytics app django, idea have table events wish track , table connects events, date , user. here main model: class events_tracked(models.model): data_point = models.foreignkey('data_points', related_name='data_point') event_date = models.datetimefield(default=datetime.datetime.now()) user = models.foreignkey('users', related_name= 'user_tracked') my problem create django query can group events tracked month, , return number of tracked events (rows) data_point__id id specify. preety sure do: events_tracked.objects.values('event_date__month').annotate(count('data_point')).filter(data_point__id=1) but limited count of single data point, need query can return count row each of data points want track. edit: important query need build each month, number of users had events tracked, data_point id in list of id's.

asp.net jquery ajax page reload issue -

we loading child page in parent page parent.aspx follows - $("#result").load("child.aspx"); child.aspx consists of asp:linkbutton. problem - onclick of asp:linkbutton causing child.aspx opened instead of being embedded in parent.aspx before click event. expected - child.aspx should remain embedded in parent.aspx onclick of asp:linkbutton note - on debug observe first page_load method first invoked followed onclick event handler. my guess when you're loading child page div, you're alsing loading form element child.aspx well, making have 2 forms on page now. , i'll bet that form set post child.aspx. when click linkbutton, submits form , directs entire window child.aspx. if want embed entire page inside page, may want use iframe.

javascript - Highcharts Column chart with drilldown, remove hyperlink like formatting from x-axis labels -

i using column chart drilldown . here jsfiddle . now problem is: i want remove hyperlink formatting labels on x-axis , datalabels as able notice fiddle have tried apply formatting on x-axis labels using code like: xaxis: { type: 'category', labels:{ style:{ color: 'red', textdecoration:"none" } } }, and used following code format datalabels: plotoptions: { series: { borderwidth: 0, datalabels: { enabled: true, format: '{point.y:.1f}%', style:{ color: 'blue', textdecoration:"none" } } } } but problem is: formatting w

Export MS Access Report to PDF based on condition -

is there way export report in ms access pdf based on criteria/field on report? i have created productivity report in ms access. instead of exporting 50 pages 1 pdf, there way export based on manager's name? field managers name included on actual report. you can take idea , play it. insert module option explicit dim g_managerreportfilterenabled boolean dim g_managerreportfilter string public function ismanagerreportfilterenabled() boolean ismanagerreportfilterenabled = g_managerreportfilterenabled end function public function getmanagerreportfilter() string getmanagerreportfilter = g_managerreportfilter end function public sub exportfilteredmanagerreporttopdf(strmanagername string) on error goto exportfilteredmanagerreporttopdf_errorhandler g_managerreportfilterenabled = true g_managerreportfilter = "[mymanagernamefield] = " & chr(34) & strmanagername & chr(34) docmd.outputto acoutputreport, "myreportname", a

How does instanceof work in JavaScript? -

in following code sample both checks of obj2 , obj3 @ end instanceof return true if ways there constructed different , results of returning name property different. var obj1 = function() { this.name = "foo1"; }; obj1.prototype.name = "foo1onprot"; var obj1 = new obj1(); var obj2 = function() {}; obj2.prototype = new obj1(); obj2.prototype.constructor = obj2; var obj2 = new obj2(); var obj3 = function() {}; obj3.prototype = object.create(obj1.prototype); obj3.prototype.constructor = obj3; var obj3 = new obj3(); console.dir(obj1); console.log("obj1.name: " + obj1.name); console.dir(obj2); console.log("obj2.name: " + obj2.name); console.dir(obj3); console.log("obj3.name: " + obj3.name); console.log("obj2 instanceof obj1: " + (obj2 instanceof obj1)); console.log("obj3 instanceof obj1: " + (obj3 instanceof obj1)); result of run in chrome: obj1 name: "foo1" __proto__: object construc

c# - Error. An error occurred while processing your request -

fairly simple question connection strings using asp.net mvc web application sql server database. i created web application uses database, using default templates mvc 5 application using visual studio 2014. i moving application on iis , sql server express database (2014) , see database application uses localdb (has .mdf extension) need know how attach sql server express database. (the development machine , server separate machines) i have attached server , have login "iis apppool\defaultapppool" iis able use server. here have granted login read , write permission database "aspnet-owintest-20140519094353" , connection string in iis server=kevin-pc\sqlexpress;database=aspnet-owintest-20140519094353;integrated security=true the default connection string when building application is: <add name="defaultconnection" connectionstring="data source=(localdb)\v11.0;attachdbfilename=|datadirectory|\aspnet-owintest-20140519094353.mdf;initial cata

javascript - datatables horizontal scroll bar to be shown on top instead of bottom -

datatables(jquery plugin) has scrollx option, when set true add scroll bar appear @ bottom of table, there option display @ top of table. not quite impossible. you find answer @ http://progrnotes.blogspot.com.ee/2013/07/horizontal-scrollbars-at-top-bottom-in-datatables.html : can jquery-doublescroll plugin ( https://github.com/sniku/jquery-doublescroll ). however, not working datatable loaded ajax. need tweak little. steps this: download , include doublescroll. add lines: $('body').find('.datatables_scrollbody').wrap('<div id="scroll_div"></div>'); $('#scroll_div').doublescroll(); add css .datatables_scrollbody { overflow-y: visible !important; overflow-x: initial !important; } that should (datatables 1.10.7) edit: if have column filters on top above solution needs modifying, otherwise headers won't scroll: add lines: $('body').find('.datatables_scroll').wrap('<div i

Walk through folders until specific ending number python -

i have range of folders named folder0, folder2,..., folder99. want walk through folder0,..., folderx , print files. x should stay variable , easy change. my code looks not working how want work yet because can't decide until number want go. import os import re rootdir = r'path' root, dirs, files in os.walk(rootdir): dir in dirs: if not re.match(r'folder[0-9]+$', dir): dirs.remove(dir) file in files: print files assuming name scheme consistent, state, why os.walk? import os dir_path = '/path/to/folders/folder{}' x = 10 in range(0, x): formatted_path = dir_path.format(i) try: f in os.listdir(formatted_path): filename = os.path.join(formatted_path, f) if os.path.isfile(filename): print filename except oserror: print "{} not exist".format(formatted_path)

How to index simple javascript hash/objects with ctags? -

i use ctags navigate javascript apps , found functions added index , work great, yet when have seemingly basic hash/object isn't added index/ctags file when index using command below. can add command or should know ctags change behavior? ctags -a -rf .ctags --languages=javascript,typescript --exclude=.git --exclude="*.min.js" --exclude=node_modules here javascript object in question var myasynccomponent = { hello: null, render: function() { return "abc123"; } }; i think might because not using correct javascript ctags definition file. i trying example out using definition tim-smart posted on over github in gist . all have include in .ctag definition file in home directory (/~) , run: ctags --languages=js <name of js file(s)> that way produce tags file can consumed editor or ide. i hope helps. tried sublime text 2 , ctags plugin , able navigate objects attribute without trouble.

PHP class issue/Session issue -

i'm trying create object , store in session variable can access on different pages. i'm having issue properties in object getting on written inexplicably. getmenu method seems displaying wrong property. cannot figure out why, maybe here @ glance know. here user.class.php: <?php /** * created phpstorm. * user: * date: 6/26/14 * time: 2:55 pm */ class user{ private $company; private $username; private $menutype; private $viewstate; private $gridtype; public function setgrid($gridtype){ $this->gridtype = $gridtype; } public function getgrid(){ if($this->gridtype='salesgrid'){ include 'gridview.php'; }elseif($this->gridtype='truckinggrid'){ include 'lactiveloadview.php'; } } public function setcompany($company){ $this->company = $company; } public function getcompany(){ return $this->comp

google apps script - setNumberFormats not working properly for percentages -

i have google spreadsheet in want copy values 1 range range using script. copying values isn't hard; use range.setvalues(valuestocopy) . want copy formatting of original range on new range. problem whenever percentage occurs, doesn't apply format correctly , ends off factor of 100. example, if original cell contains value of 0.5545, formatting of cell turns 55.45% (which want); however, when copy values range , apply formatting setnumberformats() , turns 0.5545%. how can fix this? edit: so, after bit more fiddling around, appears script copies formatting on first time, on subsequent executions of script, formatting percentages gets messed up, explained above. to copy values, use .copyto method, , format preserved default. example, rangefrom.copyto(rangeto)

android - Syncing offline data sequentially whenever internet is available -

Image
i'm working on project collects user data , stores in offline sqlite database later starts syncing whenever internet connection available. from sqllite database i'm syncing entry 1 one status "pending" i made working codes these not efficient , i'm facing these problems. 1 - broadcastreceiver activates when network status changes doesn't work when phone connected internet. want start syncing data whenever internet available not after chaning internet status 2 - i'm using simple loop starts first index of row status "pending" , runs till reaches total number of pending items. want efficient way that. i used 2 functions inside databasehandler class, function #1 pendingcontactcounter() counts number of contacts status "pending". example if consider uploaded table image function return 2 two contact availble status "pending" function #2 pendingcontactid() returns id of first row status "pending" abov

jquery - Properly firing JavaScript on Different tags -

i having difficulty trying make javascript fire in of necessary places in project. before problem, let me give little background of project. i made jsfiddle elementary, accurate mock of current website. idea when click black boxes, info associated box appears in grey "info" box. here jsfiddle: http://jsfiddle.net/5dquk/27/ the problem clickable area in the black boxes area surrounding p tag ( http://imgur.com/adq0z5f ) is there way make javascript fire when region of black box clicked? have tried adding p exception in javascript, did not work.... $("#block-buttons").on("click", "div", ***"p",*** function (clickevent) { any appreciated, many thanks!!! the issue isn't clickable area, it's logic in event handler. here working version http://jsfiddle.net/5dquk/36/ i changed target line to var target = $(this).data("target");

Should I make all parameters in Java/Android final? -

in this answer states should never change parameters assign , best if java enforce parameters final. agree , never this. if want change parameter , return again, create local copy in method, change things copy , return copy. this made me wonder, should make parameters in android/java project final, or there case wouldn't want this? some questions popped in head: does making @override method's parameters final make different? and follow-up previous question: matter if call super(my_final_parameter); ? again follow-up: super(my_final_parameter); of default java/android extends , there case behind scenes these java/android classes use parameter can't have them final? if doesn't matter cases above (or other cases might think of) if parameters final or not, idea make every parameter of methods / constructors / overridden methods final? since java pass-by-value , not pass-by-reference , modifying parameters have no effect on original variable. ad

popup - Can android PopupWindow show another PopupWindow? -

can android popupwindow show popupwindow? how many popupwindow can opened in same time? one? the first popupwindow displayed normally. on button click (which in first popupwindow contentview) having exception: 08-13 16:28:38.682: error/androidruntime(11760): fatal exception: main android.view.windowmanager$badtokenexception: unable add window -- token android.view.viewrootimpl$w@41286250 not valid; activity running? @ android.view.viewrootimpl.setview(viewrootimpl.java:600) @ android.view.windowmanagerimpl.addview(windowmanagerimpl.java:313) @ android.view.windowmanagerimpl.addview(windowmanagerimpl.java:215) @ android.view.windowmanagerimpl$compatmodewrapper.addview(windowmanagerimpl.java:140) @ android.view.window$localwindowmanager.addview(window.java:537) @ android.widget.popupwindow.invokepopup(popupwindow.java:992) @ android.widget.popupwindow.showasdropdown(popupwindow.java:901) @ org.example.qbertic

How to change the title text on the Magento sales email? -

how can change title text on sale email? i in email when make order, main website store: new order # 100000016 i want change to, [name of store]: new order # 100000016 is possible? can change it? also, in sale email content, thank order main website store. once package ships send email link track order. if have questions order please contact @ support@example.com or call @ monday - friday, 8am - 5pm pst. your order confirmation below. thank again business. where can change this? main website store ? the new order template files located in app/locale/en_us/template/email/sales/order_new.html and app/locale/en_us/template/email/sales/order_new_guest.html you can edit these files directly, it's better create overwrite in magento backend: system -> transactional emails -> add new template and choose new order / new order guest, click load template , edit mail template. template subject like: {{var store.getfrontendname()}