Posts

Showing posts from May, 2014

javascript - It'is possible to create an alphabetic vertical sidebar in HTML/jQuery? -

i have "ul" list of names. create alphabetical vertical sidebar when click on 1 of letter, li names begin letter filtered. example : mobile, need web application. i didn't found plugins or code example. update: explanation : the list sorted. need alphabetic vertical sidebar used scroll list , down. you can achieve doing this: traverse list. if first character of list element different previous list element: add unique id list element. add link alphabetical index (pointing unique id). a simple code achieve this: $("ul li").each(function() { var current = $(this).text()[0]; if (current != previous) { $(this).attr("id", "first_letter_" + current); previous = current; $("#index").append("<a href='#first_letter_" + current + "'>" + current + "</a><br/>"); } }); and can see working on demo (or on jsfiddle ): ...

lua - Awesome wm setting size for the tasklist item -

Image
i'm coding custom vertical wibox contains tasklist, want this: but instead of being fixed height, tasklist items take available space. here's result: here's code far: function render_task_box(s) myotherbox[s] = awful.wibox({ position = "left", screen = s, ontop = true, width = 200 }) mytasklist[s] = awful.widget.tasklist( s, awful.widget.tasklist.filter.currenttags, mytasklist.buttons, nil, nil, wibox.layout.flex.vertical()) local middle_layout = wibox.layout.fixed.vertical() middle_layout:add(mytasklist[s]) local layout = wibox.layout.align.vertical() layout:set_middle(middle_layout) myotherbox[s]:set_widget(layout) end so how wanted result? (or @ least set height of tasklist icon) update looked docs , tried this: local l = wibox.layout.flex.vertical(); l:set_max_widget_size(20) it did nothing. after reading of awesome's source code i've...

github - R - install_github fails -

i trying install package github in r, getting following error: > install_github("jmp75/rclr", build_vignettes=true) downloading github repo jmp75/rclr@master error in curl::curl_fetch_memory(url, handle = handle) : peer certificate cannot authenticated given ca certificates i have set rcurl options such: options(rcurloptions = c(getoption("rcurloptions"), ssl.verifypeer = false, ssl.verifyhost = false ) ) after checking setting: getoption("rcurloptions") we see.... $cainfo [1] "c:/_code/r/library/rcurl/etc/ca-bundle.crt" $ssl.verifypeer [1] false $ssl.verifyhost [1] false still error: downloading github repo jmp75/rclr@master error in curl::curl_fetch_memory(url, handle = handle) : peer certificate cannot authenticated given ca certificates any clues does work? had change bit of code ssl.verifypeer ssl_verifypeer library(httr) set_config(config(ssl_verifypeer = 0l)) see here devtools::install_github...

php - Where to write Access-Control-Allow-Origin: or Origin in javascript? -

so came know searching need set access-control-allow-origin: or origin tags. where?? suggestions use these in header. i can't see find explained this. can please tell me put tags , how!! in php file * guess have ajax request, etc.* <?php header('access-control-allow-origin : *'); ...

javascript - AngularJS Testing with Jasmine and Karma -

i try test angular controller returns promise , cant resolve it...what's wrong code? the angular controller: kpi.aboutcontroller = function ($scope, version) { function loadversion() { //$scope.version = version.getversion(); $scope.version = '1.1.0'; } loadversion(); }; and jasmine test: describe('dashboard: aboutcontroller', function() { beforeeach(module('dashboard')); var $controller; beforeeach(inject(function(_$controller_){ // injector unwraps underscores (_) around parameter names when matching $controller = _$controller_; })); it('testing version number', function() { var $scope = {}; var controller = $controller('aboutcontroller', { $scope: $scope }); var version = 0; console.log($scope.version); expect($scope.version).tocontain("1."); }); }); this working, when change line $scope.version = '1.1.0'; $scope.version = version.getversion(); rece...

xamarin - how to open application while receive call? -

in xamarin android application have receive call using broadcastreceiver public override void onreceive(context context, intent intent) { toast.maketext(context, "received intent!", toastlength.short).show(); dialercalllistener listener = new dialercalllistener(); sipregistration.call = sipregistration.sipmanager.takeaudiocall(intent, listener); string str = sipregistration.call.peerprofile.uristring; } from here want check app run in foreground/background, , if background how can bring app foreground , show incoming call receiving page? help? xamarin cross platform application.

reporting services - SSRS Matrix Page Break of Column Group by WeekNumber -

i have similar problem one, ssrs matrix page break of column groups is not possible this? aren't there other way aside hiding column group? if not wrong looking output display week 1 record in next row or in next page display week 2 record or can generic display n week on each page. i have answered similar question few months back. can take reference m x n matrix above example give output week per row .. next give page break click on table group & press f4 set page break properties value, set breaklocation between & pagename =fields!grp.value page break

broken links - Moving Drupal site from root on one server to subdirectory on another -

i'm moving drupal site root of 1 server subdirectory on another. frontpage works fine, links broken. i've inherited site located in root. when accessed site site.com came frontpage , worked fine. now, changed host , told me files in folder site.com/public_html. when visit site.com see frontpage, links broken. i'm guessing need rewrite urls somehow. hope helps else. the solution uncomment rewritebase / , set rewriteengine "on" in .htaccess.

java - Stop multiple ListCell Context Menus from Showing -

Image
i made custom listview cell can add context menu keeps opening multiple context menus when click more once , old ones raise exceptions when used. here songcell class public songcell(listview<song> list, playlist playlist) { setalignment(pos.center_left); contextmenu listcontextmenu = new contextmenu(); menuitem removeitem = new menuitem("remove"); menuitem editid3item = new menuitem("edit id3"); menuitem playnextitem = new menuitem("play next"); removeitem.setonaction((actionevent event) -> { list.getitems().remove(getindex()); }); editid3item.setonaction((actionevent event) -> { optional<pair<string, string>> show = new fxid3edit(getitem()).show(); }); playnextitem.setonaction((actionevent event) -> { song song = getitem(); list.getitems().remove(song); playlist.addsongrequest(new songrequest(song, songrequest.type.next)); }); ...

javascript - Slow page render due to checkboxs -

i have .aspx webpage requires upto 500ish records db displayed along checkbox each. having issues whereas page takes 15 seconds render. i added stopwatch pageload event, finishes , response.writes page after approx 4.7 seconds . have further 10 second wait while rest of page (namely checkboxs) rendered. originally checkboxs button , has no noticeable rendering time after pageload. foreach (datarow dr in dtscheduledvisits.rows) { ... results.append("<tr>"); results.append("<td> <input type='checkbox'> </td>"); results.append("<td>" + fullname + "</td>"); results.append("</tr>"); ... } lblresults.text = results.tostring(); on mainmaster page have referenced: <script src="js/icheck.js"></script> <!-- custom checkbox + radio --> thank help. i'm afraid volume of markup take time render. you might not able improve act...

ios - extract NSTimeZone from string like '+-hh:mm' -

in app download data json api contains entry local time: "local_date" : "2015-07-08t13:18:14+02:00" the json data parsed nsdictionary* information : nsdateformatter* dateformatter= [nsdateformatter new]; dateformatter.timezone = [nstimezone timezonewithname:@"utc"]; dateformatter.dateformat = @"yyyy-mm-dd't'hh:mm:ssz"; nsdate *date = [self.dateformatter datefromstring:information[@"local_date"]]; the date correctly set in utc (which need computations) display local data in user interface need display date in correct time zone. my question ist: how can extract nstimezone string? looking nstimezone* timezone = [nstimezone parsefromstring:@"+02:00"]; i've read documentation of nsdateformatter, nscalendar , nstimezone didn't find out how timezone string mine. thanks in advance! again: when "in local time", mean local returned string, not user? sent date germany, have enough ...

java - How can I use Apache CXF 3.X and WSS4J 2.X as of my ear project and not CXF and WSS4J (older) that is installed in the modules of JBoss 6.3.0 EAP? -

in our java application have use apache cxf 3.0.0 , wss4j 2.1.1 libraries. avoid classloader problems: how can use apache cxf 3.x , wss4j 2.x of ear project , not cxf , wss4j (older) installed in modules of jboss 6.3.0 eap? since jboss class loading modular, can create jboss-deployment-structure.xml , exclude cxf , wss4j related modules in ear file. please see wiki page reference. can find individual module names under modules folder module.xml file. for example exclude cxf-server module: <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2"> <deployment> <exclusions> <module name="org.jboss.ws.cxf.jbossws-cxf-server"/> </exclusions> </deployment> </jboss-deployment-structure> you need make sure pom.xml pulling in desired artifacts cxf , wss4j versions , not set provided scope. alternatively can create own custom jboss module folder , add libraries...

function with loop in r -

i having trouble getting following function work. simplification of function have use. data example: x = c(1628.584,2071.944,3365.916, 6450.724) n = length(x) r = seq(0.1,0.5,by=0.1) q = seq(0,2,by=1) then write function has used in next function: gh <- function(r,q){ ifelse(r>0 & p>1, r*p, ifelse(r>0 & p==1, q+1-r, na)) } what want next function is: # p=1 # d <- (log(x[p])/log(n^(-1))-outer(r,q,gh))^2 # p=2 # f <- (log(x[p])/log(n^(-1))-outer(r,q,gh))^2 # p=3 # g <- (log(x[p])/log(n^(-1))-outer(r,q,gh))^2 # p=4 # k <- (log(x[p])/log(n^(-1))-outer(r,q,gh))^2 # # z <- d+f+g+k therefore, write: ws <- function(r,q){ we=0 for(p in seq(from=1,to=4, by=1)){ we= we+ (log(x[p])/log(n^(-1))-outer(r,q,gh))^2 } return(we) } o <-ws(r,q) but error: error in ifelse(r > 0 & p > 1, r * p, ifelse(r > 0 & p == 1, q + 1 - r, : object 'p...

sharepoint - SPFile "Content Type ID" is default even after changing programmatically when excel has macros -

below code used update content type of spfile. newfile.item["content type id"] = spweb.contenttypes["subject attachment"].id; newfile.item.update(); but "content type id" attachment file assigned default value when excel file has macro . how change code such not take default "content type id" when excel file has macro. note : behavior observed when attachment file has macro.

c++ - View all macros defined in source code at a given position in Eclipse CDT -

is there possibility view live macros defined @ current position in code, in eclipse cdt? i think there way this, since eclipse smart enough follow header files included within window window > show view > include browser . can also, of today, figure out macros defined , gray out areas of i.e. #ifdef not going compiled. the thing feel missing if use defines in en external makefile, can simulated , added live index via project settings. this is, e.g. not looking for, since list macros in file/project/workspace. want know depending on, lets say, have cursor in file. type in editor window: #ifdef and press ctrl-space . see long list of active macros update 1) method correctly not shows macro before defined , shows after 2) seems eclipse cdt has error in handling #undef , method incorrectly shows macro after undefined. have filed bug report http://bugs.eclipse.org/bugs/show_bug.cgi?id=472198 .

c# - Any way to make this more generic? -

i have these 2 functions, used search folder within hierarchy: public folder<t> find (string path) { folder<t> result = null; if (this.path != path && childrendict != null) { foreach (keyvaluepair<long, folder<t>> child in childrendict) { result = child.value.find (path); } } else { result = this; } return result; } public folder<t> find (long id) { folder<t> result = null; if (this.id != id && childrendict != null) { foreach (keyvaluepair<long, folder<t>> child in childrendict) { result = child.value.find (id); } } else { result = this; } return result; } as can see, similar 1 another. how can re-structure them don't have same code several times, 1 per each property might want use find them? create method condition parameter logic: protected folder<t> find(func<fold...

javascript - How to get an element that does not have an ID and exists multiple times in plain JS -

the following html have work with. there no chance can change html or how constructed. plain js requirement, no jquery solutions please. the solution should variable containing table i'm looking for. in direction: var tablecontent = getelementsomehow() the table i'm referring starting @ line 87 , looks this: <table border=0 class='notifications'> another information might helpful is, table referred to, forth table in whole html. html: <html> <head> <link rel="shortcut icon" href="/nagios3/images/favicon.ico" type="image/ico"> <title> alert notifications </title> <link rel='stylesheet' type='text/css' href='/nagios3/stylesheets/common.css'> <link rel='stylesheet' type='text/css' href='/nagios3/stylesheets/notifications.css'> </head> <body class='notifications'> <!-- produced nagios (http://www.nagios.o...

cakephp 3.0 - Pages not found error if debug is false -

on developement server /pages/help renders fine. on production renders not found page. all files same, , else works. update: difference on production debug false , on developement debug true. can reproducate problem changing debug value. here stack trace 2015-07-08 10:36:44 error: [cake\network\exception\notfoundexception] not found request url: /pages/help stack trace: #0 /home/reseller10/domains/1108.cc/private_html/sanga/vendor/cakephp/cakephp/src/view/view.php(833): include() #1 /home/reseller10/domains/1108.cc/private_html/sanga/vendor/cakephp/cakephp/src/view/view.php(793): cake\view\view->_evaluate('/home/reseller1...', array) #2 /home/reseller10/domains/1108.cc/private_html/sanga/vendor/cakephp/cakephp/src/view/view.php(464): cake\view\view->_render('/home/reseller1...') #3 /home/reseller10/domains/1108.cc/private_html/sanga/vendor/cakephp/cakephp/src/controller/controller.php(582): cake\view\view->render('help', null) #4 /home/res...

cmake - how to specify imported dependencies of object library -

i have object library objlib linked main target maintarget . objlib has dependent library, say, zlib . if we're using legacy <package-name>_* variables it's easy: add_library(objlib object ...) target_include_directories(objlib ${zlib_include_dirs}) ... add_executable(maintarget $<target_objects:objlib>) target_link_libraries(maintarget ${zlib_libraries}) but want use dependency imported library because it's more concise (and convenient way create config modules, is, using install(export ...) , that). the following code not work because target_link_libraries cannot used object library: add_library(objlib object ...) target_link_libraries(objlib zlib::zlib) linking zlib::zlib maintarget not work either, objlib not include directories: add_library(objlib object ...) ... add_executable(maintarget $<target_objects:objlib>) target_link_libraries(maintarget zlib::zlib) hacking intermediate interface library ( objlib-wrapper ) not work...

string - Two identical chains do not identify themselves as equals in C -

i've 2 character strings, 1 first line of file (which "working"), , second word "working". problem when try put them in if, says they're not same! i've tried read both of them printf command they're same. i've tried use '\n' in second string there's not change. here's code, have look: file *fl; fl=fopen("test.txt", "r"); char line_working[100]; fscanf(fl, "%s\n", line_working); fclose(fl); printf("%s", line_working); //here prints: working char* workinger="working"; printf("\n%s", workinger); //here prints: working getch(); if(workinger==line_working){ printf("ok"); getch(); } and nothing happens... == compares pointer addresses. to compare null-terminated character arrays (aka c-strings), use strcmp : if(strcmp(workinger, line_working) == 0)

javascript - Plot always starts at 0, highstock spline chart -

i have data this var data = []; for(var i=1;i<201;i++){ data.push([i,(math.random() * (80 - 40 + 1)) + 40]) } and i'm creating chart this: $('.reactivitycont').highcharts('stockchart', { chart: { margintop: 140 }, credits: { enabled: false }, rangeselector : { selected : 1 }, scrollbar: { enabled: false }, navigator: { top : 40, xaxis: { labels: { formatter: function() { return this.value; } } } }, xaxis: { labels: { y: 50, formatter: function() { return this.value; } }, events: { setextremes: function (e) { start = parseint(e.min); koniec = parseint(e.max); ...

Multiple Summernote textarea on one page -

whenever submit form multiple summernote textarea value empty on while dumping values. view (html) <form action="some/url" method="post"> <textarea name="agenda" class="editor"></textarea> .... <textarea name="details" class="editor"></textarea> </form> js $('.editor').summernote(); backend dd($request->all()); output array:17 [▼= "type" => "7" "company" => "1" "event_date" => "2015-10-08" "pub_date" => "2015-07-08" "fiscal_year" => array:2 [▶] "agenda" => "" "title" => "title" "details" => "" "image" => uploadedfile {#29 ▶} ] serialized form output $('#createannform').submit(function(e){ e.preventdefault(); console.log($(this).serialize()); ...

c++ - Tooltip in winapi -

Image
i have tried use tooltip in winapi , worked want set position control specified. tooltip balloon. code, can tooltip appear , can set position of tooltip in screen not set position control specified. want set position of tooltip control specified eg: above, bellow, left or right of control image shows: the tooltip left of control edit: i have read in-place tooltips it's not helping! so, how can set position tooltip? can give me example code? this code: void createtooltip (hwnd hwnd, tchar *tip, hwnd &hwndtooltip, toolinfo &tootip, bool ishow, int nx, int ny) { // struct specifying control classes register initcommoncontrolsex iccex; hwnd hwndtt; // handle tooltip control // struct specifying info tool in tooltip control unsigned int uid = 0; // ti initialization wchar_t strtt[30] = l"this tooltip string."; lptstr lptstr = strtt; rect rect; // client area coordinates /* initialize common controls */ iccex.dwi...

delphi - FireDAC TFDConnection.GetTableNames doesn't work on Firebird with trusted authentication -

i'm connecting firebird database firedac (migrating fibplus , using xe8 update 1). i'm using trusted authentication (osautenth=true). need read list of tables within database. i'm using tfdconnection.gettablenames , works standard autenthication (username+password) i'm not capable work using trusted authentication. maybe i'm doing wrong or i'm using wrong method to kind of info. i'm doing: var odef : ifdstanconnectiondef; opars: tfdphysfbconnectiondefparams; begin odef:=fdmanager.connectiondefs.addconnectiondef; odef.name:='myfirebird'; opars:=tfdphysfbconnectiondefparams(odef.params); opars.driverid:='fb'; opars.protocol:=iptcpip; opars.server:=edserver.text; opars.sqldialect:=3; opars.database:=eddatabase.text; opars.osauthent:=(edpassword.text=''); opars.username:='sysdba'; opars.password:=edpassword.text; opars.rolename:=edrole.text; opars.openmode:=omopen; fdphysfbdriverlink1.embedd...

javascript - jQuery Flotcharts - show grid lines? -

Image
i'm using http://www.flotcharts.org/ . why grid lines disappear? here code plot options: var options = { grid: { markings: evs, clickable: true, hoverable: true }, series: { lines: { show: true, fill: true, linewidth: 1, fillcolor: { colors: [{ opacity: 1 }, { opacity: 1 }] } } }, colors: ["rgba(41, 150, 206, 0.9)", "rgba(67, 90, 110, 0.4)", "rgba(255, 255, 255, 1)"], crosshair: { mode: "xy", color: "#323232", linewidth: 1 }, xaxis: { mode: mode, show: true, position: "bottom", color: "#323232", font: {...

parsing - SendGrid Parse Inbound email from multiple domains -

currently i'm thinking work sendgrid , have issue. i want know if can parse incoming emails multiple domains. i read documentation parse webhook settings , , see 1 domain. so, there way receive multiple domains? yes, can. can pretty have many domains you'd like. can adding multiple hosts . example has different hosts on same domain, can have different domains there.

telerik - String format issue in RadGrid -

Image
while i'm trying bind string data rad grid not binding exact value have pulled data base. for example i'm pulling data : - " a bc e f g " , binding same data rad grid, problem here rad grid column trimming out spaces , displaying :- " a bc efg " here need bind exact data i'm pulling database. how do that? i unable replicate out issue @ end. code looks this: radgridpage.aspx <%@ page language="c#" autoeventwireup="true" codefile="radgridpage.aspx.cs" inherits="radgridpage" %> <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form i...

c# - Add date to sqlserver in yyyy-mm-dd -

when add lastimporteddate(dd-mm-yyyy) following method sql server fine. in database date yyyy-mm-dd but add lastimporteddate(dd-mm-yyyy) different pc on same server day , month switched. in database date yyyy-dd-mm. internal static void insertselloutsales(string customerid, string type, datetime lastimported, string periodstart, string periodend) { // create sql connection #connection sqlconnection sqlconnection1 = new sqlconnection(connection.connectionstring()); sqlcommand cmd = new sqlcommand(); cmd.commandtype = commandtype.text; string periodstartquery = periodstart; string periodendquery = periodend; // create query values , execute query if (!periodstart.equals("null")) { periodstartquery = " '" + periodstart + "'"; } if (!periodend.equals("null")) { periodendquery = " '" + periodend + "'"; } cmd.commandt...

php - How to download a file from ftp on server and then use import data from it -

hi have build script downloads files ftp account , import data them. works on localhost after downloading files save them on c drive , read files there , process them. need on live server. how can achieve , can store files on server outside public_html folder. i appreciate if can me please. thank you. yes, store files outside public_html you can create download folder outside public_html using various tools. log host provider account , use file manager tools there or else can ssh credential host , create folder using ssh client also give proper permission folder, can write/ read it. you can refer location of download folder script using script $_server['document_root'] .(replace public_html down load folder name)

jquery - bootstrap dropdown menu expand like a page -

i have big list , show them inside dropdown menu. since number large better menu can expand right instead of vertical listing. aware of jquery plugin use please? my requirement this, when dropdown menu clicked popup window or menu shown: a c e a1 c1 e1 a2 c2 e2 a3 c3 e3 b d f b1 d1 f1 b2 d2 f2 b3 d3 f3 hmm.. guess need megamenu . now, here go: /* start praveen's reset fiddle ;) */ * {font-family: 'segoe ui'; margin: 0; padding: 0; list-style: none; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box;} /* end praveen's reset fiddle ;) */ {text-decoration: none; display: block; color: #333; border: 1px solid #999; padding: 0 5px; border-radius: 5px;} nav ul ul {display: none;} nav ul li:hover ul {display: block; position: absolute; width: 300px; border: 1px solid #999; margin-top: 5px; border-radius: 5...

Explain please how to use WITH() in Kohana ORM -

$contract = orm::factory('contract', 1); i can shipper this: $contract->shipper; can owners this: $contract->owners->find_all(); but cant use $contract->owners , preload them orm::factory('contract', 1)->with("owners"); so why need this, cant understand does, , how works ? unfortunately ->with() works has_one or belongs_to relationships, not has_many . way expand many<->many relations ->find_all() from with method description: binds one-to-one object model. you can check source code with function here: https://github.com/kohana/orm/blob/3.3/master/classes/kohana/orm.php#l901

html - AngularJs File Upload in asp.net mvc -

here i've tried till now i cant send file action result, showing me null, <form ng-show="divpatient" name="patientform" ng-submit="addupdatepatient()"> <table> <tr> <td> <input class="form-control" type="text" readonly placeholder="key (automatic)" ng-model="patientid" /> </td> <td> <input id="formfocus" name="firstname" class="form-control" type="text" placeholder="firstname" ng-model="firstname" ng-minlength="3" required /> </td> <td> <input name="lastname" class="form-control" type="text" placeholder="lastname" ng-model="lastname...