Posts

Showing posts from February, 2014

ruby on rails - Postgres server doesn't launch -

i try set postgres rails in order able deploy on heroku. resuming rails tutorials , bit lost (am no programmer) in pgadminiii try connect single server available (postgresql 9.3 localhost 5432) it asks password (which guessing @ moment) , shows error: server doesn't listen my questions are: is password super user password? (the 1 own @ moment) what purpose of super user password? how can recover password activates server? follow tutorial command line , way can alter password , create new user custom password. actually default there template1 database creates postgresql while intalling first time , can create database. first steps mention in tutorial , applicatio eed create database rake db:create:all postgresql tutorial super user password need setup postgresql on system, can access of super admin. password recovery command there in tutorial. -------updates--------- there 2 possible reasons this: either server isn’t running @ all. start it

Draw (shapes) to a texture/sprite in libGDX -

in libgdx game have several sprites share same texture. want "manually" draw onto of sprites (i.e. want change of pixels in of sprites). how can modify texture shared amongst seveal sprites without affecting other sprites? guess need copy texture before set sprite? you can use custom shader customize sprite texture. before drawing sprite spritebatch, say: spritebatch.begin(); spritebatch.useshader(shaderprogram1); sprite1.draw(...); spritebatch.useshader(shaderprogram); sprite2.draw(...); ... spritebatch.end(); if aren't familiar shaders can check link: https://github.com/libgdx/libgdx/wiki/shaders also there option use frame buffer object, texture customization, think if texture difference aren't huge, best solution if looking best performances. hope gives idea.

Convert a multidimensional array in php -

below multidimensional array.the first index array data user, each sub array contain properties user i.e name, ideally want break array have such array below. array ( [1] => array ( [0] => array ( [first name] => dahn ) [1] => array ( [event name] => testing out eventbrite php api ) [2] => array ( [last name] => king ) ) [2] => array........ the array want able generate such array ( [0] => array ( [first name] => dahn [event name] => testing out eventbrite php api [last name] => king ) [1] => array ( thanks in advance. link or point me in right direction highly appreciated try this: <?php function convert($array){ $new = a

Phonegap run android error on windows 8.1: not recognizing User name in command -

Image
i trying use phonegap on windows 8.1 system android development. have connected admin account outlook account. user name "aditya mohan". when try running command phonegap run android it gives error 'c:\users\aditya' not recognized internal or external command,operable program or batch file. [error] cmd: command failed exit code 1 it giving error half part of user name. can't change account name. please provide solution * fix * if me has had running in circles trying throw dev machine out window. its quit simple. a lot of older systems developed unable recognize special character sets , includes space, sense cant change account name on windows device, should do? i don't recommend using "users" folder option, don't put project in folder address uses [spaces] or special characters. keep clean , concise, works better in end.

java - Stop execution of a thread when a panel is removed from another panel -

i have panel (b) inside panel (a). panel (b) starts executing thread , updating own gui. but there case user logs out of panel (b) , other panel ( panel (c) ) comes in place of (b), while thread keeps on executing. i want interrupt (stop) thread when panel (b) no more visible ...any suggestions ? one option add containerlistener panel a. check if panel b being removed , call "stopthread()" on panel b. i'd suggest creating interface "stopthread()" method (call interface c), create own panel class b such b extends panel implements c. then in containerlistener.componentremoved method, test removed component: if (component instanceof c) { c c = (c)component; c.stopthread(); } you include startthread() , call when added using similar technique.

references in perl: hash of array to another array -

i have problem referencing hash in array array. have array @result looks this: @result = ( { "type" => "variable", "s" => "ngdp", "variable" => "ngdp" }, {"type" => "subject", "s" => "usa", "subject" => "usa", "variable" => "ngdp" }, { "type" => "colon", "s" => ",", "colon" => "," }, { "type" => "subject", "s" => "jpn", "subject" => "jpn", "variable" => "ngdp" }, { "type" => "operator", "s" => "+", "operator => "+" }, {"type" => "subject", "s" => "chn", "subject" => "chn", "variable" =&g

mongodb - Exclude null properties from save operation -

i'm using spring data mongodb -1.4.1.release , mongodb 2.4.9 i'm using mongooperations.save() in order update entities. on previouse version, 1.2.0.release (due bug: datamongo-571 ) used exclude of properties setting value null. now, bug fixed, , i'm not able so, still need exclude properties save operation (in case of update). does have idea how can achieved? mongotemplate has dedicated methods perform partial updates like: updatefirst(…) - updates first document matching given criteria. updatemulti(…) - updates documents matching given criteria.

css - Bootstrap 3 and Haml - Adjust button width -

i have following haml code in rails 4 view, using bootstrap 3: %div{:class => 'btn-group'} %button{:class => 'btn btn-default btn-lg dropdown-toggle', :type => 'button', 'data-toggle'.to_sym => 'dropdown'} %span{:class => 'caret'} %span{:class => 'sr-only'} toggle dropdown %ul{:class => 'dropdown-menu'} %a{:class => 'close_task', :name => 'name', :href => '#' } close this renders incredibly small button, despite button class of btn-lg . i'm new haml, missing causing button small here? add text button, css applied around it . example: %button{:class => 'btn btn-default btn-lg dropdown-toggle', :type => 'button', 'data-toggle'.to_sym => 'dropdown'} mybutton in case, there no text button. requires @ least 1 non blank character apply styling . above create large size bootstrap button tex

What regex matches strings of consecutive 'a' and 'b'? -

i need regex matches strings of consecutive a , b , e.g.: ababa bab edge case (smallest): ab ba (no upper limit.) ...and shouldn't match: abba bbab bbaabb i've tried several regex 1 kind of tricky. can throw me hints? my tries: (a|b)+ (ab|ba)*(aba|bab)+ this 1 gets close! http://www.regexr.com/38lqg if want find matches within text (potentially several words per line): \b(((ab)+a?)|((ba)+b?))\b \b word boundary.

java - gson list object attributes are null -

i trying list object json file usiong gson. returning list objects attributes null. how objects properly? json file: [{"periodendp":"2014-04-06t00:00:00","sitekeyp":"00035"},{"periodendp":"2014-04-06t00:00:00","sitekeyp":"00035"}] scheduledto.java public class scheduledto { string periodendp; string sitekeyp; } gsonex.java public class gsonex { public static void main(string[] args) { try { jsonreader jsonreader = new jsonreader(new filereader("f:/schedule.txt")); gson gson = new gson(); type schedulemsgdesttype = new typetoken<list<scheduledto>>(){}.gettype(); list<scheduledto> schedulelist = gson.fromjson(jsonreader, schedulemsgdesttype); for(scheduledto t :schedulelist ) { system.out.println(t.periodendp); } } catch(exception e) { e.printstacktrace(); } } } make perio

Call Android methods from JavaScript -

Image
i searched, didn't find answer. i'm developing android app based on webview, using html5 , javascript. can call android method, maketoast() javascript? you can adding javascript interface webview , exposing specific methods javascript code running in web view. in other words, you'll need wrap calls android's toast class in method create in activity/fragment. activity_main.xml <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent"> <webview android:id="@+id/web_view" android:layout_width="fill_parent" android:layout_height="fill_parent"/> </relativelayout> mainactivity.java public class mainactivity extends activity { @override protected void oncreate(bundle savedinst

java - Using custom Controls in fxml -

let's have subclassed default tableview<t> class provided javafx , created class persontableview extends tableview<person> . subclass exists in java code , not use fxml @ all. defines , encapsulates behaviour need person object. now want use instance of custom class inside of fxml file, use default controls. , problem, don't know how can that, or if / common design decision. i want encapsulate behaviour specific tableview inside own class, layout should defined in fxml has nothing logic, cosmetics. i imagine kind of syntax , functionality can found in wpf .net, can use custom classes in markup other control, because xaml , c# more tightly coupled java , fxml. from current point of view, described cannot done , instead end using small amount of fxml , lot more code, parts layout. example not want use code this: anchorpane.setrightanchor(customcontrol, 65.0); because believe idea have defined inside fxml. so question either, how implement describe

C++ windows phone 8 components -

i'm new windows phone development, , need create control c++ (basically it's webbrowser control) create c# library need use core written in c++. conclusion: so question is, can develop control in c++ using external libraries , compile use language of clr , use in windows phone 8 applications? if does, let me know resource video, book, or whatever. the general answer "yes", although comes caveats. it's possible build component in c++ using windows phone runtime apis , utilize programming language, such c#. more "pure" c++ code in doesn't access native operating system features (that may not present), better off you'll be. there's general guidance on msdn: native code windows phone 8 windows phone runtime api using native c++ code in apps that being said, if you're attempting create entirely new web browser reason, i'd suggest consider using built in webbrowser component. in windows phone 8, it's based o

java - Cant run XMLParser as a background thread in fragment -

this first question, sorry if off topic or wrong! creating android application , stuck @ somewhere.. have found tutorials , tried following. scenario want use xmlparser in application , using tabs swipable views. want display items in listview inside tab fragment. have managed them in listview problem cant work in background. have tried creating new thread doesn't work! think main activity needs fragmentview display cant return view because thread still in progress! hope understand problem.. can me? here fragment class , xmlparser class of application gamesfragment.java public class gamesfragment extends fragment { // static variables public static final string url = "http://api.androidhive.info/pizza/?format=xml"; // xml node keys static final string key_item = "item"; // parent node static final string key_id = "id"; static final string key_name = "name"; static final string key_cost = "cost"; static final string key_desc =

Layering canvas objects on JPEG's - JavaScript -

i creating maze game , far have rendered circle player move , loaded maze jpeg. when 2 overlap circle hidden jpeg, what method allows 2 objects overlapped? question 2 have created 10 x 10 table cell id's 1 - 100 , put these values in array. game need check id of square player wants progress , see if can go there. use hash table lookup or how can this? question #1: the last drawn object on top, draw maze first , player second. question #2: it might easier lay out cells in 2-dimensional array: // note: these example numbers not form valid maze :-) var maze=[ [0,0,1,0,0,1,1,0,0,1], [0,0,1,0,0,1,1,0,0,1], [0,0,1,0,0,1,1,0,0,1], [0,0,1,0,0,1,1,0,0,1], [0,0,1,0,0,1,1,0,0,1], [0,0,1,0,0,1,1,0,0,1], [0,0,1,0,0,1,1,0,0,1], [0,0,1,0,0,1,1,0,0,1], [0,0,1,0,0,1,1,0,0,1], [0,0,1,0,0,1,1,0,0,1], ]; ...and define character's position x,y coordinate: var playerx=5; var playery=5; then can examine each cell neighboring pla

ide - Codenvy: how to checkout single file or files/dirs using git? -

i begin use 1 of cloud ides codenvy. it seems best 1 among cloud ides, still find troubles, such git command. want checkout single file changed wrong when realized, cannot find normal git checkout way---even using shell, git commands limited. i have looked through document git here nothing found. has encountered problem, please? checkout 1 file is: git checkout -- path/to/your/file that reset content. if codenvy has shell allowing git commands, 1 way it.

javascript - How can i play raw samples PCM_16 audio data record from Android in Web (using Web-Audio or other)? -

in app on android, use audiorecord , send continuouslly bytes array pcm_16 node.js server. byte[] audiobuffer = new byte[maudiobuffersamplesize]; maudiorecord.startrecording(); int audiorecordingstate = maudiorecord.getrecordingstate(); if (audiorecordingstate != audiorecord.recordstate_recording) { log.e(tag, "audiorecord not recording"); return; } else { log.v(tag, "audiorecord has started recording..."); } while (inrecordmode) { int samplesread = maudiorecord.read(audiobuffer, 0, maudiobuffersamplesize); log.v(tag, "got samples: " + samplesread); if (websocketmanager.roomsocket.isconnected()) { websocketmanager.roomsocket.send(audiobuffer); } } after that, can stream web browser in arraybuffer type , try convert float32array buffer instance of audiocontext. can't hear thing or loud noise. function onmessage(evt)

ios - Issue with CoreData light migration. -

i needed change xcdatamodeld followed tutorial . i created .mom file , added 1 attribute 1 of previous entities. set in appdelegate . nsdictionary *options = @{ nsmigratepersistentstoresautomaticallyoption : @yes, nsinfermappingmodelautomaticallyoption : @yes }; if (![_persistentstorecoordinator addpersistentstorewithtype:nssqlitestoretype configuration:nil url:storeurl options:options error:&error]) ... i thought ok when try interact core data app crashes error. *** terminating app due uncaught exception 'nsinternalinconsistencyexception', reason: 'this nspersistentstorecoordinator has no persistent stores. cannot perform save operation.' what did miss? i manage solve, needed update persistentstorecoordinator created handle database on icloud nsdictionary called options .

python - Paths on DigitalOcean with Flask -

i have flask application on digitalocean creates file(shapefile) , , later on reads again. how write paths of file, make sure can read later again? use paths relative application's root. in flask application object ( app ) has .root_path attribute can use create absolute paths files. like: with open(os.path.join(app.root_path, 'shapefiles', file_name), 'w') f: f.write(....) and later reverse with open(os.path.join(app.root_path, 'shapefiles', file_name), 'r') f: data = f.read(....)

c# - Force method to accept different variables in signature -

is there way force method in c# accept arrays/variables of different types in same signature slot or make ignore 1 part of signature? my code: private void array_joiner(string[,] newarray, int32[,] matrixarray, string[,] rekursionarray, char[] arrayx, char[] arrayy) { (int16 = 0; < arrayx.length + 1; i++) { newarray[i, 0] = arrayx[i].tostring(); } (int16 = 1; < arrayy.length + 1; i++) { newarray[0, i] = arrayy[i].tostring(); } (int16 y = 1; y < arrayy.length + 1; y++) { (int16 x = 1; x < arrayx.length +1; x++) { newarray[y, x] = matrixarray[y, x].tostring(); } } } my problem want parse 2 different arrays in slot of int32[,]matrixarray (int32[,] , string[,]) method don't know how. got better idea write 2 different methods? thx in advance. you declare them array class , work out type of data

javascript - Canvas.toDataUrl sometimes truncated in Chrome/Firefox -

in html5 version of libgdx game, sometimes canvas.todataurl("image/png") returns truncated string yielding black image. canvaselement canvas = ((gwtapplication)gdx.app).getcanvaselement(); string dataurl = canvas.todataurl("image/png"); window.open(dataurl, "_blank", ""); the odd part works. when work ~100kib image expected, , new window opens address bar saying "data:". can send webservice , translate base64 bytes of proper png , osx preview shows fine too. when doesn't work new window shows black image of correct dimensions, , address bar base64-encoded data in (starting data:image/png;base64,ivborw0kggoaaaan ...), ending in elipsis appears rendered browser ui rather 3 periods in actual data string. data in case ~31kib. when try transcoding via webservice, same black rectangle. i see happen in both chome , firefox. any ideas? code canvas contents simple, can't see how can doing wrong. i'm thinking either b

xml - PHP - creating a dynamically coded if statement -

i trying build if statement dynamically coded based on values submitted users visit site. if statement may have between 1 , 9 conditions test (depending on user input), , xml values (from xml document) displayed based on if statement. the potential if statement conditions inserted in $if_statement variable, this: $keyword = trim($_get["keyword"]); if (!empty($keyword)) { $if_statement = ($keyword == $product->keyword); } $shopbystore = $_get["store"]; if (!empty($shopbystore)) { $if_statement = ($if_statement && $shopbystore == $product->store); } // plus 7 more methods retrieving potential user input $if_statement variable. however nothing being displayed in foreach loop below when using dynamically coded if statement: $xmlproducts = simplexml_load_file("products.xml"); foreach($xmlproducts->product $product) { if ($if_statement) { // problem lies here, because results displayed when if statement removed echo $product->n

python - How to return a json response in twisted? -

when using django: do return httpresponse(json.dumps(result), mimetype='application/json') how can in twisted? official document not this. document here only serving wsgi applications can set mimetype .but want process , post there no more example, , searched nothing found. from twisted.web import resource class mygreatresource(resource.resource): def render_get(self, request): return "xxxx" it return raw string encoded json is (byte) string. if question "how set content-type of response application/json ?" answer is: request.responseheaders.addrawheader(b"content-type", b"application/json")

python - django form.as_p doesnt render the form -

so here's form : class secretnoteform(forms.form): note = forms.textarea() here's view : def index(request): if request.method == 'post': pass else: form = secretnoteform() return render(request, "notes/index.html", {"form" : form}) and html : {% block content %} <form method="post">{% csrf_token %} {{ form.as_p }} <input type="submit" value="create"> </form> {% endblock %} when go url shows me create button no form fields. doing wrong here ? can't seem figure out.. the correct way make textarea widget: note = forms.charfield(widget=forms.textarea) here more documentation: https://docs.djangoproject.com/en/dev/topics/forms/modelforms/ and include attributes that: note = forms.charfield(widget=forms.textarea(attrs={'rows': 16,'cols': 25}))

ruby on rails 4 - Factory Girl Passing nil to user model -

pretty simple, using factory girl following: factorygirl.define sequence :user_email |n| "user#{n}@example.com" end # allows multiple user names sequence :user_name |n| "user#{n}" end factory :user, class: xaaron::user first_name 'adam' last_name 'something' user_name {generate :user_name} email {generate :user_email} password 'somepasswordthat_is$ecure10!' end end and there pass information user modal: require 'bcrypt' module xaaron class user < activerecord::base attr_accessor :password before_save :encrypt_password validates :first_name, presence: true validates :user_name, uniqueness: true, presence: true, length: {minimum: 5} validates_format_of :email, :with => /\a([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i validates_uniqueness_of :user_name validates_uniqueness_of :email validates :password,

javascript - Coffeescript function is undefined -

this question has answer here: how define global variables in coffeescript? 8 answers i create coffeescript function square=(x)->alert x*x it's compiled javascript (function() { var square; square = function(x) { return alert(x * x); }; }).call(this); so if write code <button onclick="square(5)"> compiler says square() undefined. what's wrong? your function square has globally defined function in order call html have defined. block of code: (function() { var square; square = function(x) { return alert(x * x); }; }).call(this); does not define function globally, therefore symbol can't found. in fact, function square defined within iife , isn't available anywhere else. if want available globally, may change above block this: window.square = function(x) { return alert(x * x); } or

add css class to the form (Yii form builder) -

how can add css class or id form element has been created yii form bui imagine have created form follows: controller: public function actionregistration() { $form = new cform('application.views.user.registerform'); $form['user']->model = new users; $form['profile']->model = new profile; if(isset($_post['users'])) { $form['profile']->model->attributes = $_post['profile']; $_post['users']['mobile'] = $_post['profile']['mobile']; $form['user']->model->attributes = $_post['users']; if($form->validate()) { $user = $form['user']->model; $profile = $form['profile']->model; if($profile->save(false)) { $user->profile_id = $profile->id; $user->save(false); } } else {

ios - CGAffineTransformMakeRotation -

i'm learning use cgaffinetransformmakerotation can't work, have searched on web , can't find solution i making clock, when test arrow doesn't rotate straight, moves @ same time. -(void)tick{ nscalendar *calender = [[nscalendar alloc]initwithcalendaridentifier:nsgregoriancalendar]; nsuinteger units = nshourcalendarunit|nsminutecalendarunit|nssecondcalendarunit; nsdatecomponents *components = [calender components:units fromdate:[nsdate date]]; cgfloat secsangle = components.second*m_pi*2.0/60; self.secondhand.transform = cgaffinetransformmakerotation(secsangle); } thanks in advance :) first of all, when testing, use known value, m_pi/2.0 , instead of secsangle anything. second, keep in mind rotation around center of view/layer default. can change that, it's change it.

css - HTML elements to fill the widths of their table cells, but with a small & consistent bit of padding around -

answered own question. here answer: table, th, td { border:1px solid black; padding-left:4px; padding-right:4px; } input[type="text"], button, select { width: 100%; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } in webpage (source code below), several elements not fill widths of table cells: input text fields, grade selects, , insert button. desired result i each fill width of table cell, small bit of padding around it, delete button has around it. i have tried various combinations of css styles, including 'width:100%', 'padding:2px', plus others. however, have have not been able obtain combination yield desired result. might know how can achieve desired result? i using chrome version 33.0.1750.154 m, , html source code is: <!doctype html> <html> <head> <meta charset='utf-8'> <titl

c - Pointer to a stack allocated char array -

i have array stack allocated , used hold error messages. in cases call function returns error code , based on code know add array, use simple array: char buf[1024]; now have function can return error code or can provide "results." in case array holds results allocated elsewhere , there no reason copy 1 array other want use pointer array , pass around. way, if function returns without error, buf ready consumed. this: char _buf[1024]; char **buf = &_buf; obviously won't work because types wrong. casting char** compiles (fwiw, i'm using gcc -std=c99 -w -wall -g -gdb ) segfault when try use *buf . char _buf[1024]; char **buf = (char**)&_buf; the current solution have using intermediate variable seems want in round way: char _buf[1024]; char *tmp = _buf; char **buf = &tmp; so, question is: there more appropriate way accomplish these 3 lines? assuming means think does: now have function can return error code or can provide &qu

ios - How to keep fps rate constant in sprite kit? -

working on game ios, using sprite-kit framework build it. game runs smoothly first minute in half (maintaining 60 fps rate), player progresses game, frame rate starts decrease. time drops low 8 fps. thought result of added debris , obstacles in game, made effort remove lot of them parent after time. how game set up: there 6 nsmutablearrays different types of debris fall in game. format each of them: -(void)spawndebris6 { skspritenode * debris6 = [skspritenode spritenodewithtexture:[sktexture texturewithimagenamed:@"debris6.png"] size:cgsizemake(20, 20)]; debris6.zposition = 1.0; skemitternode *debristrail = [skemitternode kitty_emitternamed:@"dtrail"]; debristrail.zposition = -1.0; debristrail.targetnode = self; [debris6 addchild:debristrail]; debris6.physicsbody = [skphysicsbody bodywithcircleofradius:25]; debris6.physicsbody.allowsrotation = no; debris6.physicsbody.categorybitmask = collisiondebris; //set rando

php - MySQL REGEX with prepared statement: "?" being misunderstood -

i've consulted this question problem, couldn't seem see answer. i have prepared statement ? placeholder param i'm binding. problem is, mysql doesn't seem because it's inside regex block, so: $sql = 'select id teams name regexp "^(?)"'; $stmt = $db->prepare($sql); $stmt->bind_param('s', implode('|', $letters)); this throws: "got error 'repetition-operator operand invalid' regexp" is there way of escaping ? or something? [edit] based on comment below, tried: $sql = 'select id teams name regexp "^(:letters)"'; $stmt = $db->prepare($sql); $stmt->bind_param(':letters', implode('|', $letters)); now error "warning: mysqli_stmt::bind_param(): number of elements in type definition string doesn't match number of bind variables" interestingly, note i'm using bind_param() php docs say bindparam() . me, latter undefined method.

twitter bootstrap - PHP split while loop into 3 columns to avoid page break -

Image
i using php while loop review data database. however, when reviews longer 1 line breaks grid system (i using bootstrap 3) , page looks messy. have thought 2 solutions, read more button , show fixed height of boxes. alternatively, split data received database 3 columns not break page. preferably split data loop shows data in 3 columns. this while loop fetches data: <?php while($row = mysqli_fetch_array($result)) { $data = mysqli_fetch_array(mysqli_query($con, "select first_name, last_name transactions order_id = '{$row['order_id']}'")); $name = $data['first_name']. ' '. mb_substr($data['last_name'], 0, 1); if($row['rating'] == 5) $star = '<span class="glyphicon glyphicon-star review_star"></span><span class="glyphicon glyphicon-star review_star"></span><span class="glyphicon glyphicon-star review_star"></span>

api - Using cURL command with Ruby? -

want scrape bunch of tweets via twitter api, output curl command, that curl --get 'https://api.twitter.com/1.1/search/tweets.json' --data 'q=football' --header 'authorization: oauth oauth_consumer_key="**hidden**", oauth_nonce="**hidden**", oauth_signature="**hidden**", oauth_signature_method="hmac-sha1", oauth_timestamp="**hidden**", oauth_token="**hidden**", oauth_version="1.0"' --verbose my question, there way use command ruby script scrape tweets ? using twitter gem available here http://rdoc.info/gems/twitter following code can tweets ruby script. require 'twitter' client = twitter::rest::client.new |config| config.consumer_key ="hidden" config.consumer_secret ="hidden" config.access_token ="hidden" config.access_token_secret ="hidden" end client.search("football").collec

c# - Create or load controls without freezing the window -

when browser opened, before it's loaded, can use controls others being loaded (the address bar appears and, while bookmarks loaded, can type in it). i'm making personal browser, , don't know how perform that. imagined creating controls in thread, discovered that's not possible. in last question (where discovered above), received answer talking attribute, reflection, async/await modifiers , observable collection closest solution , i'll study them yet. in new question, receive others suggestions of how made (allow user use window , controls while others being created/loaded). thanks in advance. actually believe process of loading ui part of controls isn't heavy one. in other hand, loading data later bound control the problem . you can't draw controls outside ui thread, can load heavy data, preload resources or calculation in background thread. while heavy controls' data prepared hit ui in background thread, ui still responsive.

performance - Making dynamic layout for each row in ListView in android -

i have xml file contains basic layout each row of listview(which realtive layout , has textview inside it). i want change attributes of layout each row of listview different layout width , height of each row. want set values of width , height dynamically. is there way around this? my xml file want change, height , weight dynamically, each view <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:id="@+id/item1" android:layout_width="wrap_content"> <textview android:id="@+id/text" android:layout_height="wrap_content" android:gravity="center_vertical" android:text="text" android:visibility="visible" android:layout_width="wrap_content" android:textcolor="#ff2