Posts

Showing posts from June, 2012

Test google schema in my gmail account -

i'm starter in google schema, i've followed getting started, doesn't work... i've changed more simple json-ld, simple actions, .... i'm testing django project, in local, django smtp config smpt.gmail.com. same , email. can see email, can't see go-to-action.... original mail: return-path: <xx@gmail.com> received: tomas-h55m-d2h (37.130.151.22.radiocable.net. [37.130.151.22]) mx.google.com esmtpsa id n3sm2456222wix.1.2015.05.12.04.20.07 <xx@gmail.com> (version=tlsv1.2 cipher=ecdhe-rsa-aes128-gcm-sha256 bits=128/128); tue, 12 may 2015 04:20:07 -0700 (pdt) mime-version: 1.0 content-type: text/html; charset="utf-8" content-transfer-encoding: 7bit subject: testing from: xx@gmail.com to: xx@gmail.com date: tue, 12 may 2015 11:20:07 -0000 message-id: <20150512112007.23123.78164@tomas-h55m-d2h> reply-to: xx@gmail.com <html> <head> <script type="application/ld+json"> {

javascript - Call Window.Close() event for chrome and Opera from Code Behind -

as know close current browser tab chrome can use following code var win= window.open("","_parent",''); win.close(); i have tried code in way function closeme() { var win = window.open("", "_parent", ''); win.close(); } and invoke this: <asp:button id="btn" runat="server" text="close window" onclientclick="closeme()" /> works charm both chrome , opera. however trying code call codebehind c#, in way: page.clientscript.registerstartupscript(this.gettype(), "keyname", "var win = window.open('', '_parent', '');win.close();", true); but unfortunately not firing up.. doubles quotes missing or javascript has not been invoked properly? synatx alright? can 1 me please.? by security reasons chrome not allowed this.

php - How can I display `₹` properly in pdf in Magento.? -

Image
indian rupee symbol(₹) not displaying in invoice pdf in magento . in system->manage currency->symbols save currency symbol ₹ . then pdf looks: i change symbol in system->manage currency->symbols &#8377; then pdf looks this: how can display ₹ in pdf (invoice,order etc) in magento .? r4ven 's , rajatsaurastri 's answers helped me find solution. thank guys.. however post answer make working well.. 1.download font support indian rupee symbol. download dejavu-sans font. 2.place font in lib directory. 3.open app/code/core/mage/sales/model/order/pdf/abstract.php , app/code/core/mage/sales/model/order/pdf/items/abstract.php and replace $font = zend_pdf_font::fontwithpath(mage::getbasedir() . '/lib/linlibertinefont/linlibertine_re-4.4.1.ttf'); with $font = zend_pdf_font::fontwithpath(mage::getbasedir() . '/lib/dejavu-sans/dejavusans.ttf'); (in _setfontregular() , _setfontbold() , _setfontitalic() fu

Sencha ExtJS MVC - data source specified at run time -

i want write proof-of-concept app along these lines: view - url text input field @ top go button - big div underneath consisting of rest of view controller - upon go pressed, validate url text - set url data source - read data data source - create nested div element each data, apply css rules - add element big div model - define fields - define default ordering css - define styles first, have written above work within extjs or fighting framework? in particular, inserting plain html element nodes. second, know of existing project under gpl act starting point? far i've seen flashy examples urls hard-coded , set auto-load. there's nothing scary or otherwise disturbing in you've written. although not advertised, extjs handles custom html & css pretty well. can set using html or tpl config options. latter powered xtemplates, can loops, etc. when using these options and/or custom css, ext calculate layouts around rendered result, accountin

ajax - Page not getting redirected php -

i have passed values page using ajax request method post. there 1 condition f 1 directly accessing url, should redirected other page. problem not getting redirected (in else condition in img.php) . can 1 tell me mistake committing? thanks in advance. code:- imageupload.php: document.getelementbyid("submit").addeventlistener("click", function(event){ event.preventdefault(); saveimgfunc(); }); function saveimgfunc(){ var form = new formdata(document.getelementbyid('saveimg')); var file = document.getelementbyid('imgvid').files[0]; if (file) { form.append('imgvid', file); } $.ajax({ type : 'post', url : 'core/img.php', data : form, cache : false, contenttype : false, processdata : false }).success(function(data){ document.getelementbyid('msg').innerhtml = data; }); } img.php: <?php require '../co

merge 3 files with awk in linux -

following problem: (similar 1 last question) tried ` awk 'fnr==nr {a[nr]=$0;next} {print a[1]","c[1]", "$0}' file1 file2 file3 but not work file1: line1 line2 line3 and file2: date1 and file3: titel1 result should date1 merged each line of file1. result: line1, date1, titel1 line2, date1, titel1 line3, date1, titel1 thanks input [akshay@localhost tmp]$ cat f1 line1 line2 line3 [akshay@localhost tmp]$ cat f2 date1 [akshay@localhost tmp]$ cat f3 titel1 output [akshay@localhost tmp]$ awk 'fnr==1{i++}i<3{a[i,1]=$0;next}{print $0,a[1,1],a[2,1]}' ofs=', ' f2 f3 f1 line1, date1, titel1 line2, date1, titel1 line3, date1, titel1

oracle - Write a database change to another database via JMS -

is there anyway write 1 database(oracle) change database(oracle) via jms? thanks you can write java program uses "database change notification" notified when db1.tb1 changed apply same change db2.

html - .htaccess redirect to subfolder -

i'm struggling solution redirecting pages (or .html pages) subfolder , keep .html file name. i have .html site lot of subfolders , redirect traffic same subfolder - /download/file-name.html for example site is: www.mydomain.com/subfolder1/some-file-name.html redirected www.mydomain.com/download/some-file-name.html www.mydomain.com/subfolder2/another-file-name.html redirected www.mydomain.com/download/another-file-name.html ps. don t want "old subfolder" appears after /download/...` thank you! paste notepad file: rewriteengine on rewriterule ^$ www.mydomain.com/download/some-file-name.html [l] save [space].htaccess within www.mydomain.com/subfolder1/ . this should help.

jquery - gridname.getGridParam('selrow') is null -

i have code below. please let me know how can selected row data in jqgrid. i tried using below code: function getlist() { var grid = $("#gridname"); var rowkey = grid.getgridparam('selrow'); if (rowkey) alert("selected row primary key is: " + rowkey); else alert("no rows selected"); } here getting "rowkey" null. this function have used load json data jqgrid: function loadvalues() { $("#gridname").jqgrid({ datastr: mydatas, datatype: "jsonstring", jsonreader: {repeatitems: false}, autoencode:true, caption: "&nbsp;", pgbuttons : false, viewrecords : false, pgtext : "", pginput : false, rownumbers:true, cmtemplate: {sortable:false}, loadonce: true, cellsubmit : "clientarray",

java - Display the Connection ID of mysql -

i want add sniplet of code can print connection id of connection made mysql using getconnection() . going used monitoring number of connections made @ time. connection interface , implemented multiple database vendors. entirely sure whether can such value, depends whether mysql allowing or not. regarding problem of monitoring number of connections made @ time, based on requirement can go synchronized counter maintain number of times connection made/closed/open. hope helps.

android - ActionBar Tab indicator color -

i want know how change tab indicator color. have tried multiple code none working, please me how change default color? below code using : actionbar.setstackedbackgrounddrawable(getresources() .getdrawable(r.drawable.tab_selector)); tab_selector.xml --> --> --> <!-- focused states --> <item android:state_focused="true" android:state_selected="false" android:state_pressed="false" android:drawable="@drawable/cab_background_top_example" /> <item android:state_focused="true" android:state_selected="true" android:state_pressed="false" android:drawable="@drawable/cab_background_top_example" /> <!-- pressed --> <item android:state_selected="true" android:state_pressed="true" android:drawable="@color/tabcolor" /> <item android:state_pressed="true" android:drawable="@color/tabco

android - How to load images faster, smoother, and without OutOfMenory error? -

i trying write media player application. in have load album art(s) network gridview of android. initial implementation, it's working fine, it's not fast, not smooth. loading images(.jpeg) taking more time. have resize images low resolution, not working. in observation, saavn(android application) loading album arts fastly. how can load album arts speed in more efficient way. have gone through http://www.coderzheaven.com/tag/faster-loading-images-in-gridviews-or-listviews-in-android-using-menory-caching/ not helpful. other ideas? have thought use image loading libraries? try use universal image loader library, good.

sql - PHP redirect to different page after form submit -

here's first bit of form code <form action="php/form.php" id="msform" method="post"> <fieldset id="owner_service"> <h2> dog owner or service provider?</h2> <legend>owner_service</legend> <div class="owner_service"> <input type="radio" id="service" name="owner_service" value="service"> <label ="service"><h5>service provider</h5></label> <input type="radio" id="owner" name="owner_service" value="owner"> <label ="owner"><h5>dog owner</h5></label> </div> <input type="button" name="next" class="next action-button" id="next" value="next" /> </fieldset> and here's php <?php session_start(); $servername = ""; $username = ""; $password

Converting char array to an int array in c++ -

i have char array containing 3 2 4 56 1 . need perform sorting function on elements of array (i have arrange them in ascending order), can't unless numeric. how can convert array int array? actually, char array numeric: char nums[] = {1, 5, 2, 6, 0}; std::sort(std::begin(nums), std::end(nums)); (auto = std::begin(nums); != std::end(nums); ++it) printf("%i ", *it);

actionscript 3 - Why does my AS3 Video scrubber work in Preview and FP10 but not when published to Air? -

i have coded as3 class in flash pro make flv video pan backwards , forwards user drags mouse left , right on video sprite. (the video orbit of building effect spin building around mouse). video has been loaded displayobject using greensock's loadermax. it works fine in flash player 10 , preview, won't pan when published air 2 desktop on windows. video jumps final position on mouseup. limitation of air? if so, why preview work? suggestions appreciated.

c++ - E2040 Declaration terminated incorrectly -

i building winscp source. when compiling source, following error occurs: [bcc32 error] jcl.cpp(9): e2040 declaration terminated incorrectly the ide indicating @ following source. // --------------------------------------------------------------------------- # include<system.hpp> # pragma hdrstop # pragma package(smart_init) // --------------------------------------------------------------------------- // package source. // --------------------------------------------------------------------------- #pragma argsused extern " c " int _libmain(unsigned long reason) { return 1; } // --------------------------------------------------------------------------- could please tell me wrong , how correct. the actual winscp code is: #pragma argsused extern "c" int _libmain(unsigned long reason) { return 1; } see jcl.cpp in winscp cvs repository . you must have corrupted code yourself.

xcode - NSFileSystemFileNumber is changed after file is edited/updated in objective c -

i working on file management system dropbox in cocoa . my problem when edit text file @ time nsfilesystemfilenumber changed. i want unique nsfilesystemfilenumber if edited file moved particular folder. in short, want know how fetch moved file's old or original path database. any alternate way solve out problem? thanks in adv..!! it depends on how editor save functionality implemented. each editor have different functionality , sounds 1 using following: delete existing file. create new file. write file data. hence new inode each time. others might: truncate existing file. write file data. which result in same inode each time. there nothing can need track file changes using name or something, not inode.

episerver - Is there a way to override the connection timeout when upgrading site from CMS 6 R2 to 7? -

i'm having problem upgrading site cms 6 r2 7. i'm getting wait timeout error while upgrading using deployment center. i tried add following configuration in c:\program files (x86)\episerver\shared\install\episerverinstall.exe.config: <appsettings> <add key="commandtimeout" value="600"/> </appsettings> but no avail. as don't want resort manual upgrade, there way override connection timeout? thanks in advance help. edit: upgrade log (too long cut display error message): .... executing database script "c:\program files (x86)\episerver\cms\7.0.586.1\upgrade\database\sql\0007_0000_0041_0000to0007_0000_0147_0000.sql" error has occured , transaction rolled rolledback wait operation timed out wait operation timed out unhandled error has occured: wait operation timed out when executing @ c:\program files (x86)\episerver\cms\7.0.586.1\upgrade\system scripts\upgrad e site database (sqlserver).ps1:9 char:2 + e

c# - Moving Entity framework to another project from MVC causes re-migration -

i have asp.net mvc 4 application contains entity framework 6 code first models, dbcontext , migrations. in attempt separate web application can re-use these database classes in project have moved related entity framework classes own project. however when run solution thinks model has changed , attempts run migrations once more. problem appears in use of setinitializer if comment out line can run web application per normal. public static class databaseconfig { public static void initialize() { system.data.entity.database.setinitializer(new migratedatabasetolatestversion<g5datacontext, configuration>()); // make sure database created before simplemembership initialised using (var db = new g5datacontext()) db.database.initialize(true); } } this wasn't problem until i've tried move entity framework classes. not possible, or have done fundamentally wrong? at startup, ef6 queries exiting migrations in datab

How to trim only alphabets using javascript or jquery -

have scenario need trim alphabets string , display numbers , special characters. var abc = "hai 40.00"; // output : 40.00 var xyz = "hai 40.00 - 50.00 was" // output : 40.00 - 50.00 any generic way handle this. try this: var xyz = "hai 40.00 - 50.00 was" xyz = xyz.replace(/[a-z]*/gi, '').trim(); alert(xyz); [a-z] : match alphabets * : matches preceding set 0 or more times g : global flag, not stop after first match i : case insensetive match trim : remove leading , trailing spaces

python - Returned dtype of numpy vectorized function -

i have issue regarding dtype of returned numpy array of vectorized function. function returns number, fraction. strangely position of fraction seems influence returned dtype. want type object if function returns fraction. import numpy np fractions import fraction foo = lambda x: fraction(1, 3) if x < 0.5 else 1 foo_vectorized = np.vectorize(foo) foo_vectorized([1, 0.3]) # returns array([1, 0]) foo_vectorized([0.3, 1]) # returns array([fraction(1, 3), 1], dtype=object) is bug or expected work this? use numpy 1.9.2 on enthought canopy python 2.7.6. thanks explanation! that documentation states: "the output type determined evaluating first element of input, unless specified." you can specify desired output type via otypes arg, e.g.: np.vectorize(foo, otypes=[np.object])

c - Implementing a binary search tree -

i'm trying implement binary search tree holds inventory of ordered stock. stocked item attributes stored in nodes such: typedef struct item item_t; struct item{ char name; int price; int quantity; item_t *left; item_t *right; }; the idea prompt user enter above attributes, , add entered item node. i've written far: item_t *root = null; item_t *current_leaf = null; void prompt_user(){ /* in here contains code prompts user item attributes , stores in variable called input */ insert_node(input); } void insert_node(char *input){ /*if tree doesnt have root...*/ if (root == null){ /*create one...*/ *root = create_node(input); } else{ item_t *cursor = root; item_t *prev = null; int is_left = 0; int comparison; while(cursor != null){ /*comparison 1 key of input less key of cursor, , 2 otherwise...*/ comparison = compare(i

Google Plus sharing from android app -

i have been trying post on google plus stream since morning, not getting posted contents specified in deeplinkid content inside settext() gets posted. here code, intent shareintent = new plusshare.builder(this) .settext("hello android!") .settype("image/png") .setcontentdeeplinkid(offrdetails_data.get(0).offerlink, offrdetails_data.get(0).dealtitle, offrdetails_data.get(0).dealdescription, uri.parse(offrdetails_data.get(0).dealimage)) .getintent(); startactivityforresult(shareintent, 0); i tested code minimal mainactivity , worked: public class mainactivity extends activity implements view.onclicklistener { private button mbutton; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); m

javascript - jQuery validate.js only email is not being validated -

i using validate.js validate sign-up form. works fine other fields don't understand why not affect email field. here validation script: <script type="text/javascript"> $(document).ready(function(){ $("#signup").validate({ errorelement: 'div', rules:{ "display_name":{ required: true, minlength: 5 }, "user_email":{ required:true, email: true, remote: { url: "user/checkemail.php", type: "post" } }, "password":{ required:true, minlength:6 }, "confirm_password":{ required:true, equalto: "#password" } }, messages: { display_name:{ required: "please provide desired display name", mi

dictionary - US label value map in R -

Image
i using data result ([ https://drive.google.com/file/d/0b0zk9xcdoi1sq1jazfzyx1fqauu/view?usp=sharing] ) what trying color states of map based on label value in state, using maps package. i trying use following code, doesn't work. library(choroplethr) gtd <- read.csv("/users/urad_jeff/documents/image analysis/result png/state.csv") statelabel<- ddply(gtd, .(y), "nrow") colnames(statelabel) <- c("label", "value") statelabel$label <- tolower(statelabel$label) statelabel$label <- gsub(" (u.s. state)", "", statelabel$label, fixed=true) choroplethr(statlabel, lod="state") the wanted result image looks : here closest (you have missing states): library(choroplethr) library(choroplethrmaps) library(plyr) gtd <- read.csv("state.csv") statelabel <- gtd[,2:3] colnames(statelabel) <- c("region", "value") statelabel$region <- tolower(stat

javascript - How should I integrate video.js in meteor? -

i looking reference or example of how integrate video.js in meteor application. don't want use package since plan add plugins video.js. here elements understood (correct me if i'm wrong): video.js should loaded in client/compatibility folder in order loaded first it seems script , style elements must created. see here on page video.js player is, necessary load js since in dynamic html context. a couple of questions: is there easy way change lang , font path? are files in video.js download mandatory using (except demo files guess)? all feedbacks on video.js integration in meteor welcome. thank help. package: > https://atmospherejs.com/yong/meteor-videojs > https://atmospherejs.com/natestrauser/videojs github link https://github.com/slava/talk-player/blob/master/client/player.js

Javascript objects inheritance -

i working on project whereby have noticed there multiple references same objects in different areas. have been reading on mixins , prototypal inheritance not sure 1 follow: so current objects below need product inherit base class including function used everytime. var base = function() { this.id = 0; this.refererer = null; this.getcurrency = function() { return "us" } } var product = function() { this.name = ""; this.description = ""; } how can implement above use either mixins or prototypal inheritance? var base = function() { this.id = 0; this.refererer = null; this.getcurrency = function() { return "us" } } var product = function() { this.name = ""; this.description = ""; } product.prototype = new base(); // inheritance trick product.prototype.constructor = product; var proobj = new product(); alert(pro

android - How to determine a video file's framerate with MediaCodec, MediaExtractor or MediaMetadataRetriever? -

how extract frame rate of recorded video file? know there mediaformat.key_frame_rate , can access mediaformat objects through mediaextractor. key_frame_rate available encoders. instead want find out frame rate of recorded video. any ideas? it looks there no way framerate through of official api functions. might require logic - count times between timestamps or parse headers info. in general h.264 standard allows variable framerate, frame times differ 1 one. example if can show static picture several seconds or so

Open pdf files format with python -

i try open 100 pdf files python 2.7 code: import arcpy,fnmatch,os rootpath = r"d:\desktop" pattern = '*.pdf' counter = 0 root, dirs, files in os.walk(rootpath): filename in fnmatch.filter(files, pattern): os.startfile(rootpath) counter = counter + 1 print counter as result rootpath folder opened , python print number of pdf files: >>> 39 >>> no pdf files opened. search in forum , didn't find question answers request. i don't know trying do, os.startfile open adobe pdf reader (or other reader that's set default reader)... here how managed , seems working. import os rootpath = "d:\\desktop" counter = 0 file in os.listdir(rootpath): if file.endswith('.pdf'): os.startfile("%s/%s" %(rootpath, file)) counter = counter + 1 print counter or without editing main code import arcpy,fnmatch,os rootpath = r"d:\desktop" pattern = '*.pdf&#

Dockbar Changes in liferay 6.2 -

can suggest me, file responsible dockbar menu changes admin user , other user in liferay 6.2 ? i made changes in \docroot\meta-inf\custom_jsps\html\portlet\dockbar\view_user_account.jspf file dockbar menu, changes reflect guest user dockbar menu. please suggest me file dockbar menu comes admin user , other user. you found correct directory - dockbar's jsps in liferay's html/portlet/dockbar folder, there 16 jsps in there , either picked wrong 1 or edited within conditionals display guest user. they're overridden way you're doing in hook. file contains markup need change you'll have find yourself. same location in file change. state need "make changes" - not sure if add more options, change existing options, reorder, or change dom.

PHP exec() nohup with redirect -

i trying execute command exec() , redirecting stdout , stderr file. exec("nohup python main.py -i 1 > /var/scripts/logs/1_out.log 2>&1 &"); it create file not print it. if run command in terminal outputs without problem. got working. python own output buffering kept writing file. running -u option disables this. final code looks this: exec("nohup python -u main.py -i 1 > /var/scripts/logs/1_out.log 2>&1 </dev/null &"); thanks.

Android :adding tabs in fragments using view pager -

i have implement swiping in view pager 3 pages i.e fragment 1,fragment 2 , fragment 3. want add tab-host, contains 5 tabs different views in fragment 3. have 7 pages in view pager. tabs should visible in fragment 3 only. how can add tabs in fragment 3? public class homeactivity extends fragmentactivity { // page adapter between fragment list , view pager public static pageradapter mpageradapter; // view pager public viewpager mpager; // activity data public string p2text, p3text; public static list<fragment> fragments;// = buildfragments(); // / arraylist<string> categories = {"1","2","3","4","5","6","7","8"}; arraylist<string> categories = new arraylist<string>(); static final string log_tag = "homeactivity"; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate);

android - Error while retrieving values of selected RADIO buttons -

i trying values of selected radiobutton on click of submit button, getting nullpointer exception @ line : string selection = (string) btn.gettext(); error : 05-12 12:54:52.261: e/androidruntime(14113): fatal exception: main 05-12 12:54:52.261: e/androidruntime(14113): process: com.androidhub4you.multilevellistview, pid: 14113 05-12 12:54:52.261: e/androidruntime(14113): java.lang.nullpointerexception 05-12 12:54:52.261: e/androidruntime(14113): @ com.androidhub4you.multilevellistview.mainactivity$5.onclick(mainactivity.java:249) 05-12 12:54:52.261: e/androidruntime(14113): @ android.view.view.performclick(view.java:4456) 05-12 12:54:52.261: e/androidruntime(14113): @ android.view.view$performclick.run(view.java:18465) 05-12 12:54:52.261: e/androidruntime(14113): @ android.os.handler.handlecallback(handler.java:733) 05-12 12:54:52.261: e/androidruntime(14113): @ android.os.handler.dispatchmessage(handler.java:95) 05-12 12:54:52.261: e/androidruntime(14113): @

c# - Datagrid textblock not aligned on left border -

Image
this stupid problem, why can't find answer it. i have datagrid in add messages every once in while during lengthy operation, , reason textblocks appear bit on right of left border of datagrid, though there no margin on textblock , no padding on datagrid : here xaml : <datagrid x:name="dgrdmessages" horizontalalignment="left" margin="21,212,0,0" verticalalignment="top" height="202" width="690"> <datagrid.columns> <datagridtemplatecolumn header="message" width="*"> <datagridtemplatecolumn.celltemplate> <datatemplate> <textblock text="{binding message}" width="auto" horizontalalignment="left" verticalalignment="top"> <textblock.style>

android - Why does FusedLoactionProvider.getLocationAvailability() return null (while it should not)? -

in initiate google play services client this: public class myapplication extends application implements googleapiclient.connectioncallbacks, googleapiclient.onconnectionfailedlistener protected synchronized googleapiclient buildgoogleapiclient() { return new googleapiclient.builder(this) .addconnectioncallbacks(this) .addonconnectionfailedlistener(this) .addapi(locationservices.api) .build(); } /* googleapiclient.connectioncallbacks */ @override public void onconnected(bundle bundle) { log.v(tag, "google play services connected."); boolean isconnected = mgoogleapiclient.isconnected(); // - true boolean islocavailable = locationservices.fusedlocationapi.getlocationavailability(mgoogleapiclient).islocationavailable(); // causes nullpointerexception because getlocationavailabality() returns null. why ???? . . . } } google play se

Java - String replace exact word -

string x = "axe pickaxe"; x = x.replace("axe", "sword"); system.out.print(x); by code, trying replace exact word axe sword . however, if run this, prints sword picksword while print sword pickaxe only, pickaxe different word axe although contains it. how can fix this? thanks use regex word boundaries \b : string s = "axe pickaxe"; system.out.println(s.replaceall("\\baxe\\b", "sword")); the backslash boundary symbol must escaped, hence double-backslashes.

jquery - Route in angular js not workng -

i new angular js getting issue in angular js route page. when page load shows header , footer only. index.html <!doctype html> <html lang="en"> <head> <title>my first angularjs blog</title> <!-- bootstrap core css --> <link href="css/bootstrap.min.css" rel="stylesheet"> <!-- custom css --> <link href="css/blog-home.css" rel="stylesheet"> <!-- html5 shim , respond.js ie8 support of html5 elements , media queries --> <!-- warning: respond.js doesn't work if view page via file:// --> <!--[if lt ie 9]> <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script> <![endif]--> </head> <body ng-app="blogapp"> <!-- nav

c# - Nest aggregation not working correctly -

i have use case need aggregation on multiple columns using c#. using nest libraries , facing following issue query c# : var searchrequest = new searchrequest { searchtype = searchtype.count, filter = filter, aggregations = new dictionary<string, iaggregationcontainer> { { "a", new aggregationcontainer { extendedstats = new extendedstatsaggregator() { field = "a" } } }, { "b", new aggregationcontainer { extendedstats = new extendedstatsaggregator() { field = "b" }

Eclipse for Linux gets stuck in splash screen -

i know problem has been asked hundreds of time having little bit different , no method applicable eclipse installation. when try start eclipse in ubuntu starts , shows splash screen changes white splash screen. while answer on relies on fact .snap file should deleted particular folder in workspace, problem eclipse has never started , don't have workspace folder yet. don't know do.

python - carriage lines and splitting cell values in pandas DataFrame -

my data in pandas dataframe each row, structured this: > df={'date1': '0 \r created february 21, 2015', 'amt': '$50,815 raised 498 donors'} i want >df={'month': 'february', 'day': 21, 'year': '2015, 'cur': '$', 'raised': '50815', 'num_donor': '498'} df.date1 , many of cells contain carriage returns, several in row (at beginning , end of strings). there way remove them entire dataframe? in cases, works: > df['date1'] = df['date1'].map(lambda x: str(x).lstrip('\r created').rstrip('...')) but not work (code diff columns). example, none of following remove \r or ',' > df['raised2'][0] = ,50,815,\r > df['raised2'] = df['raised2'].map(lambda x: str(x).lstrip('\r').rstrip('\r')) > rm_carriage = lambda x: re.findall("^/\r*(.*?)/\r*$", str(x)) > d

vba - Excel to CSV cells with pipe delimeter -

how replace comma delimeter pipe "|" delimeter. source: batch convert excel text-delimited files option explicit dim ofso, myfolder dim xlcsv myfolder="c:\your\path\to\excelfiles\" set ofso = createobject("scripting.filesystemobject") xlcsv = 6 'excel csv format enum call convertallexcelfiles(myfolder) set ofso = nothing call msgbox ("done!") sub convertallexcelfiles(byval ofolder) dim targetf, ofilelist, ofile dim oexcel, owb, owsh set oexcel = createobject("excel.application") oexcel.displayalerts = false set targetf = ofso.getfolder(ofolder) set ofilelist = targetf.files each ofile in ofilelist if (right(ofile.name, 4) = "xlsx") set owb = oexcel.workbooks.open(ofile.path) each owsh in owb.sheets call owsh.saveas (ofile.path & owsh.name & ".csv", xlcsv) next set owsh = nothing call owb.close set owb = nothing end if next call oexc

node.js - installing mongoose on windows -

i trying install mongoose on windows 7 machine npm install mongoose but cant work. error is: kerberos.vcxproj -> d:\dan\revert\node_modules\mongoose\node_modules\mongodb\node_modules\mongodb-core\node_modules\kerberos\build\release\\kerberos.node > bson-ext@0.1.6 install d:\dan\revert\node_modules\mongoose\node_modules\mongodb\node_modules\mongodb-core\node_modules\bson\node_modules\bson-ext > ./node_modules/node-pre-gyp/bin/node-pre-gyp.js install --fallback-to-build '.' not recognized internal or external command, operable program or batch file. npm warn optional dep failed, continuing bson-ext@0.1.6 npm err! peerinvalid package mongoose not satisfy siblings' peerdependencies requirements! npm err! peerinvalid peer node-restful@0.1.18 wants mongoose@~3 npm err! system windows_nt 6.1.7601 npm err! command "c:\\program files\\nodejs\\\\node.exe" "c:\\program files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" &quo

update and save database in a create method using same form rails -

i trying use same form create new database entry, display current db information, , update db information, stuck trying patch in create method within controller. have tried using first_or_initialize , find_or_initialize_by_name, cant seem them work situation. thinking of trying if something.nil? / else type of design. new @ , appreciated! this controller (working create new db): def create params[:student].each |student_id, attendance_type| attendance = attendance.new attendance.attendance_type = attendance_type.to_i attendance.student_id = student_id attendance.event_id = params[:event_id] attendance.save end redirect_to :back end html: <tbody> <% @students.each |student| %> <form class="form-group" action="/events/<%= @event.id %>/attendances" method="post"> <tr> <div class="checkbox"> <td style="white-sp

java - How to get the actual size of selected files and folders? -

jfilechooser filechooser = new jfilechooser(); filechooser.setfileselectionmode(jfilechooser.files_and_directories); file selectedfile = filechooser.getselectedfile(); long sizeofdirectory = fileutils.sizeofdirectory(selectedfile); this isn't generating actual size of selected files , folders, gives value less actual value. i selecting more 1 folder @ once. how fix issue? actually selecting 2 folders, issue happens that's because jfilechooser#getselectedfile return one. need use jfilechooser#getselectedfiles , loop on them, calling fileutils.sizeofdirectory each file , summing results file[] selectedfiles = filechooser.getselectedfiles(); long sizeofdirectory = 0; (file file : selectedfiles) { sizeofdirectory += fileutils.sizeofdirectory(file); } (you should beware getselectedfile , getselectedfiles may return null )

python - Shortest (and Least Dangerous) Path on a Graph -

i working on assignment has me traversing simple, square graph goal of accumulating least amount of danger. end points simple: top left vertex bottom right. restricted moving horizontally , vertically between vertexes. each room in dungeon (each vertex on graph) has specified danger level. example: 0 7 2 5 4 0 -> 1 -> 1 -> 2 -> 2 -> 1 -> 3 -> 1 -> 0 1 5 1 2 1 1 2 2 1 1 1 9 5 3 5 1 1 9 1 0 i have been throwing around idea of using priority queue, still don't know how, exactly, use p.q. in first place. i try dijkstra's algorithm, not calculating distance between nodes; rather, calculating minimized danger. being said, right assume danger in 1 room weight on edge between 2 nodes? i hoping give me idea how approach problem. writing program in python if help. it's been while since these problems, pretty sure algorithm use here dijkstra's. wikipedia: for given source node in graph, algorithm finds shortest path betwee

pug - Jade - Using --watch doesn't trigger refresh from includes -

i have simple project trying work with. doctype html html(lang="en") include ./inc/head.jade body include ./inc/various.jade include ./inc/types.jade include ./inc/of.jade include ./inc/things.jade using commmand watch jade -w index.jade i expect change 'things.jade' trigger refresh 'index.jade'. not. missing? don't want call watch command each time need refresh on index.jade. desired workflow: save change in things.jade > triggers refresh index.jade current problem: save change in things.jade > switch terminal > control+c kill watch on index.jade > jade -w index.html i have seen question now, hope got fixed. seems require ' livereload ' watch changes when save file reload browser. if using task runner example 'gulp' recommend using ' gulp-connect ' runs local web server using 'livereload' using technique not have call watch command each time need refresh on index.