Posts

Showing posts from May, 2014

oracle - Taking too long to insert records in Elasticsearch in c# -

the following code pulls data 2 tables table1 , table2, performs join on them, on field 3 , indexes elasticsearch. total number or rows need indexing around 500 million. code inserts 5 million records in 1 hour, way take 100 hours complete. there way can make faster? public static void selection() { uri node = new uri("http://localhost:9200"); connectionsettings settings = new connectionsettings(node); elasticclient client = new elasticclient(settings); int batchsize = 100; string query = "select table1.field1, table2.field2 table1 join table2 on table1.field3=table2.field3"; try { oraclecommand command = new oraclecommand(query, con); oracledatareader reader = command.executereader(); list<record> l = new list<record>(batchsize); string[] str = new string[2]; int curr...

Displaying HTML partial inside JQuery qtip2 popup -

i have large complicated informative popup display multiple cells within same column. my initial attempt build html page , display within 'content' option within qtip2's jquery. find inline html option straight html. css additionally needs modified in original qtip2 download because not allow options in jquery beyond dimensions. my jquery: function initabbonamentitable(){ var content = $('<div class="popup">' + '<div class="title">' ); //etc long inline html $('.price-column').each(function(){ $(this).qtip({ content : content, //here i'd reference partial instead show: 'click', position: { my: 'top center', // position top left... at: 'bottom center', // @ bottom right of... target: $(this) // target }, style: { classes: 'custom' } }); }); the import line 1 corr...

nginx - Laravel showing blank page -

i setup laravel 5 framework in server typing in terminal laravel new blog (in "/var/www/html/" folder), then changed default config of nginx root pointing : root /var/www/html/blog/public; of-course files in place see blank page showing ! tried put html & php file in public folder , works fine. not laravel default index file. missing here ? for adding pages in laravel not put files in /public . please have @ official laravel page if want create new views. laravel uses mvc principle. need have @ least view (the part displayed) , controller handles view. add new controller , please change project root cd /var/www/html/blog , type in php artisan controller:make awesomecontroller creates controller in app/http/controllers/awesomecontroller.php . in controller can return view adding return view('myview') index() method example. (the view has exist @ resources/views/myview.blade.php of course) in last step need tell laravel how call contr...

Jenkins job for Deploying group of multiple servers (10 servers a group with multiple group)with a slave -

we have jenkins job, have 400 applications servers in 1 environment divided groups = 10 servers b = 10 servers c = 10 servers ........etc. note : have slave server(one slave) deployment above parameters a,b,c...etc. group contains 10 servers under load balancer remaining b,c...etc. while doing deployment choose parameter option deployment after completion of go b deployment happening. new scenario : while choosing a, , after b , c... want a,b,c... @ 1 click.the deployment has been completed. along want know how long take deploy servers (plug-in). can u suggest methods: 1.using jenkins plug-in cases 2.not possible plug-in suggest script. if understand correctly, need distributed deployment solution deploy application multiple application servers.please correct me if i'm wrong. if scenario, need solutions puppet/salt etc. based on requirement suggest rundeck . http://rundeck.org/index.html i've implemented distributed depl...

python 2.7 - App_Model does not exist in django -

i new django , have bit of problem. creating simple view, template , models small project. getting error vote_type not exist, when asking type model in 'vote' app. don't why looking vote_type instead of type in database. so went problem , tried create object of model type in database python console got same error. this models: from django.db import models django.utils import timezone # create models here. class voted_object(models.model): voted_object_name = models.charfield(max_length=50) voted_object_image = models.imagefield voted_object_rating = models.integerfield(default=0) voted_object_id = models.integerfield class type(models.model): pub_date = models.datetimefield('date published') type_name = models.charfield(max_length=50) type_id = models.integerfield and error when try type.objects.all() in python console. relation "vote_type" not exist line 1: ...te_type"."pub_date", "vote_...

facebook - Pixel is not paired with a product catalog -

Image
i doing facebook dynamic ads management. created product catalog , uploaded business manager. added pixel tracking code website pages. when viewing page got error: 'pixel not paired product catalog '. i found solution seen in image below i followed steps in that. cant find button 'associate pixels' in settings page. know why have no button named 'associate pixels' in settings page? i believe button renamed "associate sources" since app events can associated product catalog well.

ios - MFMailComposeViewController won't appear in iOS8 -

i have objective c program has popover list of dates , 2 buttons "done" , "cancel". when user hits date , done button, popover supposed disappear , mfmailviewcontroller window populated data date supposed appear. when run program on ipad ios 7, works fine - popover disappears , mail view appears data populated. when run on ipad ios 8.1, popover disappears mail view not appear. using nslog output, know ipad can send email, correct date getting method, mfmailviewcontroller object exist, , gets past line supposed present controller. controller doesn't appear. any appreciated because tons of web searches have found nothing helpful. the end of method is: nslog(@"about present mail view"); if ([mfmailcomposeviewcontroller cansendmail] == yes){ nslog(@"can email yes"); } else { nslog(@"can email no"); } nslog(@"the picker %@",picker); [self presentviewcontroller:picker animated:no completion:null]; nslog...

c# - Register types using Unity in SPA (MvcControllers and WebApiControllers) -

i create spa application. there mvccontrollers , webapicontrollers. i install unity using package manager , register services using unity. when test on mvccontroller - works. when start test on webapicontroller - error. after research found answer here : http://www.asp.net/web-api/overview/advanced/dependency-injection but have question-problem : should register services - in unityconfig file or in webapiconfig file or in both? registering of types in webapiconfig : var container = new unitycontainer(); container.registertype<iproductrepository, productrepository>(new hierarchicallifetimemanager()); config.dependencyresolver = new unityresolver(container); registering of types in unityconfig: public static void registertypes(iunitycontainer container) { // note: load web.config uncomment line below. make sure add microsoft.practices.unity.configuration using statements. // container.loadconfiguration(); ...

windows - Subversion Edge 5.0.1 upgrade from 4.0.11, services running but 503 error -

upgraded using downloaded windows installer (64bit) completed without error. both collabnet services running http error: 503 problem accessing /csvn. reason: service unavailable. csvnconsole reg entry seems pointing new java path c:\csvn\jre\bin\java.exe i'm guessing path or config file issue? suggestion @ appreciated. thanks. there more information problem on collabnet forum. resolved issue uninstalling subversion edge, delete in c:\csvn folder except data folder re install application.

ascii - In R create maximum raster from mulitple raster files -

i kind of new r maybe stupid question cant figure out myself. this problem. have multiple asc files same gridsize , cover same area. want maximum value each grid asc files. tried multiple things: (i in 1:144){ asc0<-rastertopoints(raster(asc0)) asc1<-rastertopoints(raster(asc[i])) asc0[,3] <-pmax(asc0[,3], asc1[,3]) } this 1 fails when loop threw files, becasue leaves out na, asc0 (my base file) different size next file asc1[2]. does know way this? have loops ready go through files, there 13x144 files. cant figure out way maximum value, store it, , compare next file. thanks, appriciate help!!! use stack , max : r1 <- r2 <- r3 <- raster(nrows=10, ncols=10, xmn=0, xmx=10, ymn=0, ymx=10) r1[] <- 1 # raster 1 r2[] <- 2 # raster 2 r3[] <- 3 # raster 3 s1 <- stack(r1, r2, r3) s1 #class : rasterstack #dimensions : 10, 10, 100, 3 (nrow, ncol, ncell, nlayers) #resolution : 1, 1 (x, y) #extent ...

encryption - Finding corresponding encrypted file on encfs -

hopefully simple question. i have read-only mount, , encfs fuse mount reads on decrypt files. how know encrypted file each decrypted file relates to? for example: want delete file, won't able via read-only filesystem. how know true filename? i possibly looking more programmatic way of doing this i found possible encfsctl . can use encode function turn human readable name real path on filesystem. $ encfs6_config='encfs6.xml' encfsctl encode /encfs/mountpoint readable/name/in/mountpoint encfs password: decryptedname http://manpages.ubuntu.com/manpages/hardy/man1/encfsctl.1.html

ios - How to use SlideNavigationController in Swift? -

i need use slidenavigationcontroller in app project, can't show menu in navigationcontroller bar. slidenavigationcontroller downloaded from: https://github.com/aryaxt/ios-slide-menu here's code in appdelegate.swift: var leftmenu = leftmenuviewcontroller() var rightmenu = rightmenuviewcontroller() slidenavigationcontroller.sharedinstance().leftmenu = leftmenu slidenavigationcontroller.sharedinstance().rightmenu = rightmenu slidenavigationcontroller.sharedinstance().menurevealanimationduration = 0.18 var leftbutton = uibutton(frame: cgrectmake(50, 50, 30, 30)) leftbutton.setimage(uiimage(named: "gear.png"), forstate: uicontrolstate.normal) leftbutton.addtarget(slidenavigationcontroller.sharedinstance(), action: "toggleleftmenu", forcontrolevents: uicontrolevents.touchupinside) var leftbarbuttonitem = uibarbuttonitem(customview: leftbutton) slidenavigationcontroller.sharedinstance().leftbarbuttonitem = leftbarbuttonitem slidenavigationcontroller.s...

android - How to change color in a theme? -

say have color defined in resources as: <color name="primary_color">#f05b31</color> i use @color/primary_color in wide variety of styles , view definitions. is possible programmatically change color value associated resource identifier primary_color @ run-time user-selected color? alternatively, there other way of globally affecting primary colors of application? i'm aware can switch themes dynamically, allows selection predetermined set of themes, , i'm needing allow selection of arbitrary palette of colors. i'm ok requiring activity/application restart change take effect.

plugins - Play Framework [play-mailer]: how to ensure each receiver sees only his or her email address in the TO field -

here below code send email play-mailer : import play.api.libs.mailer._ ... val email = email( "my subject", "me <j3d@domain.com>", seq("john@domain.com", "joe@domain.com", "jack@domain.com"), bodytext = some("some text..."), bodyhtml = some("<p>some text...</p>") ) mailerplugin.send(email) the problem receivers see recipients email sent to. of course, option invoke mailerplugin.send every single recipient... i'm wondering if there better way ensure each receiver sees or email address in to field. perhaps best solution using hidden recepient aka bcc . emailer plugin has method addbcc(string address) : public void addbcc(string address) { this.bcc.add(address); } regards!

mysql - Is Django corrupting timezone-aware DateTimeField when saving it to the Database? -

i have django model described here i create , save instance of model: >>> django.db.models import max, f, func >>> django.conf import settings >>> import pytz, datetime >>> myapp.models import mymodel >>> mymodel.objects.all().delete() >>> mymodel.objects.create( my_date=datetime.datetime(2037,4,2,15,18,17,tzinfo=pytz.utc), my_string="asda" ) <mymodel: mymodel object> then try retrieve instance inserted, datetimefield in native format , after applying unix_timestamp : >>> x = mymodel.objects.values('my_string').aggregate( max1=max('my_date'), max2=max(func(f('my_date'), function='unix_timestamp')) ) >>> x { 'max2': decimal('2122848857.000000'), 'max1': datetime.datetime(2037, 4, 8, 20, 14, 17, tzinfo=<utc>) } >>> datetime.datetime.utcfromtimestamp(x["max2"]) datetime.datetime(2...

iis - Is it possible to use the SonarQube LDAP plugin with Raduis? -

we using sonarqube past 2 years , mapped active directory (ad) credentials using below settings http://docs.sonarqube.org/display/plug/ldap+plugin now have moved amazon cloud infra team told ldap not work reason either need use iis reverseproxy or called radius (may not correct spell). for iis reverseproxy, need restrict access single ip address, how can ? for radius, if has more info on how configure ad sonarqube, please let me know. the answer question no !

ios - What is the correct approach to setting and accessing global property across ViewControllers? -

in model have built api class creates function basic api call http://openweathermap.org/api returns closure json output dictionary. i call function in first viewcontroller returns output string when run println(). the issue having how store output (all basic string types) globally accessible variable can pass through segue custom searchresultviewcontroller view. my current approach isn't working attempts set empty string @ start of firstviewcontroller, optionally unwrap output string, store in cityname variable , pass through part of segue overriding prepareforsegue function. i create corresponding property cityname in searchresultviewcontroller. i have thoroughly checked naming conventions/linking custom viewcontroller classes , want confirm if missing key step in approach. detailed code below. firstviewcontroller: var cityname = "" @ibaction func searchbutton() { let api = api() api.weathersearch(urlsearch: searchfield.text!) { dictionar...

javascript - php script not showing through my ajax loaded content -

so have index.php file uses ajax loading contents .php file within same directory. reason when click link menu , loaded in ajax, php script news panel isn't executing, or isn't visible. demo link : http://www.michaeldylanedwards.co.uk/#archives direct link : http://www.michaeldylanedwards.co.uk/archives.php php script <?php $category = "8"; $template = "archives"; include("admin/show_news.php"); ?> here codes ajax loaded content; load_page.php <?php if(!$_post['page']) die("0"); $page = $_post['page']; if(file_exists($page.'.php')) echo file_get_contents($page.'.php'); else echo 'there no such page!'; ?> script.js var default_content=""; $(document).ready(function(){ checkurl(); $('ul li a').click(function (e){ checkurl(this.hash); }); //filling in default content default_content = $('#pa...

web services - How do we get username and password from soap headers in java -

how username , password soap headers in java. sample soap: <wsse:usernametoken wsu:id="oracle" xmlns:wsu="schemas.xmlsoap.org/ws/2003/06/utility">; <wsse:username>oracle</wsse:username> <wsse:password type="wsse:passwordtext">oracle</wsse:password> <wsu:created>2004-05-19t08:46:04z</wsu:created> </wsse:usernametoken>

javascript - Keep navbar at top of page when scrolled to correct position -

so website have header. @ top of header have logo , slogan, , beneath have nav bar. when user scrolls down want top part of header (logo , slogan) disappear whereas nav bar should stay fixed. know need position:fixed; added how activate when it's in right place. i've worked bit media queries before. there 1 y-scroll? thanks you'll need use javascript here in order subscribe window.onscroll event. window.onscroll = function(){ if(window.pageyoffset > 100/*px*/) $('.nav').addclass('fixed_bar'); else $('.nav').removeclass('fixed_bar'); } and css .fixed_bar this: .fixed_bar{ position:fixed; top:0; z-index:10000; } .fixed_bar .logo{ display:none; } also, you'll have account space fixed nav free , add padding or margin beneath element;

Opencart - how to automaticlly add product to cart when certain conditions are met -

is possible add product(s) cart when conditions met? for expample: condition - if in cart product category c add product x , can`t delete form cart if condition still active. customer adds product p category c , system automaticlly adds product x in cart 2 product now. my goal have 2 product in invoice 2 separate items then. manually adding second product not option. there method named add under cart.php here catalog->controller->checkout->cart.php in product id on user clicked out add product in cart, here can check condition product belongs category. if condition true can add option product cart using method $this->cart->add($optional-product_id, $quantity, $option, $recurring_id); -> default $quantity 1. -> default $recurring_id 0. -> , $option array ($option = array()). i hope lot.

asp.net - Allow CORS for static content in MVC -

i have asp.net mvc application runs on www.domain.com (always www). static domain runs on static.domain.com. right setting access-control-allow-origin "*" in web.config: <add name="access-control-allow-origin" value="*"/> however, not practice. tried adding following: <add name="access-control-allow-origin" value="//static.domain.com"/> to allow protocols (which ideally want, or if add 2 rules, 1 http , 1 https). didn't work, tried http:// protocol. <add name="access-control-allow-origin" value="http://static.domain.com"/> which did not work either. i've read through similar threads/questions here @ stackoverflow, find suggests add domain did in last example " http://static.domain.com "... i must doing wrong, can't seem is. hope can me! thanks in advance! mike the answer similar other posts answers. not possible through web.config. needs set p...

Core java printing statement -

why java compiler gives 100a as output when ever tried print system.out.println('2'+'2'+"a") , a22 for system.out.println("a"+'2'+'2') . please explain in detail . thank you) '2' char, '2' + '2' adds int value of character (50+50) , appends "a" it, giving 100a. "a" + '2' + '2' performs string concatenation, since first operand string. therefore a22. note expressions evaluated left right, types of first 2 operands determine whether + perform int addition or string concatenation.

python - pandas show multiple bar graphs on a chart -

Image
my data looks this: term date change1 change2 aaa 2010-03-01 23.00 24.31 bbb 2010-03-01 25.00 0.00 ccc 2012-05-01 100.00 100.00 the date column can have repeated dates. want plot each term, change1 , change2 is. thinking have term x-axis , change1 , change2 share same y axis plotted bar charts side side. know how y axis part dont know how set x axis. each term somehow show date if possible otherwise not priority. heres have: fig = plt.figure() ax = fig.add_subplot(111) ax2 = ax.twinx() df.change1.plot(kind = 'bar', color = 'red', ax = ax , position = 1) df.change2.plot(kind = 'bar', color = 'blue', ax = ax2, position = 2) ax.set_ylabel= ('change1') ax2.set_ylabel=('change2') plt.show() thanks, one way make labels along x-axis term s set term index: df = df.set_index(['term']) for example, import pandas pd import matplotlib.pyplot plt df = pd.dataframe({'change1': [23.0...

sql - Get row for each user where the count of a value in a column is maximum -

my column structure: column0 column1 aaa abc aaa abc aaa xyx aaa na bbb fgh bbb na bbb na bbb na ccc na ccc na ccc na ccc na what wish foreach distinct 'column0' data 'column1' data count max unless data na in case second highest. if 'column0' data values of 'column1' na value can na so expected value: column0 column1 aaa abc bbb fgh ccc na this give correct result: declare @t table(column0 char(3), column1 varchar(3)) insert @t values ('aaa','abc'),('aaa','abc'),('aaa','xyx'),('aaa','na') ,('bbb','fgh'),('bbb','na'),('bbb','na'),('bbb','na') ,('ccc','na'),('ccc','na'),('ccc','na'),('ccc','na') ;with cte ( select column0, colu...

PYTHON: How can I add +1 to a number in a file (txt.) -

okay so, i'm trying make little nifty auction program (for habbo if you've played it, that's irrelevant.) essentially, have gotten pretty far it, main goal able view items (including ids easy access) , create new items if want. viewing items works fine, yet i'm struggling second goal, adding items. i've used bunch of different methods i've found on internet, none seem give desired effect. want have specific text document ("id.txt") starts @ "0" , each time program add item, adds 1 number in file, can call on , give brand new id. far each attempt have has done things add [1] answer, instead of adding 1 itself. import sys import time def choice1(): print("#####################################################") print("auction log opening") dotdot = "..." char in dotdot: sys.stdout.write(char) time.sleep(0.5) print("") print("1 - choose item id") ...

python - Size of sample in Random Forest Regression -

if understand correctly, when random forest estimators calculated bootstrapping applied, means tree(i) built using data sample(i), chosen replacement. want know size of sample sklearn randomforestregressor uses. the thing see close: bootstrap : boolean, optional (default=true) whether bootstrap samples used when building trees. but there no way specify size or proportion of sample size, nor tell me default sample size. i feel there should way @ least know default sample size is, missing? the sample size bootstrap number of samples. you not missing anything, same question asked on mailing list randomforestclassifier : the bootstrap sample size same input sample size. if feel it, pull request updating documentation quite welcome.

c# - Exception not caught in Async / Await block -

i'm learning use async / await in windows forms application, trying keep windows application responsive while doing slow actions. see difference in handling of thrown exceptions. if use webclient.downloadstringtaskasync, exceptions caught code: private async void button1_click(object sender, eventargs e) { try { this.textbox1.text = await webclient.downloadstringtaskasync("invalid address"); } catch (exception exc) { textbox1.text = exc.message; } } however, if call async function in own code exception not caught: private string gettext() { throw new exception("tough luck!"); } private async void button3_click(object sender, eventargs e) { using (var webclient = new webclient()) { try { this.textbox1.text = await task.run(() => gettext()); } catch (exception exc) { textbox1.text = exc.message; } } } as answer stackoverflow question correct way throw , catch exceptions using async/a...

android - RxJava and unmonitored download -

how handle in rxjava (i having hard time learning library). i have url want download @ start of android app , want start if no 1 subscribing it. download may take amount of time possible user end on page relies on download of url, want activity/fragment subscribe outstanding observable. i plan on tracking outstanding observables simple map<string, observable> so observers (activities/fragments) can know if url/string isn't in map stuff done. thinking of using publishsubject, according talk heard suggested not use subject's because should learn observable first before "shortcuts". here example of asynchronous download performed once: with asyncsubject , concurrenthashmap

javascript - Hide id dynamically by jquery -

i have 3 three divs <div id= "product_1"></div> <div id= "product_2"></div> <div id= "product_3"></div> <div id= "product_4"></div> <div id= "product_5"></div> i changing ids dynamically var hotelcode = "cunmxhidd,cunmxmaya,cunmxdsan" var splittedhotelcode = hotelcode.tostring().split(','); jquery.each(splittedhotelcode, function(i, hotelcode) { $("#product_"+ i).attr("id","product_"+ hotelcode); }); after want hide divs not been indexed product_4 , product_5 now dom <div id= "product_cunmxhidd"></div> <div id= "product_cunmxmaya"></div> <div id= "product_cunmxdsan"></div> <div id= "product_4"></div> <div id= "product_5"></div> i dont want hard code. possible can hide them jquery ? you use lengt...

regex - Ruby match groups of JavaScript variables -

i'd extract variable names scratch of code: var a,b,c, foo = "test string"; i'd match result contain a,b,c , foo , value optionally. able split string comma wonder if there's way directly regex. var\s+(.+)\s*,?\s*=.+; you can test out @ http://rubular.com/ shows me a,b,c,foo part i'd output in match groups that: a b c foo you can add more capturing groups capture parts of string way want: var\s+(\w+),(\w+),(\w+),\s*(\w+)\s*=.+; output of demo : 1. 2. b 3. c 4. foo mind if there non-specified number of arguments, not work. as alternative, use regex \g forces consecutive matches: (?:var\s+|(?<!^)\g)[,\s]*(\w+) output of another demo : match 1 1. match 2 1. b match 3 1. c match 4 1. foo

ios - Cancelled requests take a lot of time for a last new request in queue -

i've tried lot of approaches , still can't figure out how resolve issue. i make url request different parameters , show spinner (async request). need cancel previous request , create new one. there 20 cancelled requests , 1 active last. the last example i've implemented afnetworking : if connectionmanager.sharedinstance.businessoperation != nil { connectionmanager.sharedinstance.businessoperation!.cancel() } let manager = connectionmanager.sharedinstance.businessmanager manager.responseserializer = afjsonresponseserializer() manager.requestserializer = afjsonrequestserializer(writingoptions: .allzeros) var path = connectionmanager.sharedinstance.path + objectpathcomponent.businesses.rawvalue path = path.stringbyaddingpercentescapesusingencoding(nsutf8stringencoding)! nslog("start loading") connectionmanager.sharedinstance.businessoperation = manager.get(path, parameters: params, success: { (operation: afhttprequestoperation!, responseobje...

Python Local Module Repository (Equivalent of mvn install) -

i'm java developer, , workflow write library, run mvn install create package of library , install local module repo. then in other projects in unrelated directory, can tell maven import file project maven pom file. if other members of team want use library, check out code, run mvn install , can import too. as understand, can use import keyword import module program, how put module in place python know look? in summary: pythonic way 'install' module have locally written? i use setuptools that, since installs machine wide (or locally, like), without forcing copy things manually.

angularjs - Add skipauthorization to request object using Restangular -

i'm using satellizer handle authentication on app, default satellizer intercepts request , adds authorization header. request api using restangular don't want send authorization header in request make, example login , signup endpoints doesn't need header. if add skipauthorization: true request object, satellizer won't add authorization header. question is, how can add the skipauthorization property of request using restangular. i tried restangular.all('signup').withhttpconfig({'skipauthorization': true}).post(user) but "withhttpconfig" not function i'm loooking for. you need write request interceptor: // set full request interceptor restangularprovider.setfullrequestinterceptor(function (element, operation, route, url, headers, params, httpconfig) { return { element: element, params: params, headers: headers, httpconfig: _.extend(httpconfig, {skipauthorization: true}) }; });

command line interface - Linux deleted files with spaces -

i have files name has spaces in linux , want delete (or rename) command line. i've looked @ several sites , should put \ before space, put '', put " " ... none works me. if split in 2 name space. can do? in settings linux console? there many files folder, , not mine, is, want family, not every wallet. put example of say: ((((no existe fichero o directorio means not exists file or directory)))) ->ls -lrt sincerhog\ 150626* -rw-rw-r-- 1 s10283 dessiis 167 jun 26 09:25 sincerhog 150626092551.xls -rw-rw-r-- 1 s10283 dessiis 0 jun 26 09:35 sincerhog 150626093540.xls -rw-rw-r-- 1 s10283 dessiis 2306 jun 26 09:59 sincerhog 150626095953.xls -rw-rw-r-- 1 s10283 dessiis 2306 jun 26 10:12 sincerhog 150626101237.xls ->rm sincerhog\ * ls: no se puede acceder sincerhog: no existe el fichero o el directorio ls: no se puede acceder 150626092551.xls: no existe el fichero o el directorio ls: no se puede acceder sincerhog: no existe el fichero o el directorio l...

jquery - why my slide nav bar keep expanding even i dont trigger it -

Image
please take this. tired use media min-width 768px sidebar-wrapper , sidebar-nav li a, display: none, slide nav keep showing (auto expand), button trigger nav gone. every time refresh/open desktop $("#menu-toggle").click(function(e) { e.preventdefault(); $("#wrapper").toggleclass("toggled"); }); body { color: #ffffff; background-color: #ffffff; } .navbar li { color: #ffffff !important; } .navbar li a:hover { color: gray !important; } .navbar-inner, .navbar .btn-navbar { background: #ffffff } .navbar-inverse .navbar-toggle { border-color: #333; float: left; } #wrapper { padding-left: 0; -webkit-transition: 0.5s ease; -moz-transition: 0.5s ease; -o-transition: 0.5s ease; transition: 0.5s ease; } #wrapper.toggled { padding-left: 250px; } #sidebar-wrapper { z-index: 1000; position: fixed; overflow-y: auto; left: 250px; width: 0; ...

jquery - Replace selection with new content -

lets have list (but have table cells): <ul> <li>first</li> <li class="middle">2</li> <li class="middle">3</li> <li class="middle">3</li> <li>last</li> </ul> and want replace .middle elements 1 <li>middle</li> . using jquery's replacewith replace individual elements (as in this fiddle ): <ul> <li>first</li> <li>new content</li> <li>new content</li> <li>new content</li> <li>last</li> </ul> but want this: <ul> <li>first</li> <li>new content</li> <li>last</li> </ul> is there native jquery method this, or have create new list (or new table row) in case, remove old , add new? please note: elements sequential, in dom tree go 1 after (they group). wrap them within <li>middle...

java - How does this delete an element from an array? -

i using book data structures , algorithms in java learn (you guessed it) - data structures , algorithms. piece of code confuses me. have tested , works don't see in code specify delete 55 exactly? i see search in array , move data elements index don't see tell compiler delete 55. searchkey = 55; // delete item key 55 for(j=0; j<nelems; j++) // if(arr[j] == searchkey) break; for(int k=j; k<nelems-1; k++) // move higher ones down arr[k] = arr[k+1]; nelems--; // decrement size to precise, code not delete array element; overrides it. note how j declared outside first loop, , used in second loop initialize value of k . first loop walks j through array, until j "points" element value of 55 . when happens, code exits loop through break , when second loop reads j , still points location in array 55 stored. second loop copies elements k+1 -st location k -th, "overriding" value of 55 on first iteration,...

report - RDLC - One page for each item in a list -

i made report many fields, filled properties of class. the datasource class contains many properties of string type. point, works perfect. here problem: 1 of properties list of strings. need page printed each item. eg: public class student { public list<string> names { get; set; } public string course { get; set; } public string year { get; set; } } based on example, need print page each name, holding constant other values. as additional information, i'm not using tables, textbox. why need print pinpoint accuracy. i appreciate help.

c - How to read from /write to anonymous shared mapping? -

attempting write message anonymous shared memory child process, terminate it. have message read parent. have seen examples mapping input & output files using file descriptors obtained through read & write calls. not know how approach correctly. int main(void) { char *shared; int status; pid_t child; shared = mmap(0, sizeof(int) , prot_read | prot_write, map_shared | map_anon, -1, 0); if (shared == map_failed) { perror("mmap"); return 1; } child = fork(); if ( child == -1 ) { perror("fork"); return 1; } else if (child == 0) { sprintf(shared, "foo"); } else { printf("%s", shared); wait(&status); } if (munmap (shared, sizeof(int)) == -1) { perror("munmap"); return 1; } return 0; } if goal read / write between child process , parent process, using pipes easier method of doing so. this: int fd[2]; pipe(fd); if((child= ...

html - Divs in one column align, but immediately move another column down -

Image
my site has 2 column layout working fine until added 2 boxes spanned 100% of right column. (the me , contact boxes) when did that, content in left column pushed bottom. i kind of understand (i think) why it's happening. think math off somewhere , it's forcing left column lower. either or has block vs inline. here's looks like: http://test.completesources.com/fitnesspro/ everything on right perfect. left sidebar content should @ top of page. here's code: http://jsbin.com/tucuha/edit?html,css,output i thought last bit myself, don't have starting point shift sidebar back. thanks again! you need wrap .col2 inside .colleft outside shift down due block-level element behaviour. output: jsbin

python - Mechanize HTTP Error 400: Bad Request what am I doing wrong -

i'm trying upload file specific webpage mechanize , let process file , download again. got no clue, why page still throwing 400 bad request error. set user-agent, accept headers, redirects, got no idea why isn't working. my current code: import mechanize import cookielib cj = cookielib.lwpcookiejar() br = mechanize.browser() br.addheaders = [('user-agent', 'mozilla/5.0 (x11; u; linux i686; en-us; rv:1.9.0.1) gecko/2008071615 fedora/3.0.1-1.fc9 firefox/3.0.1'), ('accept', 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'), ('accept-language', 'de,en-us;q=0.7,en;q=0.3'), ('accept-encoding', '')] br.set_handle_robots(false) br.set_cookiejar(cj) br.set_handle_equiv(true) br.set_handle_redirect(true) br.set_handle_referer(true) br.set_handle_robots(false) br.set_handle_refresh(mechanize._http.httprefreshprocessor(), max_time=1) ...

embedded tomcat 8 - Spring-boot Actuator SSL configuration -

i'm developing webapplication spring-boot using embedded tomcat. 1 of requirements of app 2-way ssl (clientauth). enabling clientauth easy enough use spring-boot actuator management of app on different port without clientauth. is there clean way this? (disabling ssl on actuator endpoints enough) according latest spring docs, can use management.port=8080 management.ssl.enable=false in properties configure management ports. see production-ready-management-specific-ssl in spring boot doc more options.

html - Responsive circles with messy markup -

i'm building feature has 3 circles inside of container next each other. when began building feature thought drop circles flex container , when added media quires , resized page. much despise not case..the circles went inside of container when started resize page noticed squishing! know because border-radius:50% circles need percentage , when pressed change there size bc fluid. this issue prompted me think of solution prevent circles squishing. had idea of surrounding div s around circles possibly stop them squishing looked around see if had done before. much liking found solution had posted on sto. modified solution meet own needs works fine there's small issue here, i'm not sure way makes markup look. messy messy messy!  solution <!-- projects --> <div class="circles"> <div> <div> <div> <div class="projects"> <a href="#">projects...

windows - How to install into CSIDL_COMMON_APPDATA -

using nsis , want set installdir csidl_common_appdata . this might like c:\documents , settings\all users\application data unfortunately, the variables/constants allowed in installdir not support common app data folder. so tried: system::call 'shell32::shgetspecialfolderpath(i $hwndparent, t .r1, 0x23, i0)i.r0' installdir "$1\myproduct" ( 0x23 equals csidl_common_appdata) when compiling this, nsis complains following error: error: can't add entry, no section or function open! my question: how set installation directory csidl_common_appdata? the setshellvarcontext instruction changes of nsis constants point all-users version of special path: function .oninit setshellvarcontext strcpy $instdir $appdata functionend

python - Why does numpy.concatenate work along axis=1 for small one dimensional arrays, but not larger ones? -

i couldn't 4 arrays of year, day of year, hour, , minute concatenate way wanted, decided test several variations on shorter arrays data. i found worked using method "t" test code: import numpy np a=np.array([[1, 2, 3, 4, 5, 6]]) b=np.array([[11, 12, 13, 14, 15, 16]]) c=np.array([[21, 22, 23, 24, 25, 26]]) d=np.array([[31, 32, 33, 34, 35, 36]]) print print b print c print d q=np.concatenate((a, b, c, d), axis=0) #concatenation along 1st axis print q t=np.concatenate((a.t, b.t, c.t, d.t), axis=1) #transpose each array before concatenation along 2nd axis print t x=np.concatenate((a, b, c, d), axis=1) #concatenation along 2nd axis print x but when tried larger arrays behaved same method "q". i found alternative approach of using vstack over here did wanted, trying figure out why concatenation works this, not always. thanks insights. also, here outputs of code: q: [[ 1 2 3 4 5 6] [11 12 13 14 15 16] [21 22 23 24 25 26] [31 3...

c# - How to make foreach loop with custom class and List<> in class -

if have class: public class cacheclass { public string userid { get; set; } public list<string> tabid { get; set; } public list<string> state { get; set; } public list<string> canadmin { get; set; } } then add value class , add cache. assign var type variable cache value: var k = system.web.httpcontext.current.cache[objuserinfo.userid.tostring()]; so, how can foreach loop var k , value? as see k object (hover on var ), since cache dictionary isn't typed . compiler doesn't know actual type cacheclass . step 1 cast it. prefer use as since won't throw exception if casting fails: var k = system.web.httpcontext.current.cache[objuserinfo.userid.tostring()] cacheclass; using as require to null -check make sure cast went okay: if (k != null) { foreach (string x in k.state) { } }

numpy - Python: Matrix multiplication error -

i found 2 matrices (mass , stiffness) using scipy.sparse.diags function , took 1 away other (mass - stiffness). when trying multiply new matrix vector u0 getting following [ <6x6 sparse matrix of type '<type 'numpy.float64'>' 16 stored elements in compressed sparse row format> <6x6 sparse matrix of type '<type 'numpy.float64'>' 16 stored elements in compressed sparse row format> <6x6 sparse matrix of type '<type 'numpy.float64'>' 16 stored elements in compressed sparse row format> <6x6 sparse matrix of type '<type 'numpy.float64'>' 16 stored elements in compressed sparse row format> <6x6 sparse matrix of type '<type 'numpy.float64'>' 16 stored elements in compressed sparse row format> <6x6 sparse matrix of type '<type 'numpy.float64'>' 16 stored elements in compressed sparse row format>] i don't unders...

php - MySQL Get AVR and save in New field -

hello have problem , can't find solution: have 4 tables same structure example follows: table 1: result table 2: store 1 table 3: store 2 table 4: store 3 tables fields: id - code - name - value i need query read "value" each specific record tables (store 1 - store 2 - store 3) , calculate average , save in table (result)... , go on next record until it's done. note: i'm using php , mysql... thanks in advanced... select result.id, result.`code`, result.`name`, result.value, term1.value, term2.value, term3.value result inner join store1 on result.`code` = store1.`code` inner join store2 on result.`code` = store2.`code` inner join store3 on result.`code` = store3.`code` result.`code` = 123456 order result.serial asc the average sum of values divided number of values (3), grade school arithmetic. update result r join store1 s1 on s1.code = r.code join store2 s2 on s2.code = r.code join store3 s3 on s3.code...

git - Install my R Package on a public OpenCPU server -

i've used tutorial create r project , upload git repository. want publish project on opencpu server. it's said here , "any r package on github can used remotely on opencpu through /ocpu/github/ api." library(devtools) install_github("user/repository") however, rstudio says r package cannot found. far understand, in first step had create r package instead of r project. if so, don't know how upload git. any step-by-step tutorial highly appreciated. please consider first time realizing procedure.

cassandra - CQL 3 Unable to Create Column Family With Randomized Name -

when shelled cassandra instance via cqlsh, able create cf using create columnfamily if not exists sandbox.foo ( created timestamp, updated timestamp, primary key (created) ) ; but when run create columnfamily if not exists sandbox.6f4922f45568161a8 ( created timestamp, updated timestamp, primary key (created) ) ; the command fails w/ error syntaxexception: <errormessage code=2000 [syntax error in cql query] message="line 3:2 no viable alternative @ input '(' (... if not exists sandbox.6f4922f45568161a8 [(]...)"> . any idea i'm going wrong? yes. create table documentation pretty clear on one: valid table names strings of alphanumeric characters , underscores, which begin letter . try placing (random?) letter @ beginning of table name, , should work.

osx - Chrome Native Messaging API on Mac -

i walking through chrome native messaging api guide, https://developer.chrome.com/extensions/nativemessaging a sample host's manifest looks this, { "name": "com.my_company.my_application", "description": "my application", "path": "c:\\program files\\my application\\chrome_native_messaging_host.exe", "type": "stdio", "allowed_origins": [ "chrome-extension://knldjmfmopnpolahpmmgbagdohdnhkik/" ] } where "path" refers app chrome extension communicate with. on windows, either python script or exe file work , executed. on mac os, can shell script or python script work. cannot .app executed. what cannot working is, "path": "/applications/skype.app" when "chrome.runtime.connectnative(hostname)" in extension, error info "native host has exited." help! on windows, either python script or exe file w...

javascript - Using HTML within a JSON Object -

i'm working on faq type project using angularjs. have number of questions , answers need import page , thought idea use service/directive load content in dynamically json. the text strings quite unwieldily (639+ characters) , overall hesitation have adding html json object format text (line breaks etc). is pulling html json considered bad practice practice, , there better way solve this? i'd prefer avoid using multiple templates it's starting seem better approach. thanks if you're using angularjs , have build step, html2js turning html templates js, can concat'd , minified.

python: how to get information about a function? -

when information type needed can use: my_list = [] dir(my_list) gets: ['__add__', '__class__', '__contains__', '__delattr__', '__delitem__', '__delslice__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__getslice__', '__gt__', '__hash__', '__iadd__', '__imul__', '__init__', '__iter__', '__le__', '__len__', '__lt__', '__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__reversed__', '__rmul__', '__setattr__', '__setitem__', '__setslice__', '__sizeof__', '__str__', '__subclasshook__', 'append', 'count', 'extend', 'index', 'insert', 'pop', 'remove', 'reverse', 'sort'...

r - Descenders in facet panel intrude on panel background -

Image
i have plot on white background grey facets , white facet text: ggplot(data = data.frame(x = rep(1:2, 2), y = rep(1:2,2), color = c("ap", "ap", "b", "b")), aes(x = x, y = y, color = color)) + geom_point() + facet_grid(~color) + theme(panel.background = element_blank(), strip.text = element_text(color = "white", size = 23)) my problem descenders (p, g, q, j) cross facet. strip background have margin around text glyphs in facet text strictly within facet rectangle. can add newlines facet text color = c("ap\n", "ap\n", "b\n", "b\n") margin excessive (or lineheight required ugly). there ggplot2 solution this? for ggplot v2.2.0 in theme , specify margins in strip_text element (see here ) # set text size size = 26 library(ggplot2) library(grid) p = ggplot(data = data.frame(x = rep(1:2, 2), y = rep(1:2,2), color = c("ap", "ap", ...

php - How can you remove last parameter from a $_GET URL when using the QUERY_STRING? -

since i'm using foreach loop, parameters shown. have several parameters want include url, want remove last parameter , it's value automatically showing. code follows: <?php $query = explode('&', $_server['query_string']); $params = array(); foreach( $query $param ) { list($name, $value) = explode('=', $param, 2); echo $params[urldecode($name)][] = urldecode($value); echo "<br/>"; } echo "<br/> total amount placed: ".$total = $_get["total"]; ?> the url one: confirmation.php?betslip=juve&betslip=milan&total=0.43 as can see url consists of several items inside betslip parameter, , consists total of items. want remove total displaying in foreach loop , able display whenever call it. thanks daviddomain right. alternatively unset specific key value pair in array, if can't guarantee it'll last array element. $params = $_get; unset($params['total...

javascript - grunt failing to find task -

here grunt file, want start http-server , kick off protractor tests. i'm guessing syntax off?? 'use strict'; module.exports = function(grunt) { grunt.initconfig({ karma: { options: { configfile: 'www/test/karma-conf.js' }, unit: { singlerun: true }, continuous: { background: true } }, protractor: { options: { configfile: "www/test/frontend.conf.js", // default config file // keepalive: true, // if false, grunt process stops when test fails. nocolor: false, // if true, protractor not use colors in output. // debug: true, args: { } }, e2e: { options: { keepalive: false } }, continuous: { options: { keepalive: true } } }, watch: { options: { livereload: true }, ...