Posts

Showing posts from July, 2011

ios - How to use a custom UIView multiple times in a controller with different content? -

Image
i have created own custom uiview popover have display on screen. uiview looks this: class helptipspopover: uiview { weak var title: uilabel! weak var mytext: uilabel! override init(frame: cgrect) { super.init(frame: frame) let strongtitle = uilabel() title = strongtitle let strongmytext = uilabel() mytext = strongmytext self.addsubview(strongtitle) title.translatesautoresizingmaskintoconstraints = false if selected == true{ title.text = "search" title.font = uifont(name: "helveticaneue-bold", size: 12) title.textcolor = uicolor.trlmblueblackcolor() let leftconstraint = nslayoutconstraint(item: title, attribute: .leading, relatedby: .equal, toitem: self, attribute: .leading, multiplier: 1.0, constant: 10) let topconstraint = nslayoutconstraint(item: title, attribute: .top, relatedby: .equal, toitem: self, attribute: .top, multiplier: 1.0, constant: 10) self.addconstraints([leftconstraint, topconstrai...

c# - Poor performance in tree pruning -

i made i'm calling treepruner . purpose: given hierarchy starting @ list of root level nodes, return new hierarchy new root nodes highest level nodes meet condition. here class. public class breadthfirstpruner<tresource> { private ienumerable<tresource> originallist; private ienumerable<tresource> prunedlist; private func<tresource, icollection<tresource>> getchildren; public breadthfirstpruner(ienumerable<tresource> list, func<tresource, icollection<tresource>> getchildren) { this.originallist = list; this.getchildren = getchildren; } public ienumerable<tresource> getprunedtree(func<tresource,bool> condition) { this.prunedlist = new list<tresource>(); this.prune(this.originallist, condition); return this.prunedlist; } private void prune(ienumerable<tresource> list, func<tresource,bool> condition) { if (li...

c# - WPF Validate/Setter calls in wrong order -

i have textbox inside tabcontrol. textbox binding has updatesourcetrigger=lostfocus. textbox uses attribute based validation data model. validation working correctly. in tabcontrol.selecteditemchanged event call modelobject.validate() , prevent switch different tab if error occurs. problem have order of execution backwards. validate call occurs before property setter. in case of invalid field able switch away tab though error has been detected. how order or these events ordered properly? is there way cancel tabcontrol.items.currentchanging? https://social.msdn.microsoft.com/forums/vstudio/en-us/d8ac2677-b760-4388-a797-b39db84a7e0f/how-to-cancel-tabcontrolselectionchanged?forum=wpf seems work subscribing currentchanging event. can cancel tab changing action setting currentchangingeventargs cancel true

Creating combinations using Excel -

i wondering if there function, or combination of functions (maybe requires vba) in excel me solve following problem: there 8 people in group. need figure out , display of possible, non-repeating combinations created when 4 people selected out of 8. order of selected individuals isn’t important. need find of unique combinations. for example: 8 people bob, carol, ted, alice, reed, sue, johnny, ben (cells a1 through a8 each contain 1 of names). one combination bob, ted, reed, johnny. problem order of names isn’t important meaning bob, ted, reed, johnny same ted, bob, johnny, reed. combination of 4 people counts 1 instance. i’m not trying figure out how many combinations possible. need see possible combinations. i built binary evaluator: public sub debugallcombinations(lpicksize long, spossibilities string, optional sdelimiter string = ";") dim long dim j long dim sbin string dim apos...

c# - Json.NET Deserializing Root and Subschema Data -

this question has answer here: deserializing json data c# using json.net 8 answers i'm new json , i'm retrieving following structure api call... { "customers":[ { "code":"11111", "alpha":"a", "name":"test a", "address":{ "contact":"john doe", "address1":"po box 111", "address2":"", "address3":"", "city":"de pere", "postcode":"54115", "state":"wi", "country":"usa" ...

nasm - cross-platform self-modifying code (Intel/AMD only) -

i have searched considerably answer without success. in debugger, 1 may write instructions , execute them. requires special permissions in executable image. seek perform function without debugger. please show me asm "hello world" program has self-modifying code (perhaps replacing series of 090h code uppercase 'h' in hello) , commands necessary enable execution. next 2 lines before , after machine code h->h replacement. 90 90 90 90 90 90 90 90 90 90 90 ; 11 nops 8a 26 50 00 80 e4 df 88 26 50 00 ; mov ah,[bx]; , ah,0dfh; mov [bx],ah; i have complete competence , confidence constructing iapx86 machine code. problem convincing linux, darwin/yosemite, , windows allow execution. in end, want able construct , modify executable on-the-fly new language writing. architecture of new language has no parallels in modern practice. i expect criticism flying in face of convention, proceed plans notwithstanding. thank taking question seriously. code works! tur...

ios - Application stuck on the LaunchScreen without error messages -

Image
i work xcode swift 7 , 2. application worked , after few modifications, decided retest ... no longer spends launchscreen , remains blocked. no error message, nothing in console, , application not move ... returned arraière , have therefore removed changes, nothing do. no longer exceeds launchscreen. indication have in "show report navigator." run gets stuck on "debug" ... here screen: et voici le screen de mon warning lors du building : edit : bug found i found bug! not understand ... these textview in initial view problematic. when text require scroll, application works perfectly, when text short, application not load view , must surely enter infinite loop not reference me error ... have explanation? it looks like, orientation settings interrupted. info.plist part userinterfaceorientations gice hint. if launch screen, heard similar problem. in ios 9 launchscreen behave did change. can try reinstall xcode 7, people fixed it. or check in assets...

python - temporarily retrieve an image using the requests library -

i'm writing web scraper needs scrape thumbnail of image url. this function using, urlib library. def create_thumb(self): if self.url , not self.thumbnail: image = urllib.request.urlretrieve(self.url) # create thumbnail of dimension size size = 350, 350 t_img = imagelib.open(image[0]) t_img.thumbnail(size) # directory name temp image stored # urlretrieve dir_name = os.path.dirname(image[0]) # image name url img_name = os.path.basename(self.url) # save thumbnail in same temp directory # urlretrieve got full-sized image, # using same file extention in os.path.basename() file_path = os.path.join(dir_name, "thumb" + img_name) t_img.save(file_path) # save thumbnail in media directory, prepend thumb self.thumbnail.save( os.path.basename(self.url), file(open(file_path, 'rb'))) for various reasons...

c++ - Specifying input and output ranges to algorithms -

there number of use cases in standard library, , have run own code, situations want pass input , output range must same size, algorithm. @ present requires three, or 4 if want careful, iterators. there bunch of checking make sure iterators make sense. i aware array_view might, in cases, coalesce pairs of being/end iterators still leaves checks required input , output array_views might different size. has there been discussion on class contain both input , output range specifications? maybe range proposal solves or of of i'm not clear how does. i have similar use case. have found versatile method pass reference output 'container' concept rather range or pair of iterators. algorithm free resize or extend container necessary , possibility of buffer overruns disappears. for (a simple contrived) example, like: template<class inputiter, class outputcontainer> void encrypt_to(outputcontainer& dest, inputiter first, inputiter last) { dest.resize(last ...

linux - List all the revisions in a mixed revision SVN working copy -

svn working copy has mixed revisions in general case. there way list revision numbers? for example, following working copy: file01 (revision 1) file02 (revision 2) file02.2 (revision 2) file03 (revision 3) the list of revisions 1, 2, 3 . svnversion comes close, not close enough: $ svnversion 1:3 using svn info , awk , sed , this svn info -r | awk '/revision/ {print $2;}' | sort -u produces following if invoked in working directory root: 1 2 3 such multi-line output can further transformed single-line form using techniques bash turning multi-line string single comma-separated question. e.g. svn info -r | awk '/revision/ {print $2;}' | sort -u | paste -s -d, produces 1,2,3 .

java - Is there a convention that objects created using the Builder pattern be immutable? -

according book design patterns: elements of reusable object-oriented software,: the builder pattern separates construction of complex object representation same construction process can create different representations. in general builder pattern solves issue large number of optional parameters , inconsistent state providing way build object step-by-step , provide method return final object. with builder pattern go have build method generate object witch immutable. my question: can use builder pattern keeping setters methods in class of generate object, allowing possibility mutate built object ? if go produce mutable objects, shouldn't use builder pattern ? there value in builder pattern goes beyond helping solve telescoping parameter problem. they can make api easier use clients since setter methods self-naming and, therefore, easier remember. the builder pattern enables optional parameters, offered telescoping constructors using potentially awkwa...

linux - Set permission using octal notation -

i know permission set using chmod having hard time understating how convert octal number permission. for example 640 mean user has rw-r----x permission? becuase 4+2=6 , 4 = w , 0 = - ? i understand 777 wide open because user has full control fo file 4+2+1 = 7 rwx permission group has rwx , second group has rwx permission if answer question answer be. rw-r----x doing wrong? there 3 digits. first digit user permissions, second digit group permissions, third digit else's permissions. every digit formed adding subset of of 4 (read), 2 (write), 1 (execute). thus 6 4 0 means user ( 6 ) allowed read , write ( 4 + 2 ), group ( 4 ) allowed read ( 4 ), , else ( 0 ) has no permissions.

javascript - What interface do I need to implement to allow object to be passed through WebWorker's postMessage? -

webworkers api in javascript allows pass objects between worker's thread , main thread using worker.postmessage in browser , postmessage in worker. i've been playing around, , not postmessage passed arrays , objects regexp instances, assume there's interface these objects implement. example string conversion, implement .tostring method: "" + {tostring: function() {return "hello world!"}}; //prints `hello world!` similarly, can implement tojson method: json.stringify({tojson: alert}); //throws `typeerror: 'alert' called on object not implement interface window.` // - demonstrating tojson being called my question is, should implement postmessage player class pass through communication channel: function player(name) { this.name = name; } player.prototype = object.create(eventemitter2.prototype); i intentionally added inheritance part here - need object remain instance of something, not data holder. regexp , need reconst...

java - Constructor of a class cannot be applied to the given type -

i trying save data using arraylist (i have software class extends products): class software extends products{ private float ram; private float processor; public software (int productid,string productname,int productyear,string productpublishhouse) { super(productid,productname, productyear, productpublishhouse); this.ram = ram; this.processor = processor; // super(productid,productname, productyear, productpublishhouse); } public void setram(){ this.ram = ram; } public float getram(){ return ram; } } but in other class softwareproducts have declared ram , processor attributes in actionperformed(actionevent e) method float ram = float.parsefloat(ramtf.gettext()); float processor = float.parsefloat(processortf.gettext()); i getting error on section: software.softwarelist.add(new software(ram,processor)); i think have add more attributes parent class ? the code hav...

c++ - Gnome Shell causes QMenu to display in incorrect position when using multiple screens -

Image
my qt app's context menu displayed in incorrect position when using multiple monitors on gnome 3 . it seem perhaps culprit here gnome shell , rather qt itself, can't replicate issue described below ubuntu unity, happens when running ubuntu gnome 14.04 . symptoms: i using qwidget::maptoglobal(qpoint) qwidget::customcontextmenurequested signal in order find correct position display context menu. i using qmenu::exec(qpoint) display menu in position void window::slotonshowcontextmenu(const qpoint& p) { _menu->exec(_tree->viewport()->maptoglobal(p)); } my problem have following screen layout: when window on right hand screen, or on left hand screen @ position below top of right hand screen, context menu shown correctly: when window on left hand screen, @ level above top of right hand screen, though y value of qpoint returned maptoglobal correct, context menu not displayed @ point, rather constrained @ same level right hand screen. ...

c# - Launching an OSX process without a dock icon -

i have 2 unity3d applications - 1 launched other, -batchmode argument on launched 1 has no graphics. on mac osx launched process still gets dock icon sits there bouncing forever; clicking nothing since it's non-graphical, , i'd remove it. i've tried modifying info.plist lsuielement entry rid of dock icon. works if launch application myself, still gets dock icon when launch process. my process launching code little unusual mightn't helping. works on windows , linux not osx , i'm not sure why (c#, mono): processstartinfo proc = new processstartinfo(); proc.filename = path + filename; proc.workingdirectory = path; proc.arguments = commandlineflags; process = process.start(proc); i've got launch on osx specific setup: processstartinfo startinfo = new processstartinfo("open", "-a '" + path + filename + "' -n --args " + commandlineflags); startinfo.useshellexecute = false; process = process.start(startinfo); ...

multithreading - Simultaneous input and output for network based messaging program -

in python, creating message system client , server can send messages , forth simeltaneously. here code client: import threading import socket # global variables host = input("server: ") port = 9000 buff = 1024 # create socket instance s = socket.socket() # connect server s.connect( (host, port) ) print("connected server\n") class recieve(threading.thread): def run(self): while true: # recieve loop r_msg = s.recv(buff).decode() print("\nserver: " + r_msg) recieve_thread = recieve() recieve_thread.start() while true: # send loop s_msg = input("send message: ") if s_msg.lower() == 'q': # quit option break s.send( s_msg.encode() ) s.close() i have thread in background check server messages , looping input send messages server. problem arises when server sends message , user input bounced make room servers message. want input stays pinned bottom of shell window, while ou...

java - Building a pyramid and outputting the first line -

based on code below trying print out pyramid using input of rows looks this: * *o* *o*o* but arbitrary amount of rows. lines correctly cant figure out how first star correctly line up. outputs rows being 5: * *o* *o *o *o* *o *o *o *o *o* *o *o *o *o *o *o *o* *o *o *o *o *o *o *o *o *o* my code : system.out.println("please enter number of rows: "); int row = scan.nextint();//takes in number of rows in=scan.nextline(); //gets rid of error .nextint(); string s="*"; string pat="o"; if(row>1){//this run through if number of rows entered greater 1 (int =0; <= row; i++) {//this loop used build pyramid pattern // spacing (int j = 1; j <= row - i; j++){ ...

amazon web services - Elastic Transcoder: Duplicate output key error -

over last day started getting interesting error when trying push transcoding job php sdk: 'aws\elastictranscoder\exception\elastictranscoderexception' message 'error executing "createjob" on "https://elastictranscoder.us-east-1.amazonaws.com/2012-09-25/jobs"; aws http error: client error: 400 validationexception (client): playlists '64k' duplicate of output key. - {"message":"playlists '64k' duplicate of output key."}' in /var/www/html/app/1.0/vendor/aws/aws-sdk-php/src/wrappedhttphandler.php:152 the settings we're pushing elastic transcoder: 'pipelineid' => $this->config['pipeline_id'], 'outputkeyprefix' => "$prefix/", 'input' => [ 'key' => "uploads/$input_filename.$input_extension", ], 'playlists' => [ 'outputkeys' => [$...

python - How does __call__ actually work? -

python's magic method __call__ called whenever attempt call object. cls()() equal cls.__call__(cls()) . functions first class objects in python, meaning they're callable objects (using __call__ ). however, __call__ function, has __call__ , again has own __call__ , again has own __call__ . so cls.__call__(cls()) equal cls.__call__.__call__(cls()) , again equilevant cls.__call__.__call__.__call__(cls()) , on , forth. how infinite loop end? how __call__ execute code? under hood, calls in python use same mechanism, , arrive @ same c function in cpython implementation. whether object instance of class __call__ method, function (itself object), or builtin object, calls (except optimized special cases) arrive @ function pyobject_call . c function gets object's type ob_type field of object's pyobject struct, , type (another pyobject struct) gets tp_call field, function pointer. if tp_call not null , calls through that , args , kwargs structures p...

input - How to get Int value from String Swift 2.0 -

basically i'm getting user input number 1-3 , want take user's inputted number , compare random number. code: func input() -> string { let keyboard = nsfilehandle.filehandlewithstandardinput() let inputdata = keyboard.availabledata return nsstring(data: inputdata, encoding:nsutf8stringencoding) as! string } var userinput = input() var usernumber: int? = int(userinput) when try print usernumber returns "nil" suggestions? thanks! i'm dutch, english isn't good. sorry that. this answer works: import foundation print("what age?") var fhcpy: nsdata? = nsfilehandle.filehandlewithstandardinput().availabledata if let data = fhcpy{ var str: string = nsstring(data: data, encoding: nsutf8stringencoding) as! string var numstr: string = "" char in str.characters { if int("\(char)") != nil { numstr.append(char) } } var num: int? = int(numstr) if le...

php - Using regex to extract numbers and symbols from string -

i have string text, numbers, , symbols. i'm trying extract numbers, , symbols string limited success. instead of getting entire number , symbols, i'm getting part of it. explain regex below, make more clearer, , easier understand. \d : number [+,-,*,/,0-9]+ : 1 or more of +,-,*,/, or number \d : number code: $string = "text 1+1-1*1/1= text"; $regex = "~\d[+,-,*,/,0-9]+\d~siu"; preg_match_all($regex, $string, $matches); echo $matches[0][0]; expected results 1+1-1*1/1 actual results 1+1 remove u flag. it's causing the + nongreedy in matching. also, don't need commas between characters in character list. (you need 1 , if you're trying match it. need escape - doesn't think you're trying make range

vb.net - Set string values inside for without knowing names -

i trying find correct way set string values inside without knowing actual numbers. here's trying possible in vb6 not sure using vb.net public class form1 dim itest1 string dim itest2 string dim itest3 string private sub button1_click(sender object, e eventargs) handles button1.click = 1 3 "itest" & = "aaa" & next debug.print("itest1:" & itest1) debug.print("itest2:" & itest2) debug.print("itest3:" & itest3) end sub end class try using arrays instead. dim itest(3) string = 1 3 itest(i) = "aaa" & next or this dim variables new dictionary(of string, string)() = 1 3 variables("itest" + i.tostring) = "aaa" & next console.writeline("itest1:" + variables("itest1")) console.writeline("itest2:" + variables("itest2")) console.writeline("ites...

amazon web services - Permission Denied while trying to run a Python package -

i'm trying use python package called csvkit on aws ec2 machine. able install after hiccups, might related - running pip install csvkit threw error @ with open(path, 'rb') stream: ioerror: [errno 13] permission denied: '/usr/local/lib/python2.7/site-packages/python_dateutil-2.2-py2.7.egg/egg-info/requires.txt' but able install other command. now onto original problem - when try run simple function within csvkit package cavstat , full error output: [username ~]$ csvstat traceback (most recent call last): file "/usr/local/bin/csvstat", line 5, in <module> pkg_resources import load_entry_point file "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3020, in <module> working_set = workingset._build_master() file "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 614, in _build_master ws.require(__requires__) file "/usr/lib/python2.7/dist-packages/pkg_reso...

javascript - AngularJS $http.get Parameter -

i have simple code here , got stuck in passing parameter. here code: route.js function config($routeprovider) { $routeprovider .when('/edit/:id', { controller: 'updatetodoctrl', templateurl: 'app/views/edit-todo.html' }); } index.html <div ng-controller="someotherctrl"> <table> <tr ng-repeat="t in todos"> <a href="#/edit/{{ t.id }}">{{ t.name }}</a> </tr> </table> </div controller function updatetodoctrl($http, $scope) { function init() { $scope.todos = null; $scope.loading = true; $http.get('app/endpoints/edit-todo.php', { params: { todoid: //how id paramter } }); } } as can ee in controller , commented out part of problem. how can possibly pass id in url using $http.get ? thank you. your :id route parameter can : function updatetodoctrl($http, $scope, $routeparams) {...

css3 - How to maintain proportion on max width and fixed height? -

i trying make something this . top image 100% width of browser shorter 100% height of browser, content peeks little bit ( tops of 2 images below showing ). also, when brower size scaled, maintains it's aspect ratio , 2 images show unless responsive breaking point @media screen , (min-width:768px) has of images stack on top of eachother. here css: .thumb-12 { width: 100%; height: 100%; position: relative; } .thumb-12 img { width:100%; height: 100%; max-height:700px; background-position:center center; -webkit-background-size:cover; -moz-background-size:cover; -o-background-size:cover; background-size:cover; background-repeat:no-repeat; z-index:100; } this works until gets passed 1500px or width wise, starts stretch image. is possible pure css? i added wrapper div around image div, , gave overflow:hidden , fixed height of 700px; while keeping height of actual image 100%; .thumb-wrapper { max-height: 7...

Verify level of SSL/TLS used on a .NET socket? -

given connected socket (or tcpclient) in .net, how can find out within application, level of ssl/tls being used? example: ssl 2, ssl 3, tls 1.0, tls 1.1, tls 1.2. for example, api calls give me equivalent of socket.getssllevel() looks can maybe use sslstream.sslprotocol it's not clear whether gives actual protocol in use or 1 asked when called authenticateasclient

class - Using 2 classes for a Comission Calculator in Java -

i doing assignment beginning java class. have write commission calculator , use 2 classes in it. stuck on how use variables 1 class in second class. methods have found far not working me. advice helpful. below code have far. package calc; /** * * @author ethan */ import java.util.scanner; public class calc { public static void main(string[] args) { scanner calcu = new scanner(system.in); //creats scanner used input //sets of variables used double sal; //salary double com1; //comission percentage double com2; // find ammount of comisssion yearly sales double comp; //yearly sales double frac; //decimal comission form double total; // total of compensation of yearly salary + comission system.out.println("enter annual salary here: "); sal = calcu.nextdouble(); system.out.println("enter total sales here: "); comp = calcu.nextdouble(); rate(); frac = com1/100; //...

angularjs - Ionic slide box How to play a sound when switching slide? without a click -

i want play sound when switching slides ionic slide box, need without clicking buttons, have tried put ng-focus directive angular , tried property on-slide-changed ionic slide box... here code: <ion-slide-box on-slide-changed="slidehaschanged($index)" class="fondo-rojo" show-pager="false" does-continue="true" ng-if="sencillo.length"> <ion-slide ng-repeat="senci in sencillo" ng-init="play('/android_asset/www/raw/'+senci.sound_title+'.mp3')" repeat-done="repeatdone()"> <h1 class="margen-slide slide-estilo">{{senci.title}}</h1> <a align="center" style="text-align:center !important;" ng-click="play('/android_asset/www/raw/'+senci.sound_title+'.mp3')"><img style="text-align:center !important;" ...

gcc - Linking SDL2 and Clion -

i have clion pointing sdl2 directories , libs, fails link libraries when try build. ideas on how fix this? cmakelists: cmake_minimum_required(version 3.3) project(cavestory_development) set(cmake_c_flags "${cmake_c_flags} -wall -werror -lsdl2") set(sdl2_include_dir c:/sdl2-2.0.3/i686-w64-mingw32/include/sdl2) set(sdl2_library c:/sdl2-2.0.3/i686-w64-mingw32/lib) find_package(sdl2 required) include_directories(${sdl2_include_dir}) set(source_files main.cpp) add_executable(cavestory_development ${source_files}) target_link_libraries(cavestory_development ${sdl2_library}) build errors: "c:\program files (x86)\jetbrains\clion 1.1\bin\cmake\bin\cmake.exe" --build c:\users\conne_000\.clion11\system\cmake\generated\8a943732\8a943732\debug --target cavestory_development -- -j 8 [ 50%] linking cxx executable cavestory_development.exe cmakefiles\cavestory_development.dir/objects.a(main.cpp.obj): in function `sdl_main': c:/users/conne_000/documents/clio...

android - Why don't active contextual action bar when check the checkbox on the listview? -

i want show custom action bar when checkbox checked in listview. wrote 1 xml file type of menu this: <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android" > <item android:id="@+id/delete" android:title="actionbar" android:icon="@drawable/recycle"/> </menu> i use custom listview codes: private class adapter_collection extends arrayadapter<string> { public adapter_collection(context context, int resource, int textviewresourceid, string[] name_collection_tbl_collection) { super(context, resource, textviewresourceid, name_collection_tbl_collection); } @override public view getview(int position, view convertview, viewgroup parent) { layoutinflater inflater = (layoutinflater) getsystemservice(context.layout_inflater_service); view row = inflater.inflate(r.layout.listview_items, parent, false...

java - Atlas does not render images in order[libGDX] -

i using following class render atlas on screen: public class animationdemo implements applicationlistener { private spritebatch batch; private textureatlas textureatlas; private animation animation; private float elapsedtime = 0; @override public void create() { batch = new spritebatch(); textureatlas = new textureatlas(gdx.files.internal("data/packone.atlas")); animation = new animation(1 / 1f, textureatlas.getregions()); } @override public void dispose() { batch.dispose(); textureatlas.dispose(); } @override public void render() { gdx.gl.glclearcolor(0, 0, 0, 1); gdx.gl.glclear(gl20.gl_color_buffer_bit); batch.begin(); //sprite.draw(batch); elapsedtime += gdx.graphics.getdeltatime(); batch.draw(animation.getkeyframe(elapsedtime, true), 0, 0); batch.end(); } @override public void resize(int width, int height) ...

promote artifacts using rest api /api/build/promote error unable to find artifacts of build -

my payload is: payload = json.dumps({ "status": "staged", "comment": "testing.", "ciuser": "builder", "dryrun": "false", "targetrepo": "ext-release-local", "copy": "true", "artifacts": "true", "dependencies": "false", "scopes": [ "compile", "runtime" ], "properties": { "components": [ "c1", "c3", "c14" ], "release-name": [ "fb3-ga" ] }, "failfast": "true" }) headers = {'content-type': 'application/json'} i trying response = requests.post(self.url+'/api/build/promote'+buildurl+'/2', payload, headers=headers, auth=('', '')) getting error: {"errors": [{"status": 400, "message": "unable find artifacts of build 'it-g...

html - Displaying div element on jQuery -

hi trying display more 1 div jquery code. displaying blank page. i not able figure out going wrong. here code <!doctype html> <html lang="en"> <head> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script> $(document).ready(function(){ var parent = document.createelement("div"); parent.classname="panel panel-default"; var heading = document.createelement("div"); heading.classname="panel-heading"; var h3=document.createelement("h3"); h3.classname="panel-title"; h3.setattribute('id','panel_title'); var t = document.createtextnode("demo"); h3.appendchild(t); heading.appendchild(h3); var pbody=document.createelement('div...

Can't upload image capture from camera android -

i'm trying write small code allows me send picture directly after taking camera, want send pict capture in camera never sucess, i'm message "something went wrong" there code public void loadimagefromgallery(view view) { charsequence colors[] = new charsequence[] {"galery", "foto"}; alertdialog.builder builder = new alertdialog.builder(userprofileactivity.this); builder.settitle("pilih"); builder.setitems(colors, new dialoginterface.onclicklistener() { @override public void onclick(dialoginterface dialog, int which) { if (which == 0) { intent galleryintent = new intent(intent.action_pick, android.provider.mediastore.images.media.external_content_uri); startactivityforresult(galleryintent, result_load_img); } else if (which == 1) { ...

angularjs - Get selected file size using org.apache.cordova.file -

using org.apache.cordova.file plugin can selected file , native path of file. after have restrict user select file according there file size. can't file size . problem can't file size using plugin. using this tutorial. to file size, need access via metadata follows: window.resolvelocalfilesystemurl(filepath, function (filesystem) { filesystem.getfile(filename, {create: false}, function (fileentry) { fileentry.getmetadata( function (metadata) { alert(metadata.size); // file size }, function (error) {} ); }, function (error) {} ); }, function (error) {} );

android - How to apply all Html styles to a textview -

i'm trying display html content in native page. i'm parsing html content , showing in textview . but, of html styles not applied textview . example: <p style=\" color:#c9c8cd; font-family:arial,sans-serif; font-size:14px; line-height:17px; margin-bottom:0; margin-top:8px; overflow:hidden; padding:8px 0 7px; text-align:center; text-overflow:ellipsis; white-space:nowrap;\"> here color , font-amily , font-size , other attributes not working. i used html.fromhtml(html) method setting html content. there way extend html class , add these styles it? is there other alternatives. try following, textview mbox = new textview(context); mbox.settext(html.fromhtml("<b>" + title + "</b>" + "<br />" + "<small>" + description + "</small>" + "<br />" + "<small>" + dateadded + "</small>"));

MySQL if not exists by two columns update other -

i want insert record if not exists 2 columns, , if exists update column 3, here's query: insert aktai_islaidos_id (akto_id, islaidos_id, savikaina) select * (select ? a, ? b, ? c) tmp not exists ( select akto_id, islaidos_id, savikaina aktai_islaidos_id akto_id = , islaidos_id = b ) on duplicate key update savikaina = values(c); now i'm getting error c not exists in fields list, understand why, didn't know how complete query correctly , didn't find examples selects duplicate columns, thanks! edit: figured out stored procedure: create procedure update( in akt_id int, in isl_id int, in sav int) begin if (select count(*) aktai_islaidos_id akto_id = akt_id , islaidos_id = isl_id) > 0 begin update aktai_islaidos_id set savikaina = sav akto_id = akt_id , islaidos_id = isl_id; end; else begin insert aktai_islaid...

.htaccess - Bootstrap (website) on cpanel not working well with www -

i got problem, maybe related cname or maybe .htaccess file. website working if use domain.com example if use www. domain.com part of website css related bootstrap icons disappeared. anyone faces problem, please share knowlege how solve issue. maybe can use force through htaccess redirect non https or http in case, how make work www. ? thanks in advance

symfony - Symfony2 Sonata: No Entity Manager in Custom Class -

i'm trying create custom form in sonata-admin , im geting no entity manager defined class school\childbirthbundle\entity\datachapter my code: namespace school\childbirthbundle\admin; use sonata\adminbundle\admin\admin; use sonata\adminbundle\form\formmapper; use sonata\adminbundle\datagrid\datagridmapper; use sonata\adminbundle\datagrid\listmapper; use sonata\adminbundle\show\showmapper; use knp\menu\iteminterface menuiteminterface; use school\childbirthbundle\entity\datachapter; class datachapteradmin extends admin { protected function configureshowfields(showmapper $showmapper) { $showmapper ->add('name') ->add('status') ; } sonata.admin.data_chapter: class: school\childbirthbundle\admin\datachapteradmin tags: - { name: sonata.admin, manager_type: orm, group: "content", label: "chapter" } arguments: - ~ - school\childbirthbundle\entity\datachapter - ~ - @doctrine.orm.default_entity_manager calls: ...

java - when button is clicked, i want to know how to put some images in layout -

i want put image. when image clicked, drawn in framelayout. if press cat image , cat drawn. here code, , images put in drawable folder. mainactivity import android.content.intent; import android.support.v7.app.appcompatactivity; import android.os.bundle; import android.view.view; import android.widget.framelayout; import android.widget.horizontalscrollview; import android.widget.imagebutton; public class mainactivity extends appcompatactivity implements view.onclicklistener { imagebutton mstamp, mframe, mconfirmbtn, mcat, mmush; horizontalscrollview horizontalscrollview; framelayout framelayout; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); mstamp = (imagebutton)findviewbyid(r.id.stamp); mframe = (imagebutton)findviewbyid(r.id.frame); mconfirmbtn = (imagebutton)findviewbyid(r.id.confirm); mcat = (imagebutton)fi...