Posts

Showing posts from May, 2013

android - How to get the reference of a fragment created by FragmentTransaction.replace method -

i added fragment inside activity using following code: fragmenttransaction ft = getactivity().getsupportfragmentmanager().begintransaction(); ft.replace(r.id.parent_fragment_container, new folderstructurefragment()); ft.commit(); my question how can reference of added fragment. have searched lot of key words related fragment , fragmenttransaction didn't find close requirement think basic function , should offered us. appreciated! try using below code. folderstructurefragment folderstructurefragment = (folderstructurefragment)getactivity().getsupportfragmentmanager().findfragmentbyid(r.id.parent_fragment_container);

user interface - How to make expressions in Tkinter Python -

i'm new in python programming , i'm having issues in developing specific part of gui tkinter. what i'm trying is, space user enter (type) math equation , software make calculation variables calculated. i've found lot of calculators tkinter, none of i'm looking for. , don't have experience classes definitions. i made simple layout explain better want do: import tkinter tk root = tk.tk() iflabel = tk.label(root, text = "if...") iflabel.pack() ifentry = tk.entry(root) ifentry.pack() thenlabel = tk.label(root, text = "then...") thenentry = tk.entry(root) thenlabel.pack() thenentry.pack() elselabel = tk.label(root, text = "else..") elseentry = tk.entry(root) elselabel.pack() elseentry.pack() applybutton = tk.button(root, text = "calculate") applybutton.pack() root.mainloop() this simple code python 3 have 3 entry spaces 1st) if... 2nd then... 3rd) else... so, user enter conditional expression , softw

asp.net - Response.Redirect(Request.Url.AbsoluteURI) Clearing all user entries -

i have page user fills in text boxes saved sql database using submit button. page contains button allows them upload attachments. if user uploads attachment before clicking submit button save other data, values in text boxes cleared once upload routine executes response.redirect(request.url.absoluteuri). have tried saving values want restore session, don't seem able restore them. debugger shows there, once response.redirect executed, next lines never executed. i'm brand new asp.net, may missing obvious. here code upload procedure: protected sub upload(sender object, e eventargs) handles btnupload.click session("phone") = txtphone.text session("name") = txtname.text session("email") = txtemail.text session("startdate") = txtstartdate.text session("enddate") = txtenddate.text session("subject") = txtsubject.text session("description") = txtdescription.value dim filena

Read XML filewith HTML tags by using PHP -

i have xml file must import in wordpress. problem tags not compatible wordpress. so first, load xml php : $fichier = 'communiques.xml'; date_default_timezone_set('europe/paris'); $xml = simplexml_load_file($fichier); and foreach, change tags. my problem : my "content" tags contain html tags. when print var, content html return lot of array. [h3] => lorem ipsum .... [p] => array ( [0] => simplexmlelement object ( [b] => array ( [0] => lorem ipsum dolor [1] => sit amet, consectetur [2] => tennis et padel [3] => simplexmlelement object ( [br] => simplexmlelement object ( ) ) [4] =>

ios - Apple's official sample HLSCatalog dose not work? -

i trying apple's sample project hlscatalog downloading hls stream, avassetdownloaddelegate methods not called when pressed "download" button basic stream. however, urlsession(_ session: urlsession, task: urlsessiontask, didcompletewitherror error: error?) , urlsession(_ session: urlsession, assetdownloadtask: avassetdownloadtask, didfinishdownloadingto location: url) called when pressed "cancel" cancel download. the sample project run on iphone 6+ (real device), ios 10.3.2. wifi connection , 4g both tested. does have same issue?

virtual machine - SQL Server Management Studio connects to Azure SQL Database from Windows 10 but does not connect from VM on Windows Server 2012 -

i use absolutely same credentials , default settings connect azure sql database virtual machine windows server 2012 r2 use on laptop windows 10. same version of sql server management studio 2014. i added both machines' ip's azure sql db firewall rules. the firewall on vm off. i perfect connection laptop win10, whenever i'm on vm windows server message in ssms: connect server cannot connect <my_database>.database.windows.net. additional information: a network-related or instance-specific error occurred while establishing connection sql server. server not found or not accessible. verify instance name correct , sql server configured allow remote connections. (provider: tcp provider, error: 0 - no connection made because target machine actively refused it.) (microsoft sql server, error: 10061) for help, click: http://go.microsoft.com/fwlink?prodname=microsoft%20sql%20server&evtsrc=mssqlserver&evtid=10061&linkid=20476 no connection mad

Can I remove .00 if there are no cents in the amount using angular's currency filter? -

budget:number=50000; {{budget | currency:'usd':true}} the above code displays budget this $50,000.00 but want display this $50,000 from currency pipe docs third option uses same format decimal pipe :digitinfo so can use: {{budget | currency:'usd':true:"1.0"}} plunker example edit: jota.toledo pointed out could display cents if they're available with {{budget | currency:'usd':true:"1.0-2"}}

android - Navigation Drawer not working -

i combined navigation drawer tabs layout. in tab, layout working 3 tabs navigation drawer misbehaving. navigation drawer icon disappeared, opening sliding not getting closed sliding. , menus in navigation drawer not working. <?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.drawerlayoutxmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:fitssystemwindows="true" tools:opendrawer="start"> <include layout="@layout/app_bar_main" android:layout_width="match_parent" android:layout_height="match_parent" /> <android.support.design.widget.navigationview android:id=&quo

sql - INTERSECT is very slow - better solution available? -

i have datababase 1 main table , sub-tables. view data created c# application, shows 1 large table. in application user can set filter, show part of data. filter has 20 different parameters can each used or not. clarity of stored procedure organized this: each of 20 parameters create temporary table: declare @tbl_parameter1 type_int declare @tbl_parameter2 type_int ... type_int user-defined table type contains 1 column of type int. in next step fill these tables ids of main table of rows fit filter-parameter. if 1 parameter not set, fill ids. id @parameter1 > 0 begin insert @tbl_parameter1 select id tbl_main col1 = @parameter1 end else begin insert @tbl_parameter1 select id tbl_main end so in end need ids occure in every of 20 temporary tables: step slow. insert @result select value @tbl_testsequencetags intersect select value @tbl_source intersect select value @tbl_vehicle ... (17 more tables) at end stored procedure provides data c# appli

How to get job at new node of hazelcast jet cluster -

can how new jet cluster instance should start job? use case 1: start jet cluster 3 node submit job cluster all 3 nodes start job , process data use case 2: start 4th node 4th node nothing because it's no new submit job command how new cluster instance should start jobs, started @ nodes? the feature ask planned jet 0.5, planned end of september 2017. in jet 0.4 have cancel current job , start anew, you'll lose processor state. note job not cancelled cancelling client submitted job, have use: future<void> future = jetinstance.newjob().execute(); // time later future.cancel();

amazon web services - Inside the AWS custom authorizer, how do I find if the current IAM user is authorized to access that lambda? -

i have delegated user registation , login iam , cognito, , storing api permissing the policy document of role assigned. in document, store arns of lambda's allow . how, inside custom authorizer, recieve token , api gateways' method arn . how can go doing it? keep map lambda function name methodarn that require hardcoding level

How to disable angle bracket highlighting in Visual Studio Code? -

Image
i want disable character highlighting happens on angle brackets, find square box annoying. there way turn off? you can use following: // highlight matching brackets when 1 of them selected. "editor.matchbrackets": false, disables highlighting brackets not angle brackets.

Error in creating PDF in Latex in Texstudio -

i want create presentation in latex. following code : \documentclass{beamer} \usetheme{default} \title{electrical machines} \subtitle{electromechanical energy conversion} \author{vivek kumar pal} \institute{department of electrical engineering\\vjti} \date{\today} \subject{electricals} \begin{document} \end{document} code getting executed properly. following error coming creating pdf : does not valid pdf document. either file corrupt or in process of creation. retrying every 2 seconds. kindly in , let know reason. you missing content. once add it work properly. \documentclass{beamer} \usetheme{default} \title{electrical machines} \subtitle{electromechanical energy conversion} \author{vivek kumar pal} \institute{department of electrical engineering\\vjti} \date{\today} \subject{electricals} \begin{document} enter content here. \end{document} `

javascript - Flow inheritance - class B extends A incompatible with A -

i expect work , not outputting errors in flow: /* @flow */ class treenode { root: treenode } class rootnode extends treenode {} class othernode extends treenode { root: rootnode } but instead get: treenode. type incompatible rootnode . tho rootnode extends treenode what doing wrong? you can see issue there https://flow.org/try/#0pqkgbaagzgng9gdzcyaovbjgbdazrsafqccbtugotgbnswbvvmmyuoafwc4izkbtuax3ry8baept2vwmfiapdqqb21aixiy69yzhz4waexyaluss1zfktt038gtzqw7djhs0ka fields , properties invariant default because can both read , write them. need mark field covariant allow subclasses /* @flow */ class treenode { +root: treenode } class rootnode extends treenode {} class othernode extends treenode { root: rootnode } demo . further reading better understanding.

spring mvc - @ModelAttribute method to prevent handler method to in invoked -

i'm using @modelattribute annotation on method populate model in controller , perform logic. there way @modelattribute annotated method prevent continuing handler of invoked method, scheduled fire right after it? well, @modelattribute should't prevent handle service or controller once using annotation, can please post code , more details having issue?

Android RecyclerView wrap content of not scrolling side -

i have recyclerview horizontal linearlayoutmanager. put height of recyclerview wrap_content. items have different height. now when scroll forward through list. @ first ok. after reaches elements short height, recyclerview reduces height not increase height on tall elements after. i'm using recyclerview v25.4 each element: <?xml version="1.0" encoding="utf-8"?> <layout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <data> <variable name="provideritem" type="domin.provider.provideritem" /> <import type="domin.provider.provideritem.status" /> <import type="android.view.view" /> </data> <linearlayout android:id="@+id/root" android:layout_width="wrap_content" android:layout_hei

javascript - how to add Pagination in Woo commerce product on a custom page in flatorsome theme -

enter image description here how add pagination woo-commerce product in custom page. short of code available. kindly give me reply. you can use "wp-pagenavi" plugin https://wordpress.org/plugins/wp-pagenavi/

Puppet to Chef Syntax Convertion -

i'll have convert lot of puppet chef code. made chef tutorials , i'll reading puppet too. does know can find more examples of comparisons between puppet , chef code? (like puppet code in chef code) perfect full on guide helps me convert code. the ones have found had 3 examples... best wishes dennis https://www.google.com/search?q=puppet+chef+rosetta show many options. overall, it's not quite one-to-one due different styles @ work.

c# - CaliburnMicro + RowDetailsTemplate: Details-View disappears -

Image
i have gridview lists products. first column "gridviewtogglerowdetailscolumn" expands details-view when clicked. i use caliburnmicro load details-view so: <telerik:radgridview itemssource="{binding products.view}" selecteditem="{binding selectedproduct,mode=twoway,updatesourcetrigger=propertychanged}" autogeneratecolumns="false" enablerowvirtualization="false" showgrouppanel="false" rowdetailsvisibilitymode="collapsed" rowindicatorvisibility="collapsed" cal:message.attach="[event rowdetailsvisibilitychanged] = [action onrowdetailsvisibilitychanged($eventargs)]"> <telerik:radgridview.rowdetailstemplate> <datatemplate> <contentc

document - What is the correct way to create a Graph In ArangoDB -

i'm newbie in arangodb . i'm using version 3.1.25 i have 2 files 1 in form of documents , other imported edge collection in order graph operation such traversal, shortest path . found need create graph . here documents schema {"reference":"9606.ensp00000377461;","entry":"q3lic1"} and edge schema {"id":"8075502","_from":"p1/9606.ensp00000361446","_to":"p2/9606.ensp00000223073","s":315} doing : empty graph result mising ? any appreciated thank

javascript - How to reset selected items from the list? -

in component of office 365 fabric reactjs exists such component . has _getselectiondetails() method counts selected items list want make method reset , deselect items in list. example have button , when press it, reset items in list, marked before. tried : _resetselecteditems() :{ this.setstate ({ selectiondetails: 0 }) } after call it, sets new state , sets 0, items selected before remain selected, diselecting doesn't happen. how can deselect items? this.setstate() performs shallow merge of this.state new state, e.g. if this.state have selectiondetails , many more objects. this.setstate ({ selectiondetails: 0 }) update selectiondetails other remain unchange. have cleanup other objects manually. ref : this.setstate update : finally got it.... this._selection.setallselected(false) work. check out github project or check online .

snakemake yaml configuation for paired bwa align -

i create simple snakemake file bwa align data. have problems n wildcard , input used config.yml samples: 432: - "432_l001" - "432_l002" units: 432_l001: - "/illumina/raw/432_cgatgt_l001_r1_001.fastq.gz" - "/illumina/raw/432_cgatgt_l001_r2_001.fastq.gz" this snakemake file , bwa rules from snakemake.exceptions import missinginputexception rule bwa_mem: input: lambda wildcards: config["units"][wildcards.unit] output: temp("mapped_reads/sam/{unit}.sam") params: sample=lambda wildcards: unit_to_sample[wildcards.unit] #sample=lambda wildcards: units[wildcards.unit], #genome= config["reference"][genome_fasta] log: "mapped_reads/log/{unit}_bwa_mem.log" benchmark: "benchmarks/bwa/mem/{unit}.txt" threads: 8 shell: '/illumina/software/prog2/bwa-0.7.15/bwa mem {

Bash command with cut and pipe, No such file or directory error -

i on windows , use cmdr shell. command doesn't work : cut -s -d'"' -f2 file.txt | tr "[a-z]" "[a-z] i error : cut: '|': no such file or directory cut: tr: no such file or directory cut: '[a-z]': no such file or directory cut: '[a-z]': no such file or directory moreover, command works , gives results: cut -s -d'"' -f2 file.txt the following command works well: tr "[a-z]" "[a-z]" < file.txt

War with spring configured Camel context will not redeploy on JBoss -

i have camel application deployed on jboss in war file spring configuration starting camel context. it deploys , runs nicely on jboss eap 7.0.0.ga. if want change values in property file application depends on , touch war file, redeploys application. in cases fails. i following in server.log: 2017-07-25 12:05:26.671 info class=org.apache.camel.impl.defaultshutdownstrategy thread="serverservice thread pool -- 74" starting graceful shutdown 12 routes (timeout 300 seconds) 2017-07-25 12:05:26.725 info class=org.apache.camel.impl.defaultshutdownstrategy thread="camel (interfacedb) thread #2 - shutdowntask" waiting there still 4 inflight , pending exchanges complete, timeout in 300 seconds. inflights per route: [interfacepersistdirect = 1, route1 = 1, pullfromtransferentitytable = 1, lastscheduledrun = 1] ... 2017-07-25 12:10:26.691 warn class=org.apache.camel.impl.defaultshutdownstrategy thread="serverservice thread pool -- 74" timeout occurred

php - Where I can find passport keys in Laravel? -

i generated keys using laravel command php artisan passport:keys don't know can find it. when reading the source code find gets path from $keypath . can set loadkeysfrom($path) . or uses default location storage_path() . storage default.

python - How to disable migrations for specific Django 1.7 apps? -

how disable migrations specific apps in django>=1.7? i'm trying upgrade django 1.6 1.7, , made trivial changes django's auth app change labels, design flaw in django>=1.7 treats attributes part of database schema, triggering new migration. moreover, running manage.py makemigration myapp generates migration other apps touching myapp , though i'm not explicitly trying create migration auth , it's forcing me so, , see no way turn off. this creating havoc, since have dozen apps touch auth , causing django create on dozen pointless migrations. i tried creating custom auth migration directory using migration_modules , doesn't seem work. app relies on auth throws error like: valueerror: lookup failed model referenced field helpdesk.queue.group: auth.group if try migrate auth . how fix this? ideally, simplest solution "turn off" migrations auth , since i'm not making changes it. edit: custom migration django forces me generate: class

c# - Return HttpResponseMessage before action without disposing Service -

i new async programming , not 100% understand implementations. hence couldn't find solution problem think quite simple. i need return httpresponsemessage before run expensive tasks. problem is, if run program shown in code below, return new httpresponsemessage(httpstatuscode.ok); executed after getasynccompanysettingsbygroup . so how can first return httpresponsemessage , execute async task? public class eventcontroller : apicontroller { public readonly icompanyapisettingsservice compapiservice; public eventcontroller(icompanyapisettingsservice _compapiservice) { compapiservice = _compapiservice; } public async task<httpresponsemessage> post([frombody]jobject tlaction, int group) { var tlaction = tlaction.toobject<teamleaderaction>(); tlaction.api_group = group; //return badrequest if values missing if(group == null || string.isnullorempty(tlaction.object_type) || string.isnullorempty(tlaction

java - How to join a String array to a int array and sort by number (higher to lower) in Android? -

i have 2 arrays: int[] sinais = new int[arraysinais.length]; string[] arrayssid = new string[] { }; and joined them 1 array: string[] arrayscan = new string[arraysinais.length]; (int = 0; < arrayssid.length; i++) { arrayscan[i] = arrayssid[i] + " " + sinais[i]; } but need sort new array numbers in decreasing order , put image inside listview depending numbers, , not have idea how this. you can use create own object contains int , string , use arraylist sort

WSO2 SSO:- defining list of String as configuration for XAMCL Ploicy -

i implementing authorization. have created user has role b , created policy if user has role b allow otherwise deny. requirement that, want define list of string configuration xacml policy. if authentication passed user, need list in saml response or api call. ex:- user bob has role admin. created policy bob_admin such if request has role admin allow otherwise deny. need define list of authorization code policy user can access. need list of authorization code in application if authorization passed. thanks gaurav

html - Same classes applied to anchor tag IE 11 generates two different background images -

i applying same classes 2 different elements , generated background property different. i ending button 1 - rgba(0, 0, 0, 0) linear-gradient(rgb(0, 81, 0) 0%, rgb(36, 138, 30) 100%) repeat scroll 0% 0% / auto padding-box border-box button 2 - rgba(0, 0, 0, 0) linear-gradient(rgb(36, 138, 30) 0%, rgb(0, 81, 0) 100%) repeat scroll 0% 0% / auto padding-box border-box i not understand why 2 different values generated using same class. this background property class looks like: background: linear-gradient(to bottom, #248a1e 0%,#005100 100%); so ending 1 button renders way expect , other button looks 1 on post crossbrowser css gradient in ie10, ie11 . you using 2 classes same button. last css rendered. style "contact-button" overridden style of class "green-button". use !important not overridden properties this. .green-button { text-align: center; color: #fff; border: 1px solid #016d01;

vb.net - If I imported a class, should I still prepend that class name to its methods when they're used in a different class? -

i work codebase there many classes thousands of lines of code. i've noticed inconsistencies in style concerning prepending class names when using methods , i'm trying figure out previous developer's reasoning. if we import generalcode in class a, bad practice write generalcode.dosomething() in class since imported (instead of using dosomething() )? think so, suppose it's nice know methods come classes @ glance, since class imports many classes , uses methods several of them. edit : vb.net, not java (sorry wrong tag, rough morning). new vb.net generalcode , dosomething() not declared static, neither import in class a. might vb.net, dosomething() can indeed used or without prepending generalcode . a method need prefixed the class name if it's static method. the name of instance when it's not static method. unless calling method own class.

c# - How to get a route without the action in the URL -

i want route like: /product/123 i have action don't want in url, currently: /product/get/123 how this? global.asax.cs routeconfig.registerroutes(routetable.routes); public static void registerroutes(routecollection routes) { routes.ignoreroute("{resource}.axd/{*pathinfo}"); routes.maproute( "default", "{controller}/{action}/{id}", new { controller = "home", action = "index", id = urlparameter.optional }, new[] { "myapp.web.controllers" } ); } you can use route attribute define path this: [route("product")] public class productcontroller { [route("{productid}"] public actionresult get(int productid) { // code here } } which provides full route definition "/product/{productid}" "/product/123" in case. more details there: https://blogs.msdn.microsoft.com/webdev/2013/10/

Concatenate strings from multiple records in Teradata SQL -

i have list of merchants business in different states. merch state nc fl b ca b va instead of returning 4 records want group merch concatenate strings of states output looks like merch states nc,fl b ca,va i'm having lot of trouble translating response in answer issue optimal way concatenate/aggregate strings i cannot string_agg work, i'm not sure works in teradata. https://docs.microsoft.com/en-us/sql/t-sql/functions/string-agg-transact-sql you can use xml_agg() built in function in teradata. doesn't translate sql server why having issues 2 links. select merch, trim(trailing ',' (xmlagg(states || ',' order states) (varchar(500)))) yourtable group 1;

python - OAuth2 InvalidScopeError in Backend Application flow -

i trying implement backend application flow access token datahug api (following instructions in https://api.datahug.com/#gettingstarted ). from oauthlib.oauth2 import backendapplicationclient requests_oauthlib import oauth2session def get_access_token(): token_url = 'https://apps.datahug.com/identity/connect/token' client_id = client_id client_secret = client_secret scope = 'datahug_api' client = backendapplicationclient(client_id=client_id) client.prepare_request_body(scope=[scope]) oauth = oauth2session(client=client) token = oauth.fetch_token(token_url=token_url, client_id=client_id, client_secret=client_secret) return token if __name__ == '__main__': token = get_access_token() print(token) when running code i'm getting invalidscopeerror, namely user:dh user$ python so_test.py traceback (most recent call last): file "so_test.py", line 21, in <module> to

php - Codeigniter Unit testing send file -

i'm using https://github.com/kenjis/ci-phpunit-test unit testing library codeigniter. i'm new @ writing tests, test how "adding new post" feature working. example send post requests fields , see messages see in view. public function test_when_you_send_slug_you_do_not_see_message() { $output = $this->request('post', '/pages/add', [ 'slug' => 'not-empty' ]); $this->assertnotcontains('<p>the slug field required.</p>', $output); } for example check whether when enter slug in form not specific error message. the problem can not test case when full form submitted correctly. have these required fields: title, content, slug, featured_image that last 1 file. so if pass title, content, slug in request, still missing featured_image file, , can't find information on internet how can pass $_files, cause guess 'post' wont see $_file. what want ask, how can pass file re

Build XML file with XSLT to filter on severals childs nodes -

i've big xml file icecat. , want take informations. it's in following of subject filter-dynamically-xml-child-element-with-xslt-with-ssis now i've categorieslist xml file this: <icecat-interface> <response date="tue jul 25 16:00:10 2017" id="29306604" request_id="1500991209" status="1"> <categorieslist> <category id="2597" lowpic="http://images.icecat.biz/img/low_pic/2597-5095.jpg" score="471102" searchable="0" thumbpic="http://images.icecat.biz/thumbs/cat2597.jpg" uncatid="43223323" visible="0"> <name id="1088701" value="fiber optic adapters" langid="1"/> <name id="1595015" value="glasvezeladapters" langid="2"/> <name id="1088703" value="adaptateurs de fibres optiques" langid="3"/> <name id="1245208&qu

Restore SQL Server database backup of one machine to another -

scenario: i have database backup ( abc.bak ) on 1 machine i copied machine path let's g:\sqldb\backup\master_copy.bak i used following t-sql try , restore - errors. t-sql used: restore database new_db disk = 'g:\sqldb\backup\master_copy.bak' move 'coop_test_dat' 'g:\sqldb\livedb\new_db_data.mdf', move 'coop_test_log' 'g:\sqldb\livedb\new_db_log.ldf', replace error generated: msg 5133, level 16, state 1, line 1 directory lookup file "c:\sqldb\masterdb\master_blank.mdf" failed operating system error 3(the system cannot find path specified.). msg 3156, level 16, state 3, line 1 file 'coop_demo' cannot restored 'c:\sqldb\masterdb\master_blank.mdf'. use move identify valid location file. here given specified path old machine doesn't exists in new machine. how can fix this? what jeroen suggested was, might missing files..so see files use below command.. re

ios - Swift - Firebase getting all keys and store them into array -

i have firebase database structure: main ----- name 1 --------value 1 --------value 2 --------value 3 ----- name 2 --------value 1 --------value 1 --------value 1 i'm trying key values , storing array of custom class. my custom class has init: init(name: string, photo: string) { self._name = name self._photo = photo } so in view controller have: var array = [customclass]() let ref = database.database().reference().child("main") func getinfo(){ ref.observesingleevent(of: .value) { (snapshot) in var arraytemp = [customclass]() child in snapshot.children { let snap = child as! datasnapshot let name = snap.key let custom = customclass(name: name, photo: "") arraytemp.append(custom) } self.array = arraytemp self.collectionview.reloaddata() } } func collectionview(_ collectionview: uicollectionview, cellforitemat indexpath: indexpath) -> uicollectionv

full text search - Is it possible to obtain, alter and replace the tfidf document representations in Lucene? -

hej guys, i'm working on ranking related research. index collection of documents lucene, take tfidf representations (of each document) generates, alter them, put them place , observe how ranking on fixed set of queries changes accordingly. is there non-hacky way this? your question vague have clear answer, esp. on plan : take tfidf representations (of each document) generates, alter them lucene stores raw values scoring : collectionstatistics termstatistics per term/doc pair stats : postingsenum per field/doc pair : norms all data managed lucene , used compute score given query term. custom similarity class can used change formula generates score. but have consider search query made of multiple terms, , way scores of individual terms combined can changed well. use existing query classes (e.g. booleanquery, disjunctionmax) write own. so depends on want of note if want change raw values stored lucene going rather hard. you'll have write cust

yii2 - Yii::$app->session->setFlash() is not working -

following code in sitecontroller works fine echo, not yii-method setflash(). maybe, have reconfigure config-file(main-local.php)? other ideas how keep setflash() doing job? public function actionscript() { //a new method, programmed thomas kipp $model = new myscriptform(); $filename = 'file'; $uploadpath = yii::getalias('@uploading'); if (isset($_files[$filename])) { $file = \yii\web\uploadedfile::getinstancebyname($filename); if ($file->saveas($uploadpath . '/' . $file->name)) { echo"<script>alert('hallo');</script>"; //echo \yii\helpers\json::encode($file); } } if ($model->load(yii::$app->request->post()) && $model->validate()) { $model->fileimage = uploadedfile::getinstance($model, 'fileimage'); $model->avatar = uploadedfile::getinstances($mo

html - css - Two fonts in one page for two languages -

i'll explain myself. want users able write (in inputs, etc.) in 2 languages, hebrew , english. website can in english entirely user still type in hebrew , vice versa. basically, have no way of knowing in language user type in input box, want matching font each 1 of languages (so input box looks pretty both in english , in hebrew). so, how can have 2 fonts 2 languages in 1 element? btw: answer not :lang(he) . doesn't automatically detect language, html attribute lang . it's same writing [lang=he] as far know, should happen automatically. assign both fonts this: font-family: 'arial', 'arial (hebrew)'; @ this example.

android - Different Headers in StackNavigator -

i have implemented stacknavigator in removed header styles purpose. now have component inside stacknavigator i'd header back. how reckon ? here stacknavigator : const nav = stacknavigator( { splashscreen: {screen: splashscreen}, login: {screen: login}, register: {screen: register}, main: {screen: mainnav}, }, { headermode: 'none', }); but register screen, have header (to let user know can go back). i tried doing : static navigationoptions = { title: 'register', header: { } } but don't quite know put inside header part. personally did: had set height of header 0 when didnt want show , n show somenthing height: condition ? 0 : 10 otherwise answered here you can programmatically following code: static navigationoptions = ({ navigation }) => ({ header: > (navigation.state.params.thanks) => <headerview > content={navigation.state.params.thanks} /> : null, }) and can set

How to call a child function inside a function from another function in Javascript? -

this question has answer here: how call function inside of function? 3 answers how javascript closures work? 89 answers function hello() { function helloagain(){ } } function myfunction(){ ... } here need call function helloagain() myfunction(). can suggest possible solution scenario. you can't. scope of helloagain il limited hello function. way make private scope in javascript.

android - Downloaded images upload, but camera taken images won't -

i have issue photo upload app allows pick image device , upload server. have been following guide on how use android upload service library this. application works image downloaded, or did not originate phone's camera. whenever choose image camera folder or if take 1 , try go choose it, image file not show in uploads folder. hits database table, not image folder. when click on image hyperlink sent table column, says "object not found" having real trouble understanding why happening images particularly. can help? here mainactivity code: package com.example.stins.orbotcamera; import android.manifest; import android.app.progressdialog; import android.content.context; import android.content.dialoginterface; import android.content.intent; import android.content.pm.packagemanager; import android.database.cursor; import android.graphics.bitmap; import android.graphics.color; import android.graphics.drawable.bitmapdrawable; import android.net.uri; import android.os.async