Posts

Showing posts from May, 2014

Searching nested jsonb array in PostgreSQL -

i have orders table store summary of order in jsonb column {"users": [ {"food": [{"name": "dinner", "price": "100"}], "room": "2", "user": "bob"}, {"room": "3", "user": "foo"} ]} now want query users food->name . i tried following, gives me user foo , has no food . select jsonb_array_elements(jsonb_array_elements(summary->'users')->'food')->>'name' food, jsonb_array_elements(summary->'users')->>'user' user_name orders; food | user_name -------+----------- dinner | bob dinner | foo how such query? update i have summery 2 food options {"users": [ {"food": [{"name": "dinner", "price": "100"}, {"name": "breakfast", "price": "100"}], "roo

c# - Transparent background form -

Image
i have c# visual form wrapper custom background image (png), if launch app, looking nice, if i'll go move window - troubles. // import using system; using system.collections.generic; using system.text; using system.drawing; using system.windows.forms; using system.componentmodel; using system.drawing.drawing2d; // window control class ztwindow : form { // variables private point m_mouseposition; private image m_background; // initilization /* default constructor */ public ztwindow() { initialize(); } /* initilization constructor */ public ztwindow(string title) { initialize(); text = title; } /* default destructor */ ~ztwindow() {} /* initilization */ private void initial

parsing - Is there already a simple language and parser to embed logic within XML? -

i have xml representation of survey rendered on multiple platforms code written in multiple languages. i'd embed simple logic in xml describe how questions should skipped in survey - , possibly more complicated rules later. example, "if answer question 5 'y', skip question 10". embedded language need parsed in multiple languages. there established way or easier create own language , parser? xml information carrier. decide information, , how break (nested) chunks. isn't proactive in sense. if want "include" logic in xml control how processed, can pick programming language like, , include chunk of in xml chunk have designated purpose. whatever recipient supposed process xml, can, convention, display pleases, , run code chunk (usually "eval" mechanism, limits choice of language) provide custom behavior. but there isn't magic.

javascript - AJAX: only error callback is been fired -

i have declared success , error callbacks, in case of status code 200 calls error callback only. i have been making curl call other php file inside registry.php . here tried: $.ajax({ type: "post" ,data: { action: "blah" ,mobileno: that.mobno ,token: that.key } ,url: "http://90.8.41.232/localhost/registry.php" ,cache: false ,datatype: "json" ,success: function (response) { console.log("success"); } ,error: function () { console.log("error"); } }); i have read in documentation don't have call success callback explicitly, hope it's correct. any idea how call success callback when 200 status code. response hope help, copied chrome console, not printed console.log(). bort: (statustext) always: () complete: () done: () error: () fail: () getallresponseheaders: () getresponseheader: (key) overridemimetype: (type) pipe: () progress: () promise: (obj) readystate: 4

tkinter - Access to Canvas Items stack -

as per official documentation , items inserted on tkinter canvas placed on stack. though there methods raise, lower , remove items stack, not find method access stack. is there way access stack ? or have maintain own stack items added canvas ? the find method return items based on whatever search criteria give it. items returned in stacking order. item, use search criteria "all" : items = the_canvas.find("all")

importing assignment into modul re/expected string or buffer Python, -

well started learning python don't understand how make code correct (worth learn youtube))). want code -- if assignment num1 has 8 in end , should printed command print, , if doesn't print nothing. import re def x(): num1 = 5894652138 vav = re.match(r'[8]''$', num1) print vav x() you don't need use re here. check last digit in decimal number, should use modulos 10: num1 = 5894652138 if num1 % 10 == 8: print num1

amazon web services - Use Virtual Private Cloud in Blueprint of Apache Brooklyn -

if virtual private cloud (vpc) created in amazon web services (aws) or wherever. there chance use (and configure it) in our blueprint deploy later via apache brooklyn? has apache brooklyn vpc support? as far know, cannot specify vpc. can instruct brooklyn use specific subnet (tied vpc) through templateoptions so: within brooklyn.properties : brooklyn.location.named.my-location.templateoptions={subnetid: subnet-aa461fec} as provisioning property within yaml blueprint: ... provisioning.properties: templateoptions: {subnetid: subnet-aa461fec} ...

MS ACCESS or Excel formula or code to result in desired output column -

i have data has 1 many relation. below dummy data represent data. have id have multiple alt_ids. alt_ids have relation column called alt_spec_code. need or desire output column populate let's id_spec_code 1 of alt_spec_codes. id alt_id alt_spec_code desired_outcome(id_spec_code) 123456 111111 pa pa 123456 222222 n/a pa 123456 121212 n/a pa 654321 333333 n/a st 654321 444444 st st 654321 434343 n/a st 987654 222222 n/a n/a 987654 121212 n/a n/a 987654 333333 n/a n/a 456789 111111 pa both 456789 444444 st both 456789 555555 n/a both i thinki

javascript - One Angular Controller Karma-Jasmine test works, but not another one -

finally got karma test working angular controller. if try execute same test controller, not working error message: error: [ng:areq] argument 'test2controller' not function, got undefined the working test: describe('testcontroller: - ', function() { beforeeach(module('myapp')); var scope, $controller, httpbackend; beforeeach(inject(function ($rootscope, _$controller_, $httpbackend) { scope = $rootscope.$new(); httpbackend = $httpbackend; $controller = _$controller_; })); aftereach(function () { httpbackend.verifynooutstandingexpectation(); httpbackend.verifynooutstandingrequest(); }); describe('version testing; -', function() { it("tests version ", function() { httpbackend.whenget('url').respond(200, {"meta":{"apiversion":"0.1","code":200,"errors":null}}); var $scope = {}; var controller = $controller('testcontroller', { $s

Capybara with javascript and factory girl -

i have 1 factory inheritance factorygirl.define factory :client sequence(:first_name) { |n| "john#{n}" } sequence(:last_name) { |n| "smith#{n}" } factory : client_with_dialog show_popup true end on react code getting server client show popup value. $.get('/client/get_choise') .done(function (result) { if (result.show_popup) { alert(); } }); test code: scenario 'visit page popup' client = create :client_with_dialog visit_page_with_popup end on capybara testing popup not showing, question $.get('/client/get_choise') code run in tests or not? how can write capybara test open popup window? it sounds you're using rack-test driver doesn't support javascript. start here https://github.com/jnicklas/capybara#selecting-the-driver

c# - How do I connect to a Azure Worker Role with tcp endpoint? Tech help needed with Tcp and Azure -

i created worker role in visual studio , deployed azure. azure shows running on staging. on cloud services screen there url service, doesn't seem when ping or navigate there. get: this webpage not available err_name_not_resolved i wrote following code try , access service through tcpclient: string ip = "http://mysite.cloudapp.net"; int port = 10; tcpclient client = new tcpclient(); try { client.connect(ip, port); // line throws error. if (client.connected) { client.close(); } } catch (exception ex) { trace.warn(ex.message); } on client.connect(ip, port) there error says message = "the requested name valid, no data of requested type found" my workerrole has following run method (copied online tutorial believe). public override void run() { trace.traceinformation("wr running"); tcplistener listener = null; try { lis

Connection to two different databases in Spring JPA fails -

i trying use 2 different data sources/databases in application far not able connect them. firstdb config file @configuration @enabletransactionmanagement @enablejparepositories(basepackages = "xx.xx.xx.crud.repository.running", entitymanagerfactoryref = "nextgenentitymanagerfactory", transactionmanagerref = "transactionmanagerone") @propertysource("classpath:application.properties") public class nextgendbconfig { @value("${spring.datasourcenextgenlims.driver-class-name}") string driverclassname = ""; @value("${spring.datasourcenextgenlims.url}") string url = ""; @value("${spring.datasourcenextgenlims.username}") string username = ""; @value("${spring.datasourcenextgenlims.password}") string password = ""; @autowired @qualifier("jpanextgenvendorapapter") jpavendoradapter jpanextgenvendorapapter; @bean

has many through - Rails How to an association and data at once -

i m newbie on rails have user , attachment model , has_many through relationships. want add data,it can more one, third model intermediate form when create attachment data. can save attachment data don't know how save data third model.here files attachments/new.html.erb <%= form_for(@attachment) |f| %> <div class="field"> <%= f.label :filename, "file name" %><br> <%= f.text_field :filename %> </div><br /> <div class="field"> <%= f.label :file, "file" %><br> <%= f.file_field :file %> </div> <br /> <div class="actions"> <%= f.submit "dosya yükle" %> </div> <% end %> attachments_controller.rb def new @attachment = attachment.new end def create @attachment = attachment.new(file_params) if @attachment.save redirect_to some_path else render action: 'new' end end use

javascript - Play/Pause any Canvas animation -

i'm building tool have iframe inside of user can put html containing canvas animation. the purpose let them choose if want use createjs, adobe edge animate or other tool prefer. despite need able play , pause canvas animation no matter tool used. do think possible? or think tied framework used? i've tried clearing request animation frame of page didn't work well. iframe.contentwindow.cancelanimationframe(<don't know put in here without accessing animation framework>) do have suggestion? thank you! andrea edit: in case scenario iframe sort of sand-box user can put whatever wants, javascript functioning of framework used supporting different html5 canvas libraries it theoretically possible because while libraries have own built-in animation methods, can use drawing methods , use own animation loop animate drawings. but, wow! huge task. off top of head have to: load code of users selected library - eg. easel.js . create canvas

javascript - D3 Targeting/Control Over Specific Arcs -

i trying target individual arcs in inner donut. want able have control on each arc(14 of them) , change colors accordingly. want have 2 colors, either gray or lime green. 2-week progress checker. if user participates 7 of 14 days want show 7 green 7 grey, etc. here codepen it. thank in advance. $(function(){ var tooltip = d3.select(".tooltip"); var $container = $('.chart-container'), Ï„ = 2 * math.pi, width = $container.width(), height = $container.height(), innerradius = math.min(width,height)/4, //innerradius = (outerradius/4)*3, fontsize = (math.min(width,height)/4); var dataset = { days: [1,1,1,1,1,1,1,1,1,1,1,1,1,1], progress: [1] }; var participation = 100; var color = d3.scale.ordinal() .range(["#7eba4a"]); // create donut pie chart layout var pie = d3.layout.pie() .sort(null); // determine size of arcs var arc = d3.svg.arc(); // append svg attributes , appen

javascript - IE mobile, windows phone jQuery .css() function issue -

i have strange issue. using jquery function : .css() set width/height , paddings. on ios mobile, android works perfectly, doesn't work on windows phone device. i don't know why, ie doesn't see additional css wrote in javascript. can explain me why? , how can fix it? example: var = $(window).width(); $('.element').css('width',a+'px'); or maybe doesn't count window width?

css - Have a repeated image on top of everything -

i'm having trouble getting specific after. i have basic wordpress twenty-fifteen theme applied , i'm trying 200px wide red bar appear down right hand side of screen. the bar made of 200x1px image repeated. the problem is: a.) if set "background-image" repeat works, cannot image on top. b.) if set image img inside of div, can image on top, not repeat. can me combine these 2 1 result, repeated image-y , image on top? you can see site here: http://u64.ca/ try this, add css. affect comes directly inside #main tag. #main > * { margin-right: 200px; } or apply border right .site-content , lose background iamge. .site-content { border-right: 189px solid #db0f12; }

Excel Conditional Format Duplicate Values -

im struggling find answer this. want find duplicates in column b when column g not "n/a" using conditional format make column b red here example data server name(col b), nat (col g) myserver, n/a <---- should not checked myserver, n/a <---- should not checked myserver, 10.10.10.10 <----- should checked myserver, 10.20.20.20 <----- should checked myserver1, 1.1.1.1 <---- shouldnt checked myserver1, n/a <---- shouldnt checked obviously top 2x records shouldn't checked duplicates, next 2x records should checked dont n/a, last 2 records shouldnt checked there no duplicate (due 1 record having n/a) for reason when tried toms formula above wouldn't work conditional formatting rule, if amend (assuming g2 header): =and(countifs($b:$b,$b4,$g:$g,"<>n/a")>1,$g2<>"n/a") it should work, if have more 300 rows, excel slow, if create hidden column forumla , set conditional formula to: =$j=true

java - Is Method overloading allowed across the classes? Please explain why and how? -

my code: public class main { public static void main(string[] args) { system.out.println("hello world!"); b b = new b(); b.p(); } } class a{ void p(){ system.out.println("a"); } } class b extends a{ void p(int a){ system.out.println("b :"+a); } } is method overloading allowed across classes? because working in java. according concepts highly doubt in c++ , c# gives error java compiler invokes correct version of function not expected. please explain why , how ? yes overloading works here because class b inherits overloaded method class a . specified in java language specification : if 2 methods of class (whether both declared in same class, or both inherited class, or 1 declared , 1 inherited) have same name signatures not override-equivalent, method name said overloaded .

sql - trim the column value string -

in sql query, need values below using select query of column. result has text after first space ' ' , before first '(' source column create table test_table (column1 varchar(50)) insert test_table values ('0636 kavithi (loc)'), ('0638 sri krishna (nat)'), ('0639 selvam'), ('0643 service (loc)'), ('0644 fina care event (loc)') i need string found between first ' ' , '(' expected result kavithi sri krishna selvam service fina care event another approach without using outer apply. select case when column1 '%(%' substring(right(column1,len(column1)-charindex(' ',column1)),0, charindex('(',right(column1,len(column1)-charindex(' ',column1)),0)) else right(column1,len(column1)-charindex(' ',column1)) end trimmed test_table output trimmed kavithi sri krishna selvam service fina care event sql fiddl

java - Hibernate OneToMany MySQLIntegrityConstraintViolationException: Duplicate entry -

i have 2 java hibernate entities: @entity public class match_soccer extends match{ @id @generatedvalue(strategy=generationtype.auto) private int mid; ... and other one: @entity public class algo { @id @generatedvalue(strategy=generationtype.auto) private int id; @onetomany private list<match_soccer> matches = new arraylist<match_soccer>(); ... and if try save 2 different algo entities matches list duplicate entry '6028' key 'uk_auyvi1qkpdtaqrpuyv9je5rda' exception. hibernate create in database 3 tables: algo match_soccer , table: algo_match_soccer columns: algo1_id int(11) matches_mid int(11) pk my goal assign list of matches algo. matches can in 2 different algo objects. algo a1 = new algo(); algo a2 = new algo(); soccerdao sd = new soccerdao(); list<match_soccer> ms = sd.getmatches(datefrom,dateto); // matches database a1.setmatches(ms); a2.setmatches(ms); i use function insert:

ios - Detecting empty lines and absence of text in a UITextView in Swift -

i have created uitextview programmatically , , added placeholder so: //textview textview.frame = cgrectmake(viewsize.width * 0.05, contentview.frame.height - viewsize.width * 0.05, viewsize.width - viewsize.width * 0.05 * 2, -viewsize.height * 0.220833) self.textview.delegate = self self.textview.text = "agregue una descripción..." self.textview.textcolor = uicolor.lightgraycolor() self.textview.autocorrectiontype = uitextautocorrectiontype.no self.textview.layer.cornerradius = 6 self.view.addsubview(textview) and in delegate functions: func textviewdidbeginediting(textview: uitextview) { if textview.textcolor == uicolor.lightgraycolor() { textview.text = "" textview.textcolor = uicolor.blackcolor() } } func textviewdidendediting(textview: uitextview) { if textview.text.isempty { textview.text = "agregue una descripción..." textview.textcolor = uicolor.lightgraycolor

Magento friendly multilanguage link -

i have question multilanguage on magento. site (www.tucanotest.it) have english , italian , lot of other languages. if switch italian english url appear ' http://www.tucanotest.it/index.php/?___store=english&___from_store=italia ' there way convert link http://www.tucanotest.it/en/ ? i recommend use subdomain instead. you have update base url in configuration each store view: general > web > secure , general > web > unsecure then have set such environment variables in .htaccess: setenvifnocase host "^nl\.website\.be$" mage_run_type=store mage_run_code=nl_be setenvifnocase host "^fr\.website\.be$" mage_run_type=store mage_run_code=fr_be first have search store view code, can find them in system > manage stores click on store view name. if store view code english view en_it example, have write in .htaccess: setenvifnocase host "^en\.tucanotest\.it$" mage_run_type=store mage_run_code=en_it

c# - Data type mismatch in criteria expression exception -

Image
when run code gives me mismatch criteria exception" remove quotes amounts , category_id "update products set amount=" + amount1 + " category_id=" + temp; this build correct sql string. btw encourage use query parameters queries https://msdn.microsoft.com/it-it/library/system.data.oledb.oledbcommand.parameters(v=vs.110).aspx

soap - WSDL Editor with WS-Security support -

i have edit wsdl add policy sign , encrypt body. have been searching editor can simplify , cannot find any. i tried xmlspy(2008) , eclipse there no security policy support. have tried searching web , editor such support no luck. so far have resorted manually editing wsdl curious find out if there tool assist future's sake. with security have add manually. havent found editor has built in. not not available in future

Missing the fundamentals of arrays in PHP -

can 1 explain why doesn't work: private static $bundles = array( 'page-builder' => array( 'freya\\bundle\\pagebuilder' => self::$basedir . '/freya-bundle-pagebuilder/freya/bundle/pagebuilder' ); ); self::$basedir __dir__ . thought @ run time php evaluate , save out path/to/some/dir/freya- .... the exact error is: parse error: syntax error, unexpected '$basedir' (t_variable), expecting identifier (t_string) or class (t_class) in /vagrant/local-dev/content/mu-plugins/freya-mu/bundles/bundleloader.php on line 51 line 51, is: 'freya\\bundle\\pagebuilder' => self::$basedir . '/freya-bundle-pagebuilder/freya/bundle/pagebuilder' so ... missing , whats proper way this? php version: 5.5 php not allow this. php properties may initialized constant values, constant values available @ compile time . manual : this declaration may include initialization, initialization must constant value-

python - How to make a folder landing-page looks like the initial-page of a sub-site in a Plone portal? -

Image
as cms, plone receives contents , display these contents organized menus in initial "home" page, can browse other pages , other types of contents. is possible make menu item point second home page in same plone portal? today discovered can select page or other type of content replace landing page of folder. it's want. if make page show news folder, , other contents designed in table "initial page", goal. believe need portlet make new kind of content or make 'page' mimic 'initial page' it different creating simple page linked menu, there lists of contents , widgets @ most. the case study plone portal of government office, , subsection wants have it's own "home index" human resources division. i need real new 'home' page if home entire (and important) subsection of portal. if possible, need administrator skills or have alter python code or config file? this initial (home) page, index of plone portal this

html - Finding a regexp pattern not preceeded by something -

i have following html file structure: <table> <tr class="heading"> <td colspan="2"> <h2 class="groupheader">public types</h2> <!-- don't want that! we're in table.--> </td> </tr> <tr>...</tr> </table> <h2 class="groupheader">detailed description</h2> <!-- want until next h2--> <div class="textblock"><p>provides functions control generation of single data log file. </p> <h4>example</h4> <div class="fragment"><div class="line">test <a href="aaa">stuff</a>();</div> <div class="line">...</div> <div class="line">...</div> </div> </div> <!-- end of first result --> <h2 class="groupheader">member</h2&g

build - IBM DevOps Pipeline: How to Access Artifacts from Previous Job? -

Image
i have build stage shown below 2 build jobs, frontend , backend job. how directly access build archive directory of frontend job backend job's build script? i need access frontend build artifacts in order build final archive. , can see artifacts show in artifacts tab frontend build. how access second job, i.e. backend build? i saw here there environment variable access current job's archive dir, need access other jobs archive dir. currently, both jobs inside stage run in complete separate environments. not have access artifacts of other jobs in stage. way around create new stage 'backend' job, , set input stage build artifacts 'frontend' job

nsdate - Retrieve date from double value in NSUserDefaults (Swift) -

hi i'm creating has 2 controls: nsslider , nstextfield update continuously. added nsdateformatter nstextfield shows current value of slider formatted time. slider has range of 0 86,400 units (so user slides seconds in range of 24 hours). i connected app shared user defaults controller value stored user. the app shows correct time in nstextfield, stores value in seconds. example, if user selected 06:32:14 when moving slider, system store 23534.2261709793 in key starttime when user opens app again, see 06:32:14 expected. my problem when want read variable in code: i can read value double: let value = nsuserdefaults.standarduserdefaults().objectforkey("starttimevalue") as? double this works fine, if try cast nsdate won't work (the value set nil). thought using nsdateformatter in code work (as way interface builder work user see date): let dateformatter = nsdateformatter() dateformatter.datestyle = nsdateformatterstyle.nostyle dateformatter.timestyl

angularjs - Mocking a service call from a controller, Jasmine using the actual service -

i've trying test service called controller using spy , mock. jasmine's error appear it's trying call actual service? doing wrong? controller angular.module('vsapp').controller('kitsctrl', function ($scope, productsdataservice) { productsdataservice.getproducts("kit").success(function (data) { $scope.products = data; }); }); spec describe("kits controller", function () { var productsdataservicemock, $controllerconstructor, scope; beforeeach(module('vsapp')); beforeeach(inject(function ($controller, $rootscope) { $controllerconstructor = $controller; scope = $rootscope.$new(); productsdataservicemock = { getproducts: function(type) {return {};} }; })); it('should call products data service', inject(function () { var ctrl = $controllerconstructor('kitsctrl', {$scope: scope, productsdataservice: productsdatas

How to cut a single file into multiple files and save them with different names in UNIX? -

i have file contains create table of several tables. want cut file multiple parts , save them name present in script. for example have, create table abc_bcd.xyz , ..... create table abc_bcd.pqr , ...... now want file divided every table , saved name xyz , pqr. i tried awk '/create/{x="table"++i ".ddl";}{print > x;}' filename but gave me files named table1.ddl , table2.ddl etc. thanks in advance. @shellter yes, complete create table script more 1 line. file like: create table abc_bcd.xyz , ( column1 datatype, column2 datatype, ......); create table abc_bcd.pqr , ( column1 datatype, column2 datatype, ......); ... ... ... my requirement cut file table wise , save them name xyz, pqr , on. i tried combine awk , grep not achieve requirement.

xml - XSD Non sense error. The attribute 'filter' is not allowed -

i got next xml: <!-- language: xml --> <message name="msg1" type="simple"> <doc> message send </doc> <parameters> <parameter name="param1" type="byte" filter="2" mask="on"> <fields> <field encode="hex"> <values> <value name="indicator" id="0"/> </values> </field> </fields> </parameter> <parameter name="param2" type="byte" filter="3" mask="on"/> <parameter name="param3" type="byte"/> </parameters> </message> and xsd file one: <xs:element name="message" minoccurs="0" maxoccurs="unbounded"> <xs:complextype>

sql server - SSIS - Modify date column from the 15th to the 1st of the month -

select * [marktsk] [monthlydt] not null --and --select dateadd(mm, datediff(mm,0,getdate()), 0) hello folks. know how correctly write statement display first of each month? have excel file importing server using ms ssis (visualstudio 2008). dates monthly, last few months 15th june, may, april etc. intent make of them show 1st of month. months before january 2015 have been on 1st of month. the sql query above wrote in excel source editor. thank you this should give first of current month select dateadd(month,datediff(month,0,getdate()),0) to pull first of month dates in table should it select dateadd(month,datediff(month,0,[monthlydt]),0) [marktsk] [monthlydt] not null

php - WP REST API query multiple post types -

i trying retrieve posts multiple post types using wp rest api. have no problem getting feed 1 post type book doing this: http://example.com/wp-json/posts?type=book&filter[posts_per_page]=10 now want extend feed book , movie . gives me last specified type: http://example.com/wp-json/posts?type=book&type=movie&filter[posts_per_page]=10 this gives me error: http://example.com/wp-json/posts?type[]=book&type[]=movie&filter[posts_per_page]=10 how should handling this? thanks! edit: fixed syntax match have. here errors when syntax http://example.com/wp-json/posts?type[]=book&type[]=movie&filter[posts_per_page]=10 used: warning: urlencode() expects parameter 1 string, array given in /home/newbreak/public_html/wp-includes/formatting.php on line 4128 warning: cannot modify header information - headers sent (output started @ /home/newbreak/public_html/wp-includes/formatting.php:4128) in /home/newbreak/public_html/wp-content/plugins/jso

javascript - underscore _.filter condition -

is possible using underscore _.filter? self.getcols = function (columnid) { return cols = _.filter(self.model.cols(), function(c) { return ( (c.id === self.model.id()) && ((columnid === undefined) ? '' : c.columnid === columnid) ); }); }; right condition i'm using on columnid not valid. sorry bad, edited in proper way. in case return should (i think): return c.columnid || c.id === self.model.id(); thats assuming 'columns specify' interpreted column id property equal self.model.id()

how to start new activity using button in android studio -

this question has answer here: cannot resolve constructor (android intent) 4 answers kindly explain, why not working? b3.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { intent intent = new intent(this, signup.class); startactivity(intent); } }); signup word giving error in line given below. intent intent = new intent(this, signup.class); if current activity called main use: intent intent = new intent(main.this, signup.class); when put this , this reference of onclicklistener object.

java - pass a selected value in a spinner array to another class Android -

im building app has self destructing images , trying pass value selected spinner class final string titles[] = {"1 second","2 seconds", "3 seconds","4 seconds","5 seconds","6 seconds","7 seconds", "8 seconds, "9 seconds", 10 seconds}; mseconds = (spinner) view.findviewbyid(r.id.secondsspinner); arrayadapter<string> arrayadapter = new arrayadapter<string>(getactivity(), android.r.layout.simple_spinner_item, titles); arrayadapter.setdropdownviewresource(android.r.layout.simple_spinner_dropdown_item); mseconds.setadapter(arrayadapter); mseconds.setonitemselectedlistener(new adapterview.onitemselectedlistener() { @override public void onitemselected(adapterview<?> parentview, view selecteditemview, int position, long id) { int secondstouse = position + 1; } @override public void onnothingselected(adapterview<?> parentview) { /

c# - How do I know that a parameter uses ref or params modifier? -

in mono.cecil, parameterdefinition of out parameter has property isout set true . what ref , params ? how determine, parameterdefinition , 1 of modifiers used method parameter? while parameterdefinition doesn't contain isref or isparams , it's easy determine both 2 other properties. when parameter contains ref modifier, value of parameterdefinition.parametertype.isbyreference true . otherwise, false , if actual parameter reference type. as params , customattributes collection contains element corresponding system.paramarrayattribute . the following piece of code illustrates how determine 4 states: using system; using system.linq; using mono.cecil; ... if (definition.isout) { // there `out` modifier. } else if (definition.parametertype.isbyreference) { // there `ref` modifier. } else if (definition.customattributes.any(attribute => attribute.attributetype.fullname == typeof(paramarrayattribute).fullname)) { // there `params`

Working with ocaml Lwt sockets -

i have been on learning ocaml week, things got clear, others rather not. i'm trying compose simple tic-tac-toe server accepting connections via telnet. word. have use lwt , rigth seems me darken place because had faced of language pecularities. begining of code: let sock = lwt_unix.socket unix.pf_inet unix.sock_stream 0 let setting_up_server_socket = let sockaddr = (unix.addr_inet(unix.inet_addr_of_string "127.0.0.1", 23233)) in lwt_unix.set_close_on_exec sock; lwt_unix.setsockopt sock unix.so_reuseaddr true; lwt_unix.bind sock sockaddr; lwt_unix.listen sock 20 ok, that's clear. server socket set listen clients connections. let's try first guest: let handle_income = lwt_unix.accept sock;; seems clear, but: val handle_income : (lwt_unix.file_descr * lwt_unix.sockaddr) lwt.t = <abstr> here i'm stacked. don't know how send message client socket. unlike general unix.accept returns ('a * 'b) lwt.t. quest

ssh - Parallels Plesk MySql Database -

Image
who download mysql database(full or part of them) parallel plesk server running latest ubuntu 14.04 lts 64bit + plesk 12.0 through macbook terminal(ssh). plesk server allow mysql local host. it's remote databases access setting. if enable "allow remote connection host" can access databases ip's. need enable mysql port in server firewall if want allow remote mysql access on server.