Posts

Showing posts from July, 2010

ios - Smooth UITableView Cell Expansion With Accordion Style -

Image
my table view can expand , collapse cells when pressed, content appears when cell expands loads before animation finished. what left this: what this example . content appears if behind curtain , cell expansion animation reveals it. here code controls table view: class historyviewcontroller: uiviewcontroller, uitableviewdatasource, uitableviewdelegate{ var expandedindexpath: nsindexpath? // index path of cell expanded let collapsedheight: cgfloat = 44.0 // constant set default collapsed height var tickethistoryservice = tickethistoryservice() // service gather info ticket history coredata var tickets = [ticket]() @iboutlet var tableview: uitableview! override func viewdidload() { super.viewdidload() // remove appended table view cells tableview.tablefooterview = uiview() self.tickets = self.tickethistoryservice.fetchdata() // load inital data } // mark: - table view methods func tableview(tablevie

php - Can you install unstable packages just with command-line? -

to install latest development version of given package , on conflict requirements or minimum-stability error understand have create composer.json file , set minimum-stability dev . is possible grant appropriate permissions right command-line reasonably simple command or command set? apparently, command has --stability argument composer init forces through , endless interrogation gets on way when you're write code not packagist: c:\tmp\foo>composer init --stability dev welcome composer config generator command guide through creating composer.json config. package name (<vendor>/<name>) [alvaro.gonzalez/foo]: description []: author [, n skip]: n minimum stability [dev]: package type (e.g. library, project, metapackage, composer-plugin) []: license []: define dependencies. define dependencies (require) interactively [yes]? no define dev dependencies (require-dev) interactively [yes]? no { "name": "alvaro.gonzalez/foo",

objective c - Not getting file size in dropbox for iOS -

i working on dropbox integration ios , i've done suppose do, getting files , can download too, cant file size of before download or in meta information. here how doing in view did load. if ([[dbsession sharedsession] islinked]) { [self showprogresshud]; [[self restclient] loadmetadata:@"/"]; } - (void)restclient:(dbrestclient *)client loadedmetadata:(dbmetadata *)metadata { if (metadata.isdirectory) { [self hideprogesshud]; filelist=[[nsmutablearray alloc]initwithcapacity:0]; (dbmetadata *file in metadata.contents) { [filelist addobject:file]; } } getting nil response on file.totalbytes kindly guide me how file size before downloading file size in dropbox than,s dbmetadata contains information files contains totalbytes , humanreadablesize for (dbmetadata *file in metadata.contents) { nslog(@“file size: %@”,file.humanreadablesize); // file.humanreadablesize contains size in nsstring [filelist addobject

javascript - jQuery add a class to an element if there is another element on the page -

i want hide div container when there no <h5> in it. div container hide. when server pulls feeds other website, <h5> add inside div container. div should show on page. here simplify version of html structure without out <h5> <div id="alert-feed"> <div class="webpart-title">title</div> <div class="webpart-body"> <div class="contianer"> <ul class="feedlist"> <li class="campusfeed"> <ul class="articlelist"></ul> </li> </ul> </div> </div> </div> here html <h5> <div id="alert-feed"> <div class="webpart-title">title</div> <div class="webpart-body"> <div class="contianer"> <ul class="feedlist"

asp.net mvc - How To create Audit table in sql server ? i need to create each audit table or can manage single table all audit -

i using mvc5. created entity framework. have totally 15 tables . want recent activity in project . have plan use audit table . need create audit each table or single table can mange ? fields come on inside audit table ? i have tp_users table id int unchecked username nvarchar(50) useremail nvarchar(50) displayname nvarchar(50) password nvarchar(50) roleid int isactive bit clientid int now want create audit table tp_users table .whare fields come inside audit table ? how use audit table entity framework ? we use entity below: public class audit { [required] [stringlength(6)] public string action { get; set; } public string changes { get; set; } public string pk { get; set; } [required] public datetime revisionstamp { get; set; } [required] [stringlength(50)] public string tablename { get; set; } [required] [stringlength(50)] public string username { get; set; } } we use au

unix - Kill a process in remote linux machine using batch file -

i new field , need kill process running in remote linux machine have started nmon process using batch file.... batch file contains start putty command invokes .sh file in remote , start nmon... now need kill process using batch file. tried using kill pgrep nmon..... when execute batch file showing "network error. couldnt connect specified address" is there way kill process using batch file uses putty windows machine??? instructions execute remote instruction using ssh connection windows non-interactive shell using credentials: create text file list of commands executed. (examaple: create file c:\remote_commands.txt command pkill process-name inside) execute cli or create batch line this: c:\path\putty.exe -ssh user@ip-address -pw password -m c:\remote_commands.txt some commands may require user administrative privileges, carefull point. that's all, try , enjoy! there similar questions at: https://unix.stackexchange.com/questions/116672/run

php - Stored Procedure in phpmyadmin -

i first timer in using phpmyadmin . not aware in stored procedure working in code. don't know how make stored procedure in phpmyadmin . this code: delimiter $$ create procedure sp_1_service_card_report(in service_card_no int) begin declare error_1 int; select count(service_card.customer_id) error_1 service_card service_card.id = 27; declare error_2 int; select count(service_card.serial_no_id) error_2 service_card service_card.id = 27; if error_1 > 0 , error_2 > 0 select service_card.id yes service_card service_card.id=27; else select service_card.customer_id no service_card.id=27; end if ; end $$ delimiter ; this error: mysql said: documentation 1064 - have error in sql syntax; check manual corresponds mariadb server version right syntax use near 'declare error_2 int; select count(service_card.serial_no_id) ' @ line 11 can guys me this? s

java - Iterating over a two level structure using nested iterators -

i have following 2 level xml structure. list of boxes, each containing list of drawers. <boxes> <box id="0"> <drawers> <drawer id="0"/> <drawer id="1"/> ... </drawers> </box> <box id="1"> ... </box> </boxes> i'm parsing using stax , exposed structure through 2 iterators : boxiterator implements iterator<box>, iterable<box> box implements iterable<drawer> draweriterator implements iterator<drawer> i can following: boxiterator boxlist; (box box : boxlist) { (drawer drawer : box) { drawer.getid() } } under hood of iterators i'm using stax , both of them accessing same underlying xmlstreamreader . if call boxiterator.next() influence result returned on subsequent calls draweriterator.next() because cursor have moved next box. does break contract of iterator

using terminal command into python code -

i have file named myosm.osm . if run command $ ogrinfo myosm.osm then following output: had open data source read-only. info: open of `myosm.osm' using driver `osm' successful. 1: points (point) 2: lines (line string) 3: multilinestrings (multi line string) 4: multipolygons (multi polygon) 5: other_relations (geometry collection) i want implement command python code , want output in variable further use. using plumbum : from plumbum.cmd import ogrinfo output = ogrinfo('myosm.osm') (to install: pip install plumbum )

python - How can I create a word that does not contain the previous letter contained in the word? -

i see point of question stays in first elif : import random rnd vowels="aeiou" consonants="bcdfghlmnpqrstvz" alphabet=vowels+consonants vocabulary={} index=0 word="" positions=[] while index<5: random_lenght=rnd.randint(2,5) while len(word)<random_lenght: random_letter=rnd.randint(0,len(alphabet)-1) if len(word)==0: word+=alphabet[random_letter] elif random_letter != positions[-1] , len(word)>0: if word[-1] not in vowels: word+=alphabet[random_letter] if word[-1] not in consonants: word+=alphabet[random_letter] elif random_letter == positions[-1]: break if random_letter not in positions: positions.append(random_letter) if word not in vocabulary: vocabulary[index]=word index+=1 word="" the result doesn't satisfy me suppose: {0: 'in', 1: 'th&

angular - Angular2: Get selected option in select component -

i using angular 2.0.0-rc.4. i have form (parent component), , have in drop-down lists other components, each dropdown has ts , html template else where, each 1 data component. when submitting form need selected value of each one. how can access parent ? -parent form html: <form class="" (submit)="submitnewmodel($event, label.value)"> <div class="form-group"> <label for="label" class="control-label"> label </label> <input type="text" name="label" #label class="form-control" placeholder="model's label"> </div> <styles-dropdown></styles-dropdown> <colors-dropdown></colors-dropdown> <modes-dropdown></modes-dropdown> <shapes-dropdown></shapes-dropdown> <button type="submit" name="button">create new model</button> </form> -par

javascript - Angular 2, TypeScript & ui-router - How to get state params -

hey wondering how state params state using angular 2, typescript & ui-router. tried reviewing new docs don't seem have documentation ng2 ui-router. below have added component.ts reference. appreciated. import {component} '@angular/core'; import {http_providers} '@angular/http'; import {uirouter} 'ui-router-ng2/router'; @component({ selector: 'detail', template: require('./detail.html'), providers: [http_providers] }) export class detail { constructor(private uirouter:uirouter) { console.log('uirouter ', this.uirouter.globals.params); } } in angular 1 follows: (function() { 'use strict'; angular .module('private') .controller('controller', controller); function controller($state) { var vm = this; console.log($state.params.studentid); } })(); again advice appreciated. i able resolve state param issue having doing following: import {component} '

How to add audio at specific time on video using ffmpeg? -

i want add audio on new created video. in this, have want add on specific time duration using ffmpeg. ffmpeg -y video.mp4 -itsoffset 00:00:30 -i music.ogg -map 0:0 -map 1:0 -c:v copy -shortest out.mp4 the -itsoffset option here means 30 seconds start.

Can not check the radio button dynamically using Javascript/Jquery -

i need 1 help. need check radio button dynamically using javascript/jquery. explaining code below. <div style="float:left; margin-right:10px;"> <input type="radio" name="answer_type0" id="answer_type0" onclick="selectscale(this.value,'0');" value="5736db13ed8cda709ffc8918">scale <input type="radio" name="answer_type0" id="answer_type0" onclick="selectscale(this.value,'0');" value="5736daffed8cda709ffc8917">yes/no <input type="radio" name="answer_type0" id="answer_type0" onclick="selectscale(this.value,'0');" value="5736db29ed8cda709ffc8919">written </div> <span> <button type="button" id="btn" name="btn" onclick="setradiobuttonvalue()">set</button> </span> here 3 radio button available .when user c

Python function with default argument inside loop -

for in range(5): def test(i=i): print(i) test() test() test() test() test() this prints 4 every time? can me understanding this. you redefine test 4 times: same as: #define test def test(i = 0): print(i) #redefine test def test(i = 1): print(i) #redefine test def test(i = 2): print(i) #redefine test def test(i = 3): print(i) #redefine test def test(i = 4): print(i) so have 1 test() last one.

postgresql - How to get a subquery in FROM clause in Django ORM -

i'm trying express following (postgres) sql statement using django orm: select v.id, v.min_salary, v.max_salary, v.min_weekly_hours, v.max_weekly_hours p.min_start_date, p.max_end_date vacancy v, ( select id, vacancy_id, min(start_date) min_start_date, max(end_date) max_end_date vacancypublication (active = true , site_id = 1 , start_date <= current_timestamp) group id, vacancy_id ) p p.vacancy_id = v.id , v.workflow_status = 'a' order p.min_start_date desc; the problem i'm using subquery in clause (also known "inline-view"). i've tried using .extra(tables=['...']) django adds quotes statement, making sql invalid. i'd rather not resort .raw query. there way this? maybe through reusable app if core api doesn't provide way. edit : this (seemingly) equivalent statement using join: select v.id, v.code, v.min_salary, v.max_salary, v.min_week

python - Django sort by Articles with most similar tags -

i have model articles , tags, using filter suggestions. the article tags tags = article.tags.all() filter article.objects.filter(tags__in=tags)[:5] i'd add sort tags similar. model article , tags class article(models.model): ... tags = models.foreignkey(tag, blank=true, null=true) class tag(models.model): name = models.charfield(max_length=20, blank=true) i suggest use app django-taggit . taggablemanager has method similar_objects want.

Android bitmap recycling in widget -

a bitmap on widget updates every second. after approximately 20 seconds exception: java.lang.illegalargumentexception: remoteviews widget update exceeds maximum bitmap memory usage (used: 12572000, max: 12441600) i think because there no bitmap recycled ? ***edit*** i recycle bitmap mentioned in question / answer: redraw widget every second however error occurs: java.lang.illegalstateexception: can't parcel recycled bitmap my updated code: bitmap bitmap, lastbitmap; private static void updatetime(remoteviews views, context context, appwidgetmanager appwidgetmanager, int appwidgetid){ [...] bitmap = [...] //here create bitmap views.setimageviewbitmap(r.id.image_countdown, bitmap); try { appwidgetmanager.updateappwidget(appwidgetid, views); } catch (illegalargumentexception e){ e.printstacktrace(); } if(lastbitmap != null) { lastbitmap.recycle(); lastbitmap = null; } lastbitmap = bit

maven - jgitflow error: Error starting release: Error starting release: Working tree has untracked files -

i've got monday morning kind of problem on thursday , need stackoverflow magic here. i'm using jgitflow plugin maven in order automate of release process. unfortunately i'm hitting problem when trying start new release using mvn jgitflow:release-start : [error] failed execute goal external.atlassian.jgitflow:jgitflow-maven-plugin:1.0-m5.1:release-start (default-cli) on project <myprojectname>: error starting release: error starting release: working tree has untracked files however cannot see , untracked files here (nor on master): git status on branch develop branch up-to-date 'origin/develop'. nothing commit, working directory clean any idea how jgitflow find untracked files? fixed allowing untracked files: <plugin> <groupid>external.atlassian.jgitflow</groupid> <artifactid>jgitflow-maven-plugin</artifactid> <version>1.0-m5.1</version&g

php - Mysql Search "I" Case Insensitive -

i'm working laravel project, , noticed problem. in database (mysql) fields stored uppercase. when search below, have problem. $query->where(function ($query) use ($q) { $query->orwhere('product', 'like', '%'.$q.'%'); $query->orwhere('stock_code', 'like', '%'.$q.'%'); $query->orwhere('barcode', 'like', '%'.$q.'%'); $query->orwhere('hs_code', 'like', '%'.$q.'%'); }); for example findik turkish word. , when user search fındık no results found. i'm using unicode_general_ci mysql tables. , head codes below. <!doctype html> <html lang="tr"> <head> <meta charset="utf-8"> what should do? people offers mysql lower method. hope there exists better way. $query->where(function ($query) use ($q) { $query->orwhere('product', 'ilike', &#

jquery - How to click at position in Canvas using Javascript? -

i want click canvas element have id mycanvas width: 500, height: 200. in javascript, have method this? using page ruler - chrome extension position include parameter x , y . i tried code: function relmousecoords(event){ var totaloffsetx = 220; var totaloffsety = 100; var canvasx = 500; var canvasy = 200; var currentelement = this; do{ totaloffsetx += currentelement.offsetleft - currentelement.scrollleft; totaloffsety += currentelement.offsettop - currentelement.scrolltop; } while(currentelement = currentelement.offsetparent) canvasx = event.pagex - totaloffsetx; canvasy = event.pagey - totaloffsety; console.log(canvasx, convasty); return {x:canvasx, y:canvasy} } htmlcanvaselement.prototype.relmousecoords = relmousecoords; click on element via js can done trigger . using jquery: x_coord = 1; y_coord = 1; var e = jquery.event( "mousedown", { pagex: x_coord, pagey: y_coord } ); $('#

python - How to retrieve patient and study detail from DCM4CHEE? -

i need fetch data dcm4chee uploaded modality. as tried utility tools like: getscu: retrieves .dcm file of particular studyinstanceid don't want download .dcm images, i need fetch information like: patientid, accessionnumber , studyid using querytool of dcm4chee. first of all, not "good practice" create patient information directly dcm4chee. correct workflow his/ris send request in fotmato hl7 orm, this: msh|^~&\|cpx-ris|example hospital|pacs||20050701||orm^o01|71200517353359|p|2.3||||||| pid|1|807|eth0809||johnson^karen||12130919120000|f||0|4708 indian paint^^example^texas^77777|williamson|||0|0|0|eth0809||^0^20050701120000|||||||||| pv1|1|o|||||3^jack^johnson|162^speed^john|||||||||||en01156|||||||||||||||||||||||||20050701174500|||||||| orc|nw|ex01369|ex01369||||^^^20050701174500||20050701|2^frontdesk||||||||| obr|1|ex01369|ex01369|1299^ct abd/pelvis w/o contrast & 3drecon||||||||||||||||||||ct|||^^^20050701174500|||||||||20050701174500|||

swift - Call a function which expects arguments with SKAction.runBlock() -

i'm working swift , spritekit i'd use skaction.runblock() run function expect arguments : class tile : skshapenode { } override func didmovetoview() { let tile = tile() tile.runaction(skaction.runblock(myfunc(tile))) } func myfunc(tile: tile) { } when try create function doesn't expect argument, works fine, code above returns this: cannot convert value of type '()' expected argument type 'dispatch_block_t' (aka '@convention(block) () -> ()') what not understanding ? with writing sort of expression: skaction.runblock(myfunc(tile)) you passing result of calling myfunc(tile) . (i believe not think code: skaction.runblock(sin(0)) , pass sort of closure runblock .) and returned value myfunc(tile) void value, myfunc declared return nothing. void value can represented () . error message says () cannot converted closure of type @convention(block) () -> () . thus, need create closure of type @conventio

android - Null User Id's recorded by firebase -

we linking our firebase analytics data bigquery , upon analyzing found user id's null several users. in scenarios can happen? , solution same. the bad behavior when user_id property populated value. property user_id should null except if set explicitly call function: android function: setuserid(...) ios function: setuserid(...) if don't explicitly call setuserid , common, id should use in bigquery app_instance_id . my advice: call setuserid once have logged in user (in facebook, google sign-in or whatever method offer). give cross-device id. if user not logged in, don't call it, , use app_instance_id id instead. note app_instance_id change if user uninstall & reinstall app.

xamarin.android - How to notify change in ItemSource for repeater view Xamarin forms -

i'm trying implement itemsource in stacklayout in xamarin..fforms using repeaterview. example here . now whenever there change in observablecollection in viewmodel, repeaterview class not able notify change there no inotifycollectionchanged property. how add property repeaterview class ? here's code: private observablecollection<string> _username = new observablecollection<string>(); public observablecollection<string> username { { return _username; } set { setproperty(ref _username, value); } } on button click i'm adding strings list: username.add("user_1"); username.add("user_2"); username.add("user_3"); username.add("user_4"); you try this: var names = new list<string>(); names.add("user1"); names.add("user2"); names.add("user3"); username = new observablecollection(names);

Why Smooch not receiving Images from admin? -

i implemented smooch in project , configured receive emails when users message me. when user sends image our app our admins receive them if admin tries reply image doesn't, admin can respond text. how can send image replies users on email? unfortunately smooch doesn't support responding users image attachments via email. best workaround exists post image somewhere internet visible , send user link. note other smooch business app integrations support sending images users using special syntax looks this: ![](image_url_here) , syntax not supported business-facing email channel. can find more info these special syntaxes here .

process - Is there any limitations to number of running processes on host? -

in platform file have 1 host: <host id="worker1" speed="100mf" core="101"/> then in worker.c create 101 (or > 100) processes expecting each on each core 1 process launched. noticed 100 first processes able execute task or write xbt_info : int worker(int argc, char *argv[]) { (int = 0; < 101; ++i) { msg_process_create("x", slave, null, msg_host_self()); } return 0; } int slave(){ msg_task_execute(msg_task_create("kotok", 1e6, 0, null)); msg_process_kill(msg_process_self()); return 0; } other processes above 100 first ones unable manage , kill: [ 1.000000] (0:maestro@) oops ! deadlock or code not clean. [ 1.000000] (0:maestro@) 1 processes still running, waiting something. [ 1.000000] (0:maestro@) legend of following listing: "process <pid> (<name>@<host>): <status>" [ 1.000000] (0:maestro@) process 102 (x@worker1): waiting execution

JAVA default value design reason -

this question has answer here: why must local variables, including primitives, initialized in java? 6 answers in java world, field variables have default values if don't initialize them, while local variables don't. i have considered lot , searched lot still don't understand. why java world design that? way, think has heap , stack. local variables easier check variable initialised in relatively limited scope when can determine code paths. doesn't right job unless code confusing. final fields have initialised, though once. when 1 constructor calls another, can confused. for non final fields, hard ensure field initialised before used possible code paths. e.g. how can ensure setter called before getter if calls made class might changed in future. instead jvm leaves default values , makes problem worry about.

Delete Row from MySql Table using Hibernate -

hello fresher took application online trying run parameters using is maven springmvc mysql java eclipse i able create table in database code , delet when trying dete withoutr using save option it's giving me error ****org.hibernate.event.def.defaultdeleteeventlistener deletetransiententity info: handling transient entity in delete processing**** when checked online show object of row in app.java page delete object delete row don't know how object , how pass row of database in object(how field mbedded object , how object)plz want delete row database base on column name specific value app.java class package com.mkyong.common; import org.hibernate.session; import com.mkyong.persistence.hibernateutil; public class app { public static void main( string[] args ) { system.out.println("maven + hibernate + mysql"); session session = hibernateutil.getsessionfactory().opensession(); session.begintransaction(); stock stock =

ruby on rails - Custom devise controller not working -

Image
i have 2 models resident , user. both of them contains roll_number attribute, have entered data in resident model want, when user register devise resource checks if resident there of same roll_number in resident model? , user can registered !! added attribute (roll_number) devise's user model, edited create method of registrations controller here's code of : class users::registrationscontroller < devise::registrationscontroller before_action :configure_sign_up_params, only: [:create] before_action :configure_account_update_params, only: [:update] # /resource/sign_up # def new # super # end def create super resident = resident.find_by(roll_number: params[:roll_number]) if resident.present? @user = resident.create_user(params) if @user.save flash[:info] = "welcome messpay" redirect_to root_url else render 'new' end else flash[:danger] = "you have entered worng rol

xamarin.android - button onclick event dont work in xamarin -

i have problem code. have created button "sign up", want when click on button dialog called "dialog_signup appear. the problem doesnt appear. , error far **2>a numeric comparison attempted on "$(_devicesdkversion)" evaluates "" instead of number, in condition "$(_devicesdkversion) >= 21". 2>build failed. 2> ========== build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ========== ========== deploy: 0 succeeded, 1 failed, 0 skipped ==========** here code mainactivity.cs using system; using android.app; using android.content; using android.runtime; using android.views; using android.widget; using android.os; using android.content.res; namespace gamelandplus { [activity(label = "gamelandplus", mainlauncher = true, icon = "@drawable/icon")] public class mainactivity : activity { private button mbtnsignup;

Java FTP: Can't delete local file after upload to FTP -

i'm not able delete local file after successful upload ftp (so goal delete local file right after upload done). suspects fileinputstream blocks local file i'm not sure. maybe there else can't see. fine. i'm using org.apache.commons.net.ftp.ftp. here part of code: public class ftpconnection { string ftp_server; string ftp_user; string ftp_password; int ftp_port; public ftpclient ftpclient; int attempts = 3; long file_size; public ftpconnection(string ftp_server, string ftp_user, string ftp_password, int ftp_port) { ftp_server = ftp_server; ftp_user = ftp_user; ftp_password = ftp_password; ftp_port = ftp_port; ftpclient = new ftpclient(); ftpclient.enterlocalpassivemode(); ftpclient.setbuffersize(1024 * 1024 * 1024); ftpclient.setconnecttimeout(120000); ftpclient.setdatatimeout(60000); try { ftpclient.connect(ftp_server, ftp_port); int replycode = ftpclient.getreplycode(); if (!ftpreply.i

javascript - Uncaught SyntaxError: Unexpected token import in "backbone.radio.js" -

i'm trying migrate application backbone marionette (v3), got stuck in point 2 days already. when try run app in browser, error shows in console (and screen blank): uncaught syntaxerror: unexpected token import in backbone.radio.js:1 first line in backbone.radio.js import statement underscore : import _ 'underscore'; i use requirejs module loader. configuration in main.js : require.config({ paths: { jquery: '../bower_components/jquery/dist/jquery', underscore: '../bower_components/underscore/underscore', backbone: '../bower_components/backbone/backbone', 'backbone.radio': '../bower_components/backbone.radio/build/backbone.radio', 'backbone.babysitter': '../bower_components/backbone.babysitter/src/build/backbone.babysitter', marionette: '../bower_components/marionette/lib/backbone.marionette', bootstrap: '../bower_components/bootstrap/dist/js/bootstrap',

import - Python class, data structure and proper architecture -

i'm writing program, request user information different services, puts them in ways. manages stuff , slack interaction. python projects problematic @ size. imports start become recursive , handling data around becomes annoying. a quick example of problem come across can shown simple example. have main module (here a) creates main objects (singletons). these objects need call functions each other, use main connector. in given example don't understand when b created list requests (none) nonetype. getter function not way go, helped in situation. have tips, reads point, how structure middle-sized python programs. thanks! import b some_list = none b = none def get_list(): return some_list if __name__ == "__main__": some_list = [1,2,3] b = b.b() print b.my_list and module b from import get_list class b: def __init__(self): self.my_list = get_list().map(lambda v : v * 2) # crash here! you have two copies of main module no

css li content displays wrong characters in UTF-8 -

i trying create style display arrow on place of li element. $("html > head").append("<style id=styles>div#panel { position: absolute; border-radius: 3px; font-family:'arial black'; font-size:13px; }\n\r" + "ul li:before { content: \"\00bb \8680\"; }" + "</style>\n\r"); what see mishmash characters not arrow. page charset utf-8. i read this: http://www.artishock.net/coding/css-list-styling-using-ascii-special-characters/ http://www.w3schools.com/charsets/ref_utf_arrows.asp how fix it? try this. replace content: \"\00bb content: '\\00bb' . working example: $(function() { $("html > head").append("<style>div#panel{ position: absolute; border-radius: 3px; font-family:'arial black'; font-size:13px; } ul { list-style: none; } ul li:before{ content: '\\00bb'; margin-right: 10px; } </style>"); }); <script src=&q

angularjs - WebStorm 2016.2 live edit for a node.js app not working -

i'm working on node.js , angular.js app webstorm 2016.2 live edit function doesn't work, have restart server each change on node.js side. (changes in angular are seen in browser without server restart.) i checked , live edit plugin installed. tried both in run , debug modes. missing?

android - RelativeLayout does not expand with the heights of view elements -

Image
i have relative layout set wrap_content in height. has 2 textview , 2 edittext. however, relativelayout not match height of edittexts. dashed rectangle region highlighted android studio preview tool borders of relativelayout. the actual problem when run app bottom edittext kind of goes below relative layout , bottom part disappears. thereby, user can't see bottom line , don't know there textfield. android studio preview: problem , result on emulator: xml file: <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:paddingbottom="@dimen/activity_vertical_margin" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin"> <android.support

android - fragment container won't fill parent -

Image
as guys can see in image, fragment container exceeds smartphone screen, height set fill_parent, , it's included in (the custom view , drawer layout) fill_parent too. shouldn't fragment filling parent? <?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.drawerlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="fill_parent"> <android.support.design.widget.coordinatorlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="fill_parent" xmlns:app="http://schemas.android.com/apk/res-auto" android: