Posts

Showing posts from March, 2014

How to make certain Issues visible only to a specific user group in YouTrack -

in our youtrack project issues historically visible "all users" group same name shipped youtrack. now adding new users restricted permissions , should see small part of issues. should start seeing no issues @ all, , single issues (old issues , new issues) should selectively made visible them. i tried different ways make happen, without success. 1) if create group them "restricted group" - can give group permission view issues. , can see issues, , if uncheck "view issues" privelege checkbox, cannot see issue @ all. not me, either see issues or none. 2) tried change "issues visible to" field in single issue , set "restricted group". youtrack won't let me, "all users" or "project xy assignees" can selected here. edit: still true, after add myself "restricted group", see alex.v 's answer question so deleted group "restricted group" , tried work "assignees": 3) choose

javascript - Backbone JS Model Fetch returns 200 in Fiddler but invokes error method -

i have weird stuff going on here. have model i'm attempting fetch on. can @ calls in fiddler or call api service manually , json expect back, fetch method throws error in backbone. not tell me why , responsetext empty. in fiddler, service returns 200. here's calling code... this.createsession = function (sessionid) { var = this; cookiemanager.createsession(sessionid); var sessiondata = new authentication.response({ id: sessionid }); sessiondata.fetch({ success: function () { that.storedata(sessiondata); }, error: function (model, xhr) { if (console !== undefined && console !== null) { console.log('unable load session data: ' + xhr.responsetext); } throw new error('unable load session data'); }

windows 8 - How can I give focus to WinJS.UI.settingsFlyout after animation? -

i'm invoking winjs.ui.settingsflyout element via javascript using winjs. inside html element of settingsflyout, have text input field receive focus after animation of flyout occurs. i've tried use jquery's .focus() method, not work because not think flyout focused after completes animation. have click twice on input field begin typing. click once flyout in focus, , click time field in focus. quite annoying. there way implement auto focusing of input fields within winjs.ui.settingsflyout? have tried? settingsflyout.addeventlistener("aftershow", function(){ $('#inputid').focus(); });

xml - Copy any referenced figures to where they are referenced with xsl -

i looking way copy referenced figure/node referenced. <chapter id="intro"> <title>introduction</title> <para>welcome our new product. 1 of new features <xref linkend="some-figure"/>. other new features include ... </para> <para>grab <xref linkend="some-figure"/> , pull here too.</para> </chapter> <chapter> <title>some other chapter</title> <para>this chapter contains figure! <figure id="some-figure"><title>my figure...</title><mediaobject>...</mediaobject></figure> </para> </chapter> can turned into: <chapter id="intro"> <title>introduction</title> <para><figure><title>my figure...</title><mediaobject>...</mediaobject></figure> welcome our new product. 1 of new features <xref linkend="some-figure&

iOS, sqlite3 & unicode char -

for app want able use unicode caracters \n, , these ones : http://www.easyapns.com/category/just-for-fun the text stored in sqlite3 database, , when read it, example text \ue415 instead of smiley. neither have line break, \n . i'm able display smileys , line breaks using piece of code : nsstring* unicodestring = [mystring stringbyreplacingoccurrencesofstring:@"\\n" withstring:@"\n"]; unicodestring = [unicodestring stringbyreplacingoccurrencesofstring:@"\\ue022" withstring:@"\ue022"]; // etc... but find generic way this, in order able display unicode caracters. i'm getting text sqlite3 database way : nsstring* title = [nsstring stringwithutf8string:(char *)sqlite3_column_text(statement, 3)]; i tried replace \\ \, not possible write string @"\", because escapes " ... tried replace \\\\ \\, doesn't work. tried string database using other encoding, without success... any idea ? i found solution

javascript - DOM traversing for a searched keyword is not showing as expected? -

Image
i trying implement filtering mechanism using javascript in ui traverse through dom , find searched word. how html , ui looks like. so idea once data(which dynamic) loaded back-end(through java) want traverse dom in html particular keyword searched. how writing js in jquery $(document).ready(function() { jquery('#txtsearch').keyup(function(event){ if (event.keycode == 27) { resetsearch(); } if (jquery('#txtsearch').val().length > 0) { jquery('.list-group-item').hide(); jquery('.list-group-item span.assignee-style:contains(\'' + jquery('#txtsearch').val() + '\')'). parent('li').parent('ul').parent('li').show(); } if (jquery('#txtsearch').val().length == 0) { resetsearch(); } }); function resetsearch(){ jquery('#txtsearch').val('');

android - How to insert data from edittext -

i try insert db.insert(inputfname, inputlname, inputnickname); it's error .it tell me "the method insertdata(edittext, edittext, edittext) undefined type friendsdb insertactivity.java" can tell me please this code (mainactivity) package com.example.sqlite; import java.security.publickey; import com.example.sqlite.db.friendsdb; import android.app.activity; import android.content.context; import android.content.intent; import android.os.bundle; import android.view.view; import android.widget.button; import android.widget.edittext; public class insertactivity extends activity { private context context; private friendsdb db; edittext inputfname; edittext inputlname; edittext inputnickname; button save; button cancle; @override protected void oncreate(bundle savedinstancestate) { // todo auto-generated method stub super.oncreate(savedinstancestate); setcontentview(r.layout.insert_layout); //view matching inputfname = (edittext)findview

Encrypting data from file and sending on a socket via MemoryStream( byte[] ) using C# / .Net -

we have sockets server needs transfer encrypted binary files connected clients. files need encrypted when requests them arrive, preferably without making encrypted copies of files on disk first. due fact use asynchronous sockets api, sockets.networkstream cannot used. instead, need utilize socket.beginsend() byte[] buffer input. a seemingly straight forward possibility use cryptostream memorystream destination encrypted content. memorystream use byte [] buffer own data repository. for example: int blocksizebytes = 1024 * 64; byte [] plaindata = new byte [blocksizebytes]; byte [] encdata = new byte [blocksizebytes]; memorystream memory = new memorystream( encdata ); icryptotransform encryptor = ... ***cryptoserviceprovider.createencryptor(); cryptostream csenc = new cryptostream( memory, encryptor, cryptostreammode.write ); a file can read , encrypted buffer @ time, sent on socket client. example: socket clientsocket = ...; // connected peer. int bytesread = 0; files

Get the names of all Triggers currently in the database via SQL statement (Oracle SQL Developer) -

i need sql statement retrieves names of triggers setup in database. using oracle sql developer version 1.5.5, java version 1.7. something this: select object_name objects object_type = 'trigger' what have pretty close: select owner, object_name all_objects object_type = 'trigger' or more usefully: select owner, trigger_name, table_owner, table_name, triggering_event all_triggers all_triggers has other columns give more information all_objects does, when trigger fires. can more information , other useful data dictionary view in documentation .

java - Setting image for imageview within listview yields odd results -

i have custom listview within list row layout has smartimageview ( http://loopj.com/android-smart-image-view/ ) i trying set each smartimageview on each row picture, below list adapter. private class mylistadapter extends arrayadapter<listitem> { private arraylist<listitem> items; public mylistadapter(context context, int textviewresourceid, arraylist<listitem> items) { super(context, textviewresourceid, items); this.items = items; } @override public view getview(int position, view convertview, viewgroup parent) { view v = convertview; if (v == null) { layoutinflater vi = (layoutinflater)getsystemservice(context.layout_inflater_service); v = vi.inflate(r.layout.item_row_layout, null); } listitem o = items.get(position); if (o != null) { textview

python - Named pipe race condition? -

i have 2 processes 1 c , 1 python. c process spends time passing data named pipe python process reads. should pretty simple , works fine when i'm passing data (currently time stamp such "mon aug 19 18:30:59 2013") once per second. problems occur when take out sleep(1); command in c process. when there's no 1 second delay communication gets screwed up. python process read more 1 message or report has read data though buffer empty. @ point c process bombs. before go posting sample code i'm wondering if need implement sort of synchronisation on both sides. maybe telling c process not write fifo if it's not empty? the c process opens named pipe write , python process opens read only. both processes intended run loops. c process continually reads data comes in on usb port , python process takes each "message" , parses before sending sql db. if i'm going looking @ 50 messages per second, named pipes able handle level of transaction

Is there a way to have tmux programmatically load history from a file? -

i'm trying set tmux session of windows connect remote server , attach screen (tmux isn't installed on server). upon attaching remote screen, i'd copy history of screen tmux (i want history persistent, if tmux session restarted). is there way that? didn't see obvious while digging through man pages. for it's worth, hacky solution came works enough. have screen dump history file, , cat/delete file.

asp.net mvc 4 - MVC4 Validation with razor and twitter bootstrap -

i need validate input in mvc4 razor. problem is, want use twitter bootstrap , set error message class top div seen here: http://getbootstrap.com/css/#forms-control-states how can change parent div 's class? have tried script? http://blog.ijasoneverett.com/2013/05/asp-net-mvc-validation-with-twitters-bootstrap/ i use similar getting bootstrap , mvc validation play nice

Stop on mouse over on a simple jquery slider -

i have real simple jquery slider, fits use. linked images, no controls, thumbs, nothing, simple! i'm trying make stoo while mouse cursor on it, wasn't able to. can me here? slider.js function slideswitch() { var $active = $('#slideshow a.active'); if ( $active.length == 0 ) $active = $('#slideshow a:last'); var $next = $active.next().length ? $active.next() : $('#slideshow a:first'); $active.addclass('last-active'); $next.css({opacity: 0.0}) .addclass('active') .animate({opacity: 1.0}, 1000, function() { $active.removeclass('active last-active'); }); } $(function() { setinterval( "slideswitch()", 10000 ); }); slider.css #slideshow { height: 300px; position: relative; width: 960px; } #slideshow { left: 0; opacity: 0.0; position: absolute; top: 0; z-index: 8; } #slideshow a.active { opacity: 1.0; z-index:10;

linux kernel - Are .text pages swapped-out? -

are .text pages in process' memory swapped-out, or pages containing data (heap) swapped-out? here "swapped-out" refer 'being swapped swap area' , not 'mere eviction primary memory'. doubt whether .text pages merely evicted , read hdd never modified (unlike data pages), or swapped swap area. so also, page belonging stack swapped-out? can please provide more clarity on pages in virtual memory of process considered swapping, , ones never? all pages in end considered being swapped out. in linux starts swapping out freeing cache pages followed clean non-recently used pages (which requires unmapping rather write swap device). after try flush dirty file backed pages in memory respective backing device before reaching point must starts swapping anonymously backed process pages (includes stack, data can edited, heap, etc....). non-kernel page candidate being swapped out depends on memory pressure on system. pages have backing store unmapped or

jsf - Can not generate p:datatable in h:panelgrid values on ajax p:commandbutton update -

i developing project in jsf2.1 ,prettyfaces, hibernate 4 , primefaces getting problem here… ve 1 p:commandbutton calls ajax request condition checks that, financial year opened or not <p:commandbutton id="isfinancialyearsubmitid" value="submit" update="isfinancialyearbooleanpanelgridid scenariotabviewid:budgetanalysisdatatableid" action="#{budgetanalysisaction.isfinancialyearopened}" oncomplete="isfinancialyearopenedoncomplete();"/> there 3 value… if financial year opened ‘1’ if financial year closed ‘0’ if invalid ‘ -1’ if financial year closed or invalid image loaded text ,but problem here if financial year opened want generate p:datatable <h:panelgrid columns="2" id="isfinancialyearbooleanpanelgridid" styleclass="panelgridcenter" > <h:column> <ui:fragment rendered="#{budgetanalysisaction.budgetfinancialyearbean.financialyearforproposalsbean == '-1'}">

google play - Android: Internal storage image deleted at random -

my app downloads small number of thumbnail-sized images , stores them in internal storage (in mode_private). these images loaded listview @ runtime. there no code in app deletes these images, way uninstalling or clearing app data. the problem that, seemingly @ random, @ least 1 of images seems disappear internal storage. it's difficult reproduce, can happen few hours after last running app or can take days. i wondering if there might internal process runs deleting internal data reason. both devices have tested , experienced bug on have plenty of internal storage space left. this turned out caused millenial media sdk. bug fixed in latest version of sdk. http://docs.millennialmedia.com/android-sdk/androidsdkreleasenotes.html

zend framework2 - zf2 JSON-RPC server how to return custom error -

i'm looking proper way return custom error json-rpc exposed class. json-rpc has special format reporting error conditions. errors need provide, minimally, error message , error code; optionally, can provide additional data, such backtrace. error codes derived recommended xml-rpc epi project. zend\json\server appropriately assigns code based on error condition. application exceptions, code ‘-32000’ used. i use divide method of sample code documentation explain: <?php /** * calculator - sample class expose via json-rpc */ class calculator { /** * return sum of 2 variables * * @param int $x * @param int $y * @return int */ public function add($x, $y) { return $x + $y; } /** * return difference of 2 variables * * @param int $x * @param int $y * @return int */ public function subtract($x, $y) { return $x - $y; } /** * return product of 2 variables

ios - Get all records from core data and get string with one attribute from every record (MagicalRecord) -

i'm try elements user saved inside app(this easy), 1 attribute every record , have these attributes listed inside string(that's problem). how can it? wrote don't think right way. me please! -(nsstring*)getallrecords { nsarray* arra = [newitem mr_findallsortedby:@"data" ascending:yes]; newitem* ctn = arra.;// have not idea return [nsstring stringwithformat:@"%@", [arra componentsjoinedbystring:@", "]]; } if understand problem correctly, should want: nsarray *elements = [newitem mr_findallsortedby:@"data" ascending:yes]; nsarray *attributes = [elements valueforkey:@"attributename"]; return [nsstring stringwithformat:@"%@", [attributes componentsjoinedbystring:@", "]]; applying valueforkey:key array returns array containing results of invoking valueforkey:key on each of array's objects.

java - The method in the type is not applicable for the arguments (Date) -

i getting following error: the method setdob(date) in type employee not applicable arguments (date) the class employee defined follows: public class employee { @column(name="dob",nullable=false,unique=false) private date dob; public date getdob() { return dob; } public void setdob(date date) { this.dob = date; } } the error raised in controller code below: @controller public class employeecontroller { @requestmapping(value = "employees/save-employee.htm") public string saveemployee(httpservletrequest request,locale locale, model model){ employee employee = new employee(); employee.setdob(date.parsedate(request.getparameter("dob"))); //error raised here... } } i not sure why getting error, parameter of type date , passing date it. can please me , tell me doing wrong here? thanks time ============================= fixing problem: thanks help, able solve problem applying following code controller class: string dobdate

jquery - How can i process this form alone -

this question exact duplicate of: how can make onclick function submit form.php 2 answers i have function on html form, form script there <script type="text/javascript"> var conf = { isvip:false, ismem:false }; </script> and here the button, button process 2 form in html, here button. <li class="current"> <a href="#" onclick="submitaction('process.php')">免费邮箱登录</a> </li> <li> <a href="#" onclick="submitaction('process.php')"><span class="vip"></span>vipsubmit</a> </li> <a href="#" class="loginbtn" here form <form name="vip_login" method="post" action="process.php"> &

Onclick event, unable to change .CSS file using jQuery -

this question has answer here: change href of css link via jquery 3 answers i trying switch css file click functionality. tried lot no gain :( style2.css not getting applied <script type="text/javascript"> $(document).ready(function(){ $("#nav li a").click(function() { $("link").attr("href",$(this).attr('rel')); }); }); </script> <body> <ul id="nav"> <li class="original"><a href="#" rel="css/style1.css">original css</a></li> <li class="original"><a href="#" rel="css/style2.css">larger text</a></li> </ul> </body> try this: <!doctype html> <html lang=en-ca> <head> <meta char

aptana - Git Commands in Toolbar -

is there way standard git buttons (stage,unstage,status,commit, etc, ) in standalone version of aptana 3 in toolbar? because if go "customize perspective... --> tool bar visibility --> team" the team greyed out in goup team 1 icon that's not 1 of git icons try go tab 'command group availability' (in 'customise perspective' window) , check 'git' there.

actionscript 3 - Add color to label on list in flex -

i confused on how this.. have user list when joins adds them list (their username) have way find out if admin or not need know how can change color of each user in list... example.... if list supported html work fine onlineusers.additem({label:"<font color='$ffffff'>users[i].username+"_guest</font>",id:users[i].userid,guest:"true"}); userlist.dataprovider = onlineusers but list not support html, know work around this? generically, answer use itemrenderer. all list class display other components (renderers) , send components data dataprovider display. really, mean default itemrenderer doesn't support html. technically make itemrenderer support html give color change need; i'd take different. add property user object specifeis whether admin user or not. if user admin user; then; change color. conceptually this: <s:itemrenderer xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="librar

Using current_user and other Devise Helpers in the rails console -

i want call current_user in rails console ensure user logged in. when write though, following error: 1.9.3p393 :045 > current_user nameerror: undefined local variable or method `current_user' main:object how include appropriate module let me use method? best thing use pry gem. once install it, add line pry controller , can access current_user. cannot access current_user console in other way since session based.

java - Making a command line, if statements not working -

i want make command line, run basic commands. far, i've made people can tell program name. when don't enter name, however, treats if did. here class: public static void main(string args[]) throws ioexception { int = 1; { system.out.print("$$: "); bufferedreader br = new bufferedreader(new inputstreamreader(system.in)); string wtt = null; // wtt = typed! wtt = br.readline(); if(wtt == null) { system.out.println("why wont tell me name!"); } else { system.out.println("thanks name, " + wtt); } } while(a == 1); } here output $$: well thanks name, well $$: hole thanks name, hole $$: thanks name, why not work? use this if (wtt == null || wtt.trim().length() == 0)

EGit tag advanced does not expand -

if create tag highlighting specific commit in "history" view works fine. if try create tag specific commit using "git repositories" view shown below, fails. "advanced" drop-down arrow necessary select specific commit want tag nothing. feature not implemented yet? in works egit v3.1? note: don't have eclipse project created yet. don't have "team" menu item. tried creating 1 , result same - advanced arrow doesn't work. create new repo on github (initialized readme.) clone repo egit. make commit on master branch. from git repositories view in egit: right-click item "tags" select menu item "create tag..." in "create new tag" dialog box opens up, enter tag name, , tag message. the "advanced" drop-down arrow nothing. resize window after clicking on advanced . after that, should see dropdown select commit tag. this issue in egit, see bug 352830 . it's fixed in egit 3.

python - mongoengine embeded document in a DynamicField -

i try embed document dynamic field. when try access later, it's not document object anymore, it's dict. here example code i've made up: #defining documents class embed(embeddeddocument): field_1 = stringfield(db_field='f') class doc(document): myid = intfield(required=true, unique=true, primary_key=true) embed_me = dynamicfield(db_field='e') field_x = stringfield(db_field='x') then create new document , save it: connect('test') # embedded part embed = embed(field_1='this test') # document embedded document doc = doc(pk=2) doc.embed_me = embed doc.save() so far ok. in db: # > db.doc.find() # { "_id" : 1, "e" : { "f" : "this test", "_cls" : "embed" } } but now, if request document , try access value embedded document exception: doc, c = doc.objects.get_or_create(pk=1) just reference: access in main doc works print doc.f

swing - Checking if the mouse is clicked in Java -

i writing gui in java. need know how check if user clicks mouse. know how check position of mouse, need check if it's clicked. import java.awt.event.mouseevent; import java.awt.event.mouselistener; /* * copyright (c) 1995, 2008, oracle and/or affiliates. rights reserved. * * redistribution , use in source , binary forms, or without * modification, permitted provided following conditions * met: * * - redistributions of source code must retain above copyright * notice, list of conditions , following disclaimer. * * - redistributions in binary form must reproduce above copyright * notice, list of conditions , following disclaimer in * documentation and/or other materials provided distribution. * * - neither name of oracle or names of * contributors may used endorse or promote products derived * software without specific prior written permission. * * software provided copyright holders , contributors "as * is" , express or im

pyramid - SQLAlchemy / WTForms QuerySelectField -

i attempting use wtforms sqlalchemy extension on pyramid application. i have done: from wtforms import form, textfield,textareafield, validators wtforms.ext.sqlalchemy.fields import queryselectfield app.models import dbsession app.models import parentmodel class newchild(form): title = textfield('title:', [validators.required()]) intro = textareafield('introduction:') body = textareafield('body:') parent = queryselectfield(query_factory=dbsession().query(parentmodel).all) dbsession defined as dbsession = scoped_session(sessionmaker(extension=zopetransactionextension())) the query seems work, display in template reading <app.models.parentmodel object @ 0x9xxx> or such. doing wrong? you need define a __str__ method on parentmodel

android - drag and drop animate shadow back to original position if not dropped to target -

i have made functionality of drag , drop using ondraglistener. working fine problem shadow made not go original image if view not dropped @ target. how animate going of shadow position original position.any we have write our own logic move back, do. add ondraglistener root view, in ondrag(view view, dragevent event) of dragged view wait action_drag_ended. create image copy of shadow. bitmap bitmap = bitmap.createbitmap(view.getwidth(), view.getheight(), config.argb_8888); canvas canvas = new canvas(bitmap); shadowbuilder.ondrawshadow(canvas); create imageview bitmap , add root view of view hierarchy. then create animator move original position , remove imageview. objectanimator defaultchangein = objectanimator.ofpropertyvaluesholder((object)mimageview, pvhleft, pvhtop, pvhright, pvhbottom);

rspec - Capybara 2.1 Error uninitialized constant Rails (NameError) -

i upgraded capybara gem version 1 2.1.0 (latest). based on capybara readme, added following lines spec_helper.rb inside spork.prefork block require 'capybara/rspec' require 'capybara/rails' but, got error /home/user_1/.rvm/gems/ruby-1.9.3-p392/gems/capybara-2.1.0/lib/capybara/rails.rb:6:in `block (2 levels) in <top (required)>': uninitialized constant rails (nameerror) did miss in order capybara work ? make sure require 'rspec/rails' first: require 'rspec/rails' require 'capybara/rspec' require 'capybara/rails' if require 'capybara/rails' first, you'll error.

javascript - On location change in Angular -

is there way detect global location changes in angularjs, not single controller? goal detect every location change. or there effective way watch window.location.href changes? $routechangesuccess as understood single controller or i'm wrong? first of all, $routechangesuccess not limited single controller. broadcast $rootscope means can listened on every scope (or, every scope inherits $rootscope ) application wide event. there undocumented event works similar $routechangesuccess called $locationchangesuccess . difference former fires once route has changed , latter fires when url changed before route changes. note isn't url changes, times url changes in way angularjs application can register (for example, setter call $location.url() ). just clarify, $locationchangesuccess broadcast $rootscope well. for both, can listen event using scope.$on('$routechangesuccess') or scope.$on('$locationchangesuccess') .

HTML from Dreamweaver to Muse not working properly -

i've created scrollable frame image inside in dreamweaver. when preview in browser, seems working. i need put frame , image in adobe muse site. i've pasted code in "insert html object" feature. when preview muse site, scrollable frame works, image not show up. it's replaced blue box white question mark inside it. how can make image show in muse site? here's code, brackets replaced parenthesis: (div style="border: 1px solid #aaa;background-colo r:#f9efef; width:920; height:375px; overflow:auto; color:#fff;")(p) (img src="personalsite/portfolio.jpg" alt="" width="4325" height="350" /)(/p) (/div) i think reason why because didn't put style tags around code. try put , see if helps :-) (div style="border: 1px solid #aaa;background-colo r:#f9efef; width:920; height:375px; overflow:auto; color:#fff;")(p) (img src="personalsite/portfolio.jpg" alt="" width=

wireshark - Understanding [TCP ACKed unseen segment] [TCP Previous segment not captured] -

we doing load testing on our servers , i'm using tshark capture data pcap file using wireshark gui see errors or warnings showing going analyze -> expert info pcap loaded in.. i'm seeing various things i'm not sure or not understand yet.. under warnings have: 779 warnings tcp: acked segment wasn't captured (common @ capture start) 446 tcp: previous segment not captured (common @ capture start) an example : 40292 0.000 xxx xxx tcp 90 [tcp acked unseen segment] [tcp previous segment not captured] 11210 > 37586 [psh, ack] seq=3812 ack=28611 win=768 len=24 tsval=199317872 tsecr=4506547 we ran pcap file though nice command creates command line column of data command tshark -i 1 -w file.pcap -c 500000 basically saw few things in tcp.analysis.lost_segment column not many..\ anyone enlighten might going on? tshark not able keep writing data, other issue? false positive? that may false positive. warning message says, common capture start

swing - JFrame Error java.lang.nullpointerexception -

i have been trying create jframe calculator getting error java.lang.nullpointer.exception . says have problem in line say: guicalc go = new guicalc(); here of code: package home.personalprojects.jordan; import java.awt.*; import java.awt.event.*; import javax.swing.*; public class guicalc extends jframe { private jbutton calculate; private jtextfield num1field, num2field; private jcombobox operationbox; private jlabel label1, label2, label3; private string[] operationposs = {"+", "-", "*", "/"}; string operation; int num1, num2, answer; public guicalc(){ super("calculator"); setlayout(new flowlayout()); operationbox = new jcombobox(operationposs); calculate = new jbutton("calculate"); calculate.settooltiptext("enter 2 numbers , select operation find answer"); label1 = new jlabel("number 1: "); num1fi

how to get the integer value of a single pyserial byte in python -

i'm using pyserial in python 2.7.5 according docs : read(size=1) parameters: size – number of bytes read. returns: bytes read port. read size bytes serial port. if timeout set may return less characters requested. no timeout block until requested number of bytes read. changed in version 2.5: returns instance of bytes when available (python 2.6 , newer) , str otherwise. mostly want use values hex values , when use them use following code: ch = ser.read() print ch.encode('hex') this works no problem. but i'm trying read 1 value integer, because it's read in string serial.read, i'm encountering error after error try integer value. for example: print ch prints nothing because it's invisible character (in case chr(0x02)). print int(ch) raises error valueerror: invalid literal int() base 10: '\x02' trying print int(ch,16) , ch.decode() , ch.encode('dec') , ord(ch) , unichr(ch) give errors (or nothi

ios - Show the float value in formatted string two digits after decimal in iPhone -

i have float number in insert comma after thousands value works fine nsnumberformatter *formatter = [nsnumberformatter new]; [formatter setnumberstyle:nsnumberformatterdecimalstyle]; // line important! nsstring *formatted = [formatter stringfromnumber:[nsnumber numberwithfloat:appdelegate.c_wnd_clininf_average_default]]; but shows 1,947 want show 1,947.00 idea how formate this. thanks have tried using -setmaximumfractiondigits nsnumberformatter? so, try like: [formatter setmaximumfractiondigits:2]; [formatter setminimumfractiondigits:2]; this way deal nsnumberformatter , don't need call on nsstring.

how to register our windows mobile for test the app? -

i try test windows phone app on mobile. created developer account company. paid amount. when try register mobile tells "please check zune software running , zune's sync partnership phone has been established". when check developer account dashboard tells "validating account. learn more. haven’t completed tax profile. if you’re interested in publishing paid apps, update tax info here. learn more. don't have payment account you. add info, go here. learn more." please guide me.... i try test app in nokia lumia 710 we dont want paid apps account. when register company account there additional validation. microsoft contacts you'r company , talks something. don;t know what, in company waited 1-2 months.

html - overflow of text in a div -

this fiddle i'm working with: http://jsfiddle.net/hdyks/1/ the html is: <div class="body"> <div class="variation1 font700 green"> <h2> 1 <span class="divider">sample arrow </span> </h2> </div> <div class="clear"></div> <div class="variation2 font700 green2 "> <h2> overflown text must hidden , visible text must in single line <span class="divider"> 2 </span> </h2> </div> <div class="clear"></div> </div> i need hide overflow text, , text visible must rendered in single line. can please me out? if i'm using overflow:hidden pointed part disappearing. add white-space: nowrap; constrain text layout, i.e. restrict text wrapping next line. add overflow hidden hide text appearing outside variation2 . .variation2 h2 { white-space:nowrap; overflow:hidden; pa

java - I need to reset a few text fields after successful data insertion -

i need reset text fields except first three. should reset here or on java page has storing database method ? save data in database jquery ajax. on success function of ajax assign default values text box need rest

game physics - Unity3d Ragdoll Stuck in box collider -

Image
i created ragdoll bike racing in unity3d when bike crashes , ragdoll start dragging hand stucks in box colliders applied on sides tried different methods, changed collision modes discrete continuous solve problem failed. attached screen shot in visible. appreciated. in advance. i'd rather write comment, don't have enough reputation comment. did try lower 'fixedtimestep' make physics calcultations more accurate? see http://docs.unity3d.com/documentation/components/class-timemanager.html another thing try lower 'min penetration penalty' reduce risk of colliders breaking throug other colliders. see http://docs.unity3d.com/documentation/components/class-physicsmanager.html

mongodb - Range for the result of the %mod operator -

for document : { cartid : 11, items : [{ itemid : 1, et : 100 }, { itemid : 2, et : 200 }, { itemid : 3, et : 300 } ] } i want generate query filter select * carts cartid%100 > 10 && cartid%100 <= 20 i know can using $where, can using $mod ? mongodb documentation link same : http://docs.mongodb.org/manual/reference/operator/mod/ no-- unfortunately, $mod operator cannot take range possible remainder.

c# - Can not call wcf nettcp operation in a loop in client side, which returns a byte array? -

i tried possible ways resolve issue. explain question. i trying create file transfer mechanism using wcf nettcp service. client can request file service running in machine. file transfer happens in 3 stages. beginfiletranfer - operation in server side, open file , ready transfer, initiate session; [operationcontract(isinitiating = true, isterminating = false)] string beginfiletransfer(trnsfertype otype, string strfilename,string strfilepath); getfiledata - operation in server side, send 1024 (for time being) bytes per call opened file [operationcontract(isinitiating = false, isterminating = false)] cfiletransferdata getfiledata(string strrequestid); endfiletransfer - operation in server side, close file. terminate session [operationcontract(isinitiating = false, isterminating = true)] bool endfiletranser(string strrequestid); in client side call function file remote service private void btnget_click(object sender, eventargs e) { string strid = _agentser