Posts

Showing posts from July, 2010

abap - How to suppress to perform a webdynpro-method from the pre-exit -

i want check condition in pre exit method, if condition false have come out of method, without calling original method. as far know cannot. however, have options: check original method , see if there variable can set in pre-exit logic in method not processed; use implicit enhancement @ top of method want skip, put code here planning put in pre-exit; use overwrite-exit call original method using me->method( ) whenever want call it. if remember correctly have create overwrite option have access global vars.

android webview javascript does not load sometimes -

i loading html data webview using loaddatawithbaseurl() method. html includes js file absolute path (file:///android_asset/myjs.js). if set base url "file:///android_asset/" or "fake://not_needed" in loaddatawithbaseurl method, javascript not loads. works of time , can see rendered html in webview. fails execute javascript included in html. have viewpager webview in each page. webviews being loaded @ same time. try : webview.getsettings().setjavascriptenabled(true); and before making call loadurl : webview.clearcache(true); webview.clearhistory();

javascript - autoload files conflict with jquery files -

i have jquery files. project sidebar menu item hide show on click of menu. when add autoload code select of requirement sidebar no work don't no why me plz. because struck. <script src="../plugins/jquery/jquery-2.2.3.min.js"></script> // have use in script file when dont add on mail.php file myautoload code not run. if add in mail.php select required field. <script src="../plugins/jquery/jquery-2.2.3.min.js"></script> <script src="../plugins/jqueryui/jquery-ui.js"></script> <script> ## heading ## $(document).ready(function () { $('#user').autocomplete({ source: 'autocomplete.php', minlength: 1,`enter code here` select: function (event, ui) { var selectedobj = ui.item; jquery("#user").val(selectedobj.label); jquery('#rowid').val(selectedobj.value); return false

javascript - Libraries not loading on form load- CRM 2016 -

we upgrading crm 2011 crm 2016 on premise. have libraries added on form load in address entity form libraries aren't being loaded @ first time ans showing error message 'mscrm' undefined in below code snippet , page. <script language="javascript"> window.settimeout(ribbonrefreshforarticle, 2000); function ribbonrefreshforarticle() { var uri = mscrm.crmuri.create(window.location.href); if (uri.get_query() != null && uri.get_query()["etc"] == mscrm.internalutilities.entitytypecode.kbarticle) { refreshribbon(); } } </script> page- http://myorg/testdev/userdefined/edit.aspx?_createfromid= {447ae3ee-2727-e511-84e4-005056b33beb}&_createfromtype=2&_gridtype=1071&etc=1071&id={858c47d7-62ae-43de-a13b-2f648efd111e}&pagemode=iframe&rskey={03315b35-4585-4447-a4d2-059cf79ca0fd} need help.thanks in advance. i'm little confused snippet, you're showing js within context

java - Scanner InputMismatchException from file -

doing first steps java, here's problem: 1.) rawdata.txt can read: import java.util.scanner; import java.io.file; import java.io.filenotfoundexception; import static java.lang.system.out; class readandwrite { public static void main(string args[]) throws filenotfoundexception { scanner diskscanner = new scanner(new file("rawdata.txt")); string diskstring; diskstring = diskscanner.nextline(); out.println(diskstring); diskscanner.close(); } } the result in eclipse console : >19.5 5 so guess content can read. but: nextdouble() , nextint() won't work: import java.util.scanner; import java.io.file; import java.io.filenotfoundexception; class readandwrite { public static void main(string args[]) throws filenotfoundexception { scanner diskscanner = new scanner(new file("rawdata.txt")); double unitprice, quantity;

ubuntu - Apt-get version (build) sepecification -

could explain me "+build-ubuntu" part means? sudo apt-get install firefox=45.0.2+build1-0 sudo apt-get install firefox=28.0+build2-0ubuntu2 ubuntu has couple of patches make firefox run flawlessly on environment , play nicely versions of libraries (i.e. libc). theese patches not part of firefox, handled ubuntu maintainers. in order keep track of level of theese patches, ubuntu adds string original upstream version mozilla firefox. ubuntu maintainers can increment part of version changing suffix string +build2-0ubuntu2 +build2-ubuntu3. @ same time upstream firefox can increment main part of version - , new version bigger, independent ubuntu patch version. also might used add security patches in new firefox versions old versions of firefox (without updating whole firefox version). due nature of ubuntu not update versions of packages within release (i.e. ubuntu 16.04. sticks version of packages when released in april 2016).

Ways to pass 2D Array to function in C -

i started learning c language week ago. test decided write tictactoe game. i have field. int field[3][3]; and function printfield void printfield(int field[3][3]){ for(int = 0; < 3; i++){ for(int j = 0; j < 3; j++){ printf("%i", field[i][j]); } printf("\n"); }} it's working in main this: int main(){ printfield(field);} but if change void printfield(int field){...} or void printfield(int field[][]){...} it gives me bunch of errors: subscripted value neither array nor pointer nor vector passing argument 1 of ‘printfield’ makes integer pointer without cast note: expected ‘int’ argument of type ‘int (*)[3]’ why can't pass array this? there more ways pass it? the function independent of call function. function cannot guess rest of program array size is. in function body have have constants or variables represent dimensions. you can use variables instead of fixed size: voi

java - Running several iterations in a while loop -

i trying solve problem of finding smallest , second smallest element in array. i thinking of putting 2 pointers on 0th index of array. both pointers move left right traversing entire array. first pointer ptr1 determines min element while second pointer intends determine second min element. first pointer works ok second pointer doesn't traverse. while loop exits after 1 iteration of second pointer. is possible have n pointers in while loop & make them traverse left right turn turn? or doing wrong. below code int arr[] = {12,13,1,10,34,1}; int ptr1 = 0; int ptr2 =0; int min = integer.max_value; int minsec = integer.max_value; int arrlen=arr.length-1; while(ptr1<arrlen && ptr2<arrlen){ if(arr[ptr1]<min){ // if works great finds min element min=arr[ptr1]; ptr1++; }else{ ptr1++; } //flow enters once

c# - Failing to execute google cloud Speech API -

i have registered on google cloud platform went through authentication steps , created required json suggested here . on downloading google cloud sdk(requirement setting environment variable) , trying install installation fails os win 7 64-bit. on trying set environment directly(my computer>advance settings> environment variable) , running code mentioned in given link error please check value of environment variable google_application_credential error image error message:- system.invalidoperationexception: error reading credential file location. please check value of environment variable google_application_credentials @ google.apis.auth.oauth2.defaultcredentialprovider please help! you need use commands right path make work : set google_application_credentials=file_path/credentials.json (name of file) set gcloud_project=project_name

google app engine - How can I programmatically determine which Datastore indexes are in error? -

when run update_indexes on google datastore message below. telling me determine indexes in error looking @ gui, delete these indexes. i have 51 erroneous indexes out of 200, , copying them out of gui not feasible. (edit: laboriously removing , adding indexes datastore-indexes.xml, identified 1 problematic index.) good devops procedure demands sort of thing automatically. how 1 determine indexes in error programmatically? (python, bash, or java ok.) cannot build indexes in state error.to vacuum , rebuild indexes: 1. create backup of index.yaml specification. 2. determine indexes in state error admin console: https://appengine.google.com/datastore/indexes?&app_id=s~myproject 3. remove definitions of indexes in error index.yaml file. 4. run "appcfg.py vacuum_indexes your_app_dir/" 5. wait until error indexes no longer appear in admin console. 6. replace modified version of index.yaml file original. 7. run "appcfg.py update_indexes your_app_dir/"

Some Mapquest Nominatim API calls work only in the Browser -

when doing mapquest nominatim api call different results through curl , in browser. lets's have following request: http://open.mapquestapi.com/nominatim/v1/search.php?key=valid_api_key&addressdetails=1&format=json&limit=1&q=fulda+maberzeller+str.+45 in browser expected result, through curl "[]" means empty result. with following request same results in browser , through curl. http://open.mapquestapi.com/nominatim/v1/search.php?key=valid_api_key&addressdetails=1&format=json&limit=1&q=maberzeller+str.+45 the parameters in url seem correct encoded. has clue going on?

angular - Ionic2/Angular2 wait for SQLite database to open before querying -

i'm using ionic 2 (angular 2) hybrid app. inject shared provider page display data sqlite3 database , proceed load data. however, on creation of database provider opening database takes time (very little). code (as of moment) not wait database opened before querying, results in error. how can structure code wait database opened in order evade crash? the constructor of database provider: constructor(private platform: platform) { this.platform.ready().then(() => { if(this.isopen !== true) { this.storage = new sqlite(); this.storage.opendatabase({name: "data.db", location: "default"}).then(() => { this.isopen = true; this.storage.executesql("create table if not exists people (id integer primary key autoincrement, firstname text, lastname text)", []); }); } }); console.log('hello database provider'); this provider gets injected constructor of page. when page (home page) loaded triggers event calls lo

embedded - (error) unresolved symbols when build C++ application for ARM using Green Hills toolchain -

Image
i cross compile application target device using arm arch using green hills toolchain (the device run integrity os) fail error that __vec_new ... __vec_delete ... i don't understand means , how resolve it. can me ? unresolved symbols indicate failure link necessary object code or libraries defining said symbols. these particular symbols related implementations of new , delete c++ operators, , indicate have not linked c++ library. not familiar green hills tool chain, but, in cases invoke linker separately compiler, may need explicitly specify c++ linking. if using ide possible have created c project added c++ code - may result in linker options not link c++ support , libraries. the green hill's compiler has choice of c++ libraries selected either language variant option, or linker override option. these options can set in multi ide settings or on command line depending on how managing project. consult compiler/linker documentation - have found following

javascript - Mozilla Rhino - Error finding the class while using importClass(...) -

Image
i trying following code:- demo.js importclass(packages.java.lang.system); importclass(packages.java.util.arraylist); importclass(packages.org.demo.check); function disp(){ system.out.println("========== welcome rhino demo ===========" ); var c = new check(); c.check(); } now org.demo.check class class file present on classpath (i have verified using same class in separate java program , works fine) when run shell gives me following error: any idea issue?

sql - TSQL - How to return rows with a specific value last? -

my question reverse of question. tsql - possible define sort order? i want return records sql server database, sorted in ascending order based on column's value 2 particular records should on end. the original sql (which needs changed) below: select code_id categoryid, code_desc categorydescription codes code_id > '000001' , code_id < '000100' order categorydescription the results returned 000003 ***first record 000002 ***another record 000004 apple 000016 books 000014 cables i want below result (first 2 asteriks on last): 000004 apple 000016 books 000014 cables 000003 ***first record 000002 ***another record i tried below union statement resultset automatically sorted in ascending order , 2 rows in beginning default. select code_id categoryid, code_desc categorydescription codes code_id > '000003' , code_id < '000100' --order categorydescription union select code_id categoryid, c

ios - How to delete group data in Swift? -

i have dictionary , adding tableview. let myarray = [["name": "first element", "foo": "bar","groupid":"1"], ["name": "first element", "foo": "bar","groupid":"1"],["name": "second element", "foo": "bar","groupid":"2"], ["name": "second element", "foo": "bar","groupid":"2"]] in dictionary have key groupid . is possible can dictionary data groupid = %@ ? i want filter data based on grouping suppose have 4 data, , group id same in 2 data. want delete data groupid same dictionary. if groupid == 1 data deleted dictionary groupid == 1 , tableview reload data. i doing because want delete group data. you can use filter on array remove dictionaries array, check example var subitems: [[string:string]] = [ ["groupid&quo

java - Null pointer when reading a Properties file from another folder -

Image
this question has answer here: what nullpointerexception, , how fix it? 12 answers my application check if properties file exists , create 1 if not. try{ // create new file string path="c:\\temp\\lasercontroller.properties"; file file = new file(path); string comport = "comport=com1"; string parity = "parity=none"; string baud = "baud=9600"; string stopbits = "stopbits=0"; string databits = "databits=8"; // if file doesnt exists, create if (!file.exists()) { file.createnewfile(); filewriter fw = new filewriter(file.getabsolutefile()); bufferedwriter bw = new bufferedwriter(fw); // write in file bw.write(comport); bw.newline(); bw.write(p

javascript - Fix page shift when opening and closing uib-modal of angular ui bootstrap -

there page shift when opening , closing uib-modal . check https://angular-ui.github.io/bootstrap/#/modal . notice scrollbar disappearance , appearance. this question asked here ( opening angularjs modal causes page shift if scrollbar exists ) doesn't has working soultion. solution given set overflow-y body creates vertical scrolling if scrolling not needed. body{ overflow-y: scroll !important; } also visited following links couldn't implement uib-modal . there fix solve issue? in advance. https://github.com/twbs/bootstrap/issues/9855 https://github.com/angular-ui/bootstrap/issues/3714 shifting may coming because when modal opens add padding body. due bugs don't know padding remains body when modal closed , because of page shifts. when modal being closed on button click can try - $("#modalid").modal('hide'); $('.modal-backdrop').remove(); $('body').removeclass('modal-open'); $('body&#

android - how to Save value in Shared Preference and set in spinner -

i know question has been asked many times don't understand how set because new in android. i have tried this: 1. saved prefrence 2. use this here code: sharedpreferences.editor editor = sharedpreferences.edit(); string gender = gender.get(i).tostring(); editor.putstring(gender1, gender); editor.commit(); list = new arraylist<string>(); list.add("male"); list.add("female"); arrayadapter<string> dataadapter = new arrayadapter<string>(getactivity(), android.r.layout.simple_spinner_item, list); dataadapter.setdropdownviewresource(android.r.layout.simple_spinner_dropdown_item); // int selectedposition = gender.getselecteditemposition(); gender.setselection(sharedpreferences.getint("gender1", -1)); list.indexof(sharedpreferences.getstring(gender1, "gender1")); gender.setadapter(dataadapter); edit:- want set stored value in spinner stored in preference. please me.

ruby - Bundle command not found - Jenkinsfile groovy -

i have groovy script runs job in jenkins pipeline fails when trys run bundle . error bundle: command not found i thought including path variable in build process seems not case node { stage 'bundle build' withenv(['path=/usr/bin:/bin:/usr/sbin:/:sbin/usr/local/bin:$path']) { sh '''bundle''' } } when run which bundle /users/jenkins/.rvm/gems/ruby/bin/bundle but builds run under /users/jenkins/.jenkins how can use bundle when building job? any appreciated thanks update if run works node { stage 'bundle build' withenv(['path=/usr/bin:/bin:/usr/sbin:/:sbin/usr/local/bin:$path']) { sh '''#!/bin bash -l bundle''' } } but doesnt seem right try instead node { stage 'bundle build' withenv([ "path=$home/.rbenv/bin:$home/.rbenv/shims:$path", "rbenv_shell=sh" ]) { sh '''bundle'&#

typescript - Angular 2- Enable Multiple Components with view on one path state? -

how enable multiple components 1 path state in angular 2? ui-router, route provider 1 state open multiple views in angularjs! you use router-outlet render multiple components in route path. example code plunker

sql server - How to get latest file name from folder? -

i have used below list of files folder. list need latest file name. please suggest, need change code latest file name? drop table #file go --===== create holding table file names create table #file ( filename sysname, depth tinyint, isfile tinyint ) ; --===== capture names in desired directory -- (change "c:\temp" directory of choice) insert #file (filename, depth, isfile) exec xp_dirtree n'\\backup-server\include\monthly\sales\',1,1 ; --===== find latest file using "constant" characters -- in file name , iso style date. select top 1 filename #file isfile = 1 , filename 'sales_backup_*.bak' escape '_' order filename desc select *from #file so in case, file name contains appears creation date number. sales_backup_201201312300.rar means file created on 2012-01-31 @ 23:00. have file largest number in it's name: select to

python - Is it possible to seperate a string into sentences using context? -

is possible seperate string multiple sentences using nlp in python string contexts. input: string="chinese people use social media called weibo in china same twitter." output: chinese people use social media called weibo in china it same twitter. or can set boundary of sentences. i have tried using tokenization, using can seperate string punctuations, whitespace, blanklines etc. your example can splitted in different places still giving valid sentences. string="chinese people use social media called weibo in china same twitter." chinese people use social media chinese people use social media called weibo. social media called weibo in china same twitter. weibo in china same twitter china same twitter and on ... there's no 1 best split given example algorithm should generate valid possibilities.

Specifying gradle file (not default build.gradle file) to build android studio standard project -

for different purpose, need specify gradle file (not default build.gradle file) build android project in android studio standard structure. when using eclipse gradle, know how build project specified name gradle file. since structure little different. how make work? know it? thanks more details explained. i have android studio standard project structure below. ->root -->app -->settings.gradle -->build.gradle -->project1 (library) -->project2 (library) -->build.gradle -->settings.gradle i want create new gradle file build project generate apk file. gradle file has tasks default 1 (build.gradle). so can choose 1 of them use different purpose. for example, purpose, can execute 'gradle assembledebug' generate apk file. b purpose, can execute 'gradle assembledebug -b b.gradle' generate apk file. i have done research on this, failed.

javascript - Adding and removing class through ng-class based on attribute value -

consider below markup. it's case of accordion. have apply different css (background color) 1 open. wish use ng-class directive. header open has aria-expanded attribute set true. being false others. <v-pane-header class="header ng-scope ng-isolate-scope" role="tab" tabindex="0" aria-selected="true" aria-expanded="true"> how can accomplish this. know how respect model variable etc. note aria-expanded attribute automatically added accordion plugin. i took different approach solving issue. instead of doing through ng-class or other function or method in code, worked on accordion plugin itself. accordion adds aria-expanded attribute dynamically. made changes in plugin code , applied style attribute right plugin adds aria-expanded attribute. it's working perfectly. function expand() { accordionctrl.disable(); panecontent.attr('aria-hidden', 'false'); paneheader.attr({ 

How do I pass a local variable to remote PowerShell Script -

let me brief out methods tried. here start_testtalk.ps1 script $rn = $env:rname $testv = "local_variable" write-host $testv write-host $rname write-host $rn write-host $env:rname i've declared below variables $name="myname" $cpu= 100 first method: ps c:\users\administrator> invoke-command -session $s -scriptblock{ & "c:\users\administrator\desktop\start_testtalk.ps1 " -rname $args[0] -rcpu $args[1]}-argumentlist $name,$cpu local_variable second method ps c:\users\administrator> invoke-command -session $s -scriptblock{ & "c:\users\administrator\desktop\start_testtalk.ps1 " -rname $using:name -rcpu $using:cpu} local_variable third method ps c:\users\administrator> invoke-command -session $s -scriptblock{ param($name, $cpu) & "c:\users\administrator\desktop \start_testtalk.ps1" -rname $name -rcpu $cpu}-argumentlist $name ,$cpu local_variable all above 3 methods prints 'local_variable&#

c# - CEF - Run window multiple times one after another -

i have winform app starts in background (loop in program.cs). after receiving message shows form cef browser in it static void main(string[] args) { while(true){ if(messagereceived()){ if(program.message == 200) { application.run(new form()); } else { environment.exit(0); } } } } and window: private cefsharp.winforms.chromiumwebbrowser browserchrome; private void form_load(object sender, eventargs e) { this.browserchrome = new cefsharp.winforms.chromiumwebbrowser(string.empty); this.browserchrome.load("htp://www.google.pl"); } it works first time, after close form, app starts check messages again , when want open form again, whole exe crashes: "chromeapp stopped working" error occured in libcef.dll, version: 3.2785.1482.0, time stamp: 0x57eb4d4e is possible run form twice chromium or not? thank help are sure need use applicatio

Choose which categories to display in the wordpress admin of a post -

i trying following thing in wordpress theme coded. created custom post type. when enter new article custom post type in admin, enable selection of categories. example, display 2 categories in admin part of post: e.g.: category one, category two even if have more categories registered in wordpress: e.g.: category one, category two, category three, category four can please me in accomplish this?

installation - Installing Guides and sample code Xcode loop -

Image
each time launch xcode see so click install. when go xcode>preferences>components>documentation i see fine wait until see completed , installed checkmark. however when click check , install again again shows and again each time launch xcode see please me understand why there loop , how fix?

c# - How to add multiple columns inside a single GroupProperty method of Nhibernate Projections Class -

i using visual studio 2008. trying add multiple columns inside single groupproperty method of nhibernate.projections class. but failing required output. tried this. icriteria criteria = createcriteria("basecriteria"); projectionlist.add(projections.groupproperty( projections.sqlfunction("concat", nhibernateutil.string, projections.property("firstname"), projections.constant(' '), projections.conditional(expression.isnotnull("lastname"), projections.property("lastname"), projections.constant(string.empty)))), "clientname"); generally, aside rowcount , sum , groupproperty can use sqlgroupprojection var projectionlist = projections.projectionlist() .add(projections.rowcount(), "rowcount") .add(projections.sum("price"), "price") .add(projections.groupproperty("statusid"), "statusi

angular - Loading angular2-data-table library with SystemJS give error: "Error: (SystemJS) Unexpected token <" -

we're trying implement library angular2-data-table. version 0.12.0 worked fine including systemjs map says in documentation. 'angular2-data-table': 'npm:angular2-data-table/release/index.js' this index.js file contains lot of code build webpack. later versions of library (since v1.0.0) have index.js file in de release folder following contents: "use strict"; function __export(m) { (var p in m) if (!exports.hasownproperty(p)) exports[p] = m[p]; } __export(require('./datatable.module')); __export(require('./types')); __export(require('./components')); //# sourcemappingurl=index.js.map since version error says exception: uncaught (in promise): error: (systemjs) unexpected token '<' in console log see following: evaluating node_modules/angular2-data-table/release/components.js evaluating node_modules/angular2-data-table/release/datatable.module.js evaluating node_mod

wpf - RadioButton change background color when checked -

i want override radiobutton style togglebutton 1 <radiobutton content="point"> <radiobutton.template> <controltemplate> <togglebutton ischecked="{binding ischecked, relativesource={relativesource templatedparent}, mode=twoway}" content="{binding content, relativesource={relativesource templatedparent}, mode=twoway}"/> <controltemplate.triggers> <trigger property="ischecked" value="true"> <setter property="background" value="red"/> </trigger> </controltemplate.triggers> </controltemplate> </radiobutton.template> </radiobutton> i need change background color of button when it's checked. tried trigger it's not working. the solution not simple one. issue related fact togglebutton has defa

ios - Nested dispatch_async (dispatch_async inside another dispatch_async) -

how call dispatch_async calls inside dispatch_async dispatch_group_t downloadqueue = dispatch_group_create(); dispatch_group_async(downloadqueue,dispatch_get_global_queue(dispatch_queue_priority_high, 0), ^ { nslog(@"main"); [nsthread sleepfortimeinterval:5.0]; nslog(@"end"); [self mymethod]; }); dispatch_group_notify(downloadqueue,dispatch_get_global_queue(dispatch_queue_priority_high,0), ^ { nslog(@"final"); }); and here mymethod : -(void)mymethod { dispatch_group_t group = dispatch_group_create(); dispatch_group_async(group,dispatch_get_global_queue(dispatch_queue_priority_high, 0), ^ { // block1 nslog(@"block1"); [nsthread sleepfortimeinterval:5.0]; nslog(@"block1 end"); }); dispatch_group_async(group,dispatch_get_global_queue(dispatch_queue_priority_high, 0), ^ { // block2 nslog(@"block2"); [nsthread sleepfortimeinterval:8.0];

xml - android: best view class to create popup page -

i developing android camera app allow popup of page upon pressing button (besides shoot button)in view of photo capture activity accessing twitter services, including login(of coz button), view tweets(listview or list fragment) of bookmarked users , posting tweets. i considering approach build layout popup stuff. come across mind dialog fragment, popupwindow , activity. considering case, view recommended popup component? depends on content of popup: if popup contains list of items use popupwindow . if popup contains few buttons ok/cancel text etc. use dialogfragment . if have more stuff, should use activity .

javascript - JQuerymobile How to Remove Row Space Between Input Fields -

Image
i using cordova/jquery mobile i trying develop settings page multiple input fields. remove spacing between rows unable find solution. here html <div id="container"> <input type="text" data-mini="true" data-inline="true" id="settingscat0" /> <input type="text" data-mini="true" data-inline="true" id="settingscat1" /> <input type="text" data-mini="true" data-inline="true" id="settingscat2" /> <input type="text" data-mini="true" data-inline="true" id="settingscat3" /> <input type="text" data-mini="true" data-inline="true" id="settingscat4" /> </div> and here demo add css rule in html or in css file g

angularjs - $scope.watch does not work between two different angular pages -

the below code working within 1 page different controlloers, scope.watch not work when pass value 1 page another. how can that? below code. .factory('data', function () { var data = { lastname: '', } return { getlastname: function () { return data.lastname; }, setlastname: function (lastname) { data.lastname = lastname; } } } //first controller $scope.lastname = ''; $scope.$watch('lastname', function (newvalue2, oldvalue2) { if (newvalue2 !== oldvalue2) data.setlastname(newvalue2); }); //get first controller second $scope.$watch(function () { return data.getlastname(); }, function (newvalue2, oldvalue2) { if (newvalue2 !== oldvalue2) $scope.lastname = newvalue2; }); //form //firstcontroller < input type = "text" name="lastname" p

creating a directory and a file using another php file (single and double quotes ) -

so made php script,i want make dir , make file inside dir , fill php code,the problem quotes,check out this: <?php @mkdir('kendo',0777); $f1 = @fopen ('kendo/up.php','w'); $f2 = ' <?php error_reporting(0); $system = $_get['km']; if($system == 'up'){ $temp = $_files['file']['tmp_name']; $nan = $_files['file']['name']; echo "<form method='post' enctype='multipart/form-data'> <input type='file'name='file' /> <input type='submit' value='upload' /> </form>"; move_uploaded_file($temp,$nan); } ?> '; @fwrite($f1 , $f2); ?> i want make dir called kendo ok? , inside dir want make php file simple upload script,the thing quotes ruins code,the second variable : $f2 = ' <?php error_reporting(0); $system = $_get['km']; if($system == 'up'){ $temp = $_files['file']['tmp_name']; $na

windows server - Duplicate deduplicated file -

i using windows server data deduplication (winserver 2012 r2). there way duplicate file same (deduplicated) volume without copying whole content? example: have 30gb virtual disk deduplicated , want create copy fast , without writing 30gb on same volume, next deduplication job remove anyway.

java - How to Split odd and even numbers and sum of both in collection using Stream -

how can split odd , numbers , sum both in collection using stream method of java-8 ?? public class splitandsumoddeven { public static void main(string[] args) { // read input try (scanner scanner = new scanner(system.in)) { // read number of inputs needs read. int length = scanner.nextint(); // fillup list of inputs list<integer> inputlist = new arraylist<>(); (int = 0; < length; i++) { inputlist.add(scanner.nextint()); } // todo:: operate on inputs , produce output output map map<boolean, integer> oddandevensums = inputlist.stream(); \\here want split odd & array , sum of both // not modify below code. print output list system.out.println(oddandevensums); } } } you can use collectors.partitioningby want: map<boolean, integer> result = inputlist.stream().collect( collectors.partitioningby(x -> x%2 == 0, collectors.summingin

angularjs - ngRepeat with custom index coming up blank -

i'm using large amount of arrays in large form in application. in order make splicing out specific data datasets based on user's selections, i've structured arrays example: var userlist = []; userlist[user1.id] = user1; userlist[user2.id] = user2; this lets me splice out specific elements without looping through entire collection using: userlist.splice(user1.id, 1); however, when try make list of users in html using ng-repeat statement, comes blank. html is: <div data-ng-repeat="user in userlist">{{user.name}}</div> i suspect ngrepeat uses 0,1,2.. default , doesn't know how handle custom indexes. i've checked several sources can't make sense of things. did work when added users pushing them array instead of assigning them specific index, know rest of code works fine. help? d: edit: the addition of trackby "track user.id" didn't fix it. plunkr! http://plnkr.co/edit/8hanbvxaiplhsq0ph6gx?p=preview

java - What is the difference between setOnItemClickListener and only onItemClick -

i searched internet , read out documents on google android centre , still not clear difference between 2 , when use @ situation? go through stack-overflow not found detailed answer. servicelistviewproviderpage.setonitemclicklistener(new adapterview.onitemclicklistener() { @override public void onitemclick(adapterview<?> parent, view view, int position, long id) { //something } }); and servicelistviewproviderpage.setonitemclicklistener(this); public void onitemclick(adapterview<?> parent, view view, int position, long id) { //something } thanks in advance both same different declarations , uses. first, lets see doing. here: view.setonitemclicklistener(listener); you setting listener in view. after, must override method onitemclick of onitemclicklistener interface in order follow contract provided , make action on item click. now see code examples: first case // set listener wiew

SharePoint site taking locale specific theme CSS -

my sharepoint site has 2 different locales (subsites) sharepoint theme file loads on page. file reference /_catalogs/theme/themed/56671/corev15.themedcss now when change locale changing url, css theme file reference changes locale-specific /_layouts/15/1036/styles/themable/corev15.css above 2 css has different styles affecting page is there way refer theme file /_catalogs/theme/themed/56671/corev15.themedcss (not locale specific) always?

javascript - What do the different parts of Chrome dev tools url mean? -

if run node.js application using new --inspect flag, url debugging such as: chrome-devtools://devtools/remote/serve_file/@60cd6e859b9f557d2312f5bf532f6aec5f284980/inspector.html?experiments=true&v8only=true&ws=localhost:3000/5baf857d-5514-4f27-8410-b2ab94aed057 what different parts of url mean, , how made up? it's pretty obvious human-readable words mean, of special interest me is: what @60cd6e859b9f557d2312f5bf532f6aec5f284980 mean? what 5baf857d-5514-4f27-8410-b2ab94aed057 refer to? unfortunately, not how search on web, hint or highly appreciated :-)

vb.net - Template datetime for datapicker -

i trying create datapicker control type calendar request date. seems have create template in folder * ..\ resourceswebapp \ views \ shared \ editortemplates . it this, wrong. have go in visual basic. @model datetime? @html.textbox ( function (model) model.hasvalue? model.value.toshortdatestring ( "dd / mm / yyyy"), newwith {.class = "date"}) what correct instruction in visual basic put file datetime.vbhtml in above folder?

ruby on rails - capybara: within scope does not restrict actions to inside of that element -

there multiple similar kind classes , buttons trying click on button inside particular class using code within(first(locator, text: text))do scroll_to(first('button')) first('button').click end from <div class="some parent class"> <div class="some other class" id="1"> <div class="class1">......</div> <div class="class2">......</div> <div class="class of button">......</div> </div> <div class="class used inside within" id="2"> <div class="class1">......</div> <div class="class2">......</div> <div class="class of button">......</div> </div> </div> but when run above code clicks similar kind of button inside class other

swift - Counter wont subtract on button press? -

i trying setcount -1 each time endsetpressed action called. i have included setcount -= 1 updatetimer function when endsetpressed pressed, should -1 setcount , start restcount timer. in practice doesnt seem show doing -1 in app stays fixed @ starting setcount value. another issue want able see value of restremainingcountdownlabel user setting reststeppervaluechanged value, figured done via 'restremainingcountdownlabel.text = string(restcount)' im using 'restcount = int(sender.value)*60' generate value in minutes, showing restremainingcountdownlabel in seconds rather mins, appreciate guidance on 1 too! here code: @iboutlet weak var restremainingcountdownlabel: uilabel! @iboutlet weak var setsremainingcountdownlabel: uilabel! @iboutlet weak var numberofsetslabel: uilabel! @iboutlet weak var numberofrestlabel: uilabel! @iboutlet weak var adjustsetsstepper: uistepper! @iboutlet weak var adjustreststepper: uistepper! var resttimer: timer? var restcount = 0 v

Ruby on Rails id column not generated after db:migration -

i'm following course on coursera , i'm on first assignment details of can found on this , this link. when ran rspec found test cases failing, turned out schema didn't have id column in it. in course said when run migration id column generated automatically created_at , updated_at. has idea why id column didn't generated. know can overcome problem specifying in new migration wanted know reason. here's schema have: activerecord::schema.define(version: 20161108162529) create_table "profiles", force: :cascade |t| t.string "gender" t.integer "birth_year" t.string "first_name" t.string "last_name" t.datetime "created_at", null: false t.datetime "updated_at", null: false end create_table "todo_items", force: :cascade |t| t.date "due_date" t.string "title" t.text "description" t.boolean &qu

javascript - Using webpack to simply transpile and concat files? -

so trying figure out how use webpack replace our current brunch build process. have angular 1 app doesnt utilise requires or imports @ , want have webpack concat+transpile files (there both coffee , sass files , ill need able watch , create source maps using usual settings). angular app sitting inside application using webpack extensively. what simplest way accomplish this? possible without app using form of javascript modules? here current config: var webpack = require( "webpack" ); var extracttextplugin = require("extract-text-webpack-plugin"); var path = require("path"); var glob = require("glob"); const exportconfig = { entry: { app: glob.sync('./front-end/applications/core/app/**/*.coffee'), vendor: ['angular'] }, output: { filename: "app.bundle.js", path: path.join( __dirname, "../www_root/build" ), }, debug: true, module: {

javascript - Uncaught TypeError: Cannot read property 'text' of undefined(…) -

the issue appears be: $("#results").append("<div class='list-group'><a class='list-group-item' href='https://it.wikipedia.org/wiki/" + encodeuricomponent(item.title.replace(" ", "_")) + "' data-toggle='modal' data-target='.bs-example-modal-lg'><h4>" + item.title.replace(" ", "_") + "</h4><p class='list-group-item-text'>" + item.snippet + "</p></a></div>"); and call page: e.relatedtarget.textcontent, hit button wikipedia, results, click on result = should load wikipedia page: jsfiddle playground the following has it: $("#wiki").one('click', function(e) { var articlename = $(this).data('subject'); $.getjson("https://it.wikipedia.org/w/api.php?callback=?", { srsearch: articlename, action: "query", list: "search",

UTF8 mysql encoded database field showing only special characters in php page -

i have database field utf8_unicode_ci encoding in mysql. arrangements done previous developer , it's store arabic language data in special character format this: رنا كلبونÙ‡ i have set headers <meta http-equiv="content-type" value="text/html; charset=utf-8" /> not showing arabic language characters when try fetch values database. it's showing these special characters instead of language. if using mysql use below after db connection mysql_query("set names utf8"); if using mysqli use below after db connection mysqli_set_charset($connection,"utf8"); if using class , object of mysqli use below $mysqli = new mysqli("localhost", "root", "", "test"); $mysqli->set_charset("utf8"); hope !

java - Why does the m2e plugin build to a WEB-INF/classes in the target folder for a maven jar project? -

since packaging jar (i.e. maven jar project), don't know why m2e insists on setting eclipse project's source folder's output write target/ web-inf /classes. tried changing point build/classes, maven -> update project changes back. why? missing project level setting? update: added pom.xml <?xml version="1.0" encoding="utf-8"?> <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <parent> <groupid>com.mycompany.ta.wh</groupid> <artifactid>sales-master-pom</artifactid> <!-- <version>0.0.18</version> --> <version>[0.0.1,2.0.0)</version> </parent> <artifactid>amq2gcppubsub</artifactid>

PayPal's Button Manager API with javascript -

what i'd achieve dynamically create hosted paypal buttons through button manager api offered paypal, preferrably nvp api. using client side javascript. surprisingly, after extensive searching online i've failed find sample of code achieves goal. reading paypal documentation led me believe can use api xmlhttprequests. however, fail reply paypal. i've created string arbitrary parameters should correct, , come far as: var xmlhttp; function generatebutton() { console.log("function begun") ; var strurl= "https://api.paypal.com/nvp"; var strparameters="?method=bmcreatebutton&version=204.0&buttoncode=hosted&buttontype=buynow&buttonsubtype=products&l_buttonvar0=amount=15.00&l_buttonvar1=item_name=test_item2user=***&pwd=***&signature=***"; var urlrequest= strurl+encodeuri(strparameters); if (window.xmlhttprequest) { // code ie7+, firefox, chrome, opera, safari xmlhttp=ne