Posts

Showing posts from April, 2015

svm - Box constraint in libsvm package (compare MATLAB fitcsvm and libsvm options) -

these options of libsvm package: options: -s svm_type : set type of svm (default 0) 0 -- c-svc 1 -- nu-svc 2 -- one-class svm 3 -- epsilon-svr 4 -- nu-svr -t kernel_type : set type of kernel function (default 2) 0 -- linear: u'*v 1 -- polynomial: (gamma*u'*v + coef0)^degree 2 -- radial basis function: exp(-gamma*|u-v|^2) 3 -- sigmoid: tanh(gamma*u'*v + coef0) -d degree : set degree in kernel function (default 3) -g gamma : set gamma in kernel function (default 1/num_features) -r coef0 : set coef0 in kernel function (default 0) -c cost : set parameter c of c-svc, epsilon-svr, , nu-svr (default 1) -n nu : set parameter nu of nu-svc, one-class svm, , nu-svr (default 0.5) -p epsilon : set epsilon in loss function of epsilon-svr (default 0.1) -m cachesize : set cache memory size in mb (default 100) -e epsilon : set tolerance of termination criterion (default 0

Angularjs, value coming in token from backend not working in client side -

what wrong code it's not working, trying request call web service backend written in spring, value passing backend token wrapped, trying run code on client side form not passing value. auth.js 'use strict'; angular. module('app') .factory('auth', [ '$http', '$rootscope', '$window', 'session', 'auth_events', function($http, $rootscope, $window, session, auth_events) { var authservice = {}; this.isloggedin = function isloggedin(){ return session.getuser() !== null; }; //the login function authservice.login = function(user, success, error) { $http.post('url: http://xxx.xxx.x.xx:xxxx/xxxx/authenticateuser').success(function(authdata) { //user returned data db var users = data.users; if(users[user.

angular - How to add jquery plugins using webpack? -

i using webpack angular 2 web appllication need add jquery slider app , using jquery plugin . my webpack config jquery new provideplugin({ jquery: 'jquery', $: 'jquery', jquery: 'jquery' }) above provideplugin gives $ , jquery on app , need import jquery plugin app in main.ts include import 'jquery'; once. then in webpack config new provideplugin({ jquery: 'jquery', 'window.jquery': 'jquery', $: 'jquery', 'window.$': 'jquery' })

how to check if any item is modified by list of people through work flow in sharepoint 2013 -

i new sharepoint workflow. have requirement in list, if item modified other set of people(sharepoint group) notification set sharepoint group. able check if modified single user not multiple not if give group not working. if currentitem:modified notequals groupname not working please on how check if item modified list of people in sharepoint 2013 can find if user member of group using rest api : http://your.site.collection.url/_api/web/sitegroups/getbyname('you group name')/cancurrentuserviewmembership the response true or false. in sharepoint 2013 workflow can add activity call service. then able know if user part of group or not. hope help.

excel - Google sheets - Get all cells in a sheet with A1 notation when the sheet's name conflicts with a cell -

using new v4 google sheets api, possible range of cells in spreadsheet when conflicts cell in a1 notation ? for example, have sheet called a001 . a001!a1:d3 - range a1-d3 sheet named a001 some-other-sheet - cells sheet called "some-other-sheet" a001 - instead of getting cells sheet called a001, gets cell a1 first visible sheet. so i'm asking case #3. possible range of a001 ? (not knowing range in advance of course) unfortunately, parsing cell or named range take precedence on sheet name. can workaround choosing suitably large range , requesting that, e.g: a001!a:zzz -- request rows in column a through column zzz in sheet a001 . response include last row/col data exists.

jpa - java.lang.String cannot be cast to [Ljava.lang.String; -

i have following , error java.lang.string cannot cast [ljava.lang.string; i have changed object[] string[] because faced next error: java.lang.object cannot cast [ljava.lang.string; any idea? private collection querystatement(string selectstatement) { int colcount = 0; int rowcount = 0; int rowcounter = 0; arraylist = new arraylist(); query query = getentitymanager().createnativequery(selectstatement); list<string[]> resultlist = (list<string[]>) query.getresultlist(); if (!resultlist.equals(collections.emptylist())) { rowcount = resultlist.size(); } if (rowcount > 0) { colcount = ((string[]) query.getresultlist().get(0)).length; } rows = rowcount; cols = colcount; string[][] array = new string[rowcount][colcount]; (string[] obj : resultlist) { string[] record = new string[colcount]; (int colcounter = 0; colcounter < colcount; colcounter++) {

Is there a way to move pages with the onenote API? -

i trying reorganise large onenote file imported evernote. because of different ways 2 programs handle tags, import ended conceptual mess. so find , select notes (around 2,000) have particular tag , move them fresh notebook. think can see how find pages particular tag through api. can't see anyway move found page somewhere else. is there way want? or have copy content of every found page new 1 , delete old one? there no move api. follow 2 step process - copy api (for page) - https://msdn.microsoft.com/en-us/office/office365/howto/onenote-copy delete api (for page) - https://blogs.msdn.microsoft.com/onenotedev/2015/07/08/now-in-production-delete-page/

javascript - React Native Router (react-native-router-flux) - more control in action triggering -

we using react native router manage navigation. render function of our router looks this: <scene key="tabbar" tabs={true} hidenavbar={true} tabbarstyle={{position: 'absolute', top: 0, left: 0}}> <scene key={tab_1} component={tab1container} icon={tabicon} title={tab_1_title} hidenavbar={true} /> <scene key={tab_2} component={tab2container} icon={tabicon} title={tab_2_title} hidenavbar={true} /> <scene key={tab_3} component={tab3container} icon={tabicon} title={tab_3_title} hidenavbar={true} /> <scene key={tab_4} component={tab4container} icon={tabicon} title={tab_4_title} hidenavbar={true} /> <scene key={tab_5} component={tab5container} icon={tabicon} title={tab_5_title} hidenavbar={true} /> </scene> in our app it's not allowed jump tab_1 tab_5 immediately. have go through tab_2 tab_5. when can jump beginning end now can't find possibility have function triggered before action fired.

php - Codeigniter 3.0 captcha 404 -

i have problem helper captcha in codeigniter (3.0). captcha work in logs is: error - 2016-09-22 08:32:25 --> 404 page not found: [207.46.xxx.xxx] > /upload/captcha/1470072358.0468.jpg and every day ~100 errors. where problem? my controller: $random_number = substr(number_format(time() * rand(), 0, '', ''), 0, 6); // setting captcha config $vals = array( 'word' => $random_number, 'img_path' => './upload/captcha/', 'img_url' => base_url() . 'upload/captcha/', 'img_width' => 140, 'img_height' => 32, 'expiration' => 7200, 'pool' => '0123456789abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz', 'colors' => array( 'background' => array(255, 255, 255), 'border'

data.table - R converting to long format, pattern -

i convert data.table 1 wide format long. set.seed(1) dt <- data.table( id = c(1:5, na), name = c("bob","ana","smith","sam","big","lulu"), kind_2001 = factor(sample(c(letters[1:3], na), 6, true)), kind_2002 = factor(sample(c(letters[1:3], na), 6, true)), kind_2003 = factor(sample(c(letters[1:3], na), 6, true)), conc_2001 = sample(99,6), conc_2002 = sample(79,6), conc_2003 = sample(49,6) ) id name kind_2001 kind_2002 kind_2003 conc_2001 conc_2002 conc_2003 1 bob b na c 38 22 24 2 ana b c b 77 31 29 3 smith c c na 91 2 49 4 sam na b 21 30 9 5 big c 62 66 38 na lulu na na 12 26 30 and this: id name year kind conc

javascript - How can I remove items that have used already? -

here code. $(function() { $("#tags input").on({ focusout: function() { var txt = this.value.replace(/[^a-z0-9\+\-\.\#]/ig, ''); // allowed characters if (txt) $("<span/>", { text: txt.tolowercase(), insertbefore: }); this.value = ""; }, keydown: function(ev) { // if: comma|enter (delimit more keycodes | pipe) if (/(188|13|32)/.test(ev.which)) { $(this).focusout(); } else if (ev.which === 8 && this.value == '' && $(this).prev("span").hasclass('toremove')) { //<< check class $(this).prev("span").remove(); } else if (ev.which === 8 && this.value == '') { $(this).prev("span").addclass('toremove'); //<< add class } else { $(this).prevall('.toremove').removeclass('toremove'); //<< remov

how to get the browser name and version you are calling the WebKit in WinForms C# -

very good, i'm looking ways webkit show me information browser rendering , version.y added predetermine browser using, looking @ pages can not find how perform task, webkit've got working, mention not ask me why. use here http://webkitdotnet.sourceforge.net/ dll. i got extract information needed, use user agent of webkit, had not specified above default webkit open mozilla firefox.` if (webkitbrowser1.useragent == "mozilla/5.0 (windows nt 6.1; wow64) applewebkit/537.36 (khtml, gecko) chrome/53.0.2785.116 safari/537.36") { toolstriplabel2.text = "el navegador utilizado es google chrome"; } else { toolstriplabel2.text = "otro navegador"; } ``

ruby - I want to get my input with selenium webdriver -

i need input onetime password coded below make alert. $driver = selenium::webdriver.for :firefox $driver.execute_script("window.promptresponse=prompt('enter onetime password')") alert = $driver.switch_to.alert sleep 5 alert.accept input = $driver.execute_script("return window.promptresponse").to_s p input in way, can input when enter password , leave away 5 seconds. (i mean never click ok button) but can't when click ok before 5 seconds pass. have idea? you can't it, because script fails before getting input value. when accept alert manually, step alert.accept can't execute because there no alert accept. shouldn't accept alert manually during automatic execution.

Android Studio 2.x - Building Symbols... Forever -

i have problem android studio. after updating 2.2 takes long (~30 min) time process indicating "building symbols..." project reasonably large , includes ndk components. building using gradle quite fast: build successful time: 12.089 secs my gradle_wrapper settings: distributionbase=gradle_user_home distributionpath=wrapper/dists zipstorebase=gradle_user_home zipstorepath=wrapper/dists distributionurl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip android.usedeprecatedndk=true org.gradle.daemon=true org.gradle.parallel=true #android.dexoptions.predexlibraries=true #android.enablebuildcache=true org.gradle.jvmargs=-xmx4096m -xx:maxpermsize=1024m- heapdumponoutofmemoryerror -dfile.encoding=utf-8 whats wrong android studio? how can speed it? try changing vm options? it possible vm running out memory or you're under memory pressure. can try increasing amount of memory available android studio under help can choose edit custom vm opti

Multiple file removal in PHP -

hello , in advance! thing have 2 files named 'test3.txt' , 'text2.txt' in folder. thing want remove both of them storing them in array. firstly check if files exist 'file_exists' method , when try remove them fails. know doing wrong did little research , couldn't find answer problem. trying remove these both files @ once if it's possible somehow. 1 <?php 2 3 $files = array('test3.txt', 'text2.txt'); 4 $exists = false; 5 6 foreach ($files $file) { 7 if (file_exists($file)) { 8 $exists = true; 9 } 10 } 11 12 if ($exists == true) { 13 unlink($files); 14 echo "files deleted"; 15 } 16 else { 17 echo "couldn't delete files"; 18 } browser returns true though files still aren't removed directory. here's browser output: warning: unlink() expects parameter 1 valid path, array given in /var/www/html/web/copy.php on line 13 files deleted the docum

c# - Form Not getting Closed Completely while using "this.Close()" -

i'm using visual studio 2010 , i'm troubling problem in project right . question may feel foolishness . don't know happening. in project there 3 forms . form1 form2 displayfrm i trying open form(displayfrm) using 2 other forms(form1 , form2) this code used open "displayfrm" using both "form1" , "form2" displayfrm.initialloadcustprof = regcustidtextbox.text; displayfrm frm = new displayfrm(); frm.showdialog(); i have opened "displayfrm" using from1 after doing operations on there have closed form using [x] button in title bar . (also have tried giving this.close(); in separate button) the problem ,when opening displayfrm agian using form2 ,it's not starting fresh form . restoring displayfrm have closed before operations have done already. i don't have trouble other project . think project crashed ..it not showing kind of error. is there way use this.dispose(); form

html - Bootstrap float left automatically in a nav menu -

good day. have code menu: <!doctype html> <html lang="en"> <head> <title>bootstrap case</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> </head> <body> <nav class="navbar navbar-inverse"> <div class="container-fluid"> <ul class="nav navbar-nav"> <li class="active&

arrays - Creating a for-in loop that prints out players name and score in Swift -

this question has answer here: iterate on 2 arrays simultaneously 5 answers var players = ["donna", "craig", "brian", "anna"] let scores = [2, 2, 4, 5] (indexx, score) in scores.enumerate() { (index, player) in players.enumerate() { if indexx != index { continue } print("player's name: \(player) score: \(score)") } } i made method using have learned far for-in loops , arrays. there more sufficient way of creating for-in loop prints out players name , score? player's name: donna score: 2 player's name: craig score: 2 player's name: brian score: 4 player's name: anna score: 5 given 2 arrays var players = ["donna", "craig", "brian", "anna"] let scores = [2, 2, 4, 5] you can write zip(players, scores

for loop - Behaviour of parallel running same batch files -

for fun reasons wrote batch-file typing 100 random upper-/lowercase letters whereever click to. turned out quite slow decided start command line simple for-loop more chars in less time: for /l %m in (1,1,3) (start bat.bat) starting shell in folder file located at. beeing curious if got 300 characters went this website shows written characters in realtime , came interesting observation: 293 letters (+- 5 or so) , not expected 300 ones. assume because of parallel running processes. can see writing starts in blocks of 3 characters , 1 or 2 characters missing , continues on whole script duration. now question: parallel running of same batch-file affect each others process? below code of file (and yes know done way shorter , more efficient): @if (@codesection == @batch) @then @echo off setlocal enabledelayedexpansion timeout /t 3 set sendkeys=cscript //nologo //e:jscript "%~f0" /l %%g in (1,1,100) ( set /a grkl=!random! %%2 if "x!grkl!"=="x0" ( !s

sql - Join table query returns multiple results from right table -

i'm new access , have pulled tog ether query in gui. i have join set customers have complained in left table , work completed in right table. both table have customers reference number i've joined based on that. customers may complain before we've carried out work table left join. the problem have customer may have had multiple work items, when create join each row in complaints table being returned multiple times if have had more on work item carried out. i need add logic joins brings single work item each complaint. multiple work items present want query return work item date closets date of complaint never after it. if complaint has no work items occur before still want complain shown data work item. i know how use designer gui sql looks @ moment: select distinct [cear326 master data fo access1].id, reportingcategory.reportingcategory, [cear326 master data fo access1].category, [cear326 master data fo access1].[sub category], [

android - Retrofit 2 onResponse method not called although Http request returns data -

i making asynchronous http request, calling web service returns list of game dates in json format. can see in log data being returned, neither onresponse nor onfailure methods being called. following code fragments followed log showing results of http request. note web service being called being asked return 1 column out of 30 ( gamedate ) games table. there 2 rows in table , gamedate column being returned both rows seen in log. attempting pass game date list main activity display. does have idea why neither onresponse nor onfailure methods being reached? public interface gamesapi { @get("/hcdbwebservice/hcdbwebservice.php?format=json&operation=gamelist") call<list<game>> listgames(); } private void requestdata() { log.d("mainactivity.logtag", "requestdata method"); httplogginginterceptor interceptor = new httplogginginterceptor(); interceptor.setlevel(httplogginginterceptor.level.body); okhtt

asterisk SIP User-to-User -

i trying make sip transfer 1 asterisk passing uui. on asterisk 13 have simple dialplan: exten => 2222,1,answer exten => 2222,n,transfer(sip/1111@asterisk14&user-to-user=342342ef34;encoding=hex) exten => 2222,n,hangup i have registered sip trunk between asterisk 13 ans asterisk 1.4 register => asterisk13:welcome@10.254.2.115/asterisk14 [asterisk14] type=friend secret=welcome context=asterisk14_incomming host=dynamic and done similar config on second asterisk have error: purely numeric hostname (1111), , not peer--rejecting! i have read can find error cant find how resolve it. thanks in advance suggestions no way pass that. use sipaddheader

angularjs - $loaded is not working properly when the server data is changed -

i new firebase , angularjs. sales application use both. so, in app using angularjs v1.5.8 + firebase v3.3.0 + angularfire 2.0.2 . have sales , users objects in firebase db, , has business logic 1 user can sell multiple products, 1 product can have 1 owner (user). here users , sales objects in database: { "sales" : { "-kqlb5n6a9rclc5qcwgd" : { "price" : 8, "quantity" : { "count" : 12, "type" : "porsiyon" }, "status" : "sale", "title" : "patlicanli borek", "user" : "-kq52ojd-lwodiwzfyft" }, "-kqlcscsq8cidk7drs04" : { "price" : 12, "quantity" : { "count" : 10, "type" : "porsiyon" }, "status" : "sale", "title" : "deneme", "user&quo

php - Laravel 5 & validating multiple email addresses in a single field -

i know in laravel can setup validation rules input fields, example: $return = [ 'first_name' => 'required|max:300|min:3', 'last_name' => 'required|max:300|min:3', 'email' => 'required|email, ]; is there way set kind of validation single field comma separated email addresses ( test@email.com, wibble@test.com ) or need manually validate these splitting them apart , checking each email address individually? this may looking for: $rules = array( 'email_addresses' => 'required', 'email_addresses.*' => 'email' ); $messages = array( 'email_addresses.required' => 'email addresses required', 'email_addresses.email' => '' );

java - Espresso testing NestedScrollView - "Error performing 'scroll to' on view 'with id:" -

i need scroll down through nestedscrollview in order test xml file espresso, error message: "error performing 'scroll to' on view 'with id:" several other posts seem have similar problem. i have followed instructions this: android espresso nestedscrollview, how scroll bottom now forementioned error, , found post: scrolling view attempted, view not displayed i have no padding in nestedscrollview - tried removing padding xml alltogether, testing purposes, made no difference. this test (so far not supposed anything, scroll down): @test public void testscrolldownabilityofdetailsscrollview(){ gotospecificitemonstream(streamitemwithoneimage); onview(withid(r.id.end_of_details)) .perform(scrolltoaction.betterscrollto()); } it uses custom made scroll action class: public final class scrolltoaction implements viewaction { private static final string tag = scrolltoaction.class.getsimplename(); @

javascript - In React.js how do you create a link to change the active tab using react-bootstrap? -

i using react-bootstrap tabs , want create link within tab content changes active tab , opens second tab. for example: <tabs ...> <tab eventkey={1} ...> click <tablink eventkey={2} ...>link</tablink> </tab> <tab eventkey={2} ...> <tablink eventkey={2} ...> ... </tablink> </tab> </tabs> obviously, tablink not exists component - , question how do this? the tabs component has prop called activekey - use component's state control value ( as shown in example ), , use a tag onclick link. here's example, adapted 1 linked above - can't test right now, should give right idea. const linkedtabs = react.createclass({ getinitialstate() { return { key: 1 }; }, gototab(key) { this.setstate({key}); }, render() { return ( <tabs activekey={this.state.key}> <tab eventkey={1} title="tab 1">

itext - iTextSharp - fdfWriter access to AcroFields to Set Field Property -

i need update fdf request input steam before saving it, programmatically on server side. using itextsharp library. fdfreader gets data fine , can move writer there no acrofields property on fdfwriter. , acrofields property on fdfreader readonly, can't before setting fields. i need able set field's property hidden. this: vb.net dim reader fdfreader = new fdfreader(request.inputstream) dim writer fdfwriter = new fdfwriter writer.setfields(reader) reader.close() writer.acrofields.setfieldproperty("key", "setflags", pdfformfield.flags_hidden, nothing) ' (add save file here) but writer.acrofields not exits. how field properties set fdfwriter? how field properties set fdfwriter? they not. object allows retrieve , fill in fields throug code pdfstamper . have @ example: http://developers.itextpdf.com/question/how-save-xfdf-file-pdf-file

customization - Dynamics CRM custom entity showing in accounts hierarchy -

i have created custom entity that, through 'lookup' tool, made child of accounts entity. now, show custom entity in accounts hierarchy. how do this? thank you. unfortunately can use entities of 1 type in hierarchies. oob behavior of crm can show child accounts under account.

Having problems with saving and loading in Swift 3.0 iOS 10 -

i'm new swift , ios programming scene , trying learn bunch of things. app, want save , load 1 integer, having problems, found on stack overflow , internet doesn't seem work on swift 3. app crashes immediately, breaks on: @iboutlet weak var staticlabel: uilabel! it says "thread 1: breakpoint 3.5" . , tips appreciated :) import uikit import avfoundation var player: avaudioplayer? var number = 0 class viewcontroller: uiviewcontroller { @iboutlet weak var staticlabel: uilabel! @iboutlet weak var numberlabel: uilabel! let defaults = userdefaults.standard override func viewdidload() { super.viewdidload() load() } func load() { number = defaults.integer(forkey: "save") numberlabel.text = string(number) } func playsound() { let path = bundle.main.path(forresource: "rightyouare.mp3", oftype: nil) let url = url(fileurlwithpath: path!) {

mysql - Can I improve this query by adding new indexes, or how to improve that query? -

i working old legacy project , have problem slow query. i have following database schema: table: search_api_db_full_index_text rows : 1612226 +------------+------------------+------+-----+---------+-------+ | field | type | null | key | default | | +------------+------------------+------+-----+---------+-------+ | item_id | bigint(20) | no | pri | null | | | field_name | varchar(255) | no | pri | null | | | word | varchar(50) | no | pri | null | | | score | int(10) unsigned | no | | 0 | | +------------+------------------+------+-----+---------+-------+ indexes for: search_api_db_full_index_text +-------------------------------+------------+------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+ | table | non_unique | key_name | seq_in_index | column_name | collation | cardinalit

c# - Implementing TypeConverter for handling PropertyGrid exceptions -

i 'm developing winform application , use of propertygrid control. handle exceptions form porpertygrid implemented class derived typeconverter , overwrote various methods including convertfrom check if can convert, example, string integer, , show messagebox if not. problem convertfrom called multiple times when writing incorrect value in property , therefore messagebox displayed several times. idea why happens or how can solve it? public override object convertfrom(itypedescriptorcontext context, system.globalization.cultureinfo culture, object value) { if (value string) { int result; if (int.tryparse(value string, out result)) return result; else { messagebox.show("error"); } } var def = context.propertydescriptor.attributes.oftype<defaultvalueattribute>().firstordefault(); return def != null ? def.value : 0; }