Posts

Showing posts from March, 2012

force.com - hardcode xml in salesforce -

im new salesforce want embed(hard code) xml code in vf page,when m trying im getting following error. compilation error: <apex:page> required , must outermost tag in markup @ line 1 column 1 and code <?xml version="1.0" encoding="utf-8"?> <apexpage xmlns="http://soap.sforce.com/2006/04/metadata"> <response> <is_registered>yes</is_registered> <is_workinghour>yes</is_workinghour> <lead>00q9000000kwe6iear</lead> <callid>04153c09-8018-4cba-b03e-cd98a80f30b0</callid> <agent_number_count>3</agent_number_count> <agent_list> <agent id="1"> <agent_number>2228241485</agent_number> <agent_code>0004</agent_code> </agent> <agent id="2"> <agent_number>2228321017</agent_number> <agent_code...

c# - allowing to insert breakpoint in visual studio editor extension -

add syntax highlighting ielisonbuffer i follow question , implement visual studio editor extension. got working fine: syntax highlight, completion...but cannot add breakpoint thought options there in right context menu (disabled) is there else need enable feature editor? well, breakpoint anything, you'll need implement debugger (via ad7 interfaces, etc.). but actual breakpoint toggling working, need implement ivslanguagedebuginfo interface (and optionally ivslanguagedebuginfo2 , ivslanguagedebuginfo3 more control). (i suggest on language info object that's implementing ivslanguageinfo .) don't forget register implementation vs knows it. validatebreakpointlocation() called when user presses f9, etc., , in should set breakpoint span appropriate bounds of line (or portion of line depending on language, e.g. might in lambda or want highlight statement except trailing comments on line), return vsconstants.s_ok .

amazon web services - Reusing AWS::CloudFormation::Init (and userdata?) for multiple instances -

is possible reuse same bootstrapping config aws::cloudformation::init (and/or userdata ) multiple ec2::instance s in template? i need set content of 3 files , run 3 commands bootstrap servers, metadata block 30 lines long (and grow). each server instance has different set of tags, have more tags others. ideally, think should able declare aws::cloudformation::init resource, , refer multiple ec2::instance s, don't think possible. i thought (as newbie) aws::cloudformation::customresource might appropriate, don't think is. i'm thinking of using aws::cloudformation::stack import shared instance template, need somehow pass tags parameter each resource in stack template instance template. question - if best approach, enter in 3 locations have ???? ? (bonus credit - what's difference between userdata , init block?) stack.template ... "resources" : { "server1" : { "type": "aws::cloudformation::stack", ...

html - How to remove anchor tag around rescaled images in readthedocs site? -

Image
i use alias without width or height modifiers display image: .. |downloads_png| image:: assets/index/downloads_v2.png this image rendered correctly, without decoration. i add height modifier resize image: .. |downloads_png| image:: assets/index/downloads_v2.png :height: 26px when this, readthedocs page shows image grey line underneath: what happening anchor tag (for whatever reason) being wrapped around img tag image, , anchor tag has text decoration style applied it, adds grey underlining. how prevent happening? not need download image when mousing on it. want display image.

What is the most efficient method to process a String Freemarker syntax in Java -

here our use case. loading freemarker syntax database , processing it. processing close million of records. things working fine. when profile application, see freemarker processing method bottleneck , taking time. having read freemarker documentation, got pointers on issue be. everytime doing processing, creating new freemarker.template.template object (creation of seems expensive). not find right/more efficient way of doing this. public ftltemplateengine() { cfg = new configuration(); } public string process(string template, map<string, object> input) throws ioexception, templateexception { string rc = null; final writer out = new stringwriter(); try { final template temp =new template("temporarytemplate", new stringreader(template), cfg); temp.process(input, out); } catch (invalidreferenceexception e) { log.error("unable process ftl - ...

android - OpenCV4Android Kalman filter Assertion Failed at matmul -

i have problem opencv4android. i'm using it's newest version 2.4.10 although seems, issue occurs in 2.4.9. whenever i'm trying implement 2d kalman filter jni on android, code failing, because of errors (then method throws me sigabrt , there nothing can do): opencv error: assertion failed (type == b.type() && (type == cv_32fc1 || type == cv_64fc1 || type == cv_32fc2 || type == cv_64fc2)) in void cv::gemm(cv::inputarray, cv::inputarray, double, cv::inputarray, double, cv::outputarray, int), file /hdd2/buildbot/slaves/slave_ardbeg1/50-sdk/opencv/modules/core/src/matmul.cpp, line 711 it seems, kalmanfilter.predict() method throws it. i tried 2 other implementations- 1 taken directly internet, second different. i remember, (in order use properly) must first predict point, correct filter, isn't issue. assumption that, there weird @ junction of weird android world , c++ (maybe float values aren't 32bit floats in android's jni? i'm unable tell..)...

xaml - WPF ListBox in TabItem "Property content set more than once" -

i'm (evidently) new wpf , struggling figure out how put listbox inside tabitem . current attempt below results in property 'content' set more once , answers can't seem relate mine. <window> <grid> <tabitem> <grid background="red"></grid> <tabitem.header> <dockpanel width="130" horizontalalignment="center"> <textblock text="inventory" foreground="black" fontsize="30" textalignment="center"/> </dockpanel> </tabitem.header> <listbox> <listboxitem>test</listboxitem> </listbox> </tabitem> </grid> </window> if point me in right direction that'd appreciated. ok, edited answer works below. indeed, others suggest, removing "<grid background="red"><...

Is it possible importing Azure VM backup or snapshot from different account? -

i have simple question microsoft azure. when use free trial, can backup vm image(snapshot?) , import different account vm? yes can. can transfer vhd machine. or amazon s3.

Marklogic Search on different values -

i working on search in marklogic , requirement bring result while searching "navin rawat" is: o search should return n rawat o navin rawat o navin r o navin raw o navin rawat i planning use search:search these results. but, not getting how these results different each other. body or suggest me how these result while using marklogic search:search or cts:search. i think requirements this, you'll need code search expansion. build custom constraint search api it. string query, expand:"navin rawat" a structured query different convey same thing. next step actual expansion. it's not clear rules have in mind -- last name, number of starting letters, or there reason didn't include "navin ra"? i'll assume want number of letters. you build function looks provide options last name: declare function local:choices($first, $last) { $i in (1 fn:string-length($last)) return fn:substring($last,...

c++ - Take input from keyboard and edit existing text file -

i have been having problems code , lost. need user use console read text file , update new records. example doing football type project. have 9 players in football team , want able add new players console, when added start last entry in file , add new 1 there 10 total players if new player added. void addfootballplayer(football footballplayer[], int *f); { string forename, surname; int defence, strike, midfield; ofstream fout; fout.open("footballteam.txt"); cout << "enter first name "; cin >> forename; cout << endl; cout << "enter surname "; cin >> surname; cout << endl; cout << "enter strike power "; cin >> strike; cout << "enter defence power "; cin >> defence; cout << "enter midfield power "; cin >> midfield; you need write file using file stream have defined once h...

javascript - Analytics Embed API Multi Account -

i'm working api have problem. https://ga-dev-tools.appspot.com/embed-api my web application running fine user , client id, give access partners can't access clientid. gapi.analytics.auth.authorize({ container: 'embed-api-auth-container', clientid: 'xxxxxx.apps.googleusercontent.com', }); can have multi account application using api? can't create more users in google developer console. thanks! they can access app client id. may not have access google analytics accounts. the embed api allows user log in , view dashboards/reports ga data accounts have access . if want partners able see you're seeing, you'll have add them ga account.

javascript - how to set click event on parent using jquery? -

following html structure i'm using <div id="divid"> <table> <tr> <td onclick="var ele = document.getelementbyid('inputid'); ele.click();"> <input id="inputid" onclick="event.stoppropagation();" name="nameofelement" type="checkbox"/> </td> </tr> </table> </div> i'm trying set click event on element using jquery follows:( other functionality elsewhere in page) $("#inputid").parent().on('click',function(){ // call other functions}) this attachment leads following error: uncaught error: syntax error, unrecognized expression: ) i have give following functionality: if user click on td input element must checked , if clicked on click event must not propagated parent i.e. td reverse effect. also want jquery's click event execute. currently, first functionality working , event...

javascript - endValue as Percentage Usage -

can use endvalue percentage? pages.page1.imagebutton1.animate({ ... endvalue : 30, ... }); what type of endvalue? pixel? so, how can use percentage? tried %30 or 30% didn't work. you can use string: pages.page1.imagebutton1.animate({ ... endvalue : "100%", ... });

java - Get cookies from selenium session -

i want session variable , cookies after login. have used selenium webdriver , login. how session , cookies after login in selenium.here code: try { webdriver driver = new firefoxdriver(); driver.get("https://pacer.login.uscourts.gov/csologin/login.jsf"); system.out.println("the title is"+driver.gettitle()); webelement id= driver.findelement(by.xpath("/html/body/div[3]/div/div[1]/div[1]/div[15]/div[2]/form/table[1]/tbody/tr/td[2]/input")); webelement pass=driver.findelement(by.xpath("/html/body/div[3]/div/div[1]/div[1]/div[15]/div[2]/form/table[2]/tbody/tr/td[2]/input")); webelement button=driver.findelement(by.xpath("/html/body/div[3]/div/div[1]/div[1]/div[15]/div[2]/form/div[2]/button[1]")); id.sendkeys("username"); pass.sendkeys("password"); button.click(); } catch (exception e) { ...

r - tidyr spread function generates sparse matrix when compact vector expected -

i'm learning dplyr, having come plyr, , want generate (per group) columns (per interaction) output of xtabs. short summary: i'm getting a b 1 na na 2 when wanted a b 1 2 xtabs data looks this: > xtabs(data=data.frame(p=c(f,t,f,t,f),a=c(f,f,t,t,t))) p false true false 1 2 true 1 1 now do( wants it's data in data frames, this: > xtabs(data=data.frame(p=c(f,t,f,t,f),a=c(f,f,t,t,t))) %>% as.data.frame p freq 1 false false 1 2 true false 1 3 false true 2 4 true true 1 now want single row output columns being interaction of levels. here's i'm looking for: false_false true_true false_true true_false 1 1 2 1 but instead > xtabs(data=data.frame(p=c(f,t,f,t,f),a=c(f,f,t,t,t))) %>% as.data.frame %>% unite(s,a,p) %>% spread(s,freq) false_false false_true true_false true_true 1 1 na ...

git - How do I know what files should be gitignored? -

i'm beginner in open-source , know there guidelines adding files .gitignore ? put files not want in git repository in .gitignore file. these typically: easy generate files intermediate (build) files large binaries (e.g. documentation), available elsewhere (on companies servers) files containing sensitive information (like passwords)

node.js - less.render is not working in nodejs with multiple import files which are in different directories -

i have used less implement theming in application , using nodejs less module compiling less files css not working in 1 particular scenario. i using bootstrap application , using bootstrap less source code compiling css want in application. i can override bootstrap variables , mixins in various themes. so, while compiling bootstrap need consider theme variables , mixins well. so, differentiate bootstrap variables/mixins , css rules have created 2 different files, application_variables.less - contains required bootstrap variables , mixins application.less - contains required bootstrap css rules directory structure application | |--sample_application |--resources | |--libraries | |--bootstrap | |--css | | |--application.less | |--less | | |--application_variables.less |--themes |--red | |--mixins | | |--mixins.less | |--variables | | ...

cmd - Move files with Bat file after so many days -

i setup bat file after amount of days (5) moves files different folder. the folder paths moving c:\mags , going c:\mags\archives thanks, liam if you're using operating system later xp, can use forfiles command. @echo off :: search in c:\mags directory :: search files @ least 5 days old :: move file found c:\mags\archive forfiles /p c:\mags /c "cmd /c move @file c:\mags\archive" /d -5

debugging - Get frame pointer offset for first stack frame -

i needed base , top addresses of stack frames, extension writing windbg. example, here got: (0) ip= 0x779e5604, ret= 0x779cda0d, frame= 0x23c79c, stack= 0x23c79c (1) ip= 0x779cda0d, ret= 0x779b19f5, frame= 0x23c7b4, stack= 0x23c7a4 (2) ip= 0x779b19f5, ret= 0x779e665f, frame= 0x23c7d4, stack= 0x23c7bc (3) ip= 0x779e665f, ret= 0x779aa0aa, frame= 0x23c81c, stack= 0x23c7dc (4) ip= 0x779aa0aa, ret= 0x779765a6, frame= 0x23c910, stack= 0x23c824 (5) ip= 0x779765a6, ret= 0x7679bbe4, frame= 0x23c930, stack= 0x23c918 (6) ip= 0x7679bbe4, ret= 0x57cd4c39, frame= 0x23c944, stack= 0x23c938 (7) ip= 0x57cd4c39, ret= 0x53c6c74e, frame= 0x23c990, stack= 0x23c94c (8) ip= 0x53c6c74e, ret= 0x53dc42d7, frame= 0x23d5a4, stack= 0x23c998 (9) ip= 0x53dc42d7, ret= 0x53bc17b0, frame= 0x23d658, stack= 0x23d5ac (10) ip= 0x53bc17b0, ret= 0x57cf9321, frame= 0x23d85c, stack= 0x23d660 (11) ip= 0x57cf9321, ret= 0x53daf2da, frame= 0x23d9a4, stack= 0x23d864 (12) ip= 0x53daf2da, ret= 0x53d9bce5, frame= 0x23da3c, stack...

FileEdit in Chef giving error in Windows -

i trying replace string of xml file. tried following recipe. didn't work ruby_block 'replace_file' block f= chef::util::file_edit.new('c:\chef_file_edit\server.xml') f.search_file_replace(8081,8080) f.write_file end end my moto replace 8081 8080. wrong in above recipe? use strings instead of integers, f.search_file_replace('8081', '8080') . worth noting use of fileedit highly, highly not recommended. leads brittle systems. using template or cookbook_file resource control server.xml file going better solution.

Delphi Open Office / Libre Office PDF export selecting pages to print -

i using code post: delphi saving open office document pdf to export libre office writer document pdf file. i trying print first page of 2 page document. i have changed "pages" property line to: wproperties[2] := makepropertyvalue('pages', '1'); and wproperties[2] := makepropertyvalue('pages', 1); neither work. i have seen page: https://wiki.openoffice.org/wiki/api/tutorials/pdf_export where property mentioned, namely pagerange. this doesn't seem work either. what doing wrong? possible select specific page print this? i using delphi 6 if matters. update: when things i've tried haven't worked, exported pdf file pages included. if parameters i've added not there @ all.

python - Better way to vectorize using numpy -

i wondering if there better way vectorize following: array = [] ele in long_list: if condition: array.append(1) vector = np.array(array) now np.ones(len(long_list)) except if condition. is there better (vectorized) way of achieving above? vector = np.fromiter((1 ele in long_list if condition), dtype=int) this should faster either: vector = np.ones(len([x x in long_list if conditon])) or vector = np.array( [1 ele in long_list if condition(ele)] ) because avoids building filtered list, due fact (1 ele in long_list if condition) returns generator not list. edit i'm wondering if isn't viable option: vector = np.array( (1 ele in long_list if condition(ele)) )

angularjs - Template is not included inside directive -

i need include table few tr element based on template prototype/views/prototype/booking/templates/table-row.html . use custom directive indicate point template should inserted. define rownum show value should used while pasting template. don't anything. how make work? prototypeapplication.directive('tablerowtemplate', function() { return { restrict: 'e', transclude: true, scope: { rownum:'@' }, templateurl: 'prototype/views/prototype/booking/templates/table-row.html' }; }); booking <table><tr><td>static entry</td></tr> <tablerowtemplate rownum="1"></tablerowtemplate> <tablerowtemplate rownum="2"></tablerowtemplate> </table> prototype/views/prototype/booking/templates/table-row.html <tr> <td> <div class="form-group first-name"> <label>first name</label>...

c++ - Why insertion operator is printing address instead of string? -

i have simple lines of code, using insertion operator << show hello world string. if use a operator b should result a.operator(b); try same thing insertion operator , in output got address of string, rather actual string. std::cout<<"hello world"<<std::endl; std::cout.operator<<("hello world").operator<<(std::endl); output: hello world 0120cc74 i using visual studio. does operator conversion has problem? std::cout<<"hello world"<<std::endl; use overloaded output operator const char* , free function, not member function. std::cout.operator<<("hello world").operator<<(std::endl); use overloaded output operator const void* , since const char* implicitly convertible const void* . you can @ member overloads here , free overloads here

Basic PHP concept/syntax -

i'm new php , below 1 of first codes have tried, understanding basic concept , syntax. i'm running code using xampp server. <?php $var=1; while($var<10){ if($var==2) continue; echo "$var <br>"; $var++; } ?> i'm getting following error :- 1 fatal error: maximum execution time of 30 seconds exceeded in c:\xampp\htdocs\day\breakdemo.php on line 4 why throw error ? because, when $var 2 , say, continue , , move next iteration, time, infinite loop, , $var never incrase again.

c# - Where to put the method. Service layer ( BL ) over repository? -

i'm confused 1 thing. i've used repository pattern (not generic) in previous mvc apps , used include kind of business logic there. @ moment read service layer pattern should included bl. don't know if there more abstraction , code instead of cleary/readable , efficient code. i want implement method public void changeactivefield(bool isactive, int id) { var objecttoupdate = _context.firstordefault(x=>x.id==id); objecttoupdate.isactive - isactive; _context.entry(objecttoupdate).state = system.data.entity.entitystate.modified; _context.save(); } in code there bit of business logic change state of 1 field , after update this. should make in service layer , use simple repository update method liek this: ? public class myservice { private readonly imyrepository = _myrepo; myservice(imyrepository myrepo) //it's injectable { _myrepo = myrepo; } public void changeactivefield(bool isactive, int id) { var myobject = _myrepo.getmyobje...

javascript - Handling elements in arrays differing in their length considering indices of elements -

i have 2 arrays compare, these arrays recreated frequently. arrays have different length, in example below: a = [1,2,3,4,5] b = [2,4,6] the following needs done arrays: a) compare value in origin array value in source array (taking account position through index) , push specially designated array depending on outcome. in example comparison between 2?1, 4?2 , 3?6 , act accordingly. this not problem, clarifying this operation in further code example. b) push whatever remains (unaccounted values) specially designated array. in example above numbers 4 , 5 in array "unaccounted ones" , need pushed further. and here have problem, need find way so. i have suspicion figure out array of 2 larger , loop through , compare values @ same time performing test see if target array value "undefined". if is, push source array value specially designated array. i have not tried yet aiming to, meanwhile, may there advice on best practices on how achieve this? ...

css - Bootstrap add padding to select option -

i wondering if it's possible add padding select options in select dropdowns in twitter boostrap framework. i've added padding other inputs padding on select options out of line. expect like... option { padding: 0 24px; } ... trick nothing bootstrap select option. any appreciated. edit: here's jsfiddle: http://jsfiddle.net/sbmw3egx/ assuming you're using bootstrap form-control , first option displayed take on style of form-control css class. you'd need override form-control too. option { padding: 0 24px; } select.form-control { padding: 0 24px; } demo: http://bootply.com/dcjm6i7z5v

autocomplete - Jquery UI autcomplete with Json data source -

i using jquery ui autocomple json data source it's not working when used same fixed data works. below code. $(document).ready(function () { var codes = ""; admin_basicfeeschedule.loadcptcodes().done(function (response) { if (response.status != false) { if (response.cptcodecount > 0) { var cptcodeloadjsondata = json.parse(response.cptcodeload_json); $.each(cptcodeloadjsondata, function (i, item) { codes = codes + "'" + item.shortname + "'"; }); //codes = codes + "]"; alert(codes); } } else { utility.displaymessages(response.message, 3); } }); $.widget("ui.autocomplete", $.ui.autocomplete, { _rendermenu: function (ul, items) { var = this; $.each(items, function (index, item) { that._render...

c++ ifstream with a variable filename -

i'm trying open file wich name composed constant , variable parts. my actual code char filename[100]; char extension1[] = ".pdb"; vector<string> id; //code find ids(it works) sprintf(filename, "/home/giovanni/scrivania/enzimi/ligan/%s", id[1].c_str()); sprintf(filename, "%s%s", filename,extension1); the problem filenames becomes .pdbe/giovanni/scrivania/enzimi/ligan/102m instead of /home/giovanni/scrivania/enzimi/ligan/102m.pdb tnx in advance simply use std::string: string filename = "/home/giovanni/scrivania/enzimi/ligan/" + id[1] + ".pdb"; ... std::ifstream file(filename.c_str());

How to setup Chromium Embedded for Visual Studio? -

Image
i'm newbie cef , wanting build "cefsimple" example in visual studio can't find .sln file. how setup development environment? i used nuget packages: i set control (i'm using wpf): <usercontrol x:class="webpageviewer" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:cefsharp="clr-namespace:cefsharp.wpf;assembly=cefsharp.wpf" mc:ignorable="d" d:designheight="300" d:designwidth="300"> <grid> <cefsharp:chromiumwebbrowser address="www.google.com" /> </grid> </usercontrol> and made sure call cef.initiali...

java - Using Spark Streaming without downloading spark Apache -

i have tweets data , want analyze using spark streaming. can use spark streaming without downloading spark apache or using spark-like environment? i don't think can. spark streaming relies on underlying spark framework api , features distributed computing , fault tolerance.

Implementation of java.util.Random.nextInt -

this function java.util.random . returns pseudorandom int uniformly distributed between 0 , given n . unfortunately did not it. public int nextint(int n) { if (n <= 0) throw new illegalargumentexception("n must positive"); if ((n & -n) == n) // i.e., n power of 2 return (int)((n * (long)next(31)) >> 31); int bits, val; { bits = next(31); val = bits % n; } while (bits - val + (n-1) < 0); return val; } my questions are: why treat case n power of 2 specially ? performance ? why doest reject numbers bits - val + (n-1) < 0 ? next generates random bits . when n power of 2, random integer in range can generated generating random bits (i assume generating 31 , throwing away reproducibility). code path simpler , guess it's more commonly used case it's worth making special "fast path" case. when n isn't power of 2, throws away numbers @ "top" of...

javascript - How do I combine two or more overlays in Google Maps API-v3 -

i have created 2 separate files run individually. 1 loads google map drop down icons once click "drop turbines" box. other file loads google map , draws ring radius 20 miles. when try , combine 2 either 1 works or whole thing hangs. can help. new programming. combined code shown below runs google map , draws circle drop down icons not appear. <!doctype html> <html> <head> <meta name="viewport" content="initial-scale=1.0, user-scalable=no"> <meta charset="utf-8"> <title>circlesmarker animations <code>settimeout()</code></title> <style> html, body, #map-canvas { height: 750px; width: 1010px; margin-left: 120px; margin-top: 20px; padding: 0px } #panel { position: absolute; width 100px; height 25px; top: 65px; left: 68%; z-index: 5; background-color: #fff; padding: 5px; ...

javascript - Transform image in svg without transforming coordinate system -

i new svg. have image want rotate. have rotated image using rotation transform , giving angle , coordinates of point around want rotate image. my requirement when drag image after rotation, want check top-left corner within bounding area. works before rotate. after rotation, seems after applying transform image, coordinate system rotated in same angle. causing problem me. is there way rotate image without rotating original coordinate system? x , y attribute of image not getting updated if rotate image . if put rotated image inside <g> element , bounding box of (ie. my_group.getbbox() ) contain dimensions of rotated image. example svg (i've used rect here, work same image): <svg with="200" height="200"> <g id="my_group"> <rect id="my_rect" x="50" y="50" width="100" height="100" transform="rotate(45 100 100)"/> </g...

postgresql - How to Compare two fields in laravel and postgres -

i'm trying query postgres db , sql error every time. query correct, why work? query apireq::where('calls','<','maxcalls')->get(); error sqlstate[22p02]: invalid input syntax integer field types both set bigint . it's bizzare. you need use whereraw instead of where. it's weird, gets around issue think laravel bug. whereraw('calls < maxcalls')

sql server - Unable to set sort_in_tempdb -

i using sql server 2014. while creating index setting sort_in_tempdb = on not set. per search doesn't have other config. can please me how debug this. we have index created on 4 columns. have use query uses 3 columns of index. performance create index 3 columns. fyi, both indexes partitioned using filename code: create nonclustered index [index_filename] on table_1(columns) (pad_index = off, statistics_norecompute = off, sort_in_tempdb = on, drop_existing = on, online = off, allow_row_locks = on, allow_page_locks = on) on [filename_partitionscheme]([filename]) questions: is there possibility of optimization here in sql server 2014 since 3 fields common between both indexes. after creating 2 indexes, bulk copy talking lot of time.. can't disable indexing while loading because have producer , consumer modules separate.. is there way disable indexing on partition? thanks help. there no way know after fact. not property on index. anal...

php - Laravel show page according to authentication status -

is there way can configuration in routes.php: route::get('/', function(){ if ( auth::check() === false ) { return homecontroller@guest<--- specific controller's method } else { return homecontroller@logged <--- specific controller's method } }); i don't want use redirect since want keep mysite.com/ main address. of course can directly in route @ferticidios answer or have 1 controller method @maytham suggests. can asked for: route::get('/', function(){ if ( auth::check() === false ) { return app::make('homecontroller')->callaction('guest', array()); } else { return app::make('homecontroller')->callaction('logged', array()); } });

c# - Task Inside Loop -

i have windows service thread runs every 2 minutes. while (true) { try { repneg.willexecuteloopwithtasks(param1, param2, param3); thread.sleep(20000); } inside have loop tasks: foreach (repmodel repmodelo in listarep) { task t = new task(() => { this.coletafunc(repmodelo.endip, user, tipofilial); }); t.start(); } but think implementation wrong. need run 1 task every element in list, and, when specific task finishes, wait minute , start again. m8's need have 2 situations here. 1 - can't wait task finish. because task can take more 2 hours finish , can take 27 seconds. 2 - list of tasks can change. thats why got thread. every 2 minutes thread list of tasks execute , start loop. but task not finished yet , thread start again , strange things show in log. tryed use dictionry solve problem after time of execution, takes days, log show: "system.indexoutofrangeexception" here do... create new class sto...

javascript - Altering attr string based on current attr value -

i have combo box listener expansion. upon expansion, performs styling on each element particular class within combo box options. 1 of desired changes alteration attribute based on current attribute's value. using this returns undefined. expand : function(combo) { $('.status-0').addclass('greyed-out'); $('.status-0').attr('attrname', $(this).attr('attrname') + ' status 0'); } i'd each element .status-0 have attribute string have "is status 0" appended it. attribute extjs tooltip, solution should applicable attribute type. you need use function overload of $.attr , accepts function receive 2 parameters, index , attribute value. this refer the element. don't need here since can use attribute's value passed. $('.status-0').attr('attrname', function(_, attrval){ return attrval + ' status 0'; });

eclipse - Unable to run java console app using codenvy SDK -

i installed codenvy sdk in linux machine github: https://github.com/codenvy/sdk after starting server localhost:8080 i tried run simple hello java console application. but when run app, getting following error. can please help? "runner environment 'system:/java/standalone/simple/cli' not available workspace '1q2w3e' on infra 'community'." afaik codenvy sdk not support console app, web-apps. support different types of applications in sdk docker can used. don't know how use in sdk. way can use hosted version of codenvy support console apps (will started in docker.) should not configure docker use it, custom receipts supported too. here console hello world app created in workspace codenvy wizard. url factory - feature allow share projects easily. copy project workspace click "persist" button on top of ide. or create own project wizard.

C++ - Collision response leads to clipping -

i'm trying implement collision detection system, , working part, no overlapping (or @ little overlapping) of characters, , wall collisions. problem have bunch of characters following player , run it, , when there 15-20 of characters pushing @ player, can lead player or other objects being pushed through walls. my code works follows, first update of characters, , check collisions against each other, check character collisions walls. feel problem eventual push of characters leads pushing 1 or more of characters large distances, i'm not sure how fix problem. code below if necessary, thorough explanation of how fix sufficient. character update/collisions: void charactermanager::updateall(float elapsedtime) { for(std::vector<std::shared_ptr<character>>::iterator = _characters.begin(); != _characters.end(); i++) { (*i)->update(elapsedtime); } collisions(); } void charactermanager::collisions() { for(std::vector<std::shared_ptr<c...

Uglifyjs does not generate working map file when uglifying browserify output -

i've run browserify this: browserify js/app.js -d | exorcist js/bundle.js.map > js/bundle.js when load in chrome, sources map file fine. when uglify this: uglifyjs js/bundle.js --in-source-map js/bundle.js.map --source-map-url bundle2.js.map --source-map js/bundle2.js.map -o js/bundle2.js -p 1 the sources map file not work. tries load sources /js/js, instead of /js. have fiddled -p parameter, , every other parameter documented on commandline here: https://github.com/mishoo/uglifyjs2 the way work cd js directory , run commands there. lame, works.

class - HTML <a> tag wider than specified width -

http://exfluor.com/productsmain.html i can't seem boundary of clickable link area stay within bounds of <div> making link(11 buttons linking product categories). using class specify width, spans entire width of <td> in. i've run out of options. <a href="bycategory.php?cat=anhydrides"> <div class="category" align="center"> anhydrides<br><img src="images/cat/anhydrides.jpg" alt=""> </div> </a> use block display: .cattable { ... display: block; }